1/*! For license information please see 2.c273dff2.chunk.js.LICENSE.txt */ 2(this.webpackJsonpweb=this.webpackJsonpweb||[]).push([[2],[function(t,e,n){"use strict";t.exports=n(44)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o=n(50),a=n(8),s=n(5),u=n(13),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),l=new a.ErrorFactory("app","Firebase",c),h=((i={})["@firebase/app"]="fire-core",i["@firebase/analytics"]="fire-analytics",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),f=new u.Logger("@firebase/app"),p=function(){function t(t,e,n){var r,i,u=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=a.deepCopy(t),this.container=new s.ComponentContainer(e.name),this._addComponent(new s.Component("app",(function(){return u}),"PUBLIC"));try{for(var c=o.__values(this.firebase_.INTERNAL.components.values()),l=c.next();!l.done;l=c.next()){var h=l.value;this._addComponent(h)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,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){return void 0===e&&(e="[DEFAULT]"),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e="[DEFAULT]"),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){f.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();p.prototype.name&&p.prototype.options||p.prototype.delete||console.log("dc");var d=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={});if("object"!==typeof i||null===i){i={name:i}}var o=i;void 0===o.name&&(o.name="[DEFAULT]");var s=o.name;if("string"!==typeof s||!s)throw l.create("bad-app-name",{appName:String(s)});if(a.contains(e,s))throw l.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=h[t])&&void 0!==r?r:t;n&&(i+="-"+n);var o=i.match(/\s|\//),a=e.match(/\s|\//);if(o||a){var u=['Unable to register library "'+i+'" with version "'+e+'":'];return o&&u.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),o&&a&&u.push("and"),a&&u.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void f.warn(u.join(" "))}c(new s.Component(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.setLogLevel,onLog:function(t,e){if(null!==t&&"function"!==typeof t)throw l.create("invalid-log-argument",{appName:name});u.setUserLogHandler(t,e)},apps:null,SDK_VERSION:"7.15.2",INTERNAL:{registerComponent:c,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){if("serverAuth"===e)return null;return e}}};function i(t){if(t=t||"[DEFAULT]",!a.contains(e,t))throw l.create("no-app",{appName:t});return e[t]}function c(s){var u,c,h=s.name;if(n.has(h))return f.debug("There were multiple attempts to register component "+h+"."),"PUBLIC"===s.type?r[h]:null;if(n.set(h,s),"PUBLIC"===s.type){var p=function(t){if(void 0===t&&(t=i()),"function"!==typeof t[h])throw l.create("invalid-app-argument",{appName:h});return t[h]()};void 0!==s.serviceProps&&a.deepExtend(p,s.serviceProps),r[h]=p,t.prototype[h]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,h);return n.apply(this,s.multipleInstances?t:[])}}try{for(var d=o.__values(Object.keys(e)),v=d.next();!v.done;v=d.next()){var y=v.value;e[y]._addComponent(s)}}catch(g){u={error:g}}finally{try{v&&!v.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}return"PUBLIC"===s.type?r[h]: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}(p);return e.INTERNAL=o.__assign(o.__assign({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){a.deepExtend(e,t)},createSubscribe:a.createSubscribe,ErrorFactory:a.ErrorFactory,deepExtend:a.deepExtend}),e}(),v=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?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if(a.isBrowser()&&void 0!==self.firebase){f.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var y=self.firebase.SDK_VERSION;y&&y.indexOf("LITE")>=0&&f.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 g=d.initializeApp;d.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a.isNode()&&f.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 '),g.apply(void 0,t)};var m=d;!function(t,e){t.INTERNAL.registerComponent(new s.Component("platform-logger",(function(t){return new v(t)}),"PRIVATE")),t.registerVersion("@firebase/app","0.6.6",e),t.registerVersion("fire-js","")}(m),e.default=m,e.firebase=m},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(20);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to de
2structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return I})),n.d(e,"c",(function(){return v})),n.d(e,"d",(function(){return P})),n.d(e,"e",(function(){return d})),n.d(e,"f",(function(){return T})),n.d(e,"g",(function(){return O})),n.d(e,"h",(function(){return R}));var i=n(0),o=n.n(i),a=(n(15),n(10)),s=n(23),u=n(9);function c(){return(c=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 l=n(25),h=n.n(l);n(37);function f(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}n(42);var p=function(t){var e=Object(s.a)();return e.displayName=t,e}("Router-History"),d=function(t){var e=Object(s.a)();return e.displayName=t,e}("Router"),v=function(t){function e(e){var n;return(n=t.call(this,e)||this).state={location:e.history.location},n._isMounted=!1,n._pendingLocation=null,e.staticContext||(n.unlisten=e.history.listen((function(t){n._isMounted?n.setState({location:t}):n._pendingLocation=t}))),n}r(e,t),e.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var n=e.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(d.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o.a.createElement(p.Provider,{children:this.props.children||null,value:this.props.history}))},e}(o.a.Component);o.a.Component;var y=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(t){this.props.onUpdate&&this.props.onUpdate.call(this,this,t)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},e}(o.a.Component);var g={},m=0;function b(t,e){return void 0===t&&(t="/"),void 0===e&&(e={}),"/"===t?t:function(t){if(g[t])return g[t];var e=h.a.compile(t);return m<1e4&&(g[t]=e,m++),e}(t)(e,{pretty:!0})}function _(t){var e=t.computedMatch,n=t.to,r=t.push,i=void 0!==r&&r;return o.a.createElement(d.Consumer,null,(function(t){t||Object(u.a)(!1);var r=t.history,s=t.staticContext,l=i?r.push:r.replace,h=Object(a.c)(e?"string"===typeof n?b(n,e.params):c({},n,{pathname:b(n.pathname,e.params)}):n);return s?(l(h),null):o.a.createElement(y,{onMount:function(){l(h)},onUpdate:function(t,e){var n=Object(a.c)(e.to);Object(a.f)(n,c({},h,{key:n.key}))||l(h)},to:n})}))}var w={},E=0;function T(t,e){void 0===e&&(e={}),("string"===typeof e||Array.isArray(e))&&(e={path:e});var n=e,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(e,n){if(!n&&""!==n)return null;if(e)return e;var r=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=w[n]||(w[n]={});if(r[t])return r[t];var i=[],o={regexp:h()(t,i,e),keys:i};return E<1e4&&(r[t]=o,E++),o}(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,u=i.exec(t);if(!u)return null;var l=u[0],f=u.slice(1),p=t===l;return o&&!p?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:p,params:a.reduce((function(t,e,n){return t[e.name]=f[n],t}),{})}}),null)}var I=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var t=this;return o.a.createElement(d.Consumer,null,(function(e){e||Object(u.a)(!1);var n=t.props.location||e.location,r=c({},e,{location:n,match:t.props.computedMatch?t.props.computedMatch:t.props.path?T(n.pathname,t.props):e.match}
2),i=t.props,a=i.children,s=i.component,l=i.render;return Array.isArray(a)&&0===a.length&&(a=null),o.a.createElement(d.Provider,{value:r},r.match?a?"function"===typeof a?a(r):a:s?o.a.createElement(s,r):l?l(r):null:"function"===typeof a?a(r):null)}))},e}(o.a.Component);function S(t){return"/"===t.charAt(0)?t:"/"+t}function C(t,e){if(!t)return e;var n=S(t);return 0!==e.pathname.indexOf(n)?e:c({},e,{pathname:e.pathname.substr(n.length)})}function k(t){return"string"===typeof t?t:Object(a.e)(t)}function N(t){return function(){Object(u.a)(!1)}}function x(){}o.a.Component;var P=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var t=this;return o.a.createElement(d.Consumer,null,(function(e){e||Object(u.a)(!1);var n,r,i=t.props.location||e.location;return o.a.Children.forEach(t.props.children,(function(t){if(null==r&&o.a.isValidElement(t)){n=t;var a=t.props.path||t.props.from;r=a?T(i.pathname,c({},t.props,{path:a})):e.match}})),r?o.a.cloneElement(n,{location:i,computedMatch:r}):null}))},e}(o.a.Component);var A=o.a.useContext;function O(){return A(p)}function R(t){var e=A(d).location,n=A(d).match;return t?T(e.pathname,t):n}},function(t,e,n){"use strict";var r,i=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r;n(53),n(54),n(56),n(59),n(90),n(91),n(61),n(92),n(63);i.registerVersion("firebase","7.15.4","app");console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the module builds, these are available in the following manner\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/<PACKAGE>');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n\nTypescript:\nimport * as firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n"),i.registerVersion("firebase","7.15.4"),t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(52),i=n(8),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}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}(),a=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return t.prototype.get=function(t){void 0===t&&(t="[DEFAULT]");var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.Deferred;this.instancesDeferred.set(e,n);try{var r=this.getOrInitializeService(e);r&&n.resolve(r)}catch(o){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e=r.__assign({identifier:"[DEFAULT]",optional:!1},t),n=e.identifier,i=e.optional,o=this.normalizeInstanceIdentifier(n);try{var a=this.getOrInitializeService(o);if(!a){if(i)return null;throw Error("Service "+this.name+" is not available")}return a}catch(s){if(i)return null;throw s}},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,function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService("[DEFAULT]")}catch(h){}try{for(var i=r.__values(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var a=r.__read(o.value,2),s=a[0],u=a[1],c=this.normalizeInstanceIdentifier(s);try{var l=this.getOrInitializeService(c);u.resolve(l)}catch(h){}}}catch(f){e={error:f}}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="[DEFAULT]"),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.getOrInitializeService=function(t){var e=this.instances.get(t);return!e&&this.component&&(e=this.component.instanceFactory(this.container,function(t){return"[DEFAULT]"===t?void 0:t}(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:"[DEFAULT]":t},t}();var s=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 a(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}();e.Component=o,e.ComponentContainer=s,e.Provider=a},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
2e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";var r=n(29),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return"undefined"===typeof t}function s(t){return null!==t&&"object"===typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!==typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"===typeof t},isNumber:function(t){return"number"===typeof t},isObject:s,isUndefined:a,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"===typeof e[r]&&"object"===typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"===typeof e[r]&&"object"===typeof n?e[r]=t(e[r],n):e[r]="object"===typeof n?t({},n):n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,i){t[i]=n&&"function"===typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=n(51),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(t,e){if(!t)throw a(e)},a=function(t){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},s=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},u={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,l=o>>2,h=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,p=63&c;u||(p=64,a||(f=64)),r.push(n[l],n[h],n[f],n[p])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(s(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++];
2e[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 l=a<<4&240|s>>2;if(r.push(l),64!==u){var h=s<<6&192|u;r.push(h)}}}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)}}},c=function(t){try{return u.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(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)&&(t[n]=l(t[n],e[n]));return t}var h=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 f(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function p(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(e){return!1}}var d=function(t){function e(n,r){var i=t.call(this,r)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,v.prototype.create),i}return r.__extends(e,t),e}(Error),v=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];for(var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],a=o?y(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new d(i,s),c=0,l=Object.keys(r);c<l.length;c++){var h=l[c];"_"!==h.slice(-1)&&(h in u&&console.warn('Overwriting FirebaseError base field "'+h+'" can cause unexpected behavior.'),u[h]=r[h])}return u},t}();function y(t,e){return t.replace(g,(function(t,n){var r=e[n];return null!=r?r.toString():"<"+n+"?>"}))}var g=/\{\$([^}]+)}/g;function m(t){return JSON.parse(t)}var b=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=m(c(o[0])||""),n=m(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}};var _=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()}return 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],l=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^u&(c^l),a=1518500249):(o=u^c^l,a=1859775393):r<60?(o=u&c|l&(u|c),a=2400959708):(o=u^c^l,a=3395469782);i=(s<<5|s>>>27)+o+h+a+n[r]&4294967295;h=l,l=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]+l&4294967295,this.chain_[4]=this.chain_[4]+h&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},t}();var w=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
2ise.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=e;n<r.length;n++){var i=r[n];if(i in t&&"function"===typeof t[i])return!0}return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n}).next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);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(r){"undefined"!==typeof console&&console.error&&console.error(r)}}))},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 E(){}function T(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}e.CONSTANTS=i,e.Deferred=h,e.ErrorFactory=v,e.FirebaseError=d,e.Sha1=_,e.assert=o,e.assertionError=a,e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then((function(){t.apply(void 0,n)})).catch((function(t){e&&e(t)}))}},e.base64=u,e.base64Decode=c,e.base64Encode=function(t){var e=s(t);return u.encodeByteArray(e,!0)},e.contains=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.createSubscribe=function(t,e){var n=new w(t,e);return n.subscribe.bind(n)},e.decode=b,e.deepCopy=function(t){return l(void 0,t)},e.deepExtend=l,e.errorPrefix=T,e.getUA=f,e.isAdmin=function(t){var e=b(t).claims;return"object"===typeof e&&!0===e.admin},e.isBrowser=function(){return"object"===typeof self&&self.self===self},e.isBrowserExtension=function(){var t="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof t&&void 0!==t.id},e.isElectron=function(){return f().indexOf("Electron/")>=0},e.isEmpty=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0},e.isIE=function(){var t=f();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0},e.isMobileCordova=function(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())},e.isNode=p,e.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},e.isReactNative=function(){return"object"===typeof navigator&&"ReactNative"===navigator.product},e.isSafari=function(){return!p()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},e.isUWP=function(){return f().indexOf("MSAppHost/")>=0},e.isValidFormat=function(t){var e=b(t).claims;return!!e&&"object"===typeof e&&e.hasOwnProperty("iat")},e.isValidTimestamp=function(t){var e=b(t).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"===typeof e&&(e.hasOwnProperty("nbf")?r=e.nbf:e.hasOwnProperty("iat")&&(r=e.iat),i=e.hasOwnProperty("exp")?e.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},e.issuedAtTime=function(t){var e=b(t).claims;return"object"===typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.jsonEval=m,e.map=function(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r},e.querystring=function(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEac
2h((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r];n(o[0],o[1])}return e.length?"&"+e.join("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach((function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}})),e},e.safeGet=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},e.stringLength=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var a=i-55296;r++,o(r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(a<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.stringify=function(t){return JSON.stringify(t)},e.validateArgCount=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(T(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(T(t,e,r)+"must be a valid context object.")},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!==typeof n)throw new Error(T(t,e,r)+"must be a valid firebase namespace.")}}).call(this,n(18))},function(t,e,n){"use strict";e.a=function(t,e){if(!t)throw new Error("Invariant failed")}},function(t,e,n){"use strict";function r(){return(r=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)}function i(t){return"/"===t.charAt(0)}function o(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return C})),n.d(e,"d",(function(){return N})),n.d(e,"c",(function(){return v})),n.d(e,"f",(function(){return y})),n.d(e,"e",(function(){return d}));var a=function(t,e){void 0===e&&(e="");var n,r=t&&t.split("/")||[],a=e&&e.split("/")||[],s=t&&i(t),u=e&&i(e),c=s||u;if(t&&i(t)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var l=a[a.length-1];n="."===l||".."===l||""===l}else n=!1;for(var h=0,f=a.length;f>=0;f--){var p=a[f];"."===p?o(a,f):".."===p?(o(a,f),h++):h&&(o(a,f),h--)}if(!c)for(;h--;h)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var d=a.join("/");return n&&"/"!==d.substr(-1)&&(d+="/"),d};function s(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}var u=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every((function(e,r){return t(e,n[r])}));if("object"===typeof e||"object"===typeof n){var r=s(e),i=s(n);return r!==e||i!==n?t(r,i):Object.keys(Object.assign({},e,n)).every((function(r){return t(e[r],n[r])}))}return!1},c=n(9);function l(t){return"/"===t.charAt(0)?t:"/"+t}function h(t){return"/"===t.charAt(0)?t.substr(1):t}function f(t,e){return function(t,e){return 0===t.toLowerCase().indexOf(e.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(e.length))}(t,e)?t.substr(e.length):t}function p(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function d(t){var e=t.pathname,n=t.search,r=t.hash,i=e||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(t,e,n,i){var o;"string"===typeof t?(o=function(t){var e=t||"/",n="",r="",i=e.indexOf("#");-1!==i&&(r=e.substr(i),e=e.substr(0,i));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=r({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invali
2d percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function y(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&u(t.state,e.state)}function g(){var t=null;var e=[];return{setPrompt:function(e){return t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,r,i){if(null!=t){var o="function"===typeof t?t(e,n):t;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(t){var n=!0;function r(){n&&t.apply(void 0,arguments)}return e.push(r),function(){n=!1,e=e.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.forEach((function(t){return t.apply(void 0,n)}))}}}var m=!("undefined"===typeof window||!window.document||!window.document.createElement);function b(t,e){e(window.confirm(t))}function _(){try{return window.history.state||{}}catch(t){return{}}}function w(t){void 0===t&&(t={}),m||Object(c.a)(!1);var e=window.history,n=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}(),i=!(-1===window.navigator.userAgent.indexOf("Trident")),o=t,a=o.forceRefresh,s=void 0!==a&&a,u=o.getUserConfirmation,h=void 0===u?b:u,y=o.keyLength,w=void 0===y?6:y,E=t.basename?p(l(t.basename)):"";function T(t){var e=t||{},n=e.key,r=e.state,i=window.location,o=i.pathname+i.search+i.hash;return E&&(o=f(o,E)),v(o,r,n)}function I(){return Math.random().toString(36).substr(2,w)}var S=g();function C(t){r(j,t),j.length=e.length,S.notifyListeners(j.location,j.action)}function k(t){(function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")})(t)||P(T(t.state))}function N(){P(T(_()))}var x=!1;function P(t){if(x)x=!1,C();else{S.confirmTransitionTo(t,"POP",h,(function(e){e?C({action:"POP",location:t}):function(t){var e=j.location,n=O.indexOf(e.key);-1===n&&(n=0);var r=O.indexOf(t.key);-1===r&&(r=0);var i=n-r;i&&(x=!0,D(i))}(t)}))}}var A=T(_()),O=[A.key];function R(t){return E+d(t)}function D(t){e.go(t)}var L=0;function M(t){1===(L+=t)&&1===t?(window.addEventListener("popstate",k),i&&window.addEventListener("hashchange",N)):0===L&&(window.removeEventListener("popstate",k),i&&window.removeEventListener("hashchange",N))}var F=!1;var j={length:e.length,action:"POP",location:A,createHref:R,push:function(t,r){var i=v(t,r,I(),j.location);S.confirmTransitionTo(i,"PUSH",h,(function(t){if(t){var r=R(i),o=i.key,a=i.state;if(n)if(e.pushState({key:o,state:a},null,r),s)window.location.href=r;else{var u=O.indexOf(j.location.key),c=O.slice(0,u+1);c.push(i.key),O=c,C({action:"PUSH",location:i})}else window.location.href=r}}))},replace:function(t,r){var i=v(t,r,I(),j.location);S.confirmTransitionTo(i,"REPLACE",h,(function(t){if(t){var r=R(i),o=i.key,a=i.state;if(n)if(e.replaceState({key:o,state:a},null,r),s)window.location.replace(r);else{var u=O.indexOf(j.location.key);-1!==u&&(O[u]=i.key),C({action:"REPLACE",location:i})}else window.location.replace(r)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(t){void 0===t&&(t=!1);var e=S.setPrompt(t);return F||(M(1),F=!0),function(){return F&&(F=!1,M(-1)),e()}},listen:function(t){var e=S.appendListener(t);return M(1),function(){M(-1),e()}}};return j}var E={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+h(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:h,decodePath:l},slash:{encodePath:l,decodePath:l}};function T(t){var e=t.indexOf("#");return-1===e?t:t.slice(0,e)}function I(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)}function S(t){window.location.replace(T(window.location.href)+"#"+t)}function C(t){void 0===t&&(t={}),m||Object(c.a)(!1);var e=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),t),i=n.getUserConfirmation,o=void 0===i?b:i,a=n.hashType,s=void 0===a?"slash":a,u=t.basename?p(l(t.basename)):"",h=E[s],y=h.encodePath,_=h.decodePath;function w(){var t=_(I());return u&&(t=f(t,u)),v(t)}var C=g();function k(t){r(U,t),U.length=e.length,C.notifyListeners(U.location,U.action)}var N=!1,x=null;function P(){var t,e,n=I(),r=y(n);if(n!==r)S(r);else{var i=w(),a=U.location;if(!N&&(e=i,(t=a).pathname===e.pathname&&t.search===e.search&&t.hash===e.hash))return;if(x===d(i))return;x=null,function(t){if(N)N=!1,k();else{C.confirmTransitionTo(t,"POP",o,(function(e){e?k({action:"POP",location:t}):function(t){var e=U.location,n=D.lastIndexOf(d(e));-1===n&&(n=0);var r=D.lastIndexOf(d(t));-1===r&&(r=0);var i=n-r;i&&(N=!0,L(i))}(t)}))}}(i)}}var A=I(),O=y(A);A!==O&&S(O);var R=w(),D=[d(R)];function L(t){e.go(t)}var M=0;function F(t){1===(M+=t)&&1===t?window.addEventListener("hashchange",P):0===M&&window.removeEventListener("hashchange",P)}var j=!1;var U={length:e.length,action:"POP",location:R,createHref:function(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=T(window.location.href)),n+"#"+y(u+d(t))},push:function(t,e){var n=v(t,void 0,void 0,U.location);C.confirmTransitionTo(n,"PUSH",o,(function(t){if(t){var e=d(n),r=y(u+e);if(I()!==r){x=e,function(t){window.location.hash=t}(r);var i=D.lastIndexOf(d(U.location)),o=D.slice(0,i+1);o.push(e),D=o,k({action:"PUSH",location:n})}else k()}}))},replace:function(t,e){var n=v(t,void 0,void 0,U.location);C.confirmTransitionTo(n,"REPLACE",o,(function(t){if(t){var e=d(n),r=y(u+e);I()!==r&&(x=e,S(r));var i=D.indexOf(d(U.location));-1!==i&&(D[i]=e),k({action:"REPLACE",location:n})}}))},go:L,goBack:function(){L(-1)},goForward:function(){L(1)},block:function(t){void 0===t&&(t=!1);var e=C.setPrompt(t);return j||(F(1),j=!0),function(){return j&&(j=!1,F(-1)),e()}},listen:function(t){var e=C.appendListener(t);return F(1),function(){F(-1),e()}}};return U}function k(t,e,n){return Math.min(Math.max(t,e),n)}function N(t){void 0===t&&(t={});var e=t,n=e.getUserConfirmation,i=e.initialEntries,o=void 0===i?["/"]:i,a=e.initialIndex,s=void 0===a?0:a,u=e.keyLength,c=void 0===u?6:u,l=g();function h(t){r(_,t),_.length=_.entries.length,l.notifyListeners(_.location,_.action)}function f(){return Math.random().toString(36).substr(2,c)}var p=k(s,0,o.length-1),y=o.map((function(t){return v(t,void 0,"string"===typeof t?f():t.key||f())})),m=d;function b(t){var e=k(_.index+t,0,_.entries.length-1),r=_.entries[e];l.confirmTransitionTo(r,"POP",n,(function(t){t?h({action:"POP",location:r,index:e}):h()}))}var _={length:y.length,action:"POP",location:y[p],index:p,entries:y,createHref:m,push:function(t,e){var r=v(t,e,f(),_.location);l.confirmTransitionTo(r,"PUSH",n,(function(t){if(t){var e=_.index+1,n=_.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),h({action:"PUSH",location:r,index:e,entries:n})}}))},replace:function(t,e){var r=v(t,e,f(),_.location);l.confirmTransitionTo(r,"REPLACE",n,(function(t){t&&(_.entries[_.index]=r,h({action:"REPLACE",location:r}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(t){var e=_.index+t;return e>=0&&e<_.entries.length},block:function(t){return void 0===t&&(t=!1),l.setPrompt(t)},listen:function(t){return l.appendListener(t)}};return _}},function(t,e,n){t.exports=n(65)},function(t,e,n){!function(t){"use strict";function e(t){return Array.prototype.slice.call(t)}function n(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function r(t,e,r){var i,o=new Promise((function(o,a){n(i=t[e].apply(t,r)).then(o,a)}));return o.request=i,o}function i(t,e,n){var i=r(t,e,n);return i.then((function(t){if(t)return new l(t,i.request)}))}
2function o(t,e,n){n.forEach((function(n){Object.defineProperty(t.prototype,n,{get:function(){return this[e][n]},set:function(t){this[e][n]=t}})}))}function a(t,e,n,i){i.forEach((function(i){i in n.prototype&&(t.prototype[i]=function(){return r(this[e],i,arguments)})}))}function s(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return this[e][r].apply(this[e],arguments)})}))}function u(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return i(this[e],r,arguments)})}))}function c(t){this._index=t}function l(t,e){this._cursor=t,this._request=e}function h(t){this._store=t}function f(t){this._tx=t,this.complete=new Promise((function(e,n){t.oncomplete=function(){e()},t.onerror=function(){n(t.error)},t.onabort=function(){n(t.error)}}))}function p(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new f(n)}function d(t){this._db=t}o(c,"_index",["name","keyPath","multiEntry","unique"]),a(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),u(c,"_index",IDBIndex,["openCursor","o
2penKeyCursor"]),o(l,"_cursor",["direction","key","primaryKey","value"]),a(l,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(t){t in IDBCursor.prototype&&(l.prototype[t]=function(){var e=this,r=arguments;return Promise.resolve().then((function(){return e._cursor[t].apply(e._cursor,r),n(e._request).then((function(t){if(t)return new l(t,e._request)}))}))})})),h.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))},h.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))},o(h,"_store",["name","keyPath","indexNames","autoIncrement"]),a(h,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),u(h,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),s(h,"_store",IDBObjectStore,["deleteIndex"]),f.prototype.objectStore=function(){return new h(this._tx.objectStore.apply(this._tx,arguments))},o(f,"_tx",["objectStoreNames","mode"]),s(f,"_tx",IDBTransaction,["abort"]),p.prototype.createObjectStore=function(){return new h(this._db.createObjectStore.apply(this._db,arguments))},o(p,"_db",["name","version","objectStoreNames"]),s(p,"_db",IDBDatabase,["deleteObjectStore","close"]),d.prototype.transaction=function(){return new f(this._db.transaction.apply(this._db,arguments))},o(d,"_db",["name","version","objectStoreNames"]),s(d,"_db",IDBDatabase,["close"]),["openCursor","o
2penKeyCursor"].forEach((function(t){[h,c].forEach((function(n){t in n.prototype&&(n.prototype[t.replace("open","iterate")]=function(){var n=e(arguments),r=n[n.length-1],i=this._store||this._index,o=i[t].apply(i,n.slice(0,-1));o.onsuccess=function(){r(o.result)}})}))})),[c,h].forEach((function(t){t.prototype.getAll||(t.prototype.getAll=function(t,e){var n=this,r=[];return new Promise((function(i){n.iterateCursor(t,(function(t){t?(r.push(t.value),void 0===e||r.length!=e?t.continue():i(r)):i(r)}))}))})})),t.openDb=function(t,e,n){var i=r(indexedDB,"open",[t,e]),o=i.request;return o&&(o.onupgradeneeded=function(t){n&&n(new p(o.result,t.oldVersion,o.transaction))}),i.then((function(t){return new d(t)}))},t.deleteDb=function(t){return r(indexedDB,"deleteDatabase",[t])},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";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.r(e),n.d(e,"LogLevel",(function(){return o})),n.d(e,"Logger",(function(){return h})),n.d(e,"setLogLevel",(function(){return f})),n.d(e,"setUserLogHandler",(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),l=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))}},h=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=l,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!0,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(e){return null}})).filter((function(t){return t})).join(" ");n>=(null!==r&&void 0!==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])}}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function i(t){return function(){var e=this,n=arguments;
2return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)}))}}n.d(e,"a",(function(){return i}))},function(t,e,n){t.exports=n(84)()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return g}));var r=n(3);function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var o=n(0),a=n.n(o),s=n(10);n(15);function u(){return(u=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)}function c(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}var l=n(9),h=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).history=Object(s.a)(e.props),e}return i(e,t),e.prototype.render=function(){return a.a.createElement(r.c,{history:this.history,children:this.props.children})},e}(a.a.Component);a.a.Component;var f=function(t,e){return"function"===typeof t?t(e):t},p=function(t,e){return"string"===typeof t?Object(s.c)(t,null,null,e):t},d=function(t){return t},v=a.a.forwardRef;"undefined"===typeof v&&(v=d);var y=v((function(t,e){var n=t.innerRef,r=t.navigate,i=t.onClick,o=c(t,["innerRef","navigate","onClick"]),s=o.target,l=u({},o,{onClick:function(t){try{i&&i(t)}catch(e){throw t.preventDefault(),e}t.defaultPrevented||0!==t.button||s&&"_self"!==s||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||(t.preventDefault(),r())}});return l.ref=d!==v&&e||n,a.a.createElement("a",l)}));var g=v((function(t,e){var n=t.component,i=void 0===n?y:n,o=t.replace,s=t.to,h=t.innerRef,g=c(t,["component","replace","to","innerRef"]);return a.a.createElement(r.e.Consumer,null,(function(t){t||Object(l.a)(!1);var n=t.history,r=p(f(s,t.location),t.location),c=r?n.createHref(r):"",y=u({},g,{href:c,navigate:function(){var e=f(s,t.location);(o?n.replace:n.push)(e)}});return d!==v?y.ref=e||h:y.innerRef=h,a.a.createElement(i,y)}))})),m=function(t){return t},b=a.a.forwardRef;"undefined"===typeof b&&(b=m);b((function(t,e){var n=t["aria-current"],i=void 0===n?"page":n,o=t.activeClassName,s=void 0===o?"active":o,h=t.activeStyle,d=t.className,v=t.exact,y=t.isActive,_=t.location,w=t.sensitive,E=t.strict,T=t.style,I=t.to,S=t.innerRef,C=c(t,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.a.createElement(r.e.Consumer,null,(function(t){t||Object(l.a)(!1);var n=_||t.location,o=p(f(I,n),n),c=o.pathname,k=c&&c.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),N=k?Object(r.f)(n.pathname,{path:k,exact:v,sensitive:w,strict:E}):null,x=!!(y?y(N,n):N),P=x?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((function(t){return t})).join(" ")}(d,s):d,A=x?u({},T,{},h):T,O=u({"aria-current":x&&i||null,className:P,style:A,to:o},C);return m!==b?O.ref=e||S:O.innerRef=S,a.a.createElement(g,O)}
2))}))},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"registerInstallations",(function(){return Z}));var r=n(1),i=n.n(r),o=n(5);var a=function(){return(a=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 s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 u(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(s){o=[6,s],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 c(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 l(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(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}var h,f=n(8),p=n(12),d=((h={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',h["not-registered"]="Firebase Installation is not registered.",h["installation-not-found"]="Firebase Installation not found.",h["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',h["app-offline"]="Could not process request. Application offline.",h["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",h),v=new f.ErrorFactory("installations","Installations",d);function y(t){return t instanceof f.FirebaseError&&t.code.includes("request-failed")}function g(t){return"https://firebaseinstallations.googleapis.com/v1/projects/"+t.projectId+"/installations"}function m(t){return{token:t.token,requestStatus:2,expiresIn:(e=t.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()};var e}function b(t,e){return s(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,e.json()];case 1:return n=i.sent(),r=n.error,[2,v.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})]}}))}))}function _(t){var e=t.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function w(t,e){var n=e.refreshToken,r=_(t);return r.append("Authorization",function(t){return"FIS_v2 "+t}(n)),r}function E(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return(e=n.sent()).status>=500&&e.status<600?[2,t()]:[2,e]}}))}))}function T(t,e){var n=e.fid;return s(this,void 0,void 0,(function(){var e,r,i,o,a,s;return u(this,(function(u){switch(u.label){case 0:return e=g(t),r=_(t),i={fid:n,authVersion:"FIS_v2",appId:t.appId,sdkVersion:"w:0.4.12"},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,E((function(){return fetch(e,o)}))];case 1:return(a=u.sent()).ok?[4,a.json()]:[3,3];case 2:return s=u.sent(),[2,{fid:s.fid||n,registrationStatus:2,refreshToken:s.refreshToken,authToken:m(s.authToken)}];case 3:return[4,b("Create Installation",a)];case 4:throw u.sent()}}))}))}function I(t){return new Promise((function(e){setTimeout(e,t)}))}function S(t){return btoa(String.fromCharCode.apply(String,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}(t))).replace(/\+/g,"-").replace(/\//g,"_")}var C=/^[cdef][\w-]{21}$/;function k(){try{var t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;var e=function(t){return S(t).substr(0,22)}(t);return C.test(e)?e:""}catch(n){return""}}function N(t){return t.appName+"!"+t.appId}var x=new Map;function P(t,e){var n=N(t);A(n,e),function(t,e){var n=R();n&&n.postMessage({key:t,fid:e});D()}(n,e)}function A(t,e){var n,r,i=x.get(t);if(i)try{for(var o=c(i),a=o.next();!a.done;a=o.next()){(0,a.value)(e)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var O=null;function R(){return!O&&"BroadcastChannel"in self&&((O=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(t){A(t.data.key,t.data.fid)}),O}function D(){0===x.size&&O&&(O.close(),O=null)}var L="firebase-installations-store",M=null;function F(){return M||(M=Object(p.openDb)("firebase-installations-database",1,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(L)}}))),M}function j(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a;return u(this,(function(s){switch(s.label){case 0:return n=N(t),[4,F()];case 1:return r=s.sent(),i=r.transaction(L,"readwrite"),[4,(o=i.objectStore(L)).get(n)];case 2:return a=s.sent(),[4,o.put(e,n)];case 3:return s.sent(),[4,i.complete];case 4:return s.sent(),a&&a.fid===e.fid||P(t,e.fid),[2,e]}}))}))}function U(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return e=N(t),[4,F()];case 1:return n=i.sent(),[4,(r=n.transaction(L,"readwrite")).objectStore(L).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function V(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a,s;return u(this,(function(u){switch(u.label){case 0:return n=N(t),[4,F()];case 1:return r=u.sent(),i=r.transaction(L,"readwrite"),[4,(o=i.objectStore(L)).get(n)];case 2:return a=u.sent(),void 0!==(s=e(a))?[3,4]:[4,o.delete(n)];case 3:return u.sent(),[3,6];case 4:return[4,o.put(s,n)];case 5:u.sent(),u.label=6;case 6:return[4,i.complete];case 7:return u.sent(),!s||a&&a.fid===s.fid||P(t,s.fid),[2,s]}}))}))}function q(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,V(t,(function(n){var r=function(t){return z(t||{fid:k(),registrationStatus:0})}(n),i=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine){var n=Promise.reject(v.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=function(t,e){return s(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,T(t,e)];case 1:return n=i.sent(),[2,j(t,n)];case 2:return y(r=i.sent())&&409===r.serverCode?[4,U(t)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,j(t,{fid:e.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}
2))}))}(t,r);return{installationEntry:r,registrationPromise:i}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:B(t)}:{installationEntry:e}}(t,r);return e=i.registrationPromise,i.installationEntry}))];case 1:return""!==(n=i.sent()).fid?[3,3]:(r={},[4,e]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:e}]}}))}))}function B(t){return s(this,void 0,void 0,(function(){var e,n,r,i;return u(this,(function(o){switch(o.label){case 0:return[4,W(t)];case 1:e=o.sent(),o.label=2;case 2:return 1!==e.registrationStatus?[3,5]:[4,I(100)];case 3:return o.sent(),[4,W(t)];case 4:return e=o.sent(),[3,2];case 5:return 0!==e.registrationStatus?[3,7]:[4,q(t)];case 6:return n=o.sent(),r=n.installationEntry,(i=n.registrationPromise)?[2,i]:[2,r];case 7:return[2,e]}}))}))}function W(t){return V(t,(function(t){if(!t)throw v.create("installation-not-found");return z(t)}))}function z(t){return 1===(e=t).registrationStatus&&e.registrationTime+1e4<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}function H(t,e){var n=t.appConfig,r=t.platformLoggerProvider;return s(this,void 0,void 0,(function(){var t,i,o,a,s,c,l;return u(this,(function(u){switch(u.label){case 0:return t=function(t,e){var n=e.fid;return g(t)+"/"+n+"/authTokens:generate"}(n,e),i=w(n,e),(o=r.getImmediate({optional:!0}))&&i.append("x-firebase-client",o.getPlatformInfoString()),a={installation:{sdkVersion:"w:0.4.12"}},s={method:"POST",headers:i,body:JSON.stringify(a)},[4,E((function(){return fetch(t,s)}))];case 1:return(c=u.sent()).ok?[4,c.json()]:[3,3];case 2:return l=u.sent(),[2,m(l)];case 3:return[4,b("Generate Auth Token",c)];case 4:throw u.sent()}}))}))}function G(t,e){return void 0===e&&(e=!1),s(this,void 0,void 0,(function(){var n,r,i;return u(this,(function(o){switch(o.label){case 0:return[4,V(t.appConfig,(function(r){if(!Q(r))throw v.create("not-registered");var i=r.authToken;if(!e&&function(t){return 2===t.requestStatus&&!function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+36e5}(t)}(i))return r;if(1===i.requestStatus)return n=function(t,e){return s(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,K(t.appConfig)];case 1:n=i.sent(),i.label=2;case 2:return 1!==n.authToken.requestStatus?[3,5]:[4,I(100)];case 3:return i.sent(),[4,K(t.appConfig)];case 4:return n=i.sent(),[3,2];case 5:return 0===(r=n.authToken).requestStatus?[2,G(t,e)]:[2,r]}}))}))}(t,e),r;if(!navigator.onLine)throw v.create("app-offline");var o=function(t){var e={requestStatus:1,requestTime:Date.now()};return a(a({},t),{authToken:e})}(r);return n=function(t,e){return s(this,void 0,void 0,(function(){var n,r,i;return u(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,8]),[4,H(t,e)];case 1:return n=o.sent(),i=a(a({},e),{authToken:n}),[4,j(t.appConfig,i)];case 2:return o.sent(),[2,n];case 3:return!y(r=o.sent())||401!==r.serverCode&&404!==r.serverCode?[3,5]:[4,U(t.appConfig)];case 4:return o.sent(),[3,7];case 5:return i=a(a({},e),{authToken:{requestStatus:0}}),[4,j(t.appConfig,i)];case 6:o.sent(),o.label=7;case 7:throw r;case 8:return[2]}}
2))}))}(t,o),o}))];case 1:return r=o.sent(),n?[4,n]:[3,3];case 2:return i=o.sent(),[3,4];case 3:i=r.authToken,o.label=4;case 4:return[2,i]}}))}))}function K(t){return V(t,(function(t){if(!Q(t))throw v.create("not-registered");var e,n=t.authToken;return 1===(e=n).requestStatus&&e.requestTime+1e4<Date.now()?a(a({},t),{authToken:{requestStatus:0}}):t}))}function Q(t){return void 0!==t&&2===t.registrationStatus}function Y(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return[4,q(t)];case 1:return(e=n.sent().registrationPromise)?[4,e]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function X(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(a){switch(a.label){case 0:return n=function(t,e){var n=e.fid;return g(t)+"/"+n}(t,e),r=w(t,e),i={method:"DELETE",headers:r},[4,E((function(){return fetch(n,i)}))];case 1:return(o=a.sent()).ok?[3,3]:[4,b("Delete Installation",o)];case 2:throw a.sent();case 3:return[2]}}))}))}function $(t,e){var n=t.appConfig;return function(t,e){R();var n=N(t),r=x.get(n);r||(r=new Set,x.set(n,r)),r.add(e)}(n,e),function(){!function(t,e){var n=N(t),r=x.get(n);r&&(r.delete(e),0===r.size&&x.delete(n),D())}(n,e)}}function J(t){return v.create("missing-app-config-values",{valueName:t})}function Z(t){t.INTERNAL.registerComponent(new o.Component("installations",(function(t){var e=t.getProvider("app").getImmediate(),n={appConfig:function(t){var e,n;if(!t||!t.options)throw J("App Configuration");if(!t.name)throw J("App Name");try{for(var r=c(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!t.options[o])throw J(o)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:t.getProvider("platform-logger")};return{app:e,getId:function(){return function(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,q(t.appConfig)];case 1:return e=i.sent(),n=e.installationEntry,(r=e.registrationPromise)?r.catch(console.error):G(t).catch(console.error),[2,n.fid]}}))}))}(n)},getToken:function(t){return function(t,e){return void 0===e&&(e=!1),s(this,void 0,void 0,(function(){return u(this,(function(n){switch(n.label){case 0:return[4,Y(t.appConfig)];case 1:return n.sent(),[4,G(t,e)];case 2:return[2,n.sent().token]}}))}))}(n,t)},delete:function(){return function(t){return s(this,void 0,void 0,(function(){var e,n;return u(this,(function(r){switch(r.label){case 0:return[4,V(e=t.appConfig,(function(t){if(!t||0!==t.registrationStatus)return t}))];case 1:if(!(n=r.sent()))return[3,6];if(1!==n.registrationStatus)return[3,2];throw v.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw v.create("app-offline");case 3:return[4,X(e,n)];case 4:return r.sent(),[4,U(e)];case 5:r.sent(),r.label=6;case 6:return[2]}}
2))}))}(n)},onIdChange:function(t){return $(n,t)}}}),"PUBLIC")),t.registerVersion("@firebase/installations","0.4.12")}Z(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(17);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i=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,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,"a",(function(){return r}))},,function(t,e,n){"use strict";(function(t){var r=n(0),i=n.n(r),o=n(24),a=n(15),s=n.n(a),u="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:{};function c(t){var e=[];return{on:function(t){e.push(t)},off:function(t){e=e.filter((function(e){return e!==t}))},get:function(){return t},set:function(n,r){t=n,e.forEach((function(e){return e(t,r)}))}}}var l=i.a.createContext||function(t,e){var n,i,a="__create-react-context-"+function(){var t="__global_unique_id__";return u[t]=(u[t]||0)+1}()+"__",l=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).emitter=c(e.props.value),e}Object(o.a)(n,t);var r=n.prototype;return r.getChildContext=function(){var t;return(t={})[a]=this.emitter,t},r.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var n,r=this.props.value,i=t.value;((o=r)===(a=i)?0!==o||1/o===1/a:o!==o&&a!==a)?n=0:(n="function"===typeof e?e(r,i):1073741823,0!==(n|=0)&&this.emitter.set(t.value,n))}var o,a},r.render=function(){return this.props.children},n}(r.Component);l.childContextTypes=((n={})[a]=s.a.object.isRequired,n);var h=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!==((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}Object(o.a)(n,e);var r=n.prototype;return r.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=void 0===e||null===e?1073741823:e},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=void 0===t||null===t?1073741823:t},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():t},r.render=function(){return(t=this.props.children,Array.isArray(t)?t[0]:t)(this.state.value);var t},n}(r.Component);return h.contextTypes=((i={})[a]=s.a.object,i),{Provider:l,Consumer:h}};e.a=l}).call(this,n(18))},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(86);t.exports=p,t.exports.parse=o,t.exports.compile=function(t,e){return s(o(t,e),e)},t.exports.tokensToFunction=s,t.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(t,e){for(var n,r=[],o=0,a=0,s="",l=e&&e.delimiter||"/";null!=(n=i.exec(t));){var h=n[0],f=n[1],p=n.index;if(s+=t.slice(a,p),a=p+h.length,f)s+=f[1];else{var d=t[a],v=n[2],y=n[3],g=n[4],m=n[5],b=n[6],_=n[7];s&&(r.push(s),s="");var w=null!=v&&null!=d&&d!==v,E="+"===b||"*"===b,T="?"===b||"*"===b,I=n[2]||l,S=g||m;r.push({name:y||o++,prefix:v||"",delimiter:I,optional:T,repeat:E,partial:w,asterisk:!!_,pattern:S?c(S):_?".*":"[^"+u(I)+"]+?"})}}return a<t.length&&(s+=t.substr(a)),s&&r.push(s),r}function a(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function s(t,e){for(var n=new Array(t.length),i=0;i<t.length;i++)"object"===typeof t[i]&&(n[i]=new RegExp("^(?:"+t[i].pattern+")$",h(e)));return function(e,i){for(var o="",s=e||{},u=(i||{}).pretty?a:encodeURIComponent,c=0;c<t.length;c++){var l=t[c];if("string"!==typeof l){var h,f=s[l.name];if(null==f){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(f)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(h=u(f[p]),!n[c].test(h))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(h)+"`");o+=(0===p?l.prefix:l.delimiter)+h}}else{if(h=l.asterisk?encodeURI(f).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):u(f),!n[c].test(h))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+h+'"');o+=l.prefix+h}}else o+=l}return o}}function u(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function l(t,e){return t.keys=e,t}function h(t){return t&&t.sensitive?"":"i"}function f(t,e,n){r(e)||(n=e||n,e=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<t.length;s++){var c=t[s];if("string"===typeof c)a+=u(c);else{var f=u(c.prefix),p="(?:"+c.pattern+")";e.push(c),c.repeat&&(p+="(?:"+f+p+")*"),a+=p=c.optional?c.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var d=u(n.delimiter||"/"),v=a.slice(-d.length)===d;
2return i||(a=(v?a.slice(0,-d.length):a)+"(?:"+d+"(?=$))?"),a+=o?"$":i&&v?"":"(?="+d+"|$)",l(new RegExp("^"+a,h(n)),e)}function p(t,e,n){return r(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(t,e)}(t,e):r(t)?function(t,e,n){for(var r=[],i=0;i<t.length;i++)r.push(p(t[i],e,n).source);return l(new RegExp("(?:"+r.join("|")+")",h(n)),e)}(t,e,n):function(t,e,n){return f(o(t,n),e,n)}(t,e,n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(17);var i=n(20);function o(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Object(i.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var n,s,u=a(t),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))i.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var h=0;h<s.length;h++)o.call(n,s[h])&&(u[s[h]]=n[s[h]])}}return u}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(7);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!==t&&"undefined"!==typeof t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(i(e)+"="+i(t))})))})),o=a.join("&")}if(o){var s=t.indexOf("#");
2-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(7),i=n(73),o={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var s={adapter:function(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=n(33)),t}(),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(a(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"===typeof t)try{t=JSON.parse(t)}catch(e){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){s.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){s.headers[t]=r.merge(o)})),t.exports=s}).call(this,n(28))},function(t,e,n){"use strict";var r=n(7),i=n(74),o=n(30),a=n(76),s=n(79),u=n(80),c=n(34);t.exports=function(t){return new Promise((function(e,l){var h=t.data,f=t.headers;r.isFormData(h)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",v=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+v)}var y=a(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),o(y,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:t,request:p};i(e,l,r),p=null}},p.onabort=function(){p&&(l(c("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){l(c("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),l(c(e,t,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var g=n(81),m=(t.withCredentials||u(y))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;m&&(f[t.xsrfHeaderName]=m)}if("setRequestHeader"in p&&r.forEach(f,(function(t,e){"undefined"===typeof h&&"content-type"===e.toLowerCase()?delete f[e]:p.setRequestHeader(e,t)}
2)),r.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(b){if("json"!==t.responseType)throw b}"function"===typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),l(t),p=null)})),void 0===h&&(h=null),p.send(h)}))}},function(t,e,n){"use strict";var r=n(75);t.exports=function(t,e,n,i,o){var a=new Error(t);return r(a,e,n,i,o)}},function(t,e,n){"use strict";var r=n(7);t.exports=function(t,e){e=e||{};var n={},i=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,(function(t){"undefined"!==typeof e[t]&&(n[t]=e[t])})),r.forEach(o,(function(i){r.isObject(e[i])?n[i]=r.deepMerge(t[i],e[i]):"undefined"!==typeof e[i]?n[i]=e[i]:r.isObject(t[i])?n[i]=r.deepMerge(t[i]):"undefined"!==typeof t[i]&&(n[i]=t[i])})),r.forEach(a,(function(r){"undefined"!==typeof e[r]?n[r]=e[r]:"undefined"!==typeof t[r]&&(n[r]=t[r])}));var s=i.concat(o).concat(a),u=Object.keys(e).filter((function(t){return-1===s.indexOf(t)}));return r.forEach(u,(function(r){"undefined"!==typeof e[r]?n[r]=e[r]:"undefined"!==typeof t[r]&&(n[r]=t[r])})),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";t.exports=n(87)},function(t,e,n){"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}}(),t.exports=n(45)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},function(t,e,n){t.exports=n(68)},function(t,e,n){"use strict";var r=n(37),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(d){var i=p(n);i&&i!==d&&t(e,i,r)}var a=l(n);h&&(a=a.concat(h(n)));for(var s=u(e),v=u(n),y=0;y<a.length;++y){var g=a[y];if(!o[g]&&(!r||!r[g])&&(!v||!v[g])&&(!s||!s[g])){var m=f(n,g);try{c(e,g,m)}catch(b){}}}}return e}},,function(t,e,n){"use strict";var r=n(27),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,h=i?Symbol.for("react.context"):60110,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,d=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,y="function"===typeof Symbol&&Symbol.iterator;function g(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function _(t,e,n){this.props=t,this.context=e,this.refs=b,this.updater=n||m}function w(){}function E(t,e,n){this.props=t,this.context=e,this.refs=b,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(t,e){if("object"!==typeof t&&"function"!==typeof t&&null!=t)throw Error(g(85));this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},w.prototype=_.prototype;var T=E.prototype=new w;T.constructor=E,r(T,_.prototype),T.isPureReactComponent=!0;var I={current:null},S=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function k(t,e,n){var r,i={},a=null,s=null;
vendor: 29,311 bytes, line 2
2if(null!=e)for(r in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(a=""+e.key),e)S.call(e,r)&&!C.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}if(t&&t.defaultProps)for(r in u=t.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:t,key:a,ref:s,props:i,_owner:I.current}}function N(t){return"object"===typeof t&&null!==t&&t.$$typeof===o}var x=/\/+/g,P=[];function A(t,e,n,r){if(P.length){var i=P.pop();return i.result=t,i.keyPrefix=e,i.func=n,i.context=r,i.count=0,i}return{result:t,keyPrefix:e,func:n,context:r,count:0}}function O(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>P.length&&P.push(t)}function R(t,e,n){return null==t?0:function t(e,n,r,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case o:case a:u=!0}}if(u)return r(i,e,""===n?"."+D(e,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c<e.length;c++){var l=n+D(s=e[c],c);u+=t(s,l,r,i)}else if(null===e||"object"!==typeof e?l=null:l="function"===typeof(l=y&&e[y]||e["@@iterator"])?l:null,"function"===typeof l)for(e=l.call(e),c=0;!(s=e.next()).done;)u+=t(s=s.value,l=n+D(s,c++),r,i);else if("object"===s)throw r=""+e,Error(g(31,"[object Object]"===r?"object with keys {"+Object.keys(e).join(", ")+"}":r,""));return u}(t,"",e,n)}function D(t,e){return"object"===typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,(function(t){return e[t]}))}(t.key):e.toString(36)}function L(t,e){t.func.call(t.context,e,t.count++)}function M(t,e,n){var r=t.result,i=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?F(t,r,n,(function(t){return t})):null!=t&&(N(t)&&(t=function(t,e){return{$$typeof:o,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(t,i+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(x,"$&/")+"/")+n)),r.push(t))}function F(t,e,n,r,i){var o="";null!=n&&(o=(""+n).replace(x,"$&/")+"/"),R(t,M,e=A(e,o,r,i)),O(e)}var j={current:null};function U(){var t=j.current;if(null===t)throw Error(g(321));return t}var V={ReactCurrentDispatcher:j,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:r};e.Children={map:function(t,e,n){if(null==t)return t;var r=[];return F(t,r,null,e,n),r},forEach:function(t,e,n){if(null==t)return t;R(t,L,e=A(null,null,e,n)),O(e)},count:function(t){return R(t,(function(){return null}),null)},toArray:function(t){var e=[];return F(t,e,null,(function(t){return t})),e},only:function(t){if(!N(t))throw Error(g(143));return t}},e.Component=_,e.Fragment=s,e.Profiler=c,e.PureComponent=E,e.StrictMode=u,e.Suspense=p,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,e.cloneElement=function(t,e,n){if(null===t||void 0===t)throw Error(g(267,t));var i=r({},t.props),a=t.key,s=t.ref,u=t._owner;if(null!=e){if(void 0!==e.ref&&(s=e.ref,u=I.current),void 0!==e.key&&(a=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(l in e)S.call(e,l)&&!C.hasOwnProperty(l)&&(i[l]=void 0===e[l]&&void 0!==c?c[l]:e[l])}var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){c=Array(l);for(var h=0;h<l;h++)c[h]=arguments[h+2];i.children=c}return{$$typeof:o,type:t.type,key:a,ref:s,props:i,_owner:u}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:h,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:l,_context:t},t.Consumer=t},e.createElement=k,e.createFactory=function(t){var e=k.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:f,render:t}},e.isValidElement=N,e.lazy=function(t){return{$$typeof:v,_ctor:t,_status:-1,_result:null}},e.memo=function(t,e){return{$$typeof:d,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return U().useCallback(t,e)},e.useContext=function(t,e){return U().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return U().useEffect(t,e)},e.useImperativeHandle=function(t,e,n){return U().useImperativeHandle(t,e,n)},e.useLayoutEffect=function(t,e){return U().useLayoutEffect(t,e)},e.useMemo=function(t,e){return U().useMemo(t,e)},e.useReducer=function(t,e,n){return U().useReducer(t,e,n)},e.useRef=function(t){return U().useRef(t)},e.useState=function(t){return U().useState(t)},e.version="16.13.1"},function(t,e,n){"use strict";var r=n(0),i=n(27),o=n(46);function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));function s(t,e,n,r,i,o,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(l){this.onError(l)}}var u=!1,c=null,l=!1,h=null,f={onError:function(t){u=!0,c=t}};function p(t,e,n,r,i,o,a,l,h){u=!1,c=null,s.apply(f,arguments)}var d=null,v=null,y=null;function g(t,e,n){var r=t.type||"unknown-event";t.currentTarget=y(n),function(t,e,n,r,i,o,s,f,d){if(p.apply(this,arguments),u){if(!u)throw Error(a(198));var v=c;u=!1,c=null,l||(l=!0,h=v)}}(r,e,void 0,t),t.currentTarget=null}var m=null,b={};function _(){if(m)for(var t in b){var e=b[t],n=m.indexOf(t);if(!(-1<n))throw Error(a(96,t));if(!E[n]){if(!e.extractEvents)throw Error(a(97,t));for(var r in E[n]=e,n=e.eventTypes){var i=void 0,o=n[r],s=e,u=r;if(T.hasOwnProperty(u))throw Error(a(99,u));T[u]=o;var c=o.phasedRegistrationNames;if(c){for(i in c)c.hasOwnProperty(i)&&w(c[i],s,u);i=!0}else o.registrationName?(w(o.registrationName,s,u),i=!0):i=!1;if(!i)throw Error(a(98,r,t))}}}}function w(t,e,n){if(I[t])throw Error(a(100,t));I[t]=e,S[t]=e.eventTypes[n].dependencies}var E=[],T={},I={},S={};function C(t){var e,n=!1;for(e in t)if(t.hasOwnProperty(e)){var r=t[e];if(!b.hasOwnProperty(e)||b[e]!==r){if(b[e])throw Error(a(102,e));b[e]=r,n=!0}}n&&_()}var k=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),N=null,x=null,P=null;function A(t){if(t=v(t)){if("function"!==typeof N)throw Error(a(280));var e=t.stateNode;e&&(e=d(e),N(t.stateNode,t.type,e))}}function O(t){x?P?P.push(t):P=[t]:x=t}function R(){if(x){var t=x,e=P;if(P=x=null,A(t),e)for(t=0;t<e.length;t++)A(e[t])}}function D(t,e){return t(e)}function L(t,e,n,r,i){return t(e,n,r,i)}function M(){}var F=D,j=!1,U=!1;function V(){null===x&&null===P||(M(),R())}function q(t,e,n){if(U)return t(e,n);U=!0;try{return F(t,e,n)}finally{U=!1,V()}}var B=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,W=Object.prototype.hasOwnProperty,z={},H={};function G(t,e,n,r,i,o){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(t){K[t]=new G(t,0,!1,t,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(t){var e=t[0];K[e]=new G(e,1,!1,t[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(t){K[t]=new G(t,2,!1,t.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(t){K[t]=new G(t,2,!1,t,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(t){K[t]=new G(t,3,!1,t.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(t){K[t]=new G(t,3,!0,t,null,!1)})),["capture","download"].forEach((function(t){K[t]=new G(t,4,!1,t,null,!1)})),["cols","rows","size","span"].forEach((function(t){K[t]=new G(t,6,!1,t,null,!1)})),["rowSpan","start"].forEach((function(t){K[t]=new G(t,5,!1,t.toLowerCase(),null,!1)}));var Q=/[\-:]([a-z])/g;function Y(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(t){var e=t.replace(Q,Y);K[e]=new G(e,1,!1,t,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(t){var e=t.replace(Q,Y);K[e]=new G(e,1,!1,t,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(t){var e=t.replace(Q,Y);K[e]=new G(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(t){K[t]=new G(t,1,!1,t.toLowerCase(),null,!1)})),K.xlinkHref=new G("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(t){K[t]=new G(t,1,!1,t.toLowerCase(),null,!0)}));var X=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(t,e,n,r){var i=K.hasOwnProperty(e)?K[e]:null;(null!==i?0===i.type:!r&&(2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])))||(function(t,e,n,r){if(null===e||"undefined"===typeof e||function(t,e,n,r){if(null!==n&&0===n.type)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}(t,e,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!e;case 4:return!1===e;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}(e,n,i,r)&&(n=null),r||null===i?function(t){return!!W.call(H,t)||!W.call(z,t)&&(B.test(t)?H[t]=!0:(z[t]=!0,!1))}(e)&&(null===n?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=null===n?3!==i.type&&"":n:(e=i.attributeName,r=i.attributeNamespace,null===n?t.removeAttribute(e):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}X.hasOwnProperty("ReactCurrentDispatcher")||(X.ReactCurrentDispatcher={current:null}),X.hasOwnProperty("ReactCurrentBatchConfig")||(X.ReactCurrentBatchConfig={suspense:null});var J=/^(.*)[\\\/]/,Z="function"===typeof Symbol&&Symbol.for,tt=Z?Symbol.for("react.element"):60103,et=Z?Symbol.for("react.portal"):60106,nt=Z?Symbol.for("react.fragment"):60107,rt=Z?Symbol.for("react.strict_mode"):60108,it=Z?Symbol.for("react.profiler"):60114,ot=Z?Symbol.for("react.provider"):60109,at=Z?Symbol.for("react.context"):60110,st=Z?Symbol.for("react.concurrent_mode"):60111,ut=Z?Symbol.for("react.forward_ref"):60112,ct=Z?Symbol.for("react.suspense"):60113,lt=Z?Symbol.for("react.suspense_list"):60120,ht=Z?Symbol.for("react.memo"):60115,ft=Z?Symbol.for("react.lazy"):60116,pt=Z?Symbol.for("react.block"):60121,dt="function"===typeof Symbol&&Symbol.iterator;function vt(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=dt&&t[dt]||t["@@iterator"])?t:null}function yt(t){if(null==t)return null;if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case nt:return"Fragment";case et:return"Portal";case it:return"Profiler";case rt:return"StrictMode";case ct:return"Suspense";case lt:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case at:return"Context.Consumer";case ot:return"Context.Provider";case ut:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case ht:return yt(t.type);case pt:return yt(t.render);case ft:if(t=1===t._status?t._result:null)return yt(t)}return null}function gt(t){var e="";do{t:switch(t.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break t;default:var r=t._debugOwner,i=t._debugSource,o=yt(t.type);n=null,r&&(n=yt(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(J,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n in "+(r||"Unknown")+o}e+=n,t=t.return}while(t);return e}function mt(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function bt(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function _t(t){t._valueTracker||(t._valueTracker=function(t){var e=bt(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){r=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(t){r=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function wt(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=bt(t)?t.checked?"true":"false":t.value),(t=r)!==n&&(e.setValue(t),!0)}function Et(t,e){var n=e.checked;return i({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:t._wrapperState.initialChecked})}function Tt(t,e){var n=null==e.defaultValue?"":e.defaultValue,r=null!=e.checked?e.checked:e.defaultChecked;n=mt(null!=e.value?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function It(t,e){null!=(e=e.checked)&&$(t,"checked",e,!1)}function St(t,e){It(t,e);var n=mt(e.value),r=e.type;if(null!=n)"number"===r?(0===n&&""===t.value||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if("submit"===r||"reset"===r)return void t.removeAttribute("value");e.hasOwnProperty("value")?kt(t,e.type,n):e.hasOwnProperty("defaultValue")&&kt(t,e.type,mt(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function Ct(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!("submit"!==r&&"reset"!==r||void 0!==e.value&&null!==e.value))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}""!==(n=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==n&&(t.name=n)}function kt(t,e,n){"number"===e&&t.ownerDocument.activeElement===t||(null==n?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function Nt(t,e){return t=i({children:void 0},e),(e=function(t){var e="";return r.Children.forEach(t,(function(t){null!=t&&(e+=t)})),e}(e.children))&&(t.children=e),t}function xt(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+mt(n),e=null,i=0;i<t.length;i++){if(t[i].value===n)return t[i].selected=!0,void(r&&(t[i].defaultSelected=!0));null!==e||t[i].disabled||(e=t[i])}null!==e&&(e.selected=!0)}}function Pt(t,e){if(null!=e.dangerouslySetInnerHTML)throw Error(a(91));return i({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function At(t,e){var n=e.value;if(null==n){if(n=e.children,e=e.defaultValue,null!=n){if(null!=e)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}e=n}null==e&&(e=""),n=e}t._wrapperState={initialValue:mt(n)}}function Ot(t,e){var n=mt(e.value),r=mt(e.defaultValue);null!=n&&((n=""+n)!==t.value&&(t.value=n),null==e.defaultValue&&t.defaultValue!==n&&(t.defaultValue=n)),null!=r&&(t.defaultValue=""+r)}function Rt(t){var e=t.textContent;e===t._wrapperState.initialValue&&""!==e&&null!==e&&(t.value=e)}var Dt="http://www.w3.org/1999/xhtml",Lt="http://www.w3.org/2000/svg";function Mt(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ft(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?Mt(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}var jt,Ut=function(t){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction((function(){return t(e,n)}))}:t}((function(t,e){if(t.namespaceURI!==Lt||"innerHTML"in t)t.innerHTML=e;else{for((jt=jt||document.createElement("div")).innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=jt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}}));function Vt(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}function qt(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Bt={animationend:qt("Animation","AnimationEnd"),animationiteration:qt("Animation","AnimationIteration"),animationstart:qt("Animation","AnimationStart"),transitionend:qt("Transition","TransitionEnd")},Wt={},zt={};function Ht(t){if(Wt[t])return Wt[t];if(!Bt[t])return t;var e,n=Bt[t];for(e in n)if(n.hasOwnProperty(e)&&e in zt)return Wt[t]=n[e];return t}k&&(zt=document.createElement("div").style,"AnimationEvent"in window||(delete Bt.animationend.animation,delete Bt.animationiteration.animation,delete Bt.animationstart.animation),"TransitionEvent"in window||delete Bt.transitionend.transition);var Gt=Ht("animationend"),Kt=Ht("animationiteration"),Qt=Ht("animationstart"),Yt=Ht("transitionend"),Xt="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$t=new("function"===typeof WeakMap?WeakMap:Map);function Jt(t){var e=$t.get(t);return void 0===e&&(e=new Map,$t.set(t,e)),e}function Zt(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!==(1026&(e=t).effectTag)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function te(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&(null!==(t=t.alternate)&&(e=t.memoizedState)),null!==e)return e.dehydrated}return null}function ee(t){if(Zt(t)!==t)throw Error(a(188))}function ne(t){if(!(t=function(t){var e=t.alternate;if(!e){if(null===(e=Zt(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return ee(i),t;if(o===r)return ee(i),e;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}(t)))return null;for(var e=t;;){if(5===e.tag||6===e.tag)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function re(t,e){if(null==e)throw Error(a(30));return null==t?e:Array.isArray(t)?Array.isArray(e)?(t.push.apply(t,e),t):(t.push(e),t):Array.isArray(e)?[t].concat(e):[t,e]}function ie(t,e,n){Array.isArray(t)?t.forEach(e,n):t&&e.call(n,t)}var oe=null;function ae(t){if(t){var e=t._dispatchListeners,n=t._dispatchInstances;if(Array.isArray(e))for(var r=0;r<e.length&&!t.isPropagationStopped();r++)g(t,e[r],n[r]);else e&&g(t,e,n);t._dispatchListeners=null,t._dispatchInstances=null,t.isPersistent()||t.constructor.release(t)}}function se(t){if(null!==t&&(oe=re(oe,t)),t=oe,oe=null,t){if(ie(t,ae),oe)throw Error(a(95));if(l)throw t=h,l=!1,h=null,t}}function ue(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}function ce(t){if(!k)return!1;var e=(t="on"+t)in document;return e||((e=document.createElement("div")).setAttribute(t,"return;"),e="function"===typeof e[t]),e}var le=[];function he(t){t.topLevelType=null,t.nativeEvent=null,t.targetInst=null,t.ancestors.length=0,10>le.length&&le.push(t)}function fe(t,e,n,r){if(le.length){var i=le.pop();return i.topLevelType=t,i.eventSystemFlags=r,i.nativeEvent=e,i.targetInst=n,i}return{topLevelType:t,eventSystemFlags:r,nativeEvent:e,targetInst:n,ancestors:[]}}function pe(t){var e=t.targetInst,n=e;do{if(!n){t.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(e=n.tag)&&6!==e||t.ancestors.push(n),n=kn(r)}while(n);for(n=0;n<t.ancestors.length;n++){e=t.ancestors[n];var i=ue(t.nativeEvent);r=t.topLevelType;var o=t.nativeEvent,a=t.eventSystemFlags;0===n&&(a|=64);for(var s=null,u=0;u<E.length;u++){var c=E[u];c&&(c=c.extractEvents(r,e,o,i,a))&&(s=re(s,c))}se(s)}}function de(t,e,n){if(!n.has(t)){switch(t){case"scroll":Qe(e,"scroll",!0);break;case"focus":case"blur":Qe(e,"focus",!0),Qe(e,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ce(t)&&Qe(e,t,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Xt.indexOf(t)&&Ke(t,e)}n.set(t,null)}}var ve,ye,ge,me=!1,be=[],_e=null,we=null,Ee=null,Te=new Map,Ie=new Map,Se=[],Ce="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),ke="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Ne(t,e,n,r,i){return{blockedOn:t,topLevelType:e,eventSystemFlags:32|n,nativeEvent:i,container:r}}function xe(t,e){switch(t){case"focus":case"blur":_e=null;break;case"dragenter":case"dragleave":we=null;break;case"mouseover":case"mouseout":Ee=null;break;case"pointerover":case"pointerout":Te.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ie.delete(e.pointerId)}}function Pe(t,e,n,r,i,o){return null===t||t.nativeEvent!==o?(t=Ne(e,n,r,i,o),null!==e&&(null!==(e=Nn(e))&&ye(e)),t):(t.eventSystemFlags|=r,t)}function Ae(t){var e=kn(t.target);if(null!==e){var n=Zt(e);if(null!==n)if(13===(e=n.tag)){if(null!==(e=te(n)))return t.blockedOn=e,void o.unstable_runWithPriority(t.priority,(function(){ge(n)}))}else if(3===e&&n.stateNode.hydrate)return void(t.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}t.blockedOn=null}function Oe(t){if(null!==t.blockedOn)return!1;var e=Je(t.topLevelType,t.eventSystemFlags,t.container,t.nativeEvent);if(null!==e){var n=Nn(e);return null!==n&&ye(n),t.blockedOn=e,!1}return!0}function Re(t,e,n){Oe(t)&&n.delete(e)}function De(){for(me=!1;0<be.length;){var t=be[0];if(null!==t.blockedOn){null!==(t=Nn(t.blockedOn))&&ve(t);break}var e=Je(t.topLevelType,t.eventSystemFlags,t.container,t.nativeEvent);null!==e?t.blockedOn=e:be.shift()}null!==_e&&Oe(_e)&&(_e=null),null!==we&&Oe(we)&&(we=null),null!==Ee&&Oe(Ee)&&(Ee=null),Te.forEach(Re),Ie.forEach(Re)}function Le(t,e){t.blockedOn===e&&(t.blockedOn=null,me||(me=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,De)))}function Me(t){function e(e){return Le(e,t)}if(0<be.length){Le(be[0],t);for(var n=1;n<be.length;n++){var r=be[n];r.blockedOn===t&&(r.blockedOn=null)}}for(null!==_e&&Le(_e,t),null!==we&&Le(we,t),null!==Ee&&Le(Ee,t),Te.forEach(e),Ie.forEach(e),n=0;n<Se.length;n++)(r=Se[n]).blockedOn===t&&(r.blockedOn=null);for(;0<Se.length&&null===(n=Se[0]).blockedOn;)Ae(n),null===n.blockedOn&&Se.shift()}var Fe={},je=new Map,Ue=new Map,Ve=["abort","abort",Gt,"animationEnd",Kt,"animationIteration",Qt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Yt,"transitionEnd","waiting","waiting"];function qe(t,e){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1],o="on"+(i[0].toUpperCase()+i.slice(1));o={phasedRegistrationNames:{bubbled:o,captured:o+"Capture"},dependencies:[r],eventPriority:e},Ue.set(r,e),je.set(r,o),Fe[i]=o}}qe("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),qe("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),qe(Ve,2);for(var Be="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),We=0;We<Be.length;We++)Ue.set(Be[We],0);var ze=o.unstable_UserBlockingPriority,He=o.unstable_runWithPriority,Ge=!0;function Ke(t,e){Qe(e,t,!1)}function Qe(t,e,n){var r=Ue.get(e);switch(void 0===r?2:r){case 0:r=Ye.bind(null,e,1,t);break;case 1:r=Xe.bind(null,e,1,t);break;default:r=$e.bind(null,e,1,t)}n?t.addEventListener(e,r,!0):t.addEventListener(e,r,!1)}function Ye(t,e,n,r){j||M();var i=$e,o=j;j=!0;try{L(i,t,e,n,r)}finally{(j=o)||V()}}function Xe(t,e,n,r){He(ze,$e.bind(null,t,e,n,r))}function $e(t,e,n,r){if(Ge)if(0<be.length&&-1<Ce.indexOf(t))t=Ne(null,t,e,n,r),be.push(t);else{var i=Je(t,e,n,r);if(null===i)xe(t,r);else if(-1<Ce.indexOf(t))t=Ne(i,t,e,n,r),be.push(t);else if(!function(t,e,n,r,i){switch(e){case"focus":return _e=Pe(_e,t,e,n,r,i),!0;case"dragenter":return we=Pe(we,t,e,n,r,i),!0;case"mouseover":return Ee=Pe(Ee,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Te.set(o,Pe(Te.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ie.set(o,Pe(Ie.get(o)||null,t,e,n,r,i)),!0}return!1}(i,t,e,n,r)){xe(t,r),t=fe(t,r,null,e);try{q(pe,t)}finally{he(t)}}}}function Je(t,e,n,r){if(null!==(n=kn(n=ue(r)))){var i=Zt(n);if(null===i)n=null;else{var o=i.tag;if(13===o){if(null!==(n=te(i)))return n;n=null}else if(3===o){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}t=fe(t,r,n,e);try{q(pe,t)}finally{he(t)}return null}var Ze={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tn=["Webkit","ms","Moz","O"];function en(t,e,n){return null==e||"boolean"===typeof e||""===e?"":n||"number"!==typeof e||0===e||Ze.hasOwnProperty(t)&&Ze[t]?(""+e).trim():e+"px"}function nn(t,e){for(var n in t=t.style,e)if(e.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=en(n,e[n],r);"float"===n&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}
2Object.keys(Ze).forEach((function(t){tn.forEach((function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ze[e]=Ze[t]}))}));var rn=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function on(t,e){if(e){if(rn[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(a(137,t,""));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(a(60));if("object"!==typeof e.dangerouslySetInnerHTML||!("__html"in e.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=e.style&&"object"!==typeof e.style)throw Error(a(62,""))}}function an(t,e){if(-1===t.indexOf("-"))return"string"===typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sn=Dt;function un(t,e){var n=Jt(t=9===t.nodeType||11===t.nodeType?t:t.ownerDocument);e=S[e];for(var r=0;r<e.length;r++)de(e[r],t,n)}function cn(){}function ln(t){if("undefined"===typeof(t=t||("undefined"!==typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function hn(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fn(t,e){var n,r=hn(t);for(t=0;r;){if(3===r.nodeType){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=hn(r)}}function pn(){for(var t=window,e=ln();e instanceof t.HTMLIFrameElement;){try{var n="string"===typeof e.contentWindow.location.href}catch(r){n=!1}if(!n)break;e=ln((t=e.contentWindow).document)}return e}function dn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}var vn=null,yn=null;function gn(t,e){switch(t){case"button":case"input":case"select":case"textarea":return!!e.autoFocus}return!1}function mn(t,e){return"textarea"===t||"option"===t||"noscript"===t||"string"===typeof e.children||"number"===typeof e.children||"object"===typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var bn="function"===typeof setTimeout?setTimeout:void 0,_n="function"===typeof clearTimeout?clearTimeout:void 0;function wn(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break}return t}function En(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var n=t.data;if("$"===n||"$!"===n||"$?"===n){if(0===e)return t;e--}else"/$"===n&&e++}t=t.previousSibling}return null}var Tn=Math.random().toString(36).slice(2),In="__reactInternalInstance$"+Tn,Sn="__reactEventHandlers$"+Tn,Cn="__reactContainere$"+Tn;function kn(t){var e=t[In];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Cn]||n[In]){if(n=e.alternate,null!==e.child||null!==n&&null!==n.child)for(t=En(t);null!==t;){if(n=t[In])return n;t=En(t)}return e}n=(t=n).parentNode}return null}function Nn(t){return!(t=t[In]||t[Cn])||5!==t.tag&&6!==t.tag&&13!==t.tag&&3!==t.tag?null:t}function xn(t){if(5===t.tag||6===t.tag)return t.stateNode;throw Error(a(33))}function Pn(t){return t[Sn]||null}function An(t){do{t=t.return}while(t&&5!==t.tag);return t||null}function On(t,e){var n=t.stateNode;if(!n)return null;var r=d(n);if(!r)return null;n=r[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!r;break t;default:t=!1}if(t)return null;if(n&&"function"!==typeof n)throw Error(a(231,e,typeof n));return n}
vendor: 3,018 bytes, line 2
2function Rn(t,e,n){(e=On(t,n.dispatchConfig.phasedRegistrationNames[e]))&&(n._dispatchListeners=re(n._dispatchListeners,e),n._dispatchInstances=re(n._dispatchInstances,t))}function Dn(t){if(t&&t.dispatchConfig.phasedRegistrationNames){for(var e=t._targetInst,n=[];e;)n.push(e),e=An(e);for(e=n.length;0<e--;)Rn(n[e],"captured",t);for(e=0;e<n.length;e++)Rn(n[e],"bubbled",t)}}function Ln(t,e,n){t&&n&&n.dispatchConfig.registrationName&&(e=On(t,n.dispatchConfig.registrationName))&&(n._dispatchListeners=re(n._dispatchListeners,e),n._dispatchInstances=re(n._dispatchInstances,t))}function Mn(t){t&&t.dispatchConfig.registrationName&&Ln(t._targetInst,null,t)}function Fn(t){ie(t,Dn)}var jn=null,Un=null,Vn=null;function qn(){if(Vn)return Vn;var t,e,n=Un,r=n.length,i="value"in jn?jn.value:jn.textContent,o=i.length;for(t=0;t<r&&n[t]===i[t];t++);var a=r-t;for(e=1;e<=a&&n[r-e]===i[o-e];e++);return Vn=i.slice(t,1<e?1-e:void 0)}function Bn(){return!0}function Wn(){return!1}function zn(t,e,n,r){for(var i in this.dispatchConfig=t,this._targetInst=e,this.nativeEvent=n,t=this.constructor.Interface)t.hasOwnProperty(i)&&((e=t[i])?this[i]=e(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Bn:Wn,this.isPropagationStopped=Wn,this}function Hn(t,e,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,t,e,n,r),i}return new this(t,e,n,r)}function Gn(t){if(!(t instanceof this))throw Error(a(279));t.destructor(),10>this.eventPool.length&&this.eventPool.push(t)}function Kn(t){t.eventPool=[],t.getPooled=Hn,t.release=Gn}i(zn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!==typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!==typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){this.isPersistent=Bn},isPersistent:Wn,destructor:function(){var t,e=this.constructor.Interface;for(t in e)this[t]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Wn,this._dispatchInstances=this._dispatchListeners=null}}),zn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},zn.extend=function(t){function e(){}function n(){return r.apply(this,arguments)}var r=this;e.prototype=r.prototype;var o=new e;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,t),n.extend=r.extend,Kn(n),n},Kn(zn);var Qn=zn.extend({data:null}),Yn=zn.extend({data:null}),Xn=[9,13,27,32],$n=k&&"CompositionEvent"in window,Jn=null;k&&"documentMode"in document&&(Jn=document.documentMode);var Zn=k&&"TextEvent"in window&&!Jn,tr=k&&(!$n||Jn&&8<Jn&&11>
vendor: 9,393 bytes, line 2
2=Jn),er=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function ir(t,e){switch(t){case"keyup":return-1!==Xn.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function or(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var ar=!1;var sr={eventTypes:nr,extractEvents:function(t,e,n,r){var i;if($n)t:{switch(t){case"compositionstart":var o=nr.compositionStart;break t;case"compositionend":o=nr.compositionEnd;break t;case"compositionupdate":o=nr.compositionUpdate;break t}o=void 0}else ar?ir(t,n)&&(o=nr.compositionEnd):"keydown"===t&&229===n.keyCode&&(o=nr.compositionStart);return o?(tr&&"ko"!==n.locale&&(ar||o!==nr.compositionStart?o===nr.compositionEnd&&ar&&(i=qn()):(Un="value"in(jn=r)?jn.value:jn.textContent,ar=!0)),o=Qn.getPooled(o,e,n,r),i?o.data=i:null!==(i=or(n))&&(o.data=i),Fn(o),i=o):i=null,(t=Zn?function(t,e){switch(t){case"compositionend":return or(e);case"keypress":return 32!==e.which?null:(rr=!0,er);case"textInput":return(t=e.data)===er&&rr?null:t;default:return null}}(t,n):function(t,e){if(ar)return"compositionend"===t||!$n&&ir(t,e)?(t=qn(),Vn=Un=jn=null,ar=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return tr&&"ko"!==e.locale?null:e.data;default:return null}}(t,n))?((e=Yn.getPooled(nr.beforeInput,e,n,r)).data=t,Fn(e)):e=null,null===i?e:null===e?i:[i,e]}},ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!ur[t.type]:"textarea"===e}var lr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function hr(t,e,n){return(t=zn.getPooled(lr.change,t,e,n)).type="change",O(n),Fn(t),t}var fr=null,pr=null;function dr(t){se(t)}function vr(t){if(wt(xn(t)))return t}function yr(t,e){if("change"===t)return e}var gr=!1;function mr(){fr&&(fr.detachEvent("onpropertychange",br),pr=fr=null)}function br(t){if("value"===t.propertyName&&vr(pr))if(t=hr(pr,t,ue(t)),j)se(t);else{j=!0;try{D(dr,t)}finally{j=!1,V()}}}function _r(t,e,n){"focus"===t?(mr(),pr=n,(fr=e).attachEvent("onpropertychange",br)):"blur"===t&&mr()}function wr(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return vr(pr)}function Er(t,e){if("click"===t)return vr(e)}function Tr(t,e){if("input"===t||"change"===t)return vr(e)}k&&(gr=ce("input")&&(!document.documentMode||9<document.documentMode));var Ir={eventTypes:lr,_isInputEventSupported:gr,extractEvents:function(t,e,n,r){var i=e?xn(e):window,o=i.nodeName&&i.nodeName.toLowerCase();if("select"===o||"input"===o&&"file"===i.type)var a=yr;else if(cr(i))if(gr)a=Tr;else{a=wr;var s=_r}else(o=i.nodeName)&&"input"===o.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(a=Er);if(a&&(a=a(t,e)))return hr(a,n,r);s&&s(t,i,e),"blur"===t&&(t=i._wrapperState)&&t.controlled&&"number"===i.type&&kt(i,"number",i.value)}},Sr=zn.extend({view:null,detail:null}),Cr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kr(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):!!(t=Cr[t])&&!!e[t]}function Nr(){return kr}var xr=0,Pr=0,Ar=!1,Or=!1,Rr=Sr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Nr,button:null,buttons:null,relatedTarget:function(t){return t.relatedTarget||(t.fromElement===t.srcElement?t.toElement:t.fromElement)},movementX:function(t){if("movementX"in t)return t.movementX;var e=xr;return xr=t.screenX,Ar?"mousemove"===t.type?t.screenX-e:0:(Ar=!0,0)},movementY:function(t){if("movementY"in t)return t.movementY;var e=Pr;return Pr=t.screenY,Or?"mousemove"===t.type?t.screenY-e:0:(Or=!0,0)}}),Dr=Rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Lr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Mr={eventTypes:Lr,extractEvents:function(t,e,n,r,i){var o="mouseover"===t||"pointerover"===t,a="mouseout"===t||"pointerout"===t;if(o&&0===(32&i)&&(n.relatedTarget||n.fromElement)||!a&&!o)return null;(o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window,a)?(a=e,null!==(e=(e=n.relatedTarget||n.toElement)?kn(e):null)&&(e!==Zt(e)||5!==e.tag&&6!==e.tag)&&(e=null)):a=null;if(a===e)return null;if("mouseout"===t||"mouseover"===t)var s=Rr,u=Lr.mouseLeave,c=Lr.mouseEnter,l="mouse";else"pointerout"!==t&&"pointerover"!==t||(s=Dr,u=Lr.pointerLeave,c=Lr.pointerEnter,l="pointer");if(t=null==a?o:xn(a),o=null==e?o:xn(e),(u=s.getPooled(u,a,n,r)).type=l+"leave",u.target=t,u.relatedTarget=o,(n=s.getPooled(c,e,n,r)).type=l+"enter",n.target=o,n.relatedTarget=t,l=e,(r=a)&&l)t:{for(c=l,a=0,t=s=r;t;t=An(t))a++;for(t=0,e=c;e;e=An(e))t++;for(;0<a-t;)s=An(s),a--;for(;0<t-a;)c=An(c),t--;for(;a--;){if(s===c||s===c.alternate)break t;s=An(s),c=An(c)}s=null}else s=null;for(c=s,s=[];r&&r!==c&&(null===(a=r.alternate)||a!==c);)s.push(r),r=An(r);for(r=[];l&&l!==c&&(null===(a=l.alternate)||a!==c);)r.push(l),l=An(l);for(l=0;l<s.length;l++)Ln(s[l],"bubbled",u);for(l=r.length;0<l--;)Ln(r[l],"captured",n);return 0===(64&i)?[u]:[u,n]}};var Fr="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e},jr=Object.prototype.hasOwnProperty;function Ur(t,e){if(Fr(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(r=0;r<n.length;r++)if(!jr.call(e,n[r])||!Fr(t[n[r]],e[n[r]]))return!1;return!0}var Vr=k&&"documentMode"in document&&11>=document.documentMode,qr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Br=null,Wr=null,zr=null,Hr=!1;function Gr(t,e){var n=e.window===e?e.document:9===e.nodeType?e:e.ownerDocument;return Hr||null==Br||Br!==ln(n)?null:("selectionStart"in(n=Br)&&dn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},zr&&Ur(zr,n)?null:(zr=n,(t=zn.getPooled(qr.select,Wr,t,e)).type="select",t.target=Br,Fn(t),t))}var Kr={eventTypes:qr,extractEvents:function(t,e,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){t:{i=Jt(i),o=S.onSelect;for(var a=0;a<o.length;a++)if(!i.has(o[a])){i=!1;break t}i=!0}o=!i}if(o)return null;switch(i=e?xn(e):window,t){case"focus":(cr(i)||"true"===i.contentEditable)&&(Br=i,Wr=e,zr=null);break;case"blur":zr=Wr=Br=null;break;case"mousedown":Hr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Hr=!1,Gr(n,r);case"selectionchange":if(Vr)break;case"keydown":case"keyup":return Gr(n,r)}return null}},Qr=zn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Yr=zn.extend({clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Xr=Sr.extend({relatedTarget:null});function $r(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,10===t&&(t=13),32<=t||13===t?t:0}var Jr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ti=Sr.extend({key:function(t){if(t.key){var e=Jr[t.key]||t.key;if("Unidentified"!==e)return e}return"keypress"===t.type?13===(t=$r(t))?"Enter":String.fromCharCode(t):"keydown"===t.type||"ke
2yup"===t.type?Zr[t.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Nr,charCode:function(t){return"keypress"===t.type?$r(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?$r(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}}),ei=Rr.extend({dataTransfer:null}),ni=Sr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Nr}),ri=zn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),ii=Rr.extend({deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:null,deltaMode:null}),oi={eventTypes:Fe,extractEvents:function(t,e,n,r){var i=je.get(t);if(!i)return null;switch(t){case"keypress":if(0===$r(n))return null;case"keydown":case"keyup":t=ti;break;case"blur":case"focus":t=Xr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":t=Rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":t=ei;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":t=ni;break;case Gt:case Kt:case Qt:t=Qr;break;case Yt:t=ri;break;case"scroll":t=Sr;break;case"wheel":t=ii;break;case"copy":case"cut":case"paste":t=Yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":t=Dr;break;default:t=zn}return Fn(e=t.getPooled(i,e,n,r)),e}};if(m)throw Error(a(101));m=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),_(),d=Pn,v=Nn,y=xn,C({SimpleEventPlugin:oi,EnterLeaveEventPlugin:Mr,ChangeEventPlugin:Ir,SelectEventPlugin:Kr,BeforeInputEventPlugin:sr});var ai=[],si=-1;function ui(t){0>si||(t.current=ai[si],ai[si]=null,si--)}function ci(t,e){si++,ai[si]=t.current,t.current=e}var li={},hi={current:li},fi={current:!1},pi=li;function di(t,e){var n=t.type.contextTypes;if(!n)return li;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function vi(t){return null!==(t=t.childContextTypes)&&void 0!==t}function yi(){ui(fi),ui(hi)}function gi(t,e,n){if(hi.current!==li)throw Error(a(168));ci(hi,e),ci(fi,n)}function mi(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(a(108,yt(e)||"Unknown",o));return i({},n,{},r)}function bi(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||li,pi=hi.current,ci(hi,t),ci(fi,fi.current),!0}function _i(t,e,n){var r=t.stateNode;if(!r)throw Error(a(169));n?(t=mi(t,e,pi),r.__reactInternalMemoizedMergedChildContext=t,ui(fi),ui(hi),ci(hi,t)):ui(fi),ci(fi,n)}var wi=o.unstable_runWithPriority,Ei=o.unstable_scheduleCallback,Ti=o.unstable_cancelCallback,Ii=o.unstable_requestPaint,Si=o.unstable_now,Ci=o.unstable_getCurrentPriorityLevel,ki=o.unstable_ImmediatePriority,Ni=o.unstable_UserBlockingPriority,xi=o.unstable_NormalPriority,Pi=o.unstable_LowPriority,Ai=o.unstable_IdlePriority,Oi={},Ri=o.unstable_shouldYield,Di=void 0!==Ii?Ii:function(){},Li=null,Mi=null,Fi=!1,ji=Si(),Ui=1e4>ji?Si:function(){return Si()-ji};function Vi(){switch(Ci()){case ki:return 99;case Ni:return 98;case xi:return 97;case Pi:return 96;case Ai:return 95;default:throw Error(a(332))}}function qi(t){switch(t){case 99:return ki;case 98:return Ni;case 97:return xi;case 96:return Pi;case 95:return Ai;default:throw Error(a(332))}}function Bi(t,e){return t=qi(t),wi(t,e)}function Wi(t,e,n){return t=qi(t),Ei(t,e,n)}function zi(t){return null===Li?(Li=[t],Mi=Ei(ki,Gi)):Li.push(t),Oi}function Hi(){if(null!==Mi){var t=Mi;Mi=null,Ti(t)}Gi()}
2function Gi(){if(!Fi&&null!==Li){Fi=!0;var t=0;try{var e=Li;Bi(99,(function(){for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}})),Li=null}catch(n){throw null!==Li&&(Li=Li.slice(t+1)),Ei(ki,Hi),n}finally{Fi=!1}}}function Ki(t,e,n){return 1073741821-(1+((1073741821-t+e/10)/(n/=10)|0))*n}function Qi(t,e){if(t&&t.defaultProps)for(var n in e=i({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}var Yi={current:null},Xi=null,$i=null,Ji=null;function Zi(){Ji=$i=Xi=null}function to(t){var e=Yi.current;ui(Yi),t.type._context._currentValue=e}function eo(t,e){for(;null!==t;){var n=t.alternate;if(t.childExpirationTime<e)t.childExpirationTime=e,null!==n&&n.childExpirationTime<e&&(n.childExpirationTime=e);else{if(!(null!==n&&n.childExpirationTime<e))break;n.childExpirationTime=e}t=t.return}}function no(t,e){Xi=t,Ji=$i=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(t.expirationTime>=e&&(Pa=!0),t.firstContext=null)}function ro(t,e){if(Ji!==t&&!1!==e&&0!==e)if("number"===typeof e&&1073741823!==e||(Ji=t,e=1073741823),e={context:t,observedBits:e,next:null},null===$i){if(null===Xi)throw Error(a(308));$i=e,Xi.dependencies={expirationTime:0,firstContext:e,responders:null}}else $i=$i.next=e;return t._currentValue}var io=!1;function oo(t){t.updateQueue={baseState:t.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ao(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,baseQueue:t.baseQueue,shared:t.shared,effects:t.effects})}function so(t,e){return(t={expirationTime:t,suspenseConfig:e,tag:0,payload:null,callback:null,next:null}).next=t}function uo(t,e){if(null!==(t=t.updateQueue)){var n=(t=t.shared).pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}}function co(t,e){var n=t.alternate;null!==n&&ao(n,t),null===(n=(t=t.updateQueue).baseQueue)?(t.baseQueue=e.next=e,e.next=e):(e.next=n.next,n.next=e)}function lo(t,e,n,r){var o=t.updateQueue;io=!1;var a=o.baseQueue,s=o.shared.pending;if(null!==s){if(null!==a){var u=a.next;a.next=s.next,s.next=u}a=s,o.shared.pending=null,null!==(u=t.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=s))}if(null!==a){u=a.next;var c=o.baseState,l=0,h=null,f=null,p=null;if(null!==u)for(var d=u;;){if((s=d.expirationTime)<r){var v={expirationTime:d.expirationTime,suspenseConfig:d.suspenseConfig,tag:d.tag,payload:d.payload,callback:d.callback,next:null};null===p?(f=p=v,h=c):p=p.next=v,s>l&&(l=s)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:d.suspenseConfig,tag:d.tag,payload:d.payload,callback:d.callback,next:null}),ou(s,d.suspenseConfig);t:{var y=t,g=d;switch(s=e,v=n,g.tag){case 1:if("function"===typeof(y=g.payload)){c=y.call(v,c,s);break t}c=y;break t;case 3:y.effectTag=-4097&y.effectTag|64;case 0:if(null===(s="function"===typeof(y=g.payload)?y.call(v,c,s):y)||void 0===s)break t;c=i({},c,s);break t;case 2:io=!0}}null!==d.callback&&(t.effectTag|=32,null===(s=o.effects)?o.effects=[d]:s.push(d))}if(null===(d=d.next)||d===u){if(null===(s=o.shared.pending))break;d=a.next=s.next,s.next=u,o.baseQueue=a=s,o.shared.pending=null}}null===p?h=c:p.next=f,o.baseState=h,o.baseQueue=p,au(l),t.expirationTime=l,t.memoizedState=c}}function ho(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(null!==i){if(r.callback=null,r=i,i=n,"function"!==typeof r)throw Error(a(191,r));r.call(i)}}}var fo=X.ReactCurrentBatchConfig,po=(new r.Component).refs;function vo(t,e,n,r){n=null===(n=n(r,e=t.memoizedState))||void 0===n?e:i({},e,n),t.memoizedState=n,0===t.expirationTime&&(t.updateQueue.baseState=n)}var yo={isMounted:function(t){return!!(t=t._reactInternalFiber)&&Zt(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternalFiber;var r=Gs(),i=fo.suspense;(i=so(r=Ks(r,t,i),i)).payload=e,void 0!==n&&null!==n&&(i.callback=n),uo(t,i),Qs(t,r)},enqueueReplaceState:function(t,e,n){t=t._reactInternalFiber;var r=Gs(),i=fo.suspense;(i=so(r=Ks(r,t,i),i)).tag=1,i.payload=e,void 0!==n&&null!==n&&(i.callback=n),uo(t,i),Qs(t,r)},enqueueForceUpdate:function(t,e){t=t._reactInternalFiber;var n=Gs(),r=fo.suspense;(r=so(n=Ks(n,t,r),r)).tag=2,void 0!==e&&null!==e&&(r.callback=e),uo(t,r),Qs(t,n)}};function go(t,e,n,r,i,o,a){return"function"===typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(r,o,a):!e.prototype||!e.prototype.isPureReactComponent||(!Ur(n,r)||!Ur(i,o))}function mo(t,e,n){var r=!1,i=li,o=e.contextType;return"object"===typeof o&&null!==o?o=ro(o):(i=vi(e)?pi:hi.current,o=(r=null!==(r=e.contextTypes)&&void 0!==r)?di(t,i):li),e=new e(n,o),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=yo,t.stateNode=e,e._reactInternalFiber=t,r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function bo(t,e,n,r){t=e.state,"function"===typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),"function"===typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&yo.enqueueReplaceState(e,e.state,null)}function _o(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=po,oo(t);var o=e.contextType;"object"===typeof o&&null!==o?i.context=ro(o):(o=vi(e)?pi:hi.current,i.context=di(t,o)),lo(t,n,i,r),i.state=t.memoizedState,"function"===typeof(o=e.getDerivedStateFromProps)&&(vo(t,e,o,n),i.state=t.memoizedState),"function"===typeof e.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(e=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),e!==i.state&&yo.enqueueReplaceState(i,i.state,null),lo(t,n,i,r),i.state=t.memoizedState),"function"===typeof i.componentDidMount&&(t.effectTag|=4)}var wo=Array.isArray;function Eo(t,e,n){if(null!==(t=n.ref)&&"function"!==typeof t&&"object"!==typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,t));var i=""+t;return null!==e&&null!==e.ref&&"function"===typeof e.ref&&e.ref._stringRef===i?e.ref:((e=function(t){var e=r.refs;e===po&&(e=r.refs={}),null===t?delete e[i]:e[i]=t})._stringRef=i,e)}if("string"!==typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function To(t,e){if("textarea"!==t.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(e)?"object with keys {"+Object.keys(e).join(", ")+"}":e,""))}function Io(t){function e(e,n){if(t){var r=e.lastEffect;null!==r?(r.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!t)return null;for(;null!==r;)e(n,r),r=r.sibling;return null}function r(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(t,e){return(t=Cu(t,e)).index=0,t.sibling=null,t}function o(e,n,r){return e.index=r,t?null!==(r=e.alternate)?(r=r.index)<n?(e.effectTag=2,n):r:(e.effectTag=2,n):n}function s(e){return t&&null===e.alternate&&(e.effectTag=2),e}function u(t,e,n,r){return null===e||6!==e.tag?((e=xu(n,t.mode,r)).return=t,e):((e=i(e,n)).return=t,e)}function c(t,e,n,r){return null!==e&&e.elementType===n.type?((r=i(e,n.props)).ref=Eo(t,e,n),r.return=t,r):((r=ku(n.type,n.key,n.props,null,t.mode,r)).ref=Eo(t,e,n),r.return=t,r)}function l(t,e,n,r){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=Pu(n,t.mode,r)).return=t,e):((e=i(e,n.children||[])).return=t,e)}function h(t,e,n,r,o){return null===e||7!==e.tag?((e=Nu(n,t.mode,r,o)).return=t,e):((e=i(e,n)).return=t,e)}function f(t,e,n){if("string"===typeof e||"number"===typeof e)return(e=xu(""+e,t.mode,n)).return=t,e;if("object"===typeof e&&null!==e){switch(e.$$typeof){case tt:return(n=ku(e.type,e.key,e.props,null,t.mode,n)).ref=Eo(t,null,e),n.return=t,n;case et:return(e=Pu(e,t.mode,n)).return=t,e}if(wo(e)||vt(e))return(e=Nu(e,t.mode,n,null)).return=t,e;To(t,e)}return null}function p(t,e,n,r){var i=null!==e?e.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:u(t,e,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case tt:return n.key===i?n.type===nt?h(t,e,n.props.children,r,i):c(t,e,n,r):null;case et:return n.key===i?l(t,e,n,r):null}if(wo(n)||vt(n))return null!==i?null:h(t,e,n,r,null);To(t,n)}return null}function d(t,e,n,r,i){if("string"===typeof r||"number"===typeof r)return u(e,t=t.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case tt:return t=t.get(null===r.key?n:r.key)||null,r.type===nt?h(e,t,r.props.children,i,r.key):c(e,t,r,i);case et:return l(e,t=t.get(null===r.key?n:r.key)||null,r,i)}if(wo(r)||vt(r))return h(e,t=t.get(n)||null,r,i,null);To(e,r)}return null}function v(i,a,s,u){for(var c=null,l=null,h=a,v=a=0,y=null;null!==h&&v<s.length;v++){h.index>v?(y=h,h=null):y=h.sibling;var g=p(i,h,s[v],u);
vendor: 30,422 bytes, line 2
2if(null===g){null===h&&(h=y);break}t&&h&&null===g.alternate&&e(i,h),a=o(g,a,v),null===l?c=g:l.sibling=g,l=g,h=y}if(v===s.length)return n(i,h),c;if(null===h){for(;v<s.length;v++)null!==(h=f(i,s[v],u))&&(a=o(h,a,v),null===l?c=h:l.sibling=h,l=h);return c}for(h=r(i,h);v<s.length;v++)null!==(y=d(h,i,v,s[v],u))&&(t&&null!==y.alternate&&h.delete(null===y.key?v:y.key),a=o(y,a,v),null===l?c=y:l.sibling=y,l=y);return t&&h.forEach((function(t){return e(i,t)})),c}function y(i,s,u,c){var l=vt(u);if("function"!==typeof l)throw Error(a(150));if(null==(u=l.call(u)))throw Error(a(151));for(var h=l=null,v=s,y=s=0,g=null,m=u.next();null!==v&&!m.done;y++,m=u.next()){v.index>y?(g=v,v=null):g=v.sibling;var b=p(i,v,m.value,c);if(null===b){null===v&&(v=g);break}t&&v&&null===b.alternate&&e(i,v),s=o(b,s,y),null===h?l=b:h.sibling=b,h=b,v=g}if(m.done)return n(i,v),l;if(null===v){for(;!m.done;y++,m=u.next())null!==(m=f(i,m.value,c))&&(s=o(m,s,y),null===h?l=m:h.sibling=m,h=m);return l}for(v=r(i,v);!m.done;y++,m=u.next())null!==(m=d(v,i,y,m.value,c))&&(t&&null!==m.alternate&&v.delete(null===m.key?y:m.key),s=o(m,s,y),null===h?l=m:h.sibling=m,h=m);return t&&v.forEach((function(t){return e(i,t)})),l}return function(t,r,o,u){var c="object"===typeof o&&null!==o&&o.type===nt&&null===o.key;c&&(o=o.props.children);var l="object"===typeof o&&null!==o;if(l)switch(o.$$typeof){case tt:t:{for(l=o.key,c=r;null!==c;){if(c.key===l){switch(c.tag){case 7:if(o.type===nt){n(t,c.sibling),(r=i(c,o.props.children)).return=t,t=r;break t}break;default:if(c.elementType===o.type){n(t,c.sibling),(r=i(c,o.props)).ref=Eo(t,c,o),r.return=t,t=r;break t}}n(t,c);break}e(t,c),c=c.sibling}o.type===nt?((r=Nu(o.props.children,t.mode,u,o.key)).return=t,t=r):((u=ku(o.type,o.key,o.props,null,t.mode,u)).ref=Eo(t,r,o),u.return=t,t=u)}return s(t);case et:t:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(t,r.sibling),(r=i(r,o.children||[])).return=t,t=r;break t}n(t,r);break}e(t,r),r=r.sibling}(r=Pu(o,t.mode,u)).return=t,t=r}return s(t)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(t,r.sibling),(r=i(r,o)).return=t,t=r):(n(t,r),(r=xu(o,t.mode,u)).return=t,t=r),s(t);if(wo(o))return v(t,r,o,u);if(vt(o))return y(t,r,o,u);if(l&&To(t,o),"undefined"===typeof o&&!c)switch(t.tag){case 1:case 0:throw t=t.type,Error(a(152,t.displayName||t.name||"Component"))}return n(t,r)}}var So=Io(!0),Co=Io(!1),ko={},No={current:ko},xo={current:ko},Po={current:ko};function Ao(t){if(t===ko)throw Error(a(174));return t}function Oo(t,e){switch(ci(Po,e),ci(xo,t),ci(No,ko),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ft(null,"");break;default:e=Ft(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}ui(No),ci(No,e)}function Ro(){ui(No),ui(xo),ui(Po)}function Do(t){Ao(Po.current);var e=Ao(No.current),n=Ft(e,t.type);e!==n&&(ci(xo,t),ci(No,n))}function Lo(t){xo.current===t&&(ui(No),ui(xo))}var Mo={current:0};function Fo(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(64&e.effectTag))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function jo(t,e){return{responder:t,props:e}}var Uo=X.ReactCurrentDispatcher,Vo=X.ReactCurrentBatchConfig,qo=0,Bo=null,Wo=null,zo=null,Ho=!1;function Go(){throw Error(a(321))}function Ko(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Fr(t[n],e[n]))return!1;return!0}function Qo(t,e,n,r,i,o){if(qo=o,Bo=e,e.memoizedState=null,e.updateQueue=null,e.expirationTime=0,Uo.current=null===t||null===t.memoizedState?ga:ma,t=n(r,i),e.expirationTime===qo){o=0;do{if(e.expirationTime=0,!(25>o))throw Error(a(301));o+=1,zo=Wo=null,e.updateQueue=null,Uo.current=ba,t=n(r,i)}while(e.expirationTime===qo)}if(Uo.current=ya,e=null!==Wo&&null!==Wo.next,qo=0,zo=Wo=Bo=null,Ho=!1,e)throw Error(a(300));return t}function Yo(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===zo?Bo.memoizedState=zo=t:zo=zo.next=t,zo}function Xo(){if(null===Wo){var t=Bo.alternate;t=null!==t?t.memoizedState:null}else t=Wo.next;var e=null===zo?Bo.memoizedState:zo.next;if(null!==e)zo=e,Wo=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Wo=t).memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},null===zo?Bo.memoizedState=zo=t:zo=zo.next=t}return zo}function $o(t,e){return"function"===typeof e?e(t):e}function Jo(t){var e=Xo(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=Wo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var u=s=o=null,c=i;do{var l=c.expirationTime;if(l<qo){var h={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(s=u=h,o=r):u=u.next=h,l>Bo.expirationTime&&(Bo.expirationTime=l,au(l))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),ou(l,c.suspenseConfig),r=c.eagerReducer===t?c.eagerState:t(r,c.action);c=c.next}while(null!==c&&c!==i);null===u?o=r:u.next=s,Fr(r,e.memoizedState)||(Pa=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=u,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function Zo(t){var e=Xo(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=t(o,s.action),s=s.next}while(s!==i);Fr(o,e.memoizedState)||(Pa=!0),e.memoizedState=o,null===e.baseQueue&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function ta(t){var e=Yo();return"function"===typeof t&&(t=t()),e.memoizedState=e.baseState=t,t=(t=e.queue={pending:null,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t}).dispatch=va.bind(null,Bo,t),[e.memoizedState,t]}function ea(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===(e=Bo.updateQueue)?(e={lastEffect:null},Bo.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function na(){return Xo().memoizedState}function ra(t,e,n,r){var i=Yo();Bo.effectTag|=t,i.memoizedState=ea(1|e,n,void 0,void 0===r?null:r)}function ia(t,e,n,r){var i=Xo();r=void 0===r?null:r;var o=void 0;if(null!==Wo){var a=Wo.memoizedState;if(o=a.destroy,null!==r&&Ko(r,a.deps))return void ea(e,n,o,r)}Bo.effectTag|=t,i.memoizedState=ea(1|e,n,o,r)}function oa(t,e){return ra(516,4,t,e)}function aa(t,e){return ia(516,4,t,e)}function sa(t,e){return ia(4,2,t,e)}function ua(t,e){return"function"===typeof e?(t=t(),e(t),function(){e(null)}):null!==e&&void 0!==e?(t=t(),e.current=t,function(){e.current=null}):void 0}function ca(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,ia(4,2,ua.bind(null,e,t),n)}function la(){}function ha(t,e){return Yo().memoizedState=[t,void 0===e?null:e],t}function fa(t,e){var n=Xo();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&Ko(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function pa(t,e){var n=Xo();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&Ko(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function da(t,e,n){var r=Vi();Bi(98>r?98:r,(function(){t(!0)})),Bi(97<r?97:r,(function(){var r=Vo.suspense;Vo.suspense=void 0===e?null:e;try{t(!1),n()}finally{Vo.suspense=r}}))}function va(t,e,n){var r=Gs(),i=fo.suspense;i={expirationTime:r=Ks(r,t,i),suspenseConfig:i,action:n,eagerReducer:null,eagerState:null,next:null};var o=e.pending;if(null===o?i.next=i:(i.next=o.next,o.next=i),e.pending=i,o=t.alternate,t===Bo||null!==o&&o===Bo)Ho=!0,i.expirationTime=qo,Bo.expirationTime=qo;else{if(0===t.expirationTime&&(null===o||0===o.expirationTime)&&null!==(o=e.lastRenderedReducer))try{var a=e.lastRenderedState,s=o(a,n);if(i.eagerReducer=o,i.eagerState=s,Fr(s,a))return}catch(u){}Qs(t,r)}}var ya={readContext:ro,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useResponder:Go,useDeferredValue:Go,useTransition:Go},ga={readContext:ro,useCallback:ha,useContext:ro,useEffect:oa,useImperativeHandle:function(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,ra(4,2,ua.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ra(4,2,t,e)},useMemo:function(t,e){var n=Yo();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Yo();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,t=(t=r.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e}).dispatch=va.bind(null,Bo,t),[r.memoizedState,t]},useRef:function(t){return t={current:t},Yo().memoizedState=t},useState:ta,useDebugValue:la,useResponder:jo,useDeferredValue:function(t,e){var n=ta(t),r=n[0],i=n[1];return oa((function(){var n=Vo.suspense;Vo.suspense=void 0===e?null:e;try{i(t)}finally{Vo.suspense=n}}),[t,e]),r},useTransition:function(t){var e=ta(!1),n=e[0];return e=e[1],[ha(da.bind(null,e,t),[e,t]),n]}},ma={readContext:ro,useCallback:fa,useContext:ro,useEffect:aa,useImperativeHandle:ca,useLayoutEffect:sa,useMemo:pa,useReducer:Jo,useRef:na,useState:function(){return Jo($o)},useDebugValue:la,useResponder:jo,useDeferredValue:function(t,e){var n=Jo($o),r=n[0],i=n[1];return aa((function(){var n=Vo.suspense;Vo.suspense=void 0===e?null:e;try{i(t)}finally{Vo.suspense=n}}),[t,e]),r},useTransition:function(t){var e=Jo($o),n=e[0];return e=e[1],[fa(da.bind(null,e,t),[e,t]),n]}},ba={readContext:ro,useCallback:fa,useContext:ro,useEffect:aa,useImperativeHandle:ca,useLayoutEffect:sa,useMemo:pa,useReducer:Zo,useRef:na,useState:function(){return Zo($o)},useDebugValue:la,useResponder:jo,useDeferredValue:function(t,e){var n=Zo($o),r=n[0],i=n[1];return aa((function(){var n=Vo.suspense;Vo.suspense=void 0===e?null:e;try{i(t)}finally{Vo.suspense=n}}),[t,e]),r},useTransition:function(t){var e=Zo($o),n=e[0];return e=e[1],[fa(da.bind(null,e,t),[e,t]),n]}},_a=null,wa=null,Ea=!1;function Ta(t,e){var n=Iu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.effectTag=8,null!==t.lastEffect?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function Ia(t,e){switch(t.tag){case 5:var n=t.type;return null!==(e=1!==e.nodeType||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e)&&(t.stateNode=e,!0);case 6:return null!==(e=""===t.pendingProps||3!==e.nodeType?null:e)&&(t.stateNode=e,!0);case 13:default:return!1}}function Sa(t){if(Ea){var e=wa;if(e){var n=e;if(!Ia(t,e)){if(!(e=wn(n.nextSibling))||!Ia(t,e))return t.effectTag=-1025&t.effectTag|2,Ea=!1,void(_a=t);Ta(_a,n)}_a=t,wa=wn(e.firstChild)}else t.effectTag=-1025&t.effectTag|2,Ea=!1,_a=t}}function Ca(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;_a=t}function ka(t){if(t!==_a)return!1;if(!Ea)return Ca(t),Ea=!0,!1;var e=t.type;if(5!==t.tag||"head"!==e&&"body"!==e&&!mn(e,t.memoizedProps))for(e=wa;e;)Ta(t,e),e=wn(e.nextSibling);if(Ca(t),13===t.tag){if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));t:{for(t=t.nextSibling,e=0;t;){if(8===t.nodeType){var n=t.data;if("/$"===n){if(0===e){wa=wn(t.nextSibling);break t}e--}else"$"!==n&&"$!"!==n&&"$?"!==n||e++}t=t.nextSibling}wa=null}}else wa=_a?wn(t.stateNode.nextSibling):null;return!0}function Na(){wa=_a=null,Ea=!1}var xa=X.ReactCurrentOwner,Pa=!1;function Aa(t,e,n,r){e.child=null===t?Co(e,null,n,r):So(e,t.child,n,r)}function Oa(t,e,n,r,i){n=n.render;var o=e.ref;return no(e,i),r=Qo(t,e,n,r,o,i),null===t||Pa?(e.effectTag|=1,Aa(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.effectTag&=-517,t.expirationTime<=i&&(t.expirationTime=0),Qa(t,e,i))}function Ra(t,e,n,r,i,o){if(null===t){var a=n.type;return"function"!==typeof a||Su(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=ku(n.type,null,r,null,e.mode,o)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=a,Da(t,e,a,r,i,o))}return a=t.child,i<o&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:Ur)(i,r)&&t.ref===e.ref)?Qa(t,e,o):(e.effectTag|=1,(t=Cu(a,r)).ref=e.ref,t.return=e,e.child=t)}function Da(t,e,n,r,i,o){return null!==t&&Ur(t.memoizedProps,r)&&t.ref===e.ref&&(Pa=!1,i<o)?(e.expirationTime=t.expirationTime,Qa(t,e,o)):Ma(t,e,n,r,o)}function La(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.effectTag|=128)}function Ma(t,e,n,r,i){var o=vi(n)?pi:hi.current;return o=di(e,o),no(e,i),n=Qo(t,e,n,r,o,i),null===t||Pa?(e.effectTag|=1,Aa(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.effectTag&=-517,t.expirationTime<=i&&(t.expirationTime=0),Qa(t,e,i))}function Fa(t,e,n,r,i){if(vi(n)){var o=!0;bi(e)}else o=!1;if(no(e,i),null===e.stateNode)null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),mo(e,n,r),_o(e,n,r,i),r=!0;else if(null===t){var a=e.stateNode,s=e.memoizedProps;a.props=s;var u=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=ro(c):c=di(e,c=vi(n)?pi:hi.current);var l=n.getDerivedStateFromProps,h="function"===typeof l||"function"===typeof a.getSnapshotBeforeUpdate;h||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&bo(e,a,r,c),io=!1;var f=e.memoizedState;a.state=f,lo(e,r,a,i),u=e.memoizedState,s!==r||f!==u||fi.current||io?("function"===typeof l&&(vo(e,n,l,r),u=e.memoizedState),(s=io||go(e,n,s,r,f,u,c))?(h||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(e.effectTag|=4)):("function"===typeof a.componentDidMount&&(e.effectTag|=4),e.memoizedProps=r,e.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):("function"===typeof a.componentDidMount&&(e.effectTag|=4),r=!1)}else a=e.stateNode,ao(t,e),s=e.memoizedProps,a.props=e.type===e.elementType?s:Qi(e.type,s),u=a.context,"object"===typeof(c=n.contextType)&&null!==c?c=ro(c):c=di(e,c=vi(n)?pi:hi.current),(h="function"===typeof(l=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&bo(e,a,r,c),io=!1,u=e.memoizedState,a.state=u,lo(e,r,a,i),f=e.memoizedState,s!==r||u!==f||fi.current||io?("function"===typeof l&&(vo(e,n,l,r),f=e.memoizedState),(l=io||go(e,n,s,r,u,f,c))?(h||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,c),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,c)),"function"===typeof a.componentDidUpdate&&(e.effectTag|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(e.effectTag|=256)):("function"!==typeof a.componentDidUpdate||s===t.memoizedProps&&u===t.memoizedState||(e.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&u===t.memoizedState||(e.effectTag|=256),e.memoizedProps=r,e.memoizedState=f),a.props=r,a.state=f,a.context=c,r=l):("function"!==typeof a.componentDidUpdate||s===t.memoizedProps&&u===t.memoizedState||(e.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&u===t.memoizedState||(e.effectTag|=256),r=!1);return ja(t,e,n,r,o,i)}function ja(t,e,n,r,i,o){La(t,e);var a=0!==(64&e.effectTag);if(!r&&!a)return i&&_i(e,n,!1),Qa(t,e,o);r=e.stateNode,xa.current=e;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return e.effectTag|=1,null!==t&&a?(e.child=So(e,t.child,null,o),e.child=So(e,null,s,o)):Aa(t,e,s,o),e.memoizedState=r.state,i&&_i(e,n,!0),e.child}function Ua(t){var e=t.stateNode;e.pendingContext?gi(0,e.pendingContext,e.pendingContext!==e.context):e.context&&gi(0,e.context,!1),Oo(t,e.containerInfo)}var Va,qa,Ba,Wa={dehydrated:null,retryTime:0};function za(t,e,n){var r,i=e.mode,o=e.pendingProps,a=Mo.current,s=!1;if((r=0!==(64&e.effectTag))||(r=0!==(2&a)&&(null===t||null!==t.memoizedState)),r?(s=!0,e.effectTag&=-65):null!==t&&null===t.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(a|=1),ci(Mo,1&a),null===t){if(void 0!==o.fallback&&Sa(e),s){if(s=o.fallback,(o=Nu(null,i,0,null)).return=e,0===(2&e.mode))for(t=null!==e.memoizedState?e.child.child:e.child,o.child=t;null!==t;)t.return=o,t=t.sibling;return(n=Nu(s,i,n,null)).return=e,o.sibling=n,e.memoizedState=Wa,e.child=o,n}return i=o.children,e.memoizedState=null,e.child=Co(e,null,i,n)}if(null!==t.memoizedState){if(i=(t=t.child).sibling,s){if(o=o.fallback,(n=Cu(t,t.pendingProps)).return=e,0===(2&e.mode)&&(s=null!==e.memoizedState?e.child.child:e.child)!==t.child)for(n.child=s;null!==s;)s.return=n,s=s.sibling;return(i=Cu(i,o)).return=e,n.sibling=i,n.childExpirationTime=0,e.memoizedState=Wa,e.child=n,i}return n=So(e,t.child,o.children,n),e.memoizedState=null,e.child=n}if(t=t.child,s){if(s=o.fallback,(o=Nu(null,i,0,null)).return=e,o.child=t,null!==t&&(t.return=o),0===(2&e.mode))for(t=null!==e.memoizedState?e.child.child:e.child,o.child=t;null!==t;)t.return=o,t=t.sibling;return(n=Nu(s,i,n,null)).return=e,o.sibling=n,n.effectTag|=2,o.childExpirationTime=0,e.memoizedState=Wa,e.child=o,n}return e.memoizedState=null,e.child=So(e,t,o.children,n)}function Ha(t,e){t.expirationTime<e&&(t.expirationTime=e);var n=t.alternate;null!==n&&n.expirationTime<e&&(n.expirationTime=e),eo(t.return,e)}function Ga(t,e,n,r,i,o){var a=t.memoizedState;null===a?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:i,lastEffect:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailExpiration=0,a.tailMode=i,a.lastEffect=o)}function Ka(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Aa(t,e,r.children,n),0!==(2&(r=Mo.current)))r=1&r|2,e.effectTag|=64;else{if(null!==t&&0!==(64&t.effectTag))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Ha(t,n);else if(19===t.tag)Ha(t,n);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(ci(Mo,r),0===(2&e.mode))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;null!==n;)null!==(t=n.alternate)&&null===Fo(t)&&(i=n),n=n.sibling;null===(n=i)?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ga(e,!1,i,n,o,e.lastEffect);break;case"backwards":for(n=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===Fo(t)){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ga(e,!0,n,null,o,e.lastEffect);break;case"together":Ga(e,!1,null,null,void 0,e.lastEffect);break;default:e.memoizedState=null}return e.child}function Qa(t,e,n){null!==t&&(e.dependencies=t.dependencies);var r=e.expirationTime;if(0!==r&&au(r),e.childExpirationTime<n)return null;if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=Cu(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=Cu(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function Ya(t,e){switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e||null===t.tail?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Xa(t,e,n){var r=e.pendingProps;switch(e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return vi(e.type)&&yi(),null;case 3:return Ro(),ui(fi),ui(hi),(n=e.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||!ka(e)||(e.effectTag|=4),null;case 5:Lo(e),n=Ao(Po.current);var o=e.type;if(null!==t&&null!=e.stateNode)qa(t,e,o,r,n),t.ref!==e.ref&&(e.effectTag|=128);else{if(!r){if(null===e.stateNode)throw Error(a(166));return null}if(t=Ao(No.current),ka(e)){r=e.stateNode,o=e.type;var s=e.memoizedProps;switch(r[In]=e,r[Sn]=s,o){case"iframe":case"object":case"embed":Ke("load",r);break;case"video":case"audio":for(t=0;t<Xt.length;t++)Ke(Xt[t],r);break;case"source":Ke("error",r);break;case"img":case"image":case"link":Ke("error",r),Ke("load",r);break;case"form":Ke("reset",r),Ke("submit",r);break;case"details":Ke("toggle",r);break;case"input":Tt(r,s),Ke("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ke("invalid",r),un(n,"onChange");break;case"textarea":At(r,s),Ke("invalid",r),un(n,"onChange")}for(var u in on(o,s),t=null,s)if(s.hasOwnProperty(u)){var c=s[u];"children"===u?"string"===typeof c?r.textContent!==c&&(t=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(t=["children",""+c]):I.hasOwnProperty(u)&&null!=c&&un(n,u)}switch(o){case"input":_t(r),Ct(r,s,!0);break;case"textarea":_t(r),Rt(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=cn)}n=t,e.updateQueue=n,null!==n&&(e.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,t===sn&&(t=Mt(o)),t===sn?"script"===o?((t=u.createElement("div")).innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):"string"===typeof r.is?t=u.createElement(o,{is:r.is}):(t=u.createElement(o),"select"===o&&(u=t,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):t=u.createElementNS(t,o),t[In]=e,t[Sn]=r,Va(t,e),e.stateNode=t,u=an(o,r),o){case"iframe":case"object":case"embed":Ke("load",t),c=r;break;case"video":case"audio":for(c=0;c<Xt.length;c++)Ke(Xt[c],t);c=r;break;case"source":Ke("error",t),c=r;break;case"img":case"image":case"link":Ke("error",t),Ke("load",t),c=r;break;case"form":Ke("reset",t),Ke("submit",t),c=r;break;case"details":Ke("toggle",t),c=r;break;case"input":Tt(t,r),c=Et(t,r),Ke("invalid",t),un(n,"onChange");break;case"option":c=Nt(t,r);break;case"select":t._wrapperState={wasMultiple:!!r.multiple},c=i({},r,{value:void 0}),Ke("invalid",t),un(n,"onChange");break;case"textarea":At(t,r),c=Pt(t,r),Ke("invalid",t),un(n,"onChange");break;default:c=r}on(o,c);var l=c;for(s in l)if(l.hasOwnProperty(s)){var h=l[s];"style"===s?nn(t,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&&Ut(t,h):"children"===s?"string"===typeof h?("textarea"!==o||""!==h)&&Vt(t,h):"number"===typeof h&&Vt(t,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(I.hasOwnProperty(s)?null!=h&&un(n,s):null!=h&&$(t,s,h,u))}switch(o){case"input":_t(t),Ct(t,r,!1);break;case"textarea":_t(t),Rt(t);break;case"option":null!=r.value&&t.setAttribute("value",""+mt(r.value));break;case"select":t.multiple=!!r.multiple,null!=(n=r.value)?xt(t,!!r.multiple,n,!1):null!=r.defaultValue&&xt(t,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof c.onClick&&(t.onclick=cn)}gn(o,r)&&(e.effectTag|=4)}null!==e.ref&&(e.effectTag|=128)}return null;case 6:if(t&&null!=e.stateNode)Ba(0,e,t.memoizedProps,r);else{if("string"!==typeof r&&null===e.stateNode)throw Error(a(166));n=Ao(Po.current),Ao(No.current),ka(e)?(n=e.stateNode,r=e.memoizedProps,n[In]=e,n.nodeValue!==r&&(e.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[In]=e,e.stateNode=n)}return null;case 13:return ui(Mo),r=e.memoizedState,0!==(64&e.effectTag)?(e.expirationTime=n,e):(n=null!==r,r=!1,null===t?void 0!==e.memoizedProps.fallback&&ka(e):(r=null!==(o=t.memoizedState),n||null===o||null!==(o=t.child.sibling)&&(null!==(s=e.firstEffect)?(e.firstEffect=o,o.nextEffect=s):(e.firstEffect=e.lastEffect=o,o.nextEffect=null),o.effectTag=8)),n&&!r&&0!==(2&e.mode)&&(null===t&&!0!==e.memoizedProps.unstable_avoidThisFallback||0!==(1&Mo.current)?ks===_s&&(ks=ws):(ks!==_s&&ks!==ws||(ks=Es),0!==Os&&null!==Is&&(Ru(Is,Cs),Du(Is,Os)))),(n||r)&&(e.effectTag|=4),null);case 4:return Ro(),null;case 10:return to(e),null;case 17:return vi(e.type)&&yi(),null;case 19:if(ui(Mo),null===(r=e.memoizedState))return null;if(o=0!==(64&e.effectTag),null===(s=r.rendering)){if(o)Ya(r,!1);else if(ks!==_s||null!==t&&0!==(64&t.effectTag))for(s=e.child;null!==s;){if(null!==(t=Fo(s))){for(e.effectTag|=64,Ya(r,!1),null!==(o=t.updateQueue)&&(e.updateQueue=o,e.effectTag|=4),null===r.lastEffect&&(e.firstEffect=null),e.lastEffect=r.lastEffect,r=e.child;null!==r;)s=n,(o=r).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(t=o.alternate)?(o.childExpirationTime=0,o.expirationTime=s,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=t.childExpirationTime,o.expirationTime=t.expirationTime,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,s=t.dependencies,o.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),r=r.sibling;return ci(Mo,1&Mo.current|2),e.child}s=s.sibling}}else{if(!o)if(null!==(t=Fo(s))){if(e.effectTag|=64,o=!0,null!==(n=t.updateQueue)&&(e.updateQueue=n,e.effectTag|=4),Ya(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate)return null!==(e=e.lastEffect=r.lastEffect)&&(e.nextEffect=null),null}else 2*Ui()-r.renderingStartTime>r.tailExpiration&&1<n&&(e.effectTag|=64,o=!0,Ya(r,!1),e.expirationTime=e.childExpirationTime=n-1);r.isBackwards?(s.sibling=e.child,e.child=s):(null!==(n=r.last)?n.sibling=s:e.child=s,r.last=s)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Ui()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=e.lastEffect,r.renderingStartTime=Ui(),n.sibling=null,e=Mo.current,ci(Mo,o?1&e|2:1&e),n):null}throw Error(a(156,e.tag))}function $a(t){switch(t.tag){case 1:vi(t.type)&&yi();var e=t.effectTag;return 4096&e?(t.effectTag=-4097&e|64,t):null;case 3:if(Ro(),ui(fi),ui(hi),0!==(64&(e=t.effectTag)))throw Error(a(285));return t.effectTag=-4097&e|64,t;case 5:return Lo(t),null;case 13:return ui(Mo),4096&(e=t.effectTag)?(t.effectTag=-4097&e|64,t):null;case 19:return ui(Mo),null;case 4:return Ro(),null;case 10:return to(t),null;default:return null}}function Ja(t,e){return{value:t,source:e,stack:gt(e)}}Va=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)t.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},qa=function(t,e,n,r,o){var a=t.memoizedProps;if(a!==r){var s,u,c=e.stateNode;switch(Ao(No.current),t=null,n){case"input":a=Et(c,a),r=Et(c,r),t=[];break;case"option":a=Nt(c,a),r=Nt(c,r),t=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),t=[];break;case"textarea":a=Pt(c,a),r=Pt(c,r),t=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(c.onclick=cn)}for(s in on(n,r),n=null,a)if(!r.hasOwnProperty(s)&&a.hasOwnProperty(s)&&null!=a[s])if("style"===s)for(u in c=a[s])c.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==s&&"children"!==s&&"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(I.hasOwnProperty(s)?t||(t=[]):(t=t||[]).push(s,null));for(s in r){var l=r[s];if(c=null!=a?a[s]:void 0,r.hasOwnProperty(s)&&l!==c&&(null!=l||null!=c))if("style"===s)if(c){for(u in c)!c.hasOwnProperty(u)||l&&l.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in l)l.hasOwnProperty(u)&&c[u]!==l[u]&&(n||(n={}),n[u]=l[u])}else n||(t||(t=[]),t.push(s,n)),n=l;else"dangerouslySetInnerHTML"===s?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(t=t||[]).push(s,l)):"children"===s?c===l||"string"!==typeof l&&"number"!==typeof l||(t=t||[]).push(s,""+l):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&(I.hasOwnProperty(s)?(null!=l&&un(o,s),t||c===l||(t=[])):(t=t||[]).push(s,l))}n&&(t=t||[]).push("style",n),o=t,(e.updateQueue=o)&&(e.effectTag|=4)}},Ba=function(t,e,n,r){n!==r&&(e.effectTag|=4)};var Za="function"===typeof WeakSet?WeakSet:Set;function ts(t,e){var n=e.source,r=e.stack;null===r&&null!==n&&(r=gt(n)),null!==n&&yt(n.type),e=e.value,null!==t&&1===t.tag&&yt(t.type);try{console.error(e)}catch(i){setTimeout((function(){throw i}))}}function es(t){var e=t.ref;if(null!==e)if("function"===typeof e)try{e(null)}catch(n){mu(t,n)}else e.current=null}function ns(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&e.effectTag&&null!==t){var n=t.memoizedProps,r=t.memoizedState;e=(t=e.stateNode).getSnapshotBeforeUpdate(e.elementType===e.type?n:Qi(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(a(163))}function rs(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==e)}}function is(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function os(t,e,n){switch(n.tag){case 0:case 11:case 15:case 22:return void is(3,n);case 1:if(t=n.stateNode,4&n.effectTag)if(null===e)t.componentDidMount();else{var r=n.elementType===n.type?e.memoizedProps:Qi(n.type,e.memoizedProps);t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate)}return void(null!==(e=n.updateQueue)&&ho(n,e,t));case 3:if(null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}ho(n,e,t)}return;case 5:return t=n.stateNode,void(null===e&&4&n.effectTag&&gn(n.type,n.memoizedProps)&&t.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Me(n)))));case 19:case 17:case 20:case 21:return}throw Error(a(163))}function as(t,e,n){switch("function"===typeof Eu&&Eu(e),e.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(t=e.updateQueue)&&null!==(t=t.lastEffect)){var r=t.next;Bi(97<n?97:n,(function(){var t=r;do{var n=t.destroy;if(void 0!==n){var i=e;try{n()}catch(o){mu(i,o)}}t=t.next}
vendor: 7,764 bytes, line 2
2while(t!==r)}))}break;case 1:es(e),"function"===typeof(n=e.stateNode).componentWillUnmount&&function(t,e){try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(n){mu(t,n)}}(e,n);break;case 5:es(e);break;case 4:ls(t,e,n)}}function ss(t){var e=t.alternate;t.return=null,t.child=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.alternate=null,t.firstEffect=null,t.lastEffect=null,t.pendingProps=null,t.memoizedProps=null,t.stateNode=null,null!==e&&ss(e)}function us(t){return 5===t.tag||3===t.tag||4===t.tag}function cs(t){t:{for(var e=t.return;null!==e;){if(us(e)){var n=e;break t}e=e.return}throw Error(a(160))}switch(e=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:e=e.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.effectTag&&(Vt(e,""),n.effectTag&=-17);t:e:for(n=t;;){for(;null===n.sibling;){if(null===n.return||us(n.return)){n=null;break t}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue e;if(null===n.child||4===n.tag)continue e;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break t}}r?function t(e,n,r){var i=e.tag,o=5===i||6===i;if(o)e=o?e.stateNode:e.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(e,n):r.insertBefore(e,n):(8===r.nodeType?(n=r.parentNode).insertBefore(e,r):(n=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=cn));else if(4!==i&&null!==(e=e.child))for(t(e,n,r),e=e.sibling;null!==e;)t(e,n,r),e=e.sibling}(t,n,e):function t(e,n,r){var i=e.tag,o=5===i||6===i;if(o)e=o?e.stateNode:e.stateNode.instance,n?r.insertBefore(e,n):r.appendChild(e);else if(4!==i&&null!==(e=e.child))for(t(e,n,r),e=e.sibling;null!==e;)t(e,n,r),e=e.sibling}(t,n,e)}function ls(t,e,n){for(var r,i,o=e,s=!1;;){if(!s){s=o.return;t:for(;;){if(null===s)throw Error(a(160));switch(r=s.stateNode,s.tag){case 5:i=!1;break t;case 3:case 4:r=r.containerInfo,i=!0;break t}s=s.return}s=!0}if(5===o.tag||6===o.tag){t:for(var u=t,c=o,l=n,h=c;;)if(as(u,h,l),null!==h.child&&4!==h.tag)h.child.return=h,h=h.child;else{if(h===c)break t;for(;null===h.sibling;){if(null===h.return||h.return===c)break t;h=h.return}h.sibling.return=h.return,h=h.sibling}i?(u=r,c=o.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):r.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){r=o.stateNode.containerInfo,i=!0,o.child.return=o,o=o.child;continue}}else if(as(t,o,n),null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;4===(o=o.return).tag&&(s=!1)}o.sibling.return=o.return,o=o.sibling}}function hs(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:return void rs(3,e);case 1:return;case 5:var n=e.stateNode;if(null!=n){var r=e.memoizedProps,i=null!==t?t.memoizedProps:r;t=e.type;var o=e.updateQueue;if(e.updateQueue=null,null!==o){for(n[Sn]=r,"input"===t&&"radio"===r.type&&null!=r.name&&It(n,r),an(t,i),e=an(t,r),i=0;i<o.length;i+=2){var s=o[i],u=o[i+1];"style"===s?nn(n,u):"dangerouslySetInnerHTML"===s?Ut(n,u):"children"===s?Vt(n,u):$(n,s,u,e)}switch(t){case"input":St(n,r);break;case"textarea":Ot(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(t=r.value)?xt(n,!!r.multiple,t,!1):e!==!!r.multiple&&(null!=r.defaultValue?xt(n,!!r.multiple,r.defaultValue,!0):xt(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===e.stateNode)throw Error(a(162));return void(e.stateNode.nodeValue=e.memoizedProps);case 3:return void((e=e.stateNode).hydrate&&(e.hydrate=!1,Me(e.containerInfo)));case 12:return;case 13:if(n=e,null===e.memoizedState?r=!1:(r=!0,n=e.child,Ds=Ui()),null!==n)t:for(t=n;;){if(5===t.tag)o=t.stateNode,r?"function"===typeof(o=o.style).setProperty?o.setProperty("display","none","important"):o.display="none":(o=t.stateNode,i=void 0!==(i=t.memoizedProps.style)&&null!==i&&i.hasOwnProperty("display")?i.display:null,o.style.display=en("display",i));else if(6===t.tag)t.stateNode.nodeValue=r?"":t.memoizedProps;else{if(13===t.tag&&null!==t.memoizedState&&null===t.memoizedState.dehydrated){(o=t.child.sibling).return=t,t=o;continue}if(null!==t.child){t.child.return=t,t=t.child;continue}}if(t===n)break;for(;null===t.sibling;){if(null===t.return||t.return===n)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}return void fs(e);case 19:return void fs(e);case 17:return}throw Error(a(163))}function fs(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new Za),e.forEach((function(e){var r=_u.bind(null,t,e);n.has(e)||(n.add(e),e.then(r,r))}))}}var ps="function"===typeof WeakMap?WeakMap:Map;function ds(t,e,n){(n=so(n,null)).tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Ms||(Ms=!0,Fs=r),ts(t,e)},n}function vs(t,e,n){(n=so(n,null)).tag=3;var r=t.type.getDerivedStateFromError;if("function"===typeof r){var i=e.value;n.payload=function(){return ts(t,e),r(i)}}var o=t.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===js?js=new Set([this]):js.add(this),ts(t,e));var n=e.stack;this.componentDidCatch(e.value,{componentStack:null!==n?n:""})}),n}var ys,gs=Math.ceil,ms=X.ReactCurrentDispatcher,bs=X.ReactCurrentOwner,_s=0,ws=3,Es=4,Ts=0,Is=null,Ss=null,Cs=0,ks=_s,Ns=null,xs=1073741823,Ps=1073741823,As=null,Os=0,Rs=!1,Ds=0,Ls=null,Ms=!1,Fs=null,js=null,Us=!1,Vs=null,qs=90,Bs=null,Ws=0,zs=null,Hs=0;function Gs(){return 0!==(48&Ts)?1073741821-(Ui()/10|0):0!==Hs?Hs:Hs=1073741821-(Ui()/10|0)}function Ks(t,e,n){if(0===(2&(e=e.mode)))return 1073741823;var r=Vi();if(0===(4&e))return 99===r?1073741823:1073741822;if(0!==(16&Ts))return Cs;if(null!==n)t=Ki(t,0|n.timeoutMs||5e3,250);else switch(r){case 99:t=1073741823;break;case 98:t=Ki(t,150,100);break;case 97:case 96:t=Ki(t,5e3,250);break;case 95:t=2;break;default:throw Error(a(326))}return null!==Is&&t===Cs&&--t,t}function Qs(t,e){if(50<Ws)throw Ws=0,zs=null,Error(a(185));if(null!==(t=Ys(t,e))){var n=Vi();1073741823===e?0!==(8&Ts)&&0===(48&Ts)?Zs(t):($s(t),0===Ts&&Hi()):$s(t),0===(4&Ts)||98!==n&&99!==n||(null===Bs?Bs=new Map([[t,e]]):(void 0===(n=Bs.get(t))||n>e)&&Bs.set(t,e))}}function Ys(t,e){t.expirationTime<e&&(t.expirationTime=e);var n=t.alternate;null!==n&&n.expirationTime<e&&(n.expirationTime=e);var r=t.return,i=null;if(null===r&&3===t.tag)i=t.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<e&&(r.childExpirationTime=e),null!==n&&n.childExpirationTime<e&&(n.childExpirationTime=e),null===r.return&&3===r.tag){i=r.stateNode;break}r=r.return}return null!==i&&(Is===i&&(au(e),ks===Es&&Ru(i,Cs)),Du(i,e)),i}function Xs(t){var e=t.lastExpiredTime;if(0!==e)return e;if(!Ou(t,e=t.firstPendingTime))return e;var n=t.lastPingedTime;return 2>=(t=n>(t=t.nextKnownPendingLevel)?n:t)&&e!==t?0:t}function $s(t){if(0!==t.lastExpiredTime)t.callbackExpirationTime=1073741823,t.callbackPriority=99,t.callbackNode=zi(Zs.bind(null,t));else{var e=Xs(t),n=t.callbackNode;if(0===e)null!==n&&(t.callbackNode=null,t.callbackExpirationTime=0,t.callbackPriority=90);else{var r=Gs();if(1073741823===e?r=99:1===e||2===e?r=95:r=0>=(r=10*(1073741821-e)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=t.callbackPriority;if(t.callbackExpirationTime===e&&i>=r)return;n!==Oi&&Ti(n)}t.callbackExpirationTime=e,t.callbackPriority=r,e=1073741823===e?zi(Zs.bind(null,t)):Wi(r,Js.bind(null,t),{timeout:10*(1073741821-e)-Ui()}),t.callbackNode=e}}}function Js(t,e){if(Hs=0,e)return Lu(t,e=Gs()),$s(t),null;var n=Xs(t);if(0!==n){if(e=t.callbackNode,0!==(48&Ts))throw Error(a(327));if(vu(),t===Is&&n===Cs||nu(t,n),null!==Ss){var r=Ts;Ts|=16;for(var i=iu();;)try{uu();break}catch(u){ru(t,u)}
vendor: 20,342 bytes, line 2
2if(Zi(),Ts=r,ms.current=i,1===ks)throw e=Ns,nu(t,n),Ru(t,n),$s(t),e;if(null===Ss)switch(i=t.finishedWork=t.current.alternate,t.finishedExpirationTime=n,r=ks,Is=null,r){case _s:case 1:throw Error(a(345));case 2:Lu(t,2<n?2:n);break;case ws:if(Ru(t,n),n===(r=t.lastSuspendedTime)&&(t.nextKnownPendingLevel=hu(i)),1073741823===xs&&10<(i=Ds+500-Ui())){if(Rs){var o=t.lastPingedTime;if(0===o||o>=n){t.lastPingedTime=n,nu(t,n);break}}if(0!==(o=Xs(t))&&o!==n)break;if(0!==r&&r!==n){t.lastPingedTime=r;break}t.timeoutHandle=bn(fu.bind(null,t),i);break}fu(t);break;case Es:if(Ru(t,n),n===(r=t.lastSuspendedTime)&&(t.nextKnownPendingLevel=hu(i)),Rs&&(0===(i=t.lastPingedTime)||i>=n)){t.lastPingedTime=n,nu(t,n);break}if(0!==(i=Xs(t))&&i!==n)break;if(0!==r&&r!==n){t.lastPingedTime=r;break}if(1073741823!==Ps?r=10*(1073741821-Ps)-Ui():1073741823===xs?r=0:(r=10*(1073741821-xs)-5e3,0>(r=(i=Ui())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gs(r/1960))-r)&&(r=n)),10<r){t.timeoutHandle=bn(fu.bind(null,t),r);break}fu(t);break;case 5:if(1073741823!==xs&&null!==As){o=xs;var s=As;if(0>=(r=0|s.busyMinDurationMs)?r=0:(i=0|s.busyDelayMs,r=(o=Ui()-(10*(1073741821-o)-(0|s.timeoutMs||5e3)))<=i?0:i+r-o),10<r){Ru(t,n),t.timeoutHandle=bn(fu.bind(null,t),r);break}}fu(t);break;default:throw Error(a(329))}if($s(t),t.callbackNode===e)return Js.bind(null,t)}}return null}function Zs(t){var e=t.lastExpiredTime;if(e=0!==e?e:1073741823,0!==(48&Ts))throw Error(a(327));if(vu(),t===Is&&e===Cs||nu(t,e),null!==Ss){var n=Ts;Ts|=16;for(var r=iu();;)try{su();break}catch(i){ru(t,i)}if(Zi(),Ts=n,ms.current=r,1===ks)throw n=Ns,nu(t,e),Ru(t,e),$s(t),n;if(null!==Ss)throw Error(a(261));t.finishedWork=t.current.alternate,t.finishedExpirationTime=e,Is=null,fu(t),$s(t)}return null}function tu(t,e){var n=Ts;Ts|=1;try{return t(e)}finally{0===(Ts=n)&&Hi()}}function eu(t,e){var n=Ts;Ts&=-2,Ts|=8;try{return t(e)}finally{0===(Ts=n)&&Hi()}}function nu(t,e){t.finishedWork=null,t.finishedExpirationTime=0;var n=t.timeoutHandle;if(-1!==n&&(t.timeoutHandle=-1,_n(n)),null!==Ss)for(n=Ss.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&yi();break;case 3:Ro(),ui(fi),ui(hi);break;case 5:Lo(r);break;case 4:Ro();break;case 13:case 19:ui(Mo);break;case 10:to(r)}n=n.return}Is=t,Ss=Cu(t.current,null),Cs=e,ks=_s,Ns=null,Ps=xs=1073741823,As=null,Os=0,Rs=!1}function ru(t,e){for(;;){try{if(Zi(),Uo.current=ya,Ho)for(var n=Bo.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(qo=0,zo=Wo=Bo=null,Ho=!1,null===Ss||null===Ss.return)return ks=1,Ns=e,Ss=null;t:{var i=t,o=Ss.return,a=Ss,s=e;if(e=Cs,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==s&&"object"===typeof s&&"function"===typeof s.then){var u=s;if(0===(2&a.mode)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.expirationTime=c.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var l=0!==(1&Mo.current),h=o;do{var f;if(f=13===h.tag){var p=h.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var d=h.memoizedProps;f=void 0!==d.fallback&&(!0!==d.unstable_avoidThisFallback||!l)}}if(f){var v=h.updateQueue;if(null===v){var y=new Set;y.add(u),h.updateQueue=y}else v.add(u);if(0===(2&h.mode)){if(h.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var g=so(1073741823,null);g.tag=2,uo(a,g)}a.expirationTime=1073741823;break t}s=void 0,a=e;var m=i.pingCache;if(null===m?(m=i.pingCache=new ps,s=new Set,m.set(u,s)):void 0===(s=m.get(u))&&(s=new Set,m.set(u,s)),!s.has(a)){s.add(a);var b=bu.bind(null,i,u,a);u.then(b,b)}h.effectTag|=4096,h.expirationTime=e;break t}h=h.return}while(null!==h);s=Error((yt(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+gt(a))}5!==ks&&(ks=2),s=Ja(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=e,co(h,ds(h,u,e));break t;case 1:u=s;var _=h.type,w=h.stateNode;if(0===(64&h.effectTag)&&("function"===typeof _.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===js||!js.has(w)))){h.effectTag|=4096,h.expirationTime=e,co(h,vs(h,u,e));break t}}h=h.return}while(null!==h)}Ss=lu(Ss)}catch(E){e=E;continue}break}}function iu(){var t=ms.current;return ms.current=ya,null===t?ya:t}function ou(t,e){t<xs&&2<t&&(xs=t),null!==e&&t<Ps&&2<t&&(Ps=t,As=e)}function au(t){t>Os&&(Os=t)}function su(){for(;null!==Ss;)Ss=cu(Ss)}function uu(){for(;null!==Ss&&!Ri();)Ss=cu(Ss)}function cu(t){var e=ys(t.alternate,t,Cs);return t.memoizedProps=t.pendingProps,null===e&&(e=lu(t)),bs.current=null,e}function lu(t){Ss=t;do{var e=Ss.alternate;if(t=Ss.return,0===(2048&Ss.effectTag)){if(e=Xa(e,Ss,Cs),1===Cs||1!==Ss.childExpirationTime){for(var n=0,r=Ss.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}Ss.childExpirationTime=n}if(null!==e)return e;null!==t&&0===(2048&t.effectTag)&&(null===t.firstEffect&&(t.firstEffect=Ss.firstEffect),null!==Ss.lastEffect&&(null!==t.lastEffect&&(t.lastEffect.nextEffect=Ss.firstEffect),t.lastEffect=Ss.lastEffect),1<Ss.effectTag&&(null!==t.lastEffect?t.lastEffect.nextEffect=Ss:t.firstEffect=Ss,t.lastEffect=Ss))}else{if(null!==(e=$a(Ss)))return e.effectTag&=2047,e;null!==t&&(t.firstEffect=t.lastEffect=null,t.effectTag|=2048)}if(null!==(e=Ss.sibling))return e;Ss=t}while(null!==Ss);return ks===_s&&(ks=5),null}function hu(t){var e=t.expirationTime;return e>(t=t.childExpirationTime)?e:t}function fu(t){var e=Vi();return Bi(99,pu.bind(null,t,e)),null}function pu(t,e){do{vu()}while(null!==Vs);if(0!==(48&Ts))throw Error(a(327));var n=t.finishedWork,r=t.finishedExpirationTime;if(null===n)return null;if(t.finishedWork=null,t.finishedExpirationTime=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackExpirationTime=0,t.callbackPriority=90,t.nextKnownPendingLevel=0;var i=hu(n);if(t.firstPendingTime=i,r<=t.lastSuspendedTime?t.firstSuspendedTime=t.lastSuspendedTime=t.nextKnownPendingLevel=0:r<=t.firstSuspendedTime&&(t.firstSuspendedTime=r-1),r<=t.lastPingedTime&&(t.lastPingedTime=0),r<=t.lastExpiredTime&&(t.lastExpiredTime=0),t===Is&&(Ss=Is=null,Cs=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,i=n.firstEffect):i=n:i=n.firstEffect,null!==i){var o=Ts;Ts|=32,bs.current=null,vn=Ge;var s=pn();if(dn(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else t:{var c=(u=(u=s.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var l=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{u.nodeType,h.nodeType}catch(C){u=null;break t}var f=0,p=-1,d=-1,v=0,y=0,g=s,m=null;e:for(;;){for(var b;g!==u||0!==l&&3!==g.nodeType||(p=f+l),g!==h||0!==c&&3!==g.nodeType||(d=f+c),3===g.nodeType&&(f+=g.nodeValue.length),null!==(b=g.firstChild);)m=g,g=b;for(;;){if(g===s)break e;if(m===u&&++v===l&&(p=f),m===h&&++y===c&&(d=f),null!==(b=g.nextSibling))break;m=(g=m).parentNode}g=b}u=-1===p||-1===d?null:{start:p,end:d}}else u=null}u=u||{start:0,end:0}}else u=null;yn={activeElementDetached:null,focusedElem:s,selectionRange:u},Ge=!1,Ls=i;do{try{du()}catch(C){if(null===Ls)throw Error(a(330));mu(Ls,C),Ls=Ls.nextEffect}}while(null!==Ls);Ls=i;do{try{for(s=t,u=e;null!==Ls;){var _=Ls.effectTag;if(16&_&&Vt(Ls.stateNode,""),128&_){var w=Ls.alternate;if(null!==w){var E=w.ref;null!==E&&("function"===typeof E?E(null):E.current=null)}}switch(1038&_){case 2:cs(Ls),Ls.effectTag&=-3;break;case 6:cs(Ls),Ls.effectTag&=-3,hs(Ls.alternate,Ls);break;case 1024:Ls.effectTag&=-1025;break;case 1028:Ls.effectTag&=-1025,hs(Ls.alternate,Ls);break;case 4:hs(Ls.alternate,Ls);break;case 8:ls(s,l=Ls,u),ss(l)}Ls=Ls.nextEffect}}catch(C){if(null===Ls)throw Error(a(330));mu(Ls,C),Ls=Ls.nextEffect}}while(null!==Ls);if(E=yn,w=pn(),_=E.focusedElem,u=E.selectionRange,w!==_&&_&&_.ownerDocument&&function t(e,n){return!(!e||!n)&&(e===n||(!e||3!==e.nodeType)&&(n&&3===n.nodeType?t(e,n.parentNode):"contains"in e?e.contains(n):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(n))))}(_.ownerDocument.documentElement,_)){null!==u&&dn(_)&&(w=u.start,void 0===(E=u.end)&&(E=w),"selectionStart"in _?(_.selectionStart=w,_.selectionEnd=Math.min(E,_.value.length)):(E=(w=_.ownerDocument||document)&&w.defaultView||window).getSelection&&(E=E.getSelection(),l=_.textContent.length,s=Math.min(u.start,l),u=void 0===u.end?s:Math.min(u.end,l),!E.extend&&s>u&&(l=u,u=s,s=l),l=fn(_,s),h=fn(_,u),l&&h&&(1!==E.rangeCount||E.anchorNode!==l.node||E.anchorOffset!==l.offset||E.focusNode!==h.node||E.focusOffset!==h.offset)&&((w=w.createRange()).setStart(l.node,l.offset),E.removeAllRanges(),s>u?(E.addRange(w),E.extend(h.node,h.offset)):(w.setEnd(h.node,h.offset),E.addRange(w))))),w=[];for(E=_;E=E.parentNode;)1===E.nodeType&&w.push({element:E,left:E.scrollLeft,top:E.scrollTop});for("function"===typeof _.focus&&_.focus(),_=0;_<w.length;_++)(E=w[_]).element.scrollLeft=E.left,E.element.scrollTop=E.top}Ge=!!vn,yn=vn=null,t.current=n,Ls=i;do{try{for(_=t;null!==Ls;){var T=Ls.effectTag;if(36&T&&os(_,Ls.alternate,Ls),128&T){w=void 0;var I=Ls.ref;if(null!==I){var S=Ls.stateNode;switch(Ls.tag){case 5:w=S;break;default:w=S}"function"===typeof I?I(w):I.current=w}}Ls=Ls.nextEffect}}catch(C){if(null===Ls)throw Error(a(330));mu(Ls,C),Ls=Ls.nextEffect}}while(null!==Ls);Ls=null,Di(),Ts=o}else t.current=n;if(Us)Us=!1,Vs=t,qs=e;else for(Ls=i;null!==Ls;)e=Ls.nextEffect,Ls.nextEffect=null,Ls=e;if(0===(e=t.firstPendingTime)&&(js=null),1073741823===e?t===zs?Ws++:(Ws=0,zs=t):Ws=0,"function"===typeof wu&&wu(n.stateNode,r),$s(t),Ms)throw Ms=!1,t=Fs,Fs=null,t;return 0!==(8&Ts)||Hi(),null}function du(){for(;null!==Ls;){var t=Ls.effectTag;0!==(256&t)&&ns(Ls.alternate,Ls),0===(512&t)||Us||(Us=!0,Wi(97,(function(){return vu(),null}))),Ls=Ls.nextEffect}}function vu(){if(90!==qs){var t=97<qs?97:qs;return qs=90,Bi(t,yu)}}function yu(){if(null===Vs)return!1;var t=Vs;if(Vs=null,0!==(48&Ts))throw Error(a(331));var e=Ts;for(Ts|=32,t=t.current.firstEffect;null!==t;){try{var n=t;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rs(5,n),is(5,n)}}catch(r){if(null===t)throw Error(a(330));mu(t,r)}n=t.nextEffect,t.nextEffect=null,t=n}return Ts=e,Hi(),!0}function gu(t,e,n){uo(t,e=ds(t,e=Ja(n,e),1073741823)),null!==(t=Ys(t,1073741823))&&$s(t)}function mu(t,e){if(3===t.tag)gu(t,t,e);else for(var n=t.return;null!==n;){if(3===n.tag){gu(n,t,e);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===js||!js.has(r))){uo(n,t=vs(n,t=Ja(e,t),1073741823)),null!==(n=Ys(n,1073741823))&&$s(n);break}}n=n.return}}function bu(t,e,n){var r=t.pingCache;null!==r&&r.delete(e),Is===t&&Cs===n?ks===Es||ks===ws&&1073741823===xs&&Ui()-Ds<500?nu(t,Cs):Rs=!0:Ou(t,n)&&(0!==(e=t.lastPingedTime)&&e<n||(t.lastPingedTime=n,$s(t)))}function _u(t,e){var n=t.stateNode;null!==n&&n.delete(e),0===(e=0)&&(e=Ks(e=Gs(),t,null)),null!==(t=Ys(t,e))&&$s(t)}ys=function(t,e,n){var r=e.expirationTime;if(null!==t){var i=e.pendingProps;if(t.memoizedProps!==i||fi.current)Pa=!0;else{if(r<n){switch(Pa=!1,e.tag){case 3:Ua(e),Na();break;case 5:if(Do(e),4&e.mode&&1!==n&&i.hidden)return e.expirationTime=e.childExpirationTime=1,null;break;case 1:vi(e.type)&&bi(e);break;case 4:Oo(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value,i=e.type._context,ci(Yi,i._currentValue),i._currentValue=r;break;case 13:if(null!==e.memoizedState)return 0!==(r=e.child.childExpirationTime)&&r>=n?za(t,e,n):(ci(Mo,1&Mo.current),null!==(e=Qa(t,e,n))?e.sibling:null);ci(Mo,1&Mo.current);break;case 19:if(r=e.childExpirationTime>=n,0!==(64&t.effectTag)){if(r)return Ka(t,e,n);e.effectTag|=64}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null),ci(Mo,Mo.current),!r)return null}return Qa(t,e,n)}Pa=!1}}else Pa=!1;switch(e.expirationTime=0,e.tag){case 2:if(r=e.type,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,i=di(e,hi.current),no(e,n),i=Qo(null,e,r,t,i,n),e.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,vi(r)){var o=!0;bi(e)}else o=!1;e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,oo(e);var s=r.getDerivedStateFromProps;"function"===typeof s&&vo(e,r,s,t),i.updater=yo,e.stateNode=i,i._reactInternalFiber=e,_o(e,r,t,n),e=ja(null,e,r,!0,o,n)}else e.tag=0,Aa(null,e,i,n),e=e.child;return e;case 16:t:{if(i=e.elementType,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,function(t){if(-1===t._status){t._status=0;var e=t._ctor;e=e(),t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,e.type=i,o=e.tag=function(t){if("function"===typeof t)return Su(t)?1:0;if(void 0!==t&&null!==t){if((t=t.$$typeof)===ut)return 11;if(t===ht)return 14}return 2}(i),t=Qi(i,t),o){case 0:e=Ma(null,e,i,t,n);break t;case 1:e=Fa(null,e,i,t,n);break t;case 11:e=Oa(null,e,i,t,n);break t;case 14:e=Ra(null,e,i,Qi(i.type,t),r,n);break t}throw Error(a(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,Ma(t,e,r,i=e.elementType===r?i:Qi(r,i),n);case 1:return r=e.type,i=e.pendingProps,Fa(t,e,r,i=e.elementType===r?i:Qi(r,i),n);case 3:if(Ua(e),r=e.updateQueue,null===t||null===r)throw Error(a(282));if(r=e.pendingProps,i=null!==(i=e.memoizedState)?i.element:null,ao(t,e),lo(e,r,null,n),(r=e.memoizedState.element)===i)Na(),e=Qa(t,e,n);else{if((i=e.stateNode.hydrate)&&(wa=wn(e.stateNode.containerInfo.firstChild),_a=e,i=Ea=!0),i)for(n=Co(e,null,r,n),e.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Aa(t,e,r,n),Na();e=e.child}return e;case 5:return Do(e),null===t&&Sa(e),r=e.type,i=e.pendingProps,o=null!==t?t.memoizedProps:null,s=i.children,mn(r,i)?s=null:null!==o&&mn(r,o)&&(e.effectTag|=16),La(t,e),4&e.mode&&1!==n&&i.hidden?(e.expirationTime=e.childExpirationTime=1,e=null):(Aa(t,e,s,n),e=e.child),e;case 6:return null===t&&Sa(e),null;case 13:return za(t,e,n);case 4:return Oo(e,e.stateNode.containerInfo),r=e.pendingProps,null===t?e.child=So(e,null,r,n):Aa(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,Oa(t,e,r,i=e.elementType===r?i:Qi(r,i),n);case 7:return Aa(t,e,e.pendingProps,n),e.child;case 8:case 12:return Aa(t,e,e.pendingProps.children,n),e.child;case 10:t:{r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value;var u=e.type._context;if(ci(Yi,u._currentValue),u._currentValue=o,null!==s)if(u=s.value,0===(o=Fr(u,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(s.children===i.children&&!fi.current){e=Qa(t,e,n);break t}}else for(null!==(u=e.child)&&(u.return=e);null!==u;){var c=u.dependencies;if(null!==c){s=u.child;for(var l=c.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&o)){1===u.tag&&((l=so(n,null)).tag=2,uo(u,l)),u.expirationTime<n&&(u.expirationTime=n),null!==(l=u.alternate)&&l.expirationTime<n&&(l.expirationTime=n),eo(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}l=l.next}}else s=10===u.tag&&u.type===e.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===e){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}Aa(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=(o=e.pendingProps).children,no(e,n),r=r(i=ro(i,o.unstable_observedBits)),e.effectTag|=1,Aa(t,e,r,n),e.child;case 14:return o=Qi(i=e.type,e.pendingProps),Ra(t,e,i,o=Qi(i.type,o),r,n);case 15:return Da(t,e,e.type,e.pendingProps,r,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Qi(r,i),null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),e.tag=1,vi(r)?(t=!0,bi(e)):t=!1,no(e,n),mo(e,r,i),_o(e,r,i,n),ja(null,e,r,!0,t,n);case 19:return Ka(t,e,n)}throw Error(a(156,e.tag))};var wu=null,Eu=null;function Tu(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Iu(t,e,n,r){return new Tu(t,e,n,r)}function Su(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Cu(t,e){var n=t.alternate;return null===n?((n=Iu(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=t.childExpirationTime,n.expirationTime=t.expirationTime,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{expirationTime:e.expirationTime,firstContext:e.firstContext,responders:e.responders},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ku(t,e,n,r,i,o){var s=2;if(r=t,"function"===typeof t)Su(t)&&(s=1);else if("string"===typeof t)s=5;else t:switch(t){case nt:return Nu(n.children,i,o,e);case st:s=8,i|=7;break;case rt:s=8,i|=1;break;case it:return(t=Iu(12,n,e,8|i)).elementType=it,t.type=it,t.expirationTime=o,t;case ct:return(t=Iu(13,n,e,i)).type=ct,t.elementType=ct,t.expirationTime=o,t;case lt:return(t=Iu(19,n,e,i)).elementType=lt,t.expirationTime=o,t;default:if("object"===typeof t&&null!==t)switch(t.$$typeof){case ot:s=10;break t;case at:s=9;break t;case ut:s=11;break t;case ht:s=14;break t;case ft:s=16,r=null;break t;case pt:s=22;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=Iu(s,n,e,i)).elementType=t,e.type=r,e.expirationTime=o,e}function Nu(t,e,n,r){return(t=Iu(7,t,r,e)).expirationTime=n,t}function xu(t,e,n){return(t=Iu(6,t,null,e)).expirationTime=n,t}function Pu(t,e,n){return(e=Iu(4,null!==t.children?t.children:[],t.key,e)).expirationTime=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Au(t,e,n){this.tag=e,this.current=null,this.containerInfo=t,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Ou(t,e){var n=t.firstSuspendedTime;return t=t.lastSuspendedTime,0!==n&&n>=e&&t<=e}function Ru(t,e){var n=t.firstSuspendedTime,r=t.lastSuspendedTime;n<e&&(t.firstSuspendedTime=e),(r>e||0===n)&&(t.lastSuspendedTime=e),e<=t.lastPingedTime&&(t.lastPingedTime=0),e<=t.lastExpiredTime&&(t.lastExpiredTime=0)}function Du(t,e){e>t.firstPendingTime&&(t.firstPendingTime=e);var n=t.firstSuspendedTime;0!==n&&(e>=n?t.firstSuspendedTime=t.lastSuspendedTime=t.nextKnownPendingLevel=0:e>=t.lastSuspendedTime&&(t.lastSuspendedTime=e+1),e>t.nextKnownPendingLevel&&(t.nextKnownPendingLevel=e))}function Lu(t,e){var n=t.lastExpiredTime;(0===n||n>e)&&(t.lastExpiredTime=e)}function Mu(t,e,n,r){var i=e.current,o=Gs(),s=fo.suspense;o=Ks(o,i,s);t:if(n){e:{if(Zt(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(vi(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var c=n.type;if(vi(c)){n=mi(n,c,u);break t}}n=u}else n=li;return null===e.context?e.context=n:e.pendingContext=n,(e=so(o,s)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),uo(i,e),Qs(i,o),o}function Fu(t){if(!(t=t.current).child)return null;switch(t.child.tag){case 5:default:return t.child.stateNode}}function ju(t,e){null!==(t=t.memoizedState)&&null!==t.dehydrated&&t.retryTime<e&&(t.retryTime=e)}function Uu(t,e){ju(t,e),(t=t.alternate)&&ju(t,e)}function Vu(t,e,n){var r=new Au(t,e,n=null!=n&&!0===n.hydrate),i=Iu(3,null,null,2===e?7:1===e?3:0);r.current=i,i.stateNode=r,oo(i),t[Cn]=r.current,n&&0!==e&&function(t,e){var n=Jt(e);Ce.forEach((function(t){de(t,e,n)}
vendor: 4,313 bytes, line 2
2)),ke.forEach((function(t){de(t,e,n)}))}(0,9===t.nodeType?t:t.ownerDocument),this._internalRoot=r}function qu(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType&&(8!==t.nodeType||" react-mount-point-unstable "!==t.nodeValue))}function Bu(t,e,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"===typeof i){var s=i;i=function(){var t=Fu(a);s.call(t)}}Mu(e,a,t,i)}else{if(o=n._reactRootContainer=function(t,e){if(e||(e=!(!(e=t?9===t.nodeType?t.documentElement:t.firstChild:null)||1!==e.nodeType||!e.hasAttribute("data-reactroot"))),!e)for(var n;n=t.lastChild;)t.removeChild(n);return new Vu(t,0,e?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"===typeof i){var u=i;i=function(){var t=Fu(a);u.call(t)}}eu((function(){Mu(e,a,t,i)}))}return Fu(a)}function Wu(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:et,key:null==r?null:""+r,children:t,containerInfo:e,implementation:n}}function zu(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!qu(e))throw Error(a(200));return Wu(t,e,null,n)}Vu.prototype.render=function(t){Mu(t,this._internalRoot,null,null)},Vu.prototype.unmount=function(){var t=this._internalRoot,e=t.containerInfo;Mu(null,t,null,(function(){e[Cn]=null}))},ve=function(t){if(13===t.tag){var e=Ki(Gs(),150,100);Qs(t,e),Uu(t,e)}},ye=function(t){13===t.tag&&(Qs(t,3),Uu(t,3))},ge=function(t){if(13===t.tag){var e=Gs();Qs(t,e=Ks(e,t,null)),Uu(t,e)}},N=function(t,e,n){switch(e){case"input":if(St(t,n),e=n.name,"radio"===n.type&&null!=e){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Pn(r);if(!i)throw Error(a(90));wt(r),St(r,i)}}}break;case"textarea":Ot(t,n);break;case"select":null!=(e=n.value)&&xt(t,!!n.multiple,e,!1)}},D=tu,L=function(t,e,n,r,i){var o=Ts;Ts|=4;try{return Bi(98,t.bind(null,e,n,r,i))}finally{0===(Ts=o)&&Hi()}},M=function(){0===(49&Ts)&&(function(){if(null!==Bs){var t=Bs;Bs=null,t.forEach((function(t,e){Lu(e,t),$s(e)})),Hi()}}(),vu())},F=function(t,e){var n=Ts;Ts|=2;try{return t(e)}finally{0===(Ts=n)&&Hi()}};var Hu={Events:[Nn,xn,Pn,C,T,Fn,function(t){ie(t,Mn)},O,R,$e,se,vu,{current:!1}]};!function(t){var e=t.findFiberByHostInstance;(function(t){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)return!0;try{var n=e.inject(t);wu=function(t){try{e.onCommitFiberRoot(n,t,void 0,64===(64&t.current.effectTag))}catch(r){}},Eu=function(t){try{e.onCommitFiberUnmount(n,t)}catch(r){}}}catch(r){}})(i({},t,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:X.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return null===(t=ne(t))?null:t.stateNode},findFiberByHostInstance:function(t){return e?e(t):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:kn,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}),e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hu,e.createPortal=zu,e.findDOMNode=function(t){if(null==t)return null;if(1===t.nodeType)return t;var e=t._reactInternalFiber;if(void 0===e){if("function"===typeof t.render)throw Error(a(188));throw Error(a(268,Object.keys(t)))}return t=null===(t=ne(e))?null:t.stateNode},e.flushSync=function(t,e){if(0!==(48&Ts))throw Error(a(187));var n=Ts;Ts|=1;try{return Bi(99,t.bind(null,e))}finally{Ts=n,Hi()}},e.hydrate=function(t,e,n){if(!qu(e))throw Error(a(200));return Bu(null,t,e,!0,n)},e.render=function(t,e,n){if(!qu(e))throw Error(a(200));return Bu(null,t,e,!1,n)},e.unmountComponentAtNode=function(t){if(!qu(t))throw Error(a(40));return!!t._reactRootContainer&&(eu((function(){Bu(null,null,t,!1,(function(){t._reactRootContainer=null,t[Cn]=null}))})),!0)},e.unstable_batchedUpdates=tu,e.unstable_createPortal=function(t,e){return zu(t,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},e.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!qu(n))throw Error(a(200));if(null==t||void 0===t._reactInternalFiber)throw Error(a(38));return Bu(t,e,n,!1,r)},e.version="16.13.1"},function(t,e,n){"use strict";
2t.exports=n(47)},function(t,e,n){"use strict";var r,i,o,a,s;if("undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,c=null,l=function t(){if(null!==u)try{var n=e.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(t,0),r}},h=Date.now();e.unstable_now=function(){return Date.now()-h},r=function(t){null!==u?setTimeout(r,0,t):(u=t,setTimeout(l,0))},i=function(t,e){c=setTimeout(t,e)},o=function(){clearTimeout(c)},a=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var f=window.performance,p=window.Date,d=window.setTimeout,v=window.clearTimeout;if("undefined"!==typeof console){var y=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===typeof f&&"function"===typeof f.now)e.unstable_now=function(){return f.now()};else{var g=p.now();e.unstable_now=function(){return p.now()-g}}var m=!1,b=null,_=-1,w=5,E=0;a=function(){return e.unstable_now()>=E},s=function(){},e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<t?Math.floor(1e3/t):5};var T=new MessageChannel,I=T.port2;T.port1.onmessage=function(){if(null!==b){var t=e.unstable_now();E=t+w;try{b(!0,t)?I.postMessage(null):(m=!1,b=null)}catch(n){throw I.postMessage(null),n}}else m=!1},r=function(t){b=t,m||(m=!0,I.postMessage(null))},i=function(t,n){_=d((function(){t(e.unstable_now())}),n)},o=function(){v(_),_=-1}}function S(t,e){var n=t.length;t.push(e);t:for(;;){var r=n-1>>>1,i=t[r];if(!(void 0!==i&&0<N(i,e)))break t;t[r]=e,t[n]=i,n=r}}function C(t){return void 0===(t=t[0])?null:t}function k(t){var e=t[0];if(void 0!==e){var n=t.pop();if(n!==e){t[0]=n;t:for(var r=0,i=t.length;r<i;){var o=2*(r+1)-1,a=t[o],s=o+1,u=t[s];if(void 0!==a&&0>N(a,n))void 0!==u&&0>N(u,a)?(t[r]=u,t[s]=n,r=s):(t[r]=a,t[o]=n,r=o);else{if(!(void 0!==u&&0>
vendor: 3,220 bytes, line 2
2N(u,n)))break t;t[r]=u,t[s]=n,r=s}}}return e}return null}function N(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}var x=[],P=[],A=1,O=null,R=3,D=!1,L=!1,M=!1;function F(t){for(var e=C(P);null!==e;){if(null===e.callback)k(P);else{if(!(e.startTime<=t))break;k(P),e.sortIndex=e.expirationTime,S(x,e)}e=C(P)}}function j(t){if(M=!1,F(t),!L)if(null!==C(x))L=!0,r(U);else{var e=C(P);null!==e&&i(j,e.startTime-t)}}function U(t,n){L=!1,M&&(M=!1,o()),D=!0;var r=R;try{for(F(n),O=C(x);null!==O&&(!(O.expirationTime>n)||t&&!a());){var s=O.callback;if(null!==s){O.callback=null,R=O.priorityLevel;var u=s(O.expirationTime<=n);n=e.unstable_now(),"function"===typeof u?O.callback=u:O===C(x)&&k(x),F(n)}else k(x);O=C(x)}if(null!==O)var c=!0;else{var l=C(P);null!==l&&i(j,l.startTime-n),c=!1}return c}finally{O=null,R=r,D=!1}}function V(t){switch(t){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var q=s;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){L||D||(L=!0,r(U))},e.unstable_getCurrentPriorityLevel=function(){return R},e.unstable_getFirstCallbackNode=function(){return C(x)},e.unstable_next=function(t){switch(R){case 1:case 2:case 3:var e=3;break;default:e=R}var n=R;R=e;try{return t()}finally{R=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=q,e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=R;R=t;try{return e()}finally{R=n}},e.unstable_scheduleCallback=function(t,n,a){var s=e.unstable_now();if("object"===typeof a&&null!==a){var u=a.delay;u="number"===typeof u&&0<u?s+u:s,a="number"===typeof a.timeout?a.timeout:V(t)}else a=V(t),u=s;return t={id:A++,callback:n,priorityLevel:t,startTime:u,expirationTime:a=u+a,sortIndex:-1},u>s?(t.sortIndex=u,S(P,t),null===C(x)&&t===C(P)&&(M?o():M=!0,i(j,u-s))):(t.sortIndex=a,S(x,t),L||D||(L=!0,r(U))),t},e.unstable_shouldYield=function(){var t=e.unstable_now();F(t);var n=C(x);return n!==O&&null!==O&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTime<O.expirationTime||a()},e.unstable_wrapCallback=function(t){var e=R;return function(){var n=R;R=e;try{return t.apply(this,arguments)}finally{R=n}}}},,,function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o}
2)),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o}
2)),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";n.r(e),function(t){var e=n(1),r=n.n(e);(function(){var e,n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};var i=function(e){e=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t,e];for(var n=0;n<e.length;++n){var r=e[n];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,e){if(e){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]}(e=e(o=r[t=t[t.length-1]]))!=o&&null!=e&&n(r,t,{configurable:!0,writable:!0,value:e})}}("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(n){e.reject(n)}}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(r){this.f(r)}}}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)}}
vendor: 1,338 bytes, line 2
2,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.u(t):this.h(t)}},e.prototype.u=function(t){var e=void 0;try{e=t.then}catch(n){return void this.g(n)}"function"==typeof e?this.w(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.Oa(e.resolve,e.reject)},e.prototype.w=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(r){n.reject(r)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(n){o(n)}}:e}var i,o,a=new e((function(t,e){i=t,o=e}));return this.Oa(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Oa=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)}
2,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).Oa(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).Oa(o(a.length-1),e),i=n.next()}while(!i.done)}))},e}));var s=s||{},u=this||self,c=/^[\w+/_-]+[=]{0,2}$/,l=null;function h(){}function f(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function p(t){var e=f(t);return"array"==e||"object"==e&&"number"==typeof t.length}function d(t){return"function"==f(t)}function v(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function y(t){return Object.prototype.hasOwnProperty.call(t,g)&&t[g]||(t[g]=++m)}var g="closure_uid_"+(1e9*Math.random()>>>0),m=0;function b(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 w(t,e,n){return(w=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?b:_).apply(null,arguments)}function E(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 T=Date.now||function(){return+new Date};function I(t,e){function n(){}n.prototype=e.prototype,t.Za=e.prototype,t.prototype=new n,t.prototype.constructor=t}
2function S(t,e,n){this.code=N+t,this.message=e||x[t]||"",this.a=n||null}function C(t){var e=t&&t.code;return e?new S(e.substring(N.length),t.message,t.serverResponse):null}I(S,Error),S.prototype.v=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},S.prototype.toJSON=function(){return this.v()};var k,N="auth/",x={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
2ways 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 use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
2d-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."},P={hd:{Ra:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},pd:{Ra:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://securetoken.googleapis.com/v1/token",Ua:"https://identitytoolkit.googleapis.com/v2/",id:"p"},rd:{Ra:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},sd:{Ra:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Xa:"https://test-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function A(t){for(var e in P)if(P[e].id===t)return{firebaseEndpoint:(t=P[e]).Ra,secureTokenEndpoint:t.Xa,identityPlatformEndpoint:t.Ua};return null}function O(t){if(!t)return!1;
2try{return!!t.$goog_Thenable}catch(e){return!1}}function R(t){if(Error.captureStackTrace)Error.captureStackTrace(this,R);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function D(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");R.call(this,n+t[r])}function L(t,e){throw new D("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function M(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function F(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function j(){this.b=this.a=null}k=A("__EID__")?"__EID__":void 0,I(R,Error),R.prototype.name="CustomError",I(D,R),D.prototype.name="AssertionError",M.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 U=new M((function(){return new q}),(function(t){t.reset()}));function V(){var t=ge,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function q(){this.next=this.b=this.a=null}j.prototype.add=function(t,e){var n=U.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},q.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},q.prototype.reset=function(){this.next=this.b=this.a=null};var B=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},W=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)};var z=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},H=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},G=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 K(t,e){return 0<=B(t,e)}function Q(t,e){var n;return(n=0<=(e=B(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)&&1==Array.prototype.splice.call(t,r,1).length&&0}))}function X(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 J,Z=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},tt=/&/g,et=/</g,nt=/>/g,rt=/"/g,it=/'/g,ot=/\x00/g,at=/[\x00&<>"']/;function st(t,e){return-1!=t.indexOf(e)}function ut(t,e){return t<e?-1:t>e?1:0}t:{var ct=u.navigator;if(ct){var lt=ct.userAgent;if(lt){J=lt;break t}}J=""}function ht(t){return st(J,t)}function ft(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function pt(t){for(var e in t)return!1;return!0}function dt(t){var e,n={};for(e in t)n[e]=t[e];return n}var vt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function yt(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<vt.length;o++)n=vt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function gt(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(a){}i=null}if(i&&"undefined"!=typeof i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if(v(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(a){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;L("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function mt(t,e){this.a=t===wt&&e||"",this.b=_t}function bt(t){return t instanceof mt&&t.constructor===mt&&t.b===_t?t.a:(L("expected object of type Const, got '"+t+"'"),"type_error:Const")}mt.prototype.ra=!0,mt.prototype.qa=function(){return this.a},mt.prototype.toString=function(){return"Const{"+this.a+"}"};var _t={},wt={},Et=new mt(wt,"");function Tt(t,e){this.a=t===xt&&e||"",this.b=Nt}function It(t){return t instanceof Tt&&t.constructor===Tt&&t.b===Nt?t.a:(L("expected object of type TrustedResourceUrl, got '"+t+"' of type "+f(t)),"type_error:TrustedResourceUrl")}function St(t,e){var n=bt(t);if(!kt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return t=n.replace(Ct,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format str
2ing, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof mt?bt(t):encodeURIComponent(String(t))})),new Tt(xt,t)}Tt.prototype.ra=!0,Tt.prototype.qa=function(){return this.a.toString()},Tt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Ct=/%{(\w+)}/g,kt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Nt={},xt={};function Pt(t,e){this.a=t===Lt&&e||"",this.b=Dt}function At(t){return t instanceof Pt&&t.constructor===Pt&&t.b===Dt?t.a:(L("expected object of type SafeUrl, got '"+t+"' of type "+f(t)),"type_error:SafeUrl")}Pt.prototype.ra=!0,Pt.prototype.qa=function(){return this.a.toString()},Pt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Ot=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Rt(t){return t instanceof Pt?t:(t="object"==typeof t&&t.ra?t.qa():String(t),Ot.test(t)||(t="about:invalid#zClosurez"),new Pt(Lt,t))}var Dt={},Lt={};function Mt(){this.a="",this.b=jt}function Ft(t){return t instanceof Mt&&t.constructor===Mt&&t.b===jt?t.a:(L("expected object of type SafeHtml, got '"+t+"' of type "+f(t)),"type_error:SafeHtml")}Mt.prototype.ra=!0,Mt.prototype.qa=function(){return this.a.toString()},Mt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var jt={};function Ut(t){var e=new Mt;return e.a=t,e}Ut("<!DOCTYPE html>");var Vt=Ut("");function qt(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 Bt(t){return at.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(tt,"&")),-1!=t.indexOf("<")&&(t=t.replace(et,"<")),-1!=t.indexOf(">")&&(t=t.replace(nt,">")),-1!=t.indexOf('"')&&(t=t.replace(rt,""")),-1!=t.indexOf("'")&&(t=t.replace(it,"'")),-1!=t.indexOf("\0")&&(t=t.replace(ot,"�"))),t}function Wt(t){return Wt[" "](t),t}Ut("<br>"),Wt[" "]=h;var zt,Ht=ht("Opera"),Gt=ht("Trident")||ht("MSIE"),Kt=ht("Edge"),Qt=Kt||Gt,Yt=ht("Gecko")&&!(st(J.toLowerCase(),"webkit")&&!ht("Edge"))&&!(ht("Trident")||ht("MSIE"))&&!ht("Edge"),Xt=st(J.toLowerCase(),"webkit")&&!ht("Edge");function $t(){var t=u.document;return t?t.documentMode:void 0}t:{var Jt="",Zt=function(){var t=J;return Yt?/rv:([^\);]+)(\)|;)/.exec(t):Kt?/Edge\/([\d\.]+)/.exec(t):Gt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):Xt?/WebKit\/(\S+)/.exec(t):Ht?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(Zt&&(Jt=Zt?Zt[1]:""),Gt){var te=$t();if(null!=te&&te>parseFloat(Jt)){zt=String(te);break t}}zt=Jt}var ee,ne={};function re(t){return function(t,e){var n=ne;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,(function(){for(var e=0,n=Z(String(zt)).split("."),r=Z(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=ut(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||ut(0==a[2].length,0==s[2].length)||ut(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}ee=u.document&&Gt?$t():void 0;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(oa){}var ie=!Gt||9<=Number(ee);function oe(t){var e=document;return"string"===typeof t?e.getElementById(t):t}function ae(t,e){ft(e,(function(e,n){e&&"object"==typeof e&&e.ra&&(e=e.qa()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:ce.hasOwnProperty(n)?t.setAttribute(ce[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var se,ue,ce={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 le(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];!p(o)||v(o)&&0<o.nodeType?r(o):W(fe(o)?$(o):o,r)}}function he(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function fe(t){if(t&&"number"==typeof t.length){if(v(t))return"function"==typeof t.item||"string"==typeof t.item;if(d(t))return"function"==typeof t.item}return!1}
2function pe(t){u.setTimeout((function(){throw t}),0)}function de(){var t=u.MessageChannel;if("undefined"===typeof t&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!ht("Presto")&&(t=function(){var t=he(document,"IFRAME");t.style.display="none",function(t){var e=new Tt(xt,bt(Et));gt(t,"HTMLIFrameElement"),t.src=It(e).toString()}(t),document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.write(Ft(Vt)),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=w((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)}}}),"undefined"!==typeof t&&!ht("Trident")&&!ht("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Db;n.Db=null,t()}},function(t){r.next={Db:t},r=r.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}function ve(t,e){ue||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);ue=function(){t.then(me)}}else ue=function(){var t=me;!d(u.setImmediate)||u.Window&&u.Window.prototype&&!ht("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(se||(se=de()),se(t)):u.setImmediate(t)}}(),ye||(ue(),ye=!0),ge.add(t,e)}var ye=!1,ge=new j;function me(){for(var t;t=V();){try{t.a.call(t.b)}catch(e){pe(e)}F(U,t)}ye=!1}function be(t,e){if(this.a=_e,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=h)try{var n=this;t.call(e,(function(t){Oe(n,we,t)}),(function(t){if(!(t instanceof Ue))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Oe(n,Ee,t)}))}catch(r){Oe(this,Ee,r)}}var _e=0,we=2,Ee=3;function Te(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}Te.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Ie=new M((function(){return new Te}),(function(t){t.reset()}));function Se(t,e,n){var r=Ie.get();return r.g=t,r.b=e,r.f=n,r}function Ce(t){if(t instanceof be)return t;var e=new be(h);return Oe(e,we,t),e}
2function ke(t){return new be((function(e,n){n(t)}))}function Ne(t,e,n){Re(t,e,n,null)||ve(E(e,t))}function xe(t){return new be((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Mb:!0,value:o}:{Mb:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Ne(t[o],E(i,o,!0),E(i,o,!1));else e(r)}))}function Pe(t,e){t.b||t.a!=we&&t.a!=Ee||De(t),t.f?t.f.next=e:t.b=e,t.f=e}function Ae(t,e,n,r){var i=Se(null,null,null);return i.a=new be((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(a){o(a)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Ue?o(e):t(i)}catch(a){o(a)}}:o})),i.a.c=t,Pe(t,i),i.a}function Oe(t,e,n){t.a==_e&&(t===n&&(e=Ee,n=new TypeError("Promise cannot resolve to itself")),t.a=1,Re(n,t.Yc,t.Zc,t)||(t.i=n,t.a=e,t.c=null,De(t),e!=Ee||n instanceof Ue||function(t,e){t.g=!0,ve((function(){t.g&&je.call(null,e)}))}(t,n)))}function Re(t,e,n,r){if(t instanceof be)return Pe(t,Se(e||h,n||null,r)),!0;if(O(t))return t.then(e,n,r),!0;if(v(t))try{var i=t.then;if(d(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(s){o(s)}}(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function De(t){t.h||(t.h=!0,ve(t.ec,t))}function Le(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Me(t,e,n,r){if(n==Ee&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Fe(e,n,r);else try{e.c?e.g.call(e.f):Fe(e,n,r)}catch(i){je.call(null,i)}F(Ie,e)}function Fe(t,e,n){e==we?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}be.prototype.then=function(t,e,n){return Ae(this,d(t)?t:null,d(e)?e:null,n)},be.prototype.$goog_Thenable=!0,(e=be.prototype).ma=function(t,e){return(t=Se(t,t,e)).c=!0,Pe(this,t),this},e.o=function(t,e){return Ae(this,null,t,e)},e.cancel=function(t){if(this.a==_e){var e=new Ue(t);ve((function(){!function t(e,n){if(e.a==_e)if(e.c){var r=e.c;if(r.b){for(var i=0,o=null,a=null,s=r.b;s&&(s.c||(i++,s.a==e&&(o=s),!(o&&1<i)));s=s.next)o||(a=s);o&&(r.a==_e&&1==i?t(r,n):(a?((i=a).next==r.f&&(r.f=i),i.next=i.next.next):Le(r),Me(r,o,Ee,n)))}e.c=null}else Oe(e,Ee,n)}(this,e)}),this)}},e.Yc=function(t){this.a=_e,Oe(this,we,t)},e.Zc=function(t){this.a=_e,Oe(this,Ee,t)},e.ec=function(){for(var t;t=Le(this);)Me(this,t,this.a,this.i);this.h=!1};var je=pe;function Ue(t){R.call(this,t)}function Ve(){0!=qe&&(Be[y(this)]=this),this.wa=this.wa,this.na=this.na}I(Ue,R),Ue.prototype.name="cancel";var qe=0,Be={};function We(t){if(!t.wa&&(t.wa=!0,t.Ba(),0!=qe)){var e=y(t);if(0!=qe&&t.na&&0<t.na.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete Be[e]}}Ve.prototype.wa=!1,Ve.prototype.Ba=function(){if(this.na)for(;this.na.length;)this.na.shift()()};var ze=Object.freeze||function(t){return t},He=!Gt||9<=Number(ee),Ge=Gt&&!re("9"),Ke=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",h,e),u.removeEventListener("test",h,e)}catch(n){}return t}();function Qe(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function Ye(t,e){if(Qe.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(Yt){t:{try{Wt(e.nodeName);var i=!0;break t}catch(o){}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:Xe[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}Qe.prototype.preventDefault=function(){this.defaultPrevented=!0},I(Ye,Qe);var Xe=ze({2:"touch",3:"pen",4:"mouse"});Ye.prototype.preventDefault=function(){Ye.Za.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Ge)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},Ye.prototype.f=function(){return this.a};var $e="closure_listenable_"+(1e6*Math.random()|0),Je=0;function Ze(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Ta=i,this.key=++Je,this.ua=this.Na=!1}function tn(t){t.ua=!0,t.listener=null,t.proxy=null,t.src=null,t.Ta=null}function en(t){this.src=t,this.a={},this.b=0}function nn(t,e){var n=e.type;n in t.a&&Q(t.a[n],e)&&(tn(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function rn(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.ua&&o.listener==e&&o.capture==!!n&&o.Ta==r)return i}return-1}en.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=rn(t,e,r,i);return-1<a?(e=t[a],n||(e.Na=!1)):((e=new Ze(e,this.src,o,!!r,i)).Na=n,t.pu
2sh(e)),e};var on="closure_lm_"+(1e6*Math.random()|0),an={};function sn(t,e,n,r,i){if(r&&r.once)cn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)sn(t,e[o],n,r,i);else n=mn(n),t&&t[$e]?_n(t,e,n,v(r)?!!r.capture:!!r,i):un(t,e,n,!1,r,i)}function un(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=v(i)?!!i.capture:!!i,s=yn(t);if(s||(t[on]=s=new en(t)),!(n=s.add(e,n,r,a,o)).proxy){if(r=function(){var t=vn,e=He?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)Ke||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(fn(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function cn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)cn(t,e[o],n,r,i);else n=mn(n),t&&t[$e]?wn(t,e,n,v(r)?!!r.capture:!!r,i):un(t,e,n,!0,r,i)}function ln(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)ln(t,e[o],n,r,i);else r=v(r)?!!r.capture:!!r,n=mn(n),t&&t[$e]?(t=t.u,(e=String(e).toString())in t.a&&(-1<(n=rn(o=t.a[e],n,r,i))&&(tn(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=yn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=rn(e,n,r,i)),(n=-1<t?e[t]:null)&&hn(n))}function hn(t){if("number"!==typeof t&&t&&!t.ua){var e=t.src;if(e&&e[$e])nn(e.u,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(fn(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=yn(e))?(nn(n,t),0==n.b&&(n.src=null,e[on]=null)):tn(t)}}}function fn(t){return t in an?an[t]:an[t]="on"+t}function pn(t,e,n,r){var i=!0;if((t=yn(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.ua&&(o=dn(o,r),i=i&&!1!==o)}return i}function dn(t,e){var n=t.listener,r=t.Ta||t.src;return t.Na&&hn(t),n.call(r,e)}function vn(t,e){if(t.ua)return!0;if(!He){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 Ye(r=e,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(a){i=!0}(i||void 0==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=pn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=pn(r[i],t,!1,e),n=n&&o}return n}return dn(t,new Ye(e,this))}function yn(t){return(t=t[on])instanceof en?t:null}var gn="__closure_events_fn_"+(1e9*Math.random()>>>0);function mn(t){return d(t)?t:(t[gn]||(t[gn]=function(e){return t.handleEvent(e)}),t[gn])}function bn(){Ve.call(this),this.u=new en(this),this.Yb=this,this.eb=null}function _n(t,e,n,r,i){t.u.add(String(e),n,!1,r,i)}function wn(t,e,n,r,i){t.u.add(String(e),n,!0,r,i)}function En(t,e,n,r){if(!(e=t.u.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.ua&&a.capture==n){var s=a.listener,u=a.Ta||a.src;a.Na&&nn(t.u,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}function Tn(t,e,n){if(d(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:u.setTimeout(t,e||0)}function In(t){var e=null;return new be((function(n,r){-1==(e=Tn((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).o((function(t){throw u.clearTimeout(e),t}))}function Sn(t){if(t.V&&"function"==typeof t.V)return t.V();if("string"===typeof t)return t.split("");if(p(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 Cn(t){if(t.X&&"function"==typeof t.X)return t.X();if(!t.V||"function"!=typeof t.V){if(p(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 kn(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 kn)for(n=t.X(),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 Nn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];xn(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;)xn(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function xn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}I(bn,Ve),bn.prototype[$e]=!0,bn.prototype.addEventListener=function(t,e,n,r){sn(this,t,e,n,r)},bn.prototype.removeEventListener=function(t,e,n,r){ln(this,t,e,n,r)},bn.prototype.dispatchEvent=function(t){var e,n=this.eb;if(n)for(e=[];n;n=n.eb)e.push(n);n=this.Yb;var r=t.type||t;if("string"===typeof t)t=new Qe(t,n);else if(t instanceof Qe)t.target=t.target||n;else{var i=t;yt(t=new Qe(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];i=En(a,r,!0,t)&&i}if(i=En(a=t.b=n,r,!0,t)&&i,i=En(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=En(a=t.b=e[o],r,!1,t)&&i;return i},bn.prototype.Ba=function(){if(bn.Za.Ba.call(this),this.u){var t,e=this.u;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)tn(n[r]);delete e.a[t],e.b--}}this.eb=null},(e=kn.prototype).V=function(){Nn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},e.X=function(){return Nn(this),this.a.concat()},e.clear=function(){this.b={},this.c=this.a.length=0},e.get=function(t,e){return xn(this.b,t)?this.b[t]:e},e.set=function(t,e){xn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},e.forEach=function(t,e){for(var n=this.X(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Pn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function An(t,e){var n;this.b=this.i=this.f="",this.l=null,this.g=this.c="",this.h=!1,t instanceof An?(this.h=void 0!==e?e:t.h,On(this,t.f),this.i=t.i,this.b=t.b,Rn(this,t.l),this.c=t.c,Dn(this,Zn(t.a)),this.g=t.g):t&&(n=String(t).match(Pn))?(this.h=!!e,On(this,n[1]||"",!0),this.i=Un(n[2]||""),this.b=Un(n[3]||"",!0),Rn(this,n[4]),this.c=Un(n[5]||"",!0),Dn(this,n[6]||"",!0),this.g=Un(n[7]||"")):(this.h=!!e,this.a=new Kn(null,this.h))}
2function On(t,e,n){t.f=n?Un(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Rn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.l=e}else t.l=null}function Dn(t,e,n){e instanceof Kn?(t.a=e,function(t,e){e&&!t.f&&(Qn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(Xn(this,e),Jn(this,n,t))}),t)),t.f=e}(t.a,t.h)):(n||(e=Vn(e,Hn)),t.a=new Kn(e,t.h))}function Ln(t,e,n){t.a.set(e,n)}function Mn(t,e){return t.a.get(e)}function Fn(t){return t instanceof An?new An(t):new An(t,void 0)}function jn(t,e){var n=new An(null,void 0);return On(n,"https"),t&&(n.b=t),e&&(n.c=e),n}function Un(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Vn(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,qn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function qn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}An.prototype.toString=function(){var t=[],e=this.f;e&&t.push(Vn(e,Bn,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.i)&&t.push(Vn(e,Bn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.l)&&t.push(":",String(n))),(n=this.c)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(Vn(n,"/"==n.charAt(0)?zn:Wn,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.g)&&t.push("#",Vn(n,Gn)),t.join("")},An.prototype.resolve=function(t){var e=new An(this),n=!!t.f;n?On(e,t.f):n=!!t.i,n?e.i=t.i:n=!!t.b,n?e.b=t.b:n=null!=t.l;var r=t.c;if(n)Rn(e,t.l);else if(n=!!t.c){if("/"!=r.charAt(0))if(this.b&&!this.c)r="/"+r;else{var i=e.c.lastIndexOf("/");-1!=i&&(r=e.c.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(st(i,"./")||st(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.c=r:n=""!==t.a.toString(),n?Dn(e,Zn(t.a)):n=!!t.g,n&&(e.g=t.g),e};var Bn=/[#\/\?@]/g,Wn=/[#\?:]/g,zn=/[#\?]/g,Hn=/[#\?@]/g,Gn=/#/g;function Kn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Qn(t){t.a||(t.a=new kn,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 Yn(t){var e=Cn(t);if("undefined"==typeof e)throw Error("Keys are undefined");var n=new Kn(null,void 0);t=Sn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?Jn(n,i,o):n.add(i,o)}return n}function Xn(t,e){Qn(t),e=tr(t,e),xn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,xn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Nn(t)))}function $n(t,e){return Qn(t),e=tr(t,e),xn(t.a.b,e)}function Jn(t,e,n){Xn(t,e),0<n.length&&(t.c=null,t.a.set(tr(t,e),$(n)),t.b+=n.length)}function Zn(t){var e=new Kn;return e.c=t.c,t.a&&(e.a=new kn(t.a),e.b=t.b),e}function tr(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function er(t){var e=[];return function t(e,n,r){if(null==n)r.push("null");else{if("object"==typeof n){if(Array.isArray(n)){var i=n;n=i.length,r.push("[");for(var o="",a=0;a<n;a++)r.push(o),t(e,i[a],r),o=",";return void r.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(i in r.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,i)&&("function"!=typeof(a=n[i])&&(r.push(o),or(i,r),r.push(":"),t(e,a,r),o=","));return void r.push("}")}n=n.valueOf()}switch(typeof n){case"string":or(n,r);break;case"number":r.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":r.push(String(n));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof n)}}}(new nr,t,e),e.join("")}function nr(){}(e=Kn.prototype).add=function(t,e){Qn(this),this.c=null,t=tr(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},e.clear=function(){this.a=this.c=null,this.b=0},e.forEach=function(t,e){Qn(this),this.a.forEach((function(n,r){W(n,(function(n){t.call(e,n,r,this)}),this)}),this)},e.X=function(){Qn(this);for(var t=this.a.V(),e=this.a.X(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},e.V=function(t){Qn(this);var e=[];
2if("string"===typeof t)$n(this,t)&&(e=X(e,this.a.get(tr(this,t))));else{t=this.a.V();for(var n=0;n<t.length;n++)e=X(e,t[n])}return e},e.set=function(t,e){return Qn(this),this.c=null,$n(this,t=tr(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},e.get=function(t,e){return t&&0<(t=this.V(t)).length?String(t[0]):e},e.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.X(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.V(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 rr={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},ir=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function or(t,e){e.push('"',t.replace(ir,(function(t){var e=rr[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),rr[t]=e),e})),'"')}function ar(){var t=Sr();return Gt&&!!ee&&11==ee||/Edge\/\d+/.test(t)}function sr(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function ur(t,e){e=e||u.window;var n="about:blank";t&&(n=At(Rt(t))),e.location.href=n}function cr(t){return!!((t=(t||Sr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function lr(t){t=t||u.window;try{t.close()}catch(e){}}function hr(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=Sr().toLowerCase(),r&&(e.target=r,st(n,"crios/")&&(e.target="_blank")),Er(Sr())==_r&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Pt?n:Rt("undefined"!=typeof n.href?n.href:String(n)),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((ht("iPhone")&&!ht("iPod")&&!ht("iPad")||ht("iPad")||ht("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(gt(a=he(document,"A"),"HTMLAnchorElement"),e instanceof Pt||e instanceof Pt||(e="object"==typeof e&&e.ra?e.qa():String(e),Ot.test(e)||(e="about:invalid#zClosurez"),e=new Pt(Lt,e)),a.href=At(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=r.open("",n,a),t=At(e),a&&(Qt&&st(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t=Ut('<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Bt(t)+'">'),r=a.document)&&(r.write(Ft(t)),r.close())):(a=r.open(At(e),n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}var fr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,pr=/^[^@]+@[^@]+$/;function dr(){var t=null;return new be((function(e){"complete"==u.document.readyState?e():(t=function(){e()},cn(window,"load",t))})).o((function(e){throw ln(window,"load",t),e}))}function vr(t){return t=t||Sr(),!("file:"!==Pr()&&"ionic:"!==Pr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function yr(){var t=u.window;try{return!(!t||t==t.top)}catch(e){return!1}}function gr(){return"undefined"!==typeof u.WorkerGlobalScope&&"function"===typeof u.importScripts}function mr(){return r.a.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.a.INTERNAL.hasOwnProperty("node")?"Node":gr()?"Worker":"Browser"}function br(){var t=mr();return"ReactNative"===t||"Node"===t}var _r="Firefox",wr="Chrome";function Er(t){var e=t.toLowerCase();return st(e,"opera/")||st(e,"opr/")||st(e,"opios/")?"Opera":st(e,"iemobile")?"IEMobile":st(e,"msie")||st(e,"trident/")?"IE":st(e,"edge/")?"Edge":st(e,"firefox/")?_r:st(e,"silk/")?"Silk":st(e,"blackberry")?"Blackberry":st(e,"webos")?"Webos":!st(e,"safari/")||st(e,"chrome/")||st(e,"crios/")||st(e,"android")?!st(e,"chrome/")&&!st(e,"crios/")||st(e,"edge/")?st(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":wr:"Safari"}var Tr={jd:"FirebaseCore-web",ld:"FirebaseUI-web"};function Ir(t,e){e=e||[];var n,r=[],i={};for(n in Tr)i[Tr[n]]=!0;for(n=0;n<e.length;n++)"undefined"!==typeof i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=mr())?r=Er(i=Sr()):"Worker"===r&&(r=Er(i=Sr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Sr(){return u.navigator&&u.navigator.userAgent||""}function Cr(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 kr(){try{var t=u.localStorage,e=Lr();if(t)return t.setItem(e,"1"),t.removeItem(e),!ar()||!!u.indexedDB}catch(n){return gr()&&!!u.indexedDB}return!1}function Nr(){return(xr()||"chrome-extension:"===Pr()||vr())&&!br()&&kr()&&!gr()}function xr(){return"http:"===Pr()||"https:"===Pr()}function Pr(){return u.location&&u.location.protocol||null}function Ar(t){return!cr(t=t||Sr())&&Er(t)!=_r}function Or(t){return"undefined"===typeof t?null:er(t)}function Rr(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 Dr(t){if(null!==t)return JSON.parse(t)}function Lr(t){return t||Math.floor(1e9*Math.random()).toString()}function Mr(t){return"Safari"!=Er(t=t||Sr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function Fr(){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 jr(t,e){if(t>
2e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Sr(),e=mr(),this.b=cr(t)||"ReactNative"===e}function Ur(){var t=u.document;return!t||"undefined"===typeof t.visibilityState||"visible"==t.visibilityState}function Vr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function qr(){return!(!Cr("fireauth.oauthhelper",u)&&!Cr("fireauth.iframe",u))}jr.prototype.get=function(){var t=u.navigator;return!t||"boolean"!==typeof t.onLine||!xr()&&"chrome-extension:"!==Pr()&&"undefined"===typeof t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Br,Wr={};function zr(t){Wr[t]||(Wr[t]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(t))}try{var Hr={};Object.defineProperty(Hr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Hr,"abcd",{configurable:!0,enumerable:!0,value:2}),Br=2==Hr.abcd}catch(oa){Br=!1}function Gr(t,e,n){Br?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function Kr(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Gr(t,n,e[n])}function Qr(t){var e={};return Kr(e,t),e}function Yr(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Gr(e,n,Yr(t[n]));return e}function Xr(t){var e=t&&(t[ei]?"phone":null);if(!(e&&t&&t[ti]))throw new S("internal-error","Internal assert: invalid MultiFactorInfo object");Gr(this,"uid",t[ti]),Gr(this,"displayName",t[Jr]||null);var n=null;t[Zr]&&(n=new Date(t[Zr]).toUTCString()),Gr(this,"enrollmentTime",n),Gr(this,"factorId",e)}function $r(t){try{var e=new ni(t)}catch(n){e=null}return e}Xr.prototype.v=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var Jr="displayName",Zr="enrolledAt",ti="mfaEnrollmentId",ei="phoneInfo";function ni(t){Xr.call(this,t),Gr(this,"phoneNumber",t[ei])}function ri(t){var e={},n=t[si],r=t[ci],i=t[li];if(t=$r(t[ui]),!i||i!=oi&&i!=ai&&!n||i==ai&&!r||i==ii&&!t)throw Error("Invalid checkActionCode response!");i==ai?(e[fi]=n||null,e[di]=n||null,e[hi]=r):(e[fi]=r||null,e[di]=r||null,e[hi]=n||null),e[pi]=t||null,Gr(this,yi,i),Gr(this,vi,Yr(e))}I(ni,Xr),ni.prototype.v=function(){var t=ni.Za.v.call(this);return t.phoneNumber=this.phoneNumber,t};var ii="REVERT_SECOND_FACTOR_ADDITION",oi="EMAIL_SIGNIN",ai="VERIFY_AND_CHANGE_EMAIL",si="email",ui="mfaInfo",ci="newEmail",li="requestType",hi="email",fi="fromEmail",pi="multiFactorInfo",di="previousEmail",vi="data",yi="operation";function gi(t){var e=Mn(t=Fn(t),mi)||null,n=Mn(t,bi)||null,r=Mn(t,Ei)||null;if(r=r&&Ii[r]||null,!e||!n||!r)throw new S("argument-error",mi+", "+bi+"and "+Ei+" are required in a valid action code URL.");Kr(this,{apiKey:e,operation:r,code:n,continueUrl:Mn(t,_i)||null,languageCode:Mn(t,wi)||null,tenantId:Mn(t,Ti)||null})}var mi="apiKey",bi="oobCode",_i="continueUrl",wi="languageCode",Ei="mode",Ti="tenantId",Ii={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:ii,signIn:oi,verifyAndChangeEmail:ai,verifyEmail:"VERIFY_EMAIL"};function Si(t){try{return new gi(t)}catch(e){return null}}function Ci(t){var e=t[Ai];if("undefined"===typeof e)throw new S("missing-continue-uri");if("string"!==typeof e||"string"===typeof e&&!e.length)throw new S("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[ki];if(n&&"object"===typeof n){e=n[Di];var r=n[Oi];if(n=n[Ri],"string"===typeof e&&e.length){if(this.a=e,"undefined"!==typeof r&&"boolean"!==typeof r)throw new S("argument-error",Oi+" property must be a boolean when specified.");if(this.g=!!r,"undefined"!==typeof n&&("string"!==typeof n||"string"===typeof n&&!n.length))throw new S("argument-error",Ri+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!==typeof e)throw new S("argument-error",Di+" property must be a non empty string when specified.");if("undefined"!==typeof r||"undefined"!==typeof n)throw new S("missing-android-pkg-name")}}else if("undefined"!==typeof n)throw new S("argument-error",ki+" property must be a non null object when specified.");if(this.f=null,(e=t[Pi])&&"object"===typeof e){if("string"===typeof(e=e[Li])&&e.length)this.f=e;else if("undefined"!==typeof e)throw new S("argument-error",Li+" property must be a non empty string when specified.")}else if("undefined"!==typeof e)throw new S("argument-error",Pi+" property must be a non null object when specified.");if("undefined"!==typeof(e=t[xi])&&"boolean"!==typeof e)throw new S("argument-error",xi+" property must be a boolean when specified.");if(this.c=!!e,"undefined"!==typeof(t=t[Ni])&&("string"!==typeof t||"string"===typeof t&&!t.length))throw new S("argument-error",Ni+" property must be a non empty string when specified.");this.i=t||null}var ki="android",Ni="dynamicLinkDomain",xi="handleCodeInApp",Pi="iOS",Ai="url",Oi="installApp",Ri="minimumVersion",Di="packageName",Li="bundleId";function Mi(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 Fi=null;function ji(t){var e="";return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=Fi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!Fi){Fi={};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===Fi[o]&&(Fi[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+=String.fromCharCode(t)})),e}function Ui(t){var e=qi(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.g=t,this.c=e.exp,this.h=e.sub,T(),this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function Vi(t){try{return new Ui(t)}catch(e){return null}}function qi(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{return JSON.parse(ji(t))}catch(r){}return null}Ui.prototype.S=function(){return this.f},Ui.prototype.i=function(){return this.b},Ui.prototype.toString=function(){return this.g};var Bi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Wi=["client_id","response_type","scope","redirect_uri","state"],zi={kd:{Ha:"locale",ta:700,sa:600,ea:"facebook.com",Va:Wi},md:{Ha:null,ta:500,sa:750,ea:"github.com",Va:Wi},nd:{Ha:"hl",ta:515,sa:680,ea:"google.com",Va:Wi},td:{Ha:"lang",ta:485,sa:705,ea:"twitter.com",Va:Bi},gd:{Ha:"locale",ta:640,sa:600,ea:"apple.com",Va:[]}};function Hi(t){for(var e in zi)if(zi[e].ea==t)return zi[e];return null}function Gi(t){var e={};e["facebook.com"]=$i,e["google.com"]=Zi,e["github.com"]=Ji,e["twitter.com"]=to;var n=t&&t[Qi];try{if(n)return e[n]?new e[n](t):new Xi(t);if("undefined"!==typeof t[Ki])return new Yi(t)}catch(r){}return null}var Ki="idToken",Qi="providerId";function Yi(t){var e=t[Qi];if(!e&&t[Ki]){var n=Vi(t[Ki]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,"undefined"!==typeof t.isNewUser?n=!!t.
2isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Gr(this,"providerId",e),Gr(this,"isNewUser",n)}function Xi(t){Yi.call(this,t),Gr(this,"profile",Yr((t=Dr(t.rawUserInfo||"{}"))||{}))}function $i(t){if(Xi.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Ji(t){if(Xi.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Gr(this,"username",this.profile&&this.profile.login||null)}function Zi(t){if(Xi.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function to(t){if(Xi.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Gr(this,"username",t.screenName||null)}function eo(t){var e=Fn(t),n=Mn(e,"link"),r=Mn(Fn(n),"link");return e=Mn(e,"deep_link_id"),Mn(Fn(e),"link")||e||r||n||t}function no(t,e){if(!t&&!e)throw new S("internal-error","Internal assert: no raw session string available");if(t&&e)throw new S("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?ro:io}I(Xi,Yi),I($i,Xi),I(Ji,Xi),I(Zi,Xi),I(to,Xi);var ro="enroll",io="signin";function oo(){}function ao(t,e){return t.then((function(t){if(t[Ya]){var n=Vi(t[Ya]);if(!n||e!=n.h)throw new S("user-mismatch");return t}throw new S("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==N+"user-not-found"?new S("user-mismatch"):t}))}function so(t,e){if(!e)throw new S("internal-error","failed to construct a credential");this.a=e,Gr(this,"providerId",t),Gr(this,"signInMethod",t)}function uo(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function co(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new so(t.providerId,t.pendingToken)}catch(e){}return null}function lo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Gr(this,"idToken",e.idToken),e.accessToken&&Gr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Gr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new S("internal-error","failed to construct a credential");Gr(this,"accessToken",e.oauthToken),Gr(this,"secret",e.oauthTokenSecret)}Gr(this,"providerId",t),Gr(this,"signInMethod",n)}function ho(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:Yn(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function fo(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 lo(t.providerId,e,t.signInMethod)}catch(n){}}return null}function po(t,e){this.Oc=e||[],Kr(this,{providerId:t,isOAuthProvider:!0}),this.Fb={},this.lb=(Hi(t)||{}).Ha||null,this.kb=null}function vo(t){if("string"!==typeof t||0!=t.indexOf("saml."))throw new S("argument-error",'SAML provider IDs must be prefixed with "saml."');po.call(this,t,[])}function yo(t){po.call(this,t,Wi),this.a=[]}function go(){yo.call(this,"facebook.com")}function mo(t){if(!t)throw new S("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return v(t)&&(e=t.accessToken),(new go).credential({accessToken:e})}function bo(){yo.call(this,"github.com")}function _o(t){if(!t)throw new S("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return v(t)&&(e=t.accessToken),(new bo).credential({accessToken:e})}function wo(){yo.call(this,"google.com"),this.Aa("profile")}function Eo(t,e){var n=t;return v(t)&&(n=t.idToken,e=t.accessToken),(new wo).credential({idToken:n,accessToken:e})}function To(){po.call(this,"twitter.com",Bi)}function Io(t,e){var n=t;if(v(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new S("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new lo("twitter.com",n,"twitter.com")}function So(t,e,n){this.a=t,this.f=e,Gr(this,"providerId","password"),Gr(this,"signInMethod",n===ko.EMAIL_LINK_SIGN_IN_METHOD?ko.EMAIL_LINK_SIGN_IN_METHOD:ko.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Co(t){return t&&t.email&&t.password?new So(t.email,t.password,t.signInMethod):null}function ko(){Kr(this,{providerId:"password",isOAuthProvider:!1})}function No(t,e){if(!(e=xo(e)))throw new S("argument-error","Invalid email link!");return new So(t,e.code,ko.EMAIL_LINK_SIGN_IN_METHOD)}function xo(t){return(t=Si(t=eo(t)))&&t.operation===oi?t:null}function Po(t){if(!(t.bb&&t.ab||t.Ja&&t.da))throw new S("internal-error");this.a=t,Gr(this,"providerId","phone"),this.ea="phone",Gr(this,"signInMethod","phone")}function Ao(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return W(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new Po(e)}return null}function Oo(t){return t.a.Ja&&t.a.da?{temporaryProof:t.a.Ja,phoneNumber:t.a.da}:{sessionInfo:t.a.bb,code:t.a.ab}}function Ro(t){try{this.a=t||r.a.auth()}catch(e){throw new S("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().")}Kr(this,{providerId:"phone",isOAuthProvider:!1})}function Do(t,e){if(!t)throw new S("missing-verification-id");if(!e)throw new S("missing-verification-code");return new Po({bb:t,ab:e})}function Lo(t){if(t.temporaryProof&&t.phoneNumber)return new Po({Ja:t.temporaryProof,da: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 Eo(o,n);case"facebook.com":return mo(n);case"github.com":return _o(n);case"twitter.com":return Io(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new so(e,a):new lo(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new yo(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(s){return null}}function Mo(t){if(!t.isOAuthProvider)throw new S("invalid-oauth-provider")}function Fo(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 S("invalid-auth-event");
2if(this.g&&this.a)throw new S("invalid-auth-event");if(this.g&&!this.f)throw new S("invalid-auth-event")}function jo(t){return(t=t||{}).type?new Fo(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&C(t.error),t.postBody,t.tenantId):null}function Uo(){this.b=null,this.a=[]}no.prototype.Fa=function(){return this.a?Ce(this.a):Ce(this.b)},no.prototype.v=function(){return this.type==ro?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},oo.prototype.ia=function(){},oo.prototype.b=function(){},oo.prototype.c=function(){},oo.prototype.v=function(){},so.prototype.ia=function(t){return vs(t,uo(this))},so.prototype.b=function(t,e){var n=uo(this);return n.idToken=e,ys(t,n)},so.prototype.c=function(t,e){return ao(gs(t,uo(this)),e)},so.prototype.v=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},lo.prototype.ia=function(t){return vs(t,ho(this))},lo.prototype.b=function(t,e){var n=ho(this);return n.idToken=e,ys(t,n)},lo.prototype.c=function(t,e){return ao(gs(t,ho(this)),e)},lo.prototype.v=function(){var t={providerId:this.providerId,sign
2InMethod: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},po.prototype.Ia=function(t){return this.Fb=dt(t),this},I(vo,po),I(yo,po),yo.prototype.Aa=function(t){return K(this.a,t)||this.a.push(t),this},yo.prototype.Nb=function(){return $(this.a)},yo.prototype.credential=function(t,e){var n;if(!(n=v(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null}).idToken&&!n.accessToken)throw new S("argument-error","credential failed: must provide the ID token and/or the access token.");return new lo(this.providerId,n,this.providerId)},I(go,yo),Gr(go,"PROVIDER_ID","facebook.com"),Gr(go,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),I(bo,yo),Gr(bo,"PROVIDER_ID","github.com"),Gr(bo,"GITHUB_SIGN_IN_METHOD","github.com"),I(wo,yo),Gr(wo,"PROVIDER_ID","google.com"),Gr(wo,"GOOGLE_SIGN_IN_METHOD","google.com"),I(To,po),Gr(To,"PROVIDER_ID","twitter.com"),Gr(To,"TWITTER_SIGN_IN_METHOD","twitter.com"),So.prototype.ia=function(t){return this.signInMethod==ko.EMAIL_LINK_SIGN_IN_METHOD?Js(t,Ss,{email:this.a,oobCode:this.f}):Js(t,Ks,{email:this.a,password:this.f})},So.prototype.b=function(t,e){return this.signInMethod==ko.EMAIL_LINK_SIGN_IN_METHOD?Js(t,Cs,{idToken:e,email:this.a,oobCode:this.f}):Js(t,Us,{idToken:e,email:this.a,password:this.f})},So.prototype.c=function(t,e){return ao(this.ia(t),e)},So.prototype.v=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},Kr(ko,{PROVIDER_ID:"password"}),Kr(ko,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Kr(ko,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Po.prototype.ia=function(t){return t.cb(Oo(this))},Po.prototype.b=function(t,e){var n=Oo(this);return n.idToken=e,Js(t,Ys,n)},Po.prototype.c=function(t,e){var n=Oo(this);return n.operation="REAUTH",ao(t=Js(t,Xs,n),e)},Po.prototype.v=function(){var t={providerId:"phone"};return this.a.bb&&(t.verificationId=this.a.bb),this.a.ab&&(t.verificationCode=this.a.ab),this.a.Ja&&(t.temporaryProof=this.a.Ja),this.a.da&&(t.phoneNumber=this.a.da),t},Ro.prototype.cb=function(t,e){var n=this.a.b;return Ce(e.verify()).then((function(r){if("string"!==typeof r)throw new S("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=v(t)?t.session:null,o=v(t)?t.phoneNumber:t;return(i&&i.type==ro?i.Fa().then((function(t){return function(t,e){return Js(t,qs,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:r}})})):i&&i.type==io?i.Fa().then((function(e){return function(t,e){return Js(t,Bs,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 Js(t,Fs,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 S("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},Kr(Ro,{PROVIDER_ID:"phone"}),Kr(Ro,{PHONE_SIGN_IN_METHOD:"phone"}),Fo.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("-")},Fo.prototype.S=function(){return this.h},Fo.prototype.v=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.v()}};var Vo,qo=null;function Bo(t){var e="unauthorized-domain",n=void 0,r=Fn(t);t=r.b,"chrome-extension"==(r=r.f)?n=qt("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=qt("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",S.call(this,e,n)}function Wo(t,e,n){S.call(this,t,n),(t=e||{}).Gb&&Gr(this,"email",t.Gb),t.da&&Gr(this,"phoneNumber",t.da),t.credential&&Gr(this,"credential",t.credential),t.Wb&&Gr(this,"tenantId",t.Wb)}function zo(t){if(t.code){var e=t.code||"";0==e.indexOf(N)&&(e=e.substring(N.length));var n={credential:Lo(t),Wb:t.tenantId};if(t.email)n.Gb=t.email;else if(t.phoneNumber)n.da=t.phoneNumber;else if(!n.credential)return new S(e,t.message||void 0);return new Wo(e,n,t.message)}return null}function Ho(){}function Go(t){return t.c||(t.c=t.b())}function Ko(){}function Qo(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(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function Yo(){}function Xo(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=w(this.oc,this),this.a.onerror=w(this.Pb,this),this.a.onprogress=w(this.pc,this),this.a.ontimeout=w(this.tc,this)}function $o(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function Jo(t,e,n){this.reset(t,e,n,void 0,void 0)}I(Bo,S),I(Wo,S),Wo.prototype.v=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.v();return e&&yt(t,e),t},Wo.prototype.toJSON=function(){return this.v()},Ho.prototype.c=null,I(Ko,Ho),Ko.prototype.a=function(){var t=Qo(this);return t?new ActiveXObject(t):new XMLHttpRequest},Ko.prototype.b=function(){var t={};return Qo(this)&&(t[0]=!0,t[1]=!0),t},Vo=new Ko,I(Yo,Ho),Yo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new Xo;throw Error("Unsupported browser")},Yo.prototype.b=function(){return{}},(e=Xo.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},e.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},e.abort=function(){this.a.abort()},e.setRequestHeader=function(){},e.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},e.oc=function(){this.status=200,this.response=this.responseText=this.a.responseText,$o(this,4)},e.Pb=function(){this.status=500,this.response=this.responseText="",$o(this,4)},e.tc=function(){this.Pb()},e.pc=function(){this.status=200,$o(this,1)},e.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},Jo.prototype.a=null;function Zo(t){this.f=t,this.b=this.c=this.a=null}function ta(t,e){this.name=t,this.value=e}Jo.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||T(),delete this.a},ta.prototype.toString=function(){return this.name};var ea=new ta("SEVERE",1e3),na=new ta("WARNING",900),ra=new ta("CONFIG",700),ia=new ta("FINE",500);Zo.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(L("Root logger has no level set."),null)}(this).value)for(d(e)&&(e=e()),t=new Jo(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var oa,aa={},sa=null;function ua(t){var e;if(sa||(sa=new Zo(""),aa[""]=sa,sa.c=ra),!(e=aa[t])){e=new Zo(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=ua(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,aa[t]=e}return e}function ca(t,e){t&&t.log(ia,e,void 0)}function la(t){this.f=t}function ha(t){bn.call(this),this.s=t,this.readyState=fa,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.i=new Headers,this.b=null,this.m="GET",this.g="",this.a=!1,this.h=ua("goog.net.FetchXmlHttp"),this.l=this.c=this.f=null}I(la,Ho),la.prototype.a=function(){return new ha(this.f)},la.prototype.b=(oa={},function(){return oa}),I(ha,bn);var fa=0;function pa(t){t.c.read().then(t.nc.bind(t)).catch(t.Sa.bind(t))}function da(t,e){e&&t.f&&(t.status=t.f.status,t.statusText=t.f.statusText),t.readyState=4,t.f=null,t.c=null,t.l=null,va(t)}function va(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function ya(t){bn.call(this),this.headers=new kn,this.D=t||null,this.c=!1,this.B=this.a=null,this.h=this.P=this.l="",this.f=this.O=this.i=this.N=!1,this.g=0,this.s=null,this.m=ga,this.w=this.R=!1}(e=ha.prototype).open=function(t,e){if(this.readyState!=fa)throw this.abort(),Error("Error reopening a connection");this.m=t,this.g=e,this.readyState=1,va(this)},e.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.i,method:this.m,credentials:void 0,cache:void 0};
2t&&(e.body=t),this.s.fetch(new Request(this.g,e)).then(this.sc.bind(this),this.Sa.bind(this))},e.abort=function(){this.response=this.responseText="",this.i=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,da(this,!1)),this.readyState=fa},e.sc=function(t){this.a&&(this.f=t,this.b||(this.b=t.headers,this.readyState=2,va(this)),this.a&&(this.readyState=3,va(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.qc.bind(this),this.Sa.bind(this)):"undefined"!==typeof u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.l=new TextDecoder,pa(this)):t.text().then(this.rc.bind(this),this.Sa.bind(this)))))},e.nc=function(t){if(this.a){var e=this.l.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?da(this,!0):va(this),3==this.readyState&&pa(this)}},e.rc=function(t){this.a&&(this.response=this.responseText=t,da(this,!0))},e.qc=function(t){this.a&&(this.response=t,da(this,!0))},e.Sa=function(t){var e=this.h;e&&e.log(na,"Failed to fetch url "+this.g,t instanceof Error?t:Error(t)),this.a&&da(this,!0)},e.setRequestHeader=function(t,e){this.i.append(t,e)},e.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.h)&&t.log(na,"Attempting to get response header but no headers have been received for url: "+this.g,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var t=this.h;return t&&t.log(na,"Attempting to get all response headers but no headers have been received for url: "+this.g,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")},I(ya,bn);var ga="";ya.prototype.b=ua("goog.net.XhrIo");var ma=/^https?$/i,ba=["POST","PUT"];function _a(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.N=!1,t.c=!0,t.a=t.D?t.D.a():Vo.a(),t.B=t.D?Go(t.D):Go(Vo),t.a.onreadystatechange=w(t.Sb,t);try{ca(t.b,xa(t,"Opening Xhr")),t.O=!0,t.a.open(n,String(e),!0),t.O=!1}catch(a){return ca(t.b,xa(t,"Error opening Xhr: "+a.message)),void Ea(t,a)}e=r||"";var o=new kn(t.headers);i&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(p(t)||"string"===typeof t)W(t,e,void 0);else for(var n=Cn(t),r=Sn(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=wa,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.X()),r=u.FormData&&e instanceof u.FormData,!K(ba,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.R&&(t.a.withCredentials=t.R);try{Ca(t),0<t.g&&(t.w=function(t){return Gt&&re(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}(t.a),ca(t.b,xa(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.w)),t.w?(t.a.timeout=t.g,t.a.ontimeout=w(t.Ka,t)):t.s=Tn(t.Ka,t.g,t)),ca(t.b,xa(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(a){ca(t.b,xa(t,"Send error: "+a.message)),Ea(t,a)}}function wa(t){return"content-type"==t.toLowerCase()}function Ea(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Ta(t),Sa(t)}function Ta(t){t.N||(t.N=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Ia(t){if(t.c&&"undefined"!=typeof s)if(t.B[1]&&4==ka(t)&&2==Na(t))ca(t.b,xa(t,"Local request error detected and ignored"));else if(t.i&&4==ka(t))Tn(t.Sb,0,t);else if(t.dispatchEvent("readystatechange"),4==ka(t)){ca(t.b,xa(t,"Request complete")),t.c=!1;try{var e,n=Na(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(Pn)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!ma.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<ka(t)?t.a.statusText:""}catch(l){ca(t.b,"Can not get status: "+l.message),c=""}t.h=c+" ["+Na(t)+"]",Ta(t)}}finally{Sa(t)}}}function Sa(t,e){if(t.a){Ca(t);var n=t.a,r=t.B[0]?h:null;
2t.a=null,t.B=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(ea,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function Ca(t){t.a&&t.w&&(t.a.ontimeout=null),t.s&&(u.clearTimeout(t.s),t.s=null)}function ka(t){return t.a?t.a.readyState:0}function Na(t){try{return 2<ka(t)?t.a.status:-1}catch(e){return-1}}function xa(t,e){return e+" ["+t.P+" "+t.l+" "+Na(t)+"]"}function Pa(t){var e=qa;this.g=[],this.w=e,this.s=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.B=this.i=!1,this.h=0,this.b=null,this.l=0}function Aa(t,e,n){t.a=!0,t.c=n,t.f=!e,La(t)}function Oa(t){if(t.a){if(!t.u)throw new Ma(t);t.u=!1}}function Ra(t,e,n,r){t.g.push([e,n,r]),t.a&&La(t)}function Da(t){return G(t.g,(function(t){return d(t[1])}))}function La(t){if(t.h&&t.a&&Da(t)){var e=t.h,n=Ua[e];n&&(u.clearTimeout(n.a),delete Ua[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),(O(e)||"function"===typeof u.Promise&&e instanceof u.Promise)&&(r=!0,t.i=!0)}catch(c){e=c,t.f=!0,Da(t)||(n=!0)}}t.c=e,r&&(s=w(t.m,t,!0),r=w(t.m,t,!1),e instanceof Pa?(Ra(e,s,r),e.B=!0):e.then(s,r)),n&&(e=new ja(e),Ua[e.a]=e,t.h=e.a)}function Ma(){R.call(this)}function Fa(){R.call(this)}function ja(t){this.a=u.setTimeout(w(this.c,this),0),this.b=t}(e=ya.prototype).Ka=function(){"undefined"!=typeof s&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",ca(this.b,xa(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},e.abort=function(){this.a&&this.c&&(ca(this.b,xa(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Sa(this))},e.Ba=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Sa(this,!0)),ya.Za.Ba.call(this)},e.Sb=function(){this.wa||(this.O||this.i||this.f?Ia(this):this.Hc())},e.Hc=function(){Ia(this)},e.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case ga: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(ea,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(e){return ca(this.b,"Can not get response: "+e.message),null}},Pa.prototype.cancel=function(t){if(this.a)this.c instanceof Pa&&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.w?this.w.call(this.s,this):this.u=!0,this.a||(t=new Fa(this),Oa(this),Aa(this,!1,t))}},Pa.prototype.m=function(t,e){this.i=!1,Aa(this,t,e)},Pa.prototype.then=function(t,e,n){var r,i,o=new be((function(t,e){r=t,i=e}));return Ra(this,r,(function(t){t instanceof Fa?o.cancel():i(t)})),o.then(t,e,n)},Pa.prototype.$goog_Thenable=!0,I(Ma,R),Ma.prototype.message="Deferred has already fired",Ma.prototype.name="AlreadyCalledError",I(Fa,R),Fa.prototype.message="Deferred was canceled",Fa.prototype.name="CanceledError",ja.prototype.c=function(){throw delete Ua[this.a],this.b};var Ua={};function Va(t){var e={},n=e.document||document,r=It(t).toString(),i=he(document,"SCRIPT"),o={Tb:i,Ka:void 0},a=new Pa(o),s=null,h=null!=e.timeout?e.timeout:5e3;return 0<h&&(s=window.setTimeout((function(){Ba(i,!0);var t=new Ha(za,"Timeout reached for loading script "+r);Oa(a),Aa(a,!1,t)}),h),o.Ka=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Ba(i,e.ud||!1,s),Oa(a),Aa(a,!0,null))},i.onerror=function(){Ba(i,!0,s);var t=new Ha(Wa,"Error while loading script "+r);Oa(a),Aa(a,!1,t)},yt(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),ae(i,o),function(t,e){gt(t,"HTMLScriptElement"),t.src=It(e),null===l&&(l=(e=(e=u.document).querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&c.test(e)?e:""),(e=l)&&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 qa(){if(this&&this.Tb){var t=this.Tb;
2t&&"SCRIPT"==t.tagName&&Ba(t,!0,this.Ka)}}function Ba(t,e,n){null!=n&&u.clearTimeout(n),t.onload=h,t.onerror=h,t.onreadystatechange=h,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var Wa=0,za=1;function Ha(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),R.call(this,n),this.code=t}function Ga(t){this.f=t}function Ka(t,e,n){if(this.c=t,t=e||{},this.u=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||Xa,this.g=dt(t.secureTokenHeaders||$a),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.l=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.i=t.firebaseTimeout||Ja,this.a=dt(t.firebaseHeaders||Za),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==mr(),!(n=u.XMLHttpRequest||n&&r.a.INTERNAL.node&&r.a.INTERNAL.node.XMLHttpRequest)&&!gr())throw new S("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,gr()?this.f=new la(self):br()?this.f=new Ga(n):this.f=new Yo,this.b=null}I(Ha,R),I(Ga,Ho),Ga.prototype.a=function(){return new this.f},Ga.prototype.b=function(){return{}};var Qa,Ya="idToken",Xa=new jr(3e4,6e4),$a={"Content-Type":"application/x-www-form-urlencoded"},Ja=new jr(3e4,6e4),Za={"Content-Type":"application/json"};function ts(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function es(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 ns(t,e,n,r,i,o,a){(function(){var t=Sr();return!((t=Er(t)!=wr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t)&&(!Gt||!ee||9<ee)})()||gr()?t=w(t.w,t):(Qa||(Qa=new be((function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{u[is]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Ra(t,null,e,void 0)}(Va(St(rs,{onload:is})),(function(){e(Error("CORS_UNSUPPORTED"))}))}}(t,e)}))),t=w(t.s,t)),t(e,n,r,i,o,a)}Ka.prototype.S=function(){return this.b},Ka.prototype.w=function(t,e,n,r,i,o){if(gr()&&("undefined"===typeof u.fetch||"undefined"===typeof u.Headers||"undefined"===typeof u.Request))throw new S("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 ya(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout((function(){a.dispatchEvent("timeout")}),o)}_n(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 ca(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)})),wn(a,"ready",(function(){s&&clearTimeout(s),We(this)})),wn(a,"timeout",(function(){s&&clearTimeout(s),We(this),e&&e(null)})),_a(a,t,n,r,i)};var rs=new mt(wt,"https://apis.google.com/js/client.js?onload=%{onload}"),is="__fcb"+Math.floor(1e6*Math.random()).toString();function os(t,e,n,r,i,o,a){var s=Fn(e+n);Ln(s,"key",t.c),a&&Ln(s,"cb",T().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&Ln(s,c,i[c]);
2return new be((function(e,n){ns(t,s.toString(),(function(t){t?t.error?n(tu(t,o||{})):e(t):n(new S("network-request-failed"))}),r,u?void 0:er(Rr(i)),t.a,t.i.get())}))}function as(t){if("string"!==typeof(t=t.email)||!pr.test(t))throw new S("invalid-email")}function ss(t){"email"in t&&as(t)}function us(t){if(!t[Ya]){if(t.mfaPendingCredential)throw new S("multi-factor-auth-required",null,dt(t));throw new S("internal-error")}}function cs(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new S("internal-error")}else{if(!t.sessionInfo)throw new S("missing-verification-id");if(!t.code)throw new S("missing-verification-code")}}Ka.prototype.s=function(t,e,n,r,i){var o=this;Qa.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"}})}))},Ka.prototype.vb=function(){return Js(this,Vs,{})},Ka.prototype.xb=function(t,e){return Js(this,js,{idToken:t,email:e})},Ka.prototype.yb=function(t,e){return Js(this,Us,{idToken:t,password:e})};var ls={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function hs(t){if(!t.phoneVerificationInfo)throw new S("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new S("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new S("missing-verification-code")}function fs(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new S("internal-error")}function ps(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&($n(t=new Kn(t.postBody),"nonce")&&(e.nonce=t.get("nonce")))),e}function ds(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=zo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=zo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=zo(t)):t.errorMessage&&(e=Zs(t.errorMessage)),e)throw e;us(t)}function vs(t,e){return e.returnIdpCredential=!0,Js(t,Ws,e)}function ys(t,e){return e.returnIdpCredential=!0,Js(t,Hs,e)}function gs(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,Js(t,zs,e)}function ms(t){if(!t.oobCode)throw new S("invalid-action-code")}(e=Ka.prototype).zb=function(t,e){var n={idToken:t},r=[];return ft(ls,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),Js(this,js,n)},e.rb=function(t,e){return yt(t={requestType:"PASSWORD_RESET",email:t},e),Js(this,Rs,t)},e.sb=function(t,e){return yt(t={requestType:"EMAIL_SIGNIN",email:t},e),Js(this,Ps,t)},e.qb=function(t,e){return yt(t={requestType:"VERIFY_EMAIL",idToken:t},e),Js(this,As,t)},e.Ab=function(t,e,n){return yt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),Js(this,Os,t)},e.cb=function(t){return Js(this,Qs,t)},e.jb=function(t,e){return Js(this,Ms,{oobCode:t,newPassword:e})},e.Pa=function(t){return Js(this,_s,{oobCode:t})},e.fb=function(t){return Js(this,bs,{oobCode:t})};var bs={endpoint:"setAccountInfo",A:ms,Y:"email",C:!0},_s={endpoint:"resetPassword",A:ms,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new S("internal-error")},C:!0},ws={endpoint:"signupNewUser",A:function(t){if(as(t),!t.password)throw new S("weak-password")},G:us,U:!0,C:!0},Es={endpoint:"createAuthUri",C:!0},Ts={endpoint:"deleteAccount",M:["idToken"]},Is={endpoint:"setAccountInfo",M:["idToken","deleteProvider"],A:function(t){if("array"!=f(t.deleteProvider))throw new S("internal-error")}},Ss={endpoint:"emailLinkSignin",M:["email","oobCode"],A:as,G:us,U:!0,C:!0},Cs={endpoint:"emailLinkSignin",M:["idToken","email","oobCode"],A:as,G:us,U:!0},ks={endpoint:"accounts/mfaEnrollment:finalize",M:["idToken","phoneVerificationInfo"],A:hs,G:us,C:!0,La:!0},Ns={endpoint:"accounts/mfaSignIn:finalize",M:["mfaPendingCredential","phoneVerificationInfo"],A:hs,G:us,C:!0,La:!0},xs={endpoint:"getAccountInfo"},Ps={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new S("internal-error");as(t)},Y:"email",C:!0},As={endpoint:"getOobConfirmationCode",M:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new S("internal-error")},Y:"email",C:!0},Os={endpoint:"getOobConfirmationCode",M:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new S("internal-error")},Y:"email",C:!0},Rs={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new S("internal-error");as(t)},Y:"email",C:!0},Ds={hb:!0,endpoint:"getProjectConfig",Rb:"GET"},Ls={hb:!0,endpoint:"getRecaptchaParam",Rb:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new S("internal-error")}},Ms={endpoint:"resetPassword",A:ms,Y:"email",C:!0},Fs={endpoint:"sendVerificationCode",M:["phoneNumber","recaptchaToken"],Y:"sessionInfo",C:!0},js={endpoint:"setAccountInfo",M:["idToken"],A:ss,U:!0},Us={endpoint:"setAccountInfo",M:["idToken"],A:function(t){if(ss(t),!t.password)throw new S("weak-password")},G:us,U:!0},Vs={endpoint:"signupNewUser",G:us,U:!0,C:!0},qs={endpoint:"accounts/mfaEnrollment:start",M:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phone
2EnrollmentInfo)throw new S("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new S("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new S("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new S("internal-error")},C:!0,La:!0},Bs={endpoint:"accounts/mfaSignIn:start",M:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new S("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new S("internal-error")},C:!0,La:!0},Ws={endpoint:"verifyAssertion",A:fs,Wa:ps,G:ds,U:!0,C:!0},zs={endpoint:"verifyAssertion",A:fs,Wa:ps,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new S("user-not-found");if(t.errorMessage)throw Zs(t.errorMessage);us(t)},U:!0,C:!0},Hs={endpoint:"verifyAssertion",A:function(t){if(fs(t),!t.idToken)throw new S("internal-error")},Wa:ps,G:ds,U:!0},Gs={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new S("invalid-custom-token")},G:us,U:!0,C:!0},Ks={endpoint:"verifyPassword",A:function(t){if(as(t),!t.password)throw new S("wrong-password")},G:us,U:!0,C:!0},Qs={endpoint:"verifyPhoneNumber",A:cs,G:us,C:!0},Ys={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new S("internal-error");cs(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",zo(t);us(t)}},Xs={Eb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:cs,G:us,C:!0},$s={endpoint:"accounts/mfaEnrollment:withdraw",M:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[Ya]^!!t.refreshToken)throw new S("internal-error")},C:!0,La:!0};function Js(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(void 0===r||null===r||""===r)return!1}return!0}(n,e.M))return ke(new S("internal-error"));var r,i=!!e.La,o=e.Rb||"POST";return Ce(n).then(e.A).then((function(){return e.U&&(n.returnSecureToken=!0),e.C&&t.b&&"undefined"===typeof n.tenantId&&(n.tenantId=t.b),os(t,i?t.l:t.h,e.endpoint,o,n,e.Eb,e.hb||!1)})).then((function(t){return r=t,e.Wa?e.Wa(n,r):r})).then(e.G).then((function(){if(!e.Y)return r;if(!(e.Y in r))throw new S("internal-error");return r[e.Y]}))}function Zs(t){return tu({error:{errors:[{message:t}],code:400,message:t}})}function tu(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 S(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",yt(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_
2NONCE:"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 S(r[i],e);return!e&&t&&(e=Or(t)),new S("internal-error",e)}function eu(t){this.b=t,this.a=null,this.nb=function(t){return(ou||(ou=new be((function(t,e){function n(){Fr(),Cr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){Fr(),e(Error("Network Error"))},timeout:ru.get()})}if(Cr("gapi.iframes.Iframe"))t();else if(Cr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[r]=function(){Cr("gapi.load")?n():e(Error("Network Error"))},Ce(Va(r=St(nu,{onload:r}))).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw ou=null,t})))).then((function(){return new be((function(e,n){Cr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:Cr("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"))}),iu.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var nu=new mt(wt,"https://apis.google.com/js/api.js?onload=%{onload}"),ru=new jr(3e4,6e4),iu=new jr(5e3,15e3),ou=null;function au(t,e,n){this.i=t,this.g=e,this.h=n,this.f=null,this.a=jn(this.i,"/__/auth/iframe"),Ln(this.a,"apiKey",this.g),Ln(this.a,"appName",this.h),this.b=null,this.c=[]}function su(t,e,n,r,i){this.s=t,this.m=e,this.c=n,this.u=r,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function uu(t){try{return r.a.app(t).auth().Ea()}catch(e){return[]}}function cu(t,e,n,r,i){this.u=t,this.f=e,this.b=n,this.c=r||null,this.h=i||null,this.m=this.s=this.w=null,this.g=[],this.l=this.a=null}function lu(t){var e=sr();return function(t){return Js(t,Ds,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=Fn(e),r=n.f;n=n.b;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=Fn(o).b==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:fr.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 Bo(sr())}
2))}function hu(t){return t.l||(t.l=dr().then((function(){if(!t.s){var e=t.c,n=t.h,r=uu(t.b),i=new au(t.u,t.f,t.b);i.f=e,i.b=n,i.c=$(r||[]),t.s=i.toString()}t.i=new eu(t.s),function(t){if(!t.i)throw Error("IfcHandler must be initialized!");!function(t,e){t.nb.then((function(){t.a.register("authEvent",e,Cr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.i,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=jo(e.authEvent),n=0;n<t.g.length;n++)r=t.g[n](e)||r;return(n={}).status=r?"ACK":"ERROR",Ce(n)}return n.status="ERROR",Ce(n)}))}(t)}))),t.l}function fu(t){return t.m||(t.w=t.c?Ir(t.c,uu(t.b)):null,t.m=new Ka(t.f,A(t.h),t.w)),t.m}function pu(t,e,n,r,i,o,a,s,u,c,l){return(t=new su(t,e,n,r,i)).l=o,t.g=a,t.i=s,t.b=dt(u||null),t.f=c,t.ub(l).toString()}function du(t){if(this.a=t||r.a.INTERNAL.reactNative&&r.a.INTERNAL.reactNative.AsyncStorage,!this.a)throw new S("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function vu(t){this.b=t,this.a={},this.f=w(this.c,this)}au.prototype.toString=function(){return this.f?Ln(this.a,"v",this.f):Xn(this.a.a,"v"),this.b?Ln(this.a,"eid",this.b):Xn(this.a.a,"eid"),this.c.length?Ln(this.a,"fw",this.c.join(",")):Xn(this.a.a,"fw"),this.a.toString()},su.prototype.ub=function(t){return this.h=t,this},su.prototype.toString=function(){var t=jn(this.s,"/__/auth/handler");if(Ln(t,"apiKey",this.m),Ln(t,"appName",this.c),Ln(t,"authType",this.u),this.a.isOAuthProvider){var e=this.a;try{var n=r.a.app(this.c).auth().ja()}catch(u){n=null}for(var i in e.kb=n,Ln(t,"providerId",this.a.providerId),n=Rr((e=this.a).Fb))n[i]=n[i].toString();i=e.Oc,n=dt(n);for(var o=0;o<i.length;o++){var a=i[o];a in n&&delete n[a]}e.lb&&e.kb&&!n[e.lb]&&(n[e.lb]=e.kb),pt(n)||Ln(t,"customParameters",Or(n))}if("function"===typeof this.a.Nb&&((e=this.a.Nb()).length&&Ln(t,"scopes",e.join(","))),this.l?Ln(t,"redirectUrl",this.l):Xn(t.a,"redirectUrl"),this.g?Ln(t,"eventId",this.g):Xn(t.a,"eventId"),this.i?Ln(t,"v",this.i):Xn(t.a,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Mn(t,s)&&Ln(t,s,this.b[s]);return this.h?Ln(t,"tid",this.h):Xn(t.a,"tid"),this.f?Ln(t,"eid",this.f):Xn(t.a,"eid"),(s=uu(this.c)).length&&Ln(t,"fw",s.join(",")),t.toString()},(e=cu.prototype).Lb=function(t,e,n){var r=new S("popup-closed-by-user"),i=new S("web-storage-unsupported"),o=this,a=!1;return this.ka().then((function(){(function(t){var e={type:"webStorageSupport"};return hu(t).then((function(){return function(t,e){return t.nb.then((function(){return new be((function(n){t.a.send(e.type,e,n,Cr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.i,e)})).then((function(t){if(t&&t.length&&"undefined"!==typeof t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&lr(t),e(i),a=!0)}))})).o((function(){})).then((function(){if(!a)return function(t){return new be((function(e){return function n(){In(2e3).then((function(){if(t&&!t.closed)return n();e()}))}()}))}(t)})).then((function(){if(!a)return In(n).then((function(){e(r)}))}))},e.Ub=function(){var t=Sr();return!Ar(t)&&!Mr(t)},e.Qb=function(){return!1}
2,e.Jb=function(t,e,n,r,i,o,a,s){if(!t)return ke(new S("popup-blocked"));if(a&&!Ar())return this.ka().o((function(e){lr(t),i(e)})),r(),Ce();this.a||(this.a=lu(fu(this)));var u=this;return this.a.then((function(){var e=u.ka().o((function(e){throw lr(t),i(e),e}));return r(),e})).then((function(){(Mo(n),a)||ur(pu(u.u,u.f,u.b,e,n,null,o,u.c,void 0,u.h,s),t)})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},e.Kb=function(t,e,n,r){this.a||(this.a=lu(fu(this)));var i=this;return this.a.then((function(){Mo(e),ur(pu(i.u,i.f,i.b,t,e,sr(),n,i.c,void 0,i.h,r))})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},e.ka=function(){var t=this;return hu(this).then((function(){return t.i.nb})).o((function(){throw t.a=null,new S("network-request-failed")}))},e.Xb=function(){return!0},e.Ca=function(t){this.g.push(t)},e.Qa=function(t){Y(this.g,(function(e){return e==t}))},(e=du.prototype).get=function(t){return Ce(this.a.getItem(t)).then((function(t){return t&&Dr(t)}))},e.set=function(t,e){return Ce(this.a.setItem(t,Or(e)))},e.T=function(t){return Ce(this.a.removeItem(t))},e.ba=function(){},e.ha=function(){};var yu,gu=[];function mu(t,e,n){pt(t.a)&&t.b.addEventListener("message",t.f),"undefined"===typeof t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function bu(t){this.a=t}function _u(t){this.c=t,this.b=!1,this.a=[]}function wu(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return ke(Error("connection_unavailable"));var l=r?800:50,h="undefined"!==typeof MessageChannel?new MessageChannel:null;return new be((function(n,r){h?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),l),c={messageChannel:h,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),"undefined"!==typeof t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}},t.a.push(c),h.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[h.port2])):r(Error("connection_unavailable"))})).then((function(e){return Eu(t,c),e})).o((function(e){throw Eu(t,c),e}))}function Eu(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 Tu(){if(!Cu())throw new S("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.u=u.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.s=!1,this.h=null;var t=this;gr()&&self?(this.l=function(){var t=gr()?self:null;if(W(gu,(function(n){n.b==t&&(e=n)})),!e){var e=new vu(t);gu.push(e)}return e}(),mu(this.l,"keyChanged",(function(e,n){return Au(t).then((function(e){return 0<e.length&&W(t.a,(function(t){t(e)})),{keyProcessed:K(e,n.key)}}))})),mu(this.l,"ping",(function(){return Ce(["keyChanged"])}))):function(){var t=u.navigator;return t&&t.serviceWorker?Ce().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):Ce(null)}().then((function(e){(t.h=e)&&(t.g=new _u(new bu(e)),wu(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&K(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function Iu(t){return new be((function(e,n){var r=t.u.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new be((function(e,n){var r=t.u.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(t).then((function(){return Iu(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Su(t){return t.m||(t.m=Iu(t)),t.m}function Cu(){try{return!!u.indexedDB}catch(oa){return!1}}function ku(t){return t.objectStore("firebaseLocalStorage")}function Nu(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function xu(t){return new be((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function Pu(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?wu(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):Ce()}function Au(t){return Su(t).then((function(t){var e=ku(Nu(t,!1));return e.getAll?xu(e.getAll()):new be((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=function t(e,n){var r,i=[];for(r in e)r in n?typeof e[r]!=typeof n[r]?i.push(r):"object"==typeof e[r]&&null!=e[r]&&null!=n[r]?0<t(e[r],n[r]).length&&i.push(r):e[r]!==n[r]&&i.push(r):i.push(r);for(r in n)r in e||i.push(r);return i}(t.c,n),t.c=n}return r}))}function Ou(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Ru(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=Ce().then((function(){if(Cu()){var t=Lr(),r="__sak"+t;return yu||(yu=new Tu),(n=yu).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.T(r)})).then((function(){return n})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ba((function(t){W(e.a,(function(e){e(t)}))}
2)),t}))}function Du(){this.a={},this.type="inMemory"}function Lu(){if(!function(){var t="Node"==mr();if(!(t=Mu()||t&&r.a.INTERNAL.node&&r.a.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==mr())throw new S("internal-error","The LocalStorage compatibility library was not found.");throw new S("web-storage-unsupported")}this.a=Mu()||r.a.INTERNAL.node.localStorage,this.type="localStorage"}function Mu(){try{var t=u.localStorage,e=Lr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Fu(){this.type="nullStorage"}function ju(){if(!function(){var t="Node"==mr();if(!(t=Uu()||t&&r.a.INTERNAL.node&&r.a.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==mr())throw new S("internal-error","The SessionStorage compatibility library was not found.");throw new S("web-storage-unsupported")}this.a=Uu()||r.a.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Uu(){try{var t=u.sessionStorage,e=Lr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Vu(){var t={};t.Browser=Wu,t.Node=zu,t.ReactNative=Hu,t.Worker=Gu,this.a=t[mr()]}vu.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=[];W(r,(function(e){i.push(Ce().then((function(){return e(t.origin,t.data.data)})))})),xe(i).then((function(r){var i=[];W(r,(function(t){i.push({fulfilled:t.Mb,value:t.value,reason:t.reason?t.reason.message:void 0})})),W(i,(function(t){for(var e in t)"undefined"===typeof t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},bu.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},_u.prototype.close=function(){for(;0<this.a.length;)Eu(this,this.a[0]);this.b=!0},(e=Tu.prototype).set=function(t,e){var n,r=!1,i=this;return Su(this).then((function(e){return xu((e=ku(Nu(n=e,!0))).get(t))})).then((function(o){var a=ku(Nu(n,!0));return o?(o.value=e,xu(a.put(o))):(i.b++,r=!0,(o={}).fbase_key=t,o.value=e,xu(a.add(o)))})).then((function(){return i.c[t]=e,Pu(i,t)})).ma((function(){r&&i.b--}))},e.get=function(t){return Su(this).then((function(e){return xu(ku(Nu(e,!1)).get(t))})).then((function(t){return t&&t.value}))},e.T=function(t){var e=!1,n=this;return Su(this).then((function(r){return e=!0,n.b++,xu(ku(Nu(r,!0)).delete(t))})).then((function(){return delete n.c[t],Pu(n,t)})).ma((function(){e&&n.b--}))},e.ba=function(t){0==this.a.length&&function(t){Ou(t),function e(){t.f=setTimeout((function(){t.i=Au(t).then((function(e){0<e.length&&W(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}()}(this),this.a.push(t)},e.ha=function(t){Y(this.a,(function(e){return e==t})),0==this.a.length&&Ou(this)},(e=Ru.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},e.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},e.T=function(t){return this.b.then((function(e){return e.T(t)}))},e.ba=function(t){this.a.push(t)},e.ha=function(t){Y(this.a,(function(e){return e==t}))},(e=Du.prototype).get=function(t){return Ce(this.a[t])},e.set=function(t,e){return this.a[t]=e,Ce()},e.T=function(t){return delete this.a[t],Ce()},e.ba=function(){},e.ha=function(){},(e=Lu.prototype).get=function(t){var e=this;return Ce().then((function(){return Dr(e.a.getItem(t))}))},e.set=function(t,e){var n=this;return Ce().then((function(){var r=Or(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return Ce().then((function(){e.a.removeItem(t)}))},e.ba=function(t){u.window&&sn(u.window,"storage",t)},e.ha=function(t){u.window&&ln(u.window,"storage",t)},(e=Fu.prototype).get=function(){return Ce(null)},e.set=function(){return Ce()},e.T=function(){return Ce()},e.ba=function(){},e.ha=function(){},(e=ju.prototype).get=function(t){var e=this;return Ce().then((function(){return Dr(e.a.getItem(t))}))},e.set=function(t,e){var n=this;return Ce().then((function(){var r=Or(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return Ce().then((function(){e.a.removeItem(t)}))},e.ba=function(){},e.ha=function(){};var qu,Bu,Wu={F:Lu,$a:ju},zu={F:Lu,$a:ju},Hu={F:du,$a:Fu},Gu={F:Lu,$a:Fu},Ku={od:"local",NONE:"none",qd:"session"};function Qu(){var t=!(Mr(Sr())||!yr()),e=Ar(),n=kr();this.m=t,this.h=e,this.l=n,this.a={},qu||(qu=new Vu),t=qu;try{this.g=!ar()&&qr()||!u.indexedDB?new t.a.F:new Ru(gr()?new Du:new t.a.F)}catch(r){this.g=new Du,this.h=!0}try{this.i=new t.a.$a}catch(r){this.i=new Du}this.u=new Du,this.f=w(this.Vb,this),this.b={}}function Yu(){return Bu||(Bu=new Qu),Bu}function Xu(t,e){switch(e){case"session":return t.i;case"none":return t.u;default:return t.g}}function $u(t,e){return"firebase:"+t.name+(e?":"+e:"")}function Ju(t,e,n){return n=$u(e,n),"local"==e.F&&(t.b[n]=null),Xu(t,e.F).T(n)}function Zu(t){t.c&&(clearInterval(t.c),t.c=null)}function tc(t){this.a=t,this.b=Yu()}(e=Qu.prototype).get=function(t,e){return Xu(this,t.F).get($u(t,e))},e.set=function(t,e,n){var r=$u(t,n),i=this,o=Xu(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},e.addListener=function(t,e,n){t=$u(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),pt(this.a)&&(Xu(this,"local").ba(this.f),this.h||(ar()||!qr())&&u.indexedDB||!this.l||function(t){Zu(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 Ye({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Vb(n))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},e.removeListener=function(t,e,n){t=$u(t,e),this.a[t]&&(Y(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),pt(this.a)&&(Xu(this,"local").ha(this.f),Zu(this))},e.Vb=function(t){if(t&&t.f){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];"undefined"===typeof r&&(r=null);var i=u.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.ib(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if("undefined"!==typeof t.a.a?Xu(this,"local").ha(this.f):Zu(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&&"undefined"===typeof t.a.a)return;var o=this;n=function(){"undefined"===typeof t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.ib(e))},Gt&&ee&&10==ee&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}
2else W(t,w(this.ib,this))},e.ib=function(t){this.a[t]&&W(this.a[t],(function(t){t()}))};var ec,nc={name:"authEvent",F:"local"};function rc(){this.a=Yu()}function ic(t,e){this.b=oc,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===ec&&(ec=u.Int32Array?new Int32Array(fc):fc),this.reset()}I(ic,(function(){this.b=-1}));for(var oc=64,ac=oc-1,sc=[],uc=0;uc<ac;uc++)sc[uc]=0;var cc=X(128,sc);function lc(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],l=0|t.a[5],h=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&l^~c&h)+(0|ec[e])|0)+(0|n[e])|0)|0,o=h,h=l,l=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]+l|0,t.a[6]=t.a[6]+h|0,t.a[7]=t.a[7]+o|0}function hc(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&&(lc(t),i=0);else{if(!p(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&&(lc(t),i=0)}}t.c=i,t.g+=n}ic.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):$(this.h)};var fc=[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 pc(){ic.call(this,8,dc)}I(pc,ic);var dc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function vc(t,e,n,r,i){this.u=t,this.i=e,this.l=n,this.m=r||null,this.s=i||null,this.h=e+":"+n,this.w=new rc,this.g=new tc(this.h),this.f=null,this.b=[],this.a=this.c=null}function yc(t){return new S("invalid-cordova-configuration",t)}function gc(t){var e=new pc;hc(e,t),t=[];var n=8*e.g;56>e.c?hc(e,cc,56-e.c):hc(e,cc,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(lc(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 H(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}function mc(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function bc(t){return t.f||(t.f=t.ka().then((function(){return new be((function(e){t.Ca((function n(r){return e(r),t.Qa(n),!1})),function(t){function e(e){r=!0,i&&i.cancel(),_c(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;-1!=(i=eo(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"===typeof(o=Dr(Mn(o=Fn(i),"firebaseError")||null))?C(o):null)?new Fo(r.c,r.b,null,null,o,null,r.S()):new Fo(r.c,r.b,i,r.f,null,null,r.S())),i=o||n}mc(t,i)}))}var n=new Fo("unknown",null,null,null,new S("no-auth-event")),r=!1,i=In(500).then((function(){return _c(t).then((function(){r||mc(t,n)}))})),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(Cr("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"===typeof o)try{o(t)}catch(n){console.error(n)}},qo||(qo=new Uo),function(t){var e=qo;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=Cr("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)}))}))),t.f}function _c(t){var e=null;return function(t){return t.b.get(nc,t.a).then((function(t){return jo(t)}))}(t.g).then((function(n){return e=n,Ju((n=t.g).b,nc,n.a)})).then((function(){return e}))}function wc(t){this.a=t,this.b=Yu()}(e=vc.prototype).ka=function(){return this.Ga?this.Ga:this.Ga=(vr(void 0)?dr().then((function(){return new be((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)}))})):ke(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!==typeof Cr("universalLinks.subscribe",u))throw yc("cordova-universal-links-plugin-fix is not installed");if("undefined"===typeof Cr("BuildInfo.packageName",u))throw yc("cordova-plugin-buildinfo is not installed");if("function"!==typeof Cr("cordova.plugins.browsertab.openUrl",u))throw yc("cordova-plugin-browsertab is not installed");if("function"!==typeof Cr("cordova.InAppBrowser.open",u))throw yc("cordova-plugin-inappbrowser is not installed")}),(function(){throw new S("cordova-not-ready")}))},e.Lb=function(t,e){return e(new S("operation-not-supported-in-this-environment")),Ce()},e.Jb=function(){return ke(new S("operation-not-supported-in-this-environment"))},e.Xb=function(){return!1},e.Ub=function(){return!0},e.Qb=function(){return!0},e.Kb=function(t,e,n,r){if(this.c)return ke(new S("redirect-operation-pending"));var i=this,o=u.document,a=null,s=null,c=null,l=null;return this.c=Ce().then((function(){return Mo(e),bc(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 Fo(e,r,null,o,new S("no-auth-event"),null,i),s=Cr("BuildInfo.packageName",u);if("string"!==typeof s)throw new S("invalid-cordova-configuration");var c=Cr("BuildInfo.displayName",u),l={};if(Sr().toLowerCase().match(/iphone|ipad|ipod/))l.ibi=s;else{if(!Sr().toLowerCase().match(/android/))return ke(new S("operation-not-supported-in-this-environment"));l.apn=s}c&&(l.appDisplayName=c),o=gc(o),l.sessionId=o;var h=pu(t.u,t.i,t.l,e,n,null,r,t.m,l,t.s,i);return t.ka().then((function(){var e=t.h;return t.w.a.set(nc,a.v(),e)})).then((function(){var e=Cr("cordova.plugins.browsertab.isAvailable",u);if("function"!==typeof e)throw new S("invalid-cordova-configuration");var n=null;e((function(e){if(e){if("function"!==typeof(n=Cr("cordova.plugins.browsertab.openUrl",u)))throw new S("invalid-cordova-configuration");n(h)}else{if("function"!==typeof(n=Cr("cordova.InAppBrowser.open",u)))throw new S("invalid-cordova-configuration");e=Sr(),t.a=n(h,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 be((function(t,e){s=function(){var e=Cr("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.Ca(s),c=function(){a||(a=In(2e3).then((function(){e(new S("redirect-cancelled-by-user"))})))},l=function(){Ur()&&c()},o.addEventListener("resume",c,!1),Sr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",l,!1)})).o((function(t){return _c(i).then((function(){throw t}))}))})).ma((function(){c&&o.removeEventListener("resume",c,!1),l&&o.removeEventListener("visibilitychange",l,!1),a&&a.cancel(),s&&i.Qa(s),i.c=null}))},e.Ca=function(t){this.b.push(t),bc(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Fo("unknown",null,null,null,new S("no-auth-event")),t(e))}))},e.Qa=function(t){Y(this.b,(function(e){return e==t}))};var Ec={name:"pendingRedirect",F:"session"};function Tc(t){return Ju(t.b,Ec,t.a)}function Ic(t,e,n){this.i={},this.w=0,this.D=t,this.u=e,this.m=n,this.h=[],this.f=!1,this.l=w(this.s,this),this.b=new jc,this.B=new Wc,this.g=new wc(this.u
2+":"+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.B,this.c.linkViaPopup=this.B,this.c.reauthViaPopup=this.B,this.a=Sc(this.D,this.u,this.m,k)}function Sc(t,e,n,i){var o=r.a.SDK_VERSION||null;return vr()?new vc(t,e,n,o,i):new cu(t,e,n,o,i)}function Cc(t){t.f||(t.f=!0,t.a.Ca(t.l));var e=t.a;return t.a.ka().o((function(n){throw t.a==e&&t.reset(),n}))}function kc(t){t.a.Ub()&&Cc(t).o((function(e){var n=new Fo("unknown",null,null,null,new S("operation-not-supported-in-this-environment"));Rc(e)&&t.s(n)})),t.a.Qb()||Uc(t.b)}function Nc(t,e){K(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(Ec,t.a).then((function(t){return"pending"==t}))}(t.g).then((function(e){e?Tc(t.g).then((function(){Cc(t).o((function(e){var n=new Fo("unknown",null,null,null,new S("operation-not-supported-in-this-environment"));Rc(e)&&t.s(n)}))})):kc(t)})).o((function(){kc(t)}))}function xc(t,e){Y(t.h,(function(t){return t==e}))}Ic.prototype.reset=function(){this.f=!1,this.a.Qa(this.l),this.a=Sc(this.D,this.u,this.m),this.i={}},Ic.prototype.s=function(t){if(!t)throw new S("invalid-auth-event");if(6e5<=T()-this.w&&(this.i={},this.w=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.Cb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.w=T())),e=!0;break}}return Uc(this.b),e};var Pc=new jr(2e3,1e4),Ac=new jr(3e4,6e4);function Oc(t,e,n,r,i,o,a){return t.a.Jb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ca(t.l))}),(function(){t.reset()}),i,o,a)}function Rc(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Dc(t,e,n,r,i){var o;return function(t){return t.b.set(Ec,"pending",t.a)}(t.g).then((function(){return t.a.Kb(e,n,r,i).o((function(e){if(Rc(e))throw new S("operation-not-supported-in-this-environment");return o=e,Tc(t.g).then((function(){throw o}))})).then((function(){return t.a.Xb()?new be((function(){})):Tc(t.g).then((function(){return t.pa()})).then((function(){})).o((function(){}))}))}))}function Lc(t,e,n,r,i){return t.a.Lb(r,(function(t){e.la(n,null,t,i)}),Pc.get())}Ic.prototype.pa=function(){return this.b.pa()};var Mc={};function Fc(t,e,n){var r=e+":"+n;return Mc[r]||(Mc[r]=new Ic(t,e,n)),Mc[r]}function jc(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Uc(t){t.g||(t.g=!0,Bc(t,!1,null,null))}function Vc(t){t.g&&!t.i&&Bc(t,!1,null,null)}function qc(t,e){if(t.b=function(){return Ce(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Bc(t,e,n,r){e?r?function(t,e){if(t.b=function(){return ke(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):qc(t,n):qc(t,{user:null}),t.f=[],t.c=[]}function Wc(){}function zc(){this.Bb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.Bb},set:function(t){this.Bb=t},enumerable:!1})}function Hc(t,e){this.a=e,Gr(this,"verificationId",t)}function Gc(t,e,n,r){return new Ro(t).cb(e,n).then((function(t){return new Hc(t,r)}))}function Kc(t){var e=qi(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new S("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Kr(this,{token:t,expirationTime:Vr(1e3*e.exp),authTime:Vr(1e3*e.auth_time),issuedAtTime:Vr(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 Qc(t,e,n){var r=e&&e[Xc];if(!r)throw new S("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=dt(e),this.g=n,this.c=new no(null,r),this.b=[];var i=this;W(e[Yc]||[],(function(t){(t=$r(t))&&i.b.push(t)})),Gr(this,"auth",this.a),Gr(this,"session",this.c),Gr(this,"hints",this.b)}jc.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},jc.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?(Bc(this,!0,null,t.a),Ce()):e.Da(n,r)?function(t,e,n){n=n.Da(e.c,e.b);var r=e.g,i=e.f,o=e.i,a=e.S(),s=!!e.c.match(/Redirect$/);n(r,i,a,o).then((function(e){Bc(t,s,e,null)})).o((function(e){Bc(t,s,null,e)}))}(this,t,e):ke(new S("invalid-auth-event")):(Bc(this,!1,null,null),Ce())}
2else ke(new S("invalid-auth-event"))},jc.prototype.pa=function(){var t=this;return new be((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new S("timeout");t.a&&t.a.cancel(),t.a=In(Ac.get()).then((function(){t.b||(t.g=!0,Bc(t,!0,null,e))}))}(t))}))},Wc.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.la(t.c,null,t.a,t.b),Ce()):e.Da(n,r)?function(t,e){var n=t.b,r=t.c;e.Da(r,n)(t.g,t.f,t.S(),t.i).then((function(t){e.la(r,t,null,n)})).o((function(t){e.la(r,null,t,n)}))}(t,e):ke(new S("invalid-auth-event"))}else ke(new S("invalid-auth-event"))},Hc.prototype.confirm=function(t){return t=Do(this.verificationId,t),this.a(t)};var Yc="mfaInfo",Xc="mfaPendingCredential";function $c(t,e,n,r){S.call(this,"multi-factor-auth-required",r,e),this.b=new Qc(t,e,n),Gr(this,"resolver",this.b)}function Jc(t,e,n){if(t&&v(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new $c(e,t.serverResponse,n,t.message)}catch(r){}return null}function Zc(){}function tl(t){Gr(this,"factorId",t.ea),this.a=t}function el(t){if(tl.call(this,t),this.a.ea!=Ro.PROVIDER_ID)throw new S("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function nl(t,e){for(var n in Qe.call(this,t),e)this[n]=e[n]}function rl(t,e){this.a=t,this.b=[],this.c=w(this.wc,this),sn(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&W(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};if(t){t.uid&&(r[ti]=t.uid),t.displayName&&(r[Jr]=t.displayName),t.enrollmentTime&&(r[Zr]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[ei]=t.phoneNumber);try{e=new ni(r)}catch(i){}t=e}else t=null;t&&n.push(t)})),il(this,n)}function il(t,e){t.b=e,Gr(t,"enrolledFactors",e)}function ol(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 al(t){this.c=t,this.b=this.a=null}function sl(t){return t.b&&1e3*t.b.c||0}function ul(t,e){var n=e.refreshToken;t.b=Vi(e[Ya]||""),t.a=n}function cl(t,e){return function(t,e){return new be((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?ns(t,t.u+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(tu(t)):t.access_token&&t.refresh_token?n(t):r(new S("internal-error")):r(new S("network-request-failed"))}),"POST",Yn(e).toString(),t.g,t.m.get()):r(new S("internal-error"))}))}(t.c,e).then((function(e){return t.b=Vi(e.access_token),t.a=e.refresh_token,{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}function ll(t,e){this.a=t||null,this.b=e||null,Kr(this,{lastSignInTime:Vr(e||null),creationTime:Vr(t||null)})}function hl(t,e,n,r,i,o){Kr(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function fl(t,e,n){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null,t=r.a.SDK_VERSION?Ir(r.a.SDK_VERSION):null,this.a=new Ka(this.l,A(k),t),this.b=new al(this.a),bl(this,e[Ya]),ul(this.b,e),Gr(this,"refreshToken",this.b.a),El(this,n||{}),bn.call(this),this.P=!1,this.s&&Nr()&&(this.i=Fc(this.s,this.l,this.m)),this.R=[],this.h=null,this.B=function(t){return new ol((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=sl(t.b)-T()-3e5;return 0<e?e:0}))}(this),this.Z=w(this.Ma,this);var i=this;this.oa=null,this.za=function(t){i.va(t.g)},this.aa=null,this.W=[],this.ya=function(t){dl(i,t.c)},this.$=null,this.O=new rl(this,n),Gr(this,"multiFactor",this.O)}function pl(t,e){t.aa&&ln(t.aa,"languageCodeChanged",t.za),(t.aa=e)&&sn(e,"languageCodeChanged",t.za)}function dl(t,e){t.W=e,es(t.a,r.a.SDK_VERSION?Ir(r.a.SDK_VERSION,t.W):null)}function vl(t,e){t.$&&ln(t.$,"frameworkChanged",t.ya),(t.$=e)&&sn(e,"frameworkChanged",t.ya)}function yl(t){try{return r.a.app(t.m).auth()}catch(e){throw new S("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function gl(t){t.D||t.B.b||(t.B.start(),ln(t,"tokenChanged",t.Z),sn(t,"tokenChanged",t.Z))}function ml(t){ln(t,"tokenChanged",t.Z),t.B.stop()}function bl(t,e){t.xa=e,Gr(t,"_lat",e)}function _l(t){for(var e=[],n=0;n<t.R.length;n++)e.push(t.R[n](t));return xe(e).then((function(){return t}))}function wl(t){t.i&&!t.P&&(t.P=!0,Nc(t.i,t))}function El(t,e){Kr(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.ph
2otoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new ll(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Tl(){}function Il(t){return Ce().then((function(){if(t.D)throw new S("app-deleted")}))}function Sl(t){return H(t.providerData,(function(t){return t.providerId}))}function Cl(t,e){e&&(kl(t,e.providerId),t.providerData.push(e))}function kl(t,e){Y(t.providerData,(function(t){return t.providerId==e}))}function Nl(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Gr(t,e,n)}function xl(t,e){t!=e&&(Kr(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?Gr(t,"metadata",function(t){return new ll(t.a,t.b)}(e.metadata)):Gr(t,"metadata",new ll),W(e.providerData,(function(e){Cl(t,e)})),function(t,e){t.b=e.b,t.a=e.a}(t.b,e.b),Gr(t,"refreshToken",t.b.a),il(t.O,e.O.b))}function Pl(t){return t.I().then((function(e){var n=t.isAnonymous;return function(t,e){return Js(t.a,xs,{idToken:e}).then(w(t.Ic,t))}(t,e).then((function(){return n||Nl(t,"isAnonymous",!1),e}))}))}function Al(t,e){e[Ya]&&t.xa!=e[Ya]&&(ul(t.b,e),t.dispatchEvent(new nl("tokenChanged")),bl(t,e[Ya]),Nl(t,"refreshToken",t.b.a))}function Ol(t,e){return Pl(t).then((function(){if(K(Sl(t),e))return _l(t).then((function(){throw new S("provider-already-linked")}))}))}function Rl(t,e,n){return Qr({user:t,credential:Lo(e),additionalUserInfo:e=Gi(e),operationType:n})}function Dl(t,e){return Al(t,e),t.reload().then((function(){return t}))}function Ll(t,e,n,i,o){if(!Nr())return ke(new S("operation-not-supported-in-this-environment"));if(t.h&&!o)return ke(t.h);var a=Hi(n.providerId),s=Lr(t.uid+":::"),u=null;(!Ar()||yr())&&t.s&&n.isOAuthProvider&&(u=pu(t.s,t.l,t.m,e,n,null,s,r.a.SDK_VERSION||null,null,null,t.tenantId));var c=hr(u,a&&a.ta,a&&a.sa);return i=i().then((function(){if(Fl(t),!o)return t.I().then((function(){}))})).then((function(){return Oc(t.i,c,e,n,s,!!u,t.tenantId)})).then((function(){return new be((function(n,r){t.la(e,null,new S("cancelled-popup-request"),t.g||null),t.f=n,t.w=r,t.g=s,t.c=Lc(t.i,t,e,c,s)}))})).then((function(t){return c&&lr(c),t?Qr(t):null})).o((function(t){throw c&&lr(c),t})),jl(t,i,o)}function Ml(t,e,n,r,i){if(!Nr())return ke(new S("operation-not-supported-in-this-environment"));if(t.h&&!i)return ke(t.h);var o=null,a=Lr(t.uid+":::");return r=r().then((function(){if(Fl(t),!i)return t.I().then((function(){}))})).then((function(){return t.fa=a,_l(t)})).then((function(e){return t.ga&&(e=(e=t.ga).b.set(ql,t.v(),e.a)),e})).then((function(){return Dc(t.i,e,n,a,t.tenantId)})).o((function(e){if(o=e,t.ga)return Bl(t.ga);throw o})).then((function(){if(o)throw o})),jl(t,r,i)}function Fl(t){if(!t.i||!t.P){if(t.i&&!t.P)throw new S("internal-error");throw new S("auth-domain-config-required")}}function jl(t,e,n){var r=function(t,e,n){return t.h&&!n?(e.cancel(),ke(t.h)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.h||t.dispatchEvent(new nl("userInvalidated")),t.h=e),e}))}(t,e,n);return t.N.push(r),r.ma((function(){Q(t.N,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=Jc(e.v(),yl(t),w(t.hc,t))),n||e}))}function Ul(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[Ya]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=new fl(e,n,t);return t.providerData&&W(t.providerData,(function(t){t&&Cl(r,Qr(t))})),t.redirectEventId&&(r.fa=t.redirectEventId),r}function Vl(t){this.a=t,this.b=Yu()}Qc.prototype.Pc=function(t){var e=this;return t.ob(this.a.b,this.c).then((function(t){var n=dt(e.f);return delete n[Yc],delete n[Xc],yt(n,t),e.g(n)}))},I($c,S),Zc.prototype.ob=function(t,e,n){return e.type==ro?function(t,e,n,r){return n.Fa().then((function(n){return n={idToken:n},"undefined"!==typeof r&&(n.displayName=r),yt(n,{phoneVerificationInfo:Oo(t.a)}),Js(e,ks,n)}))}(this,t,e,n):function(t,e,n){return n.Fa().then((function(n){return yt(n={mfaPendingCredential:n},{phoneVerificationInfo:Oo(t.a)}),Js(e,Ns,n)}))}(this,t,e)},I(tl,Zc),I(el,tl),I(nl,Qe),(e=rl.prototype).wc=function(t){il(this,function(t){var e=[];return W(t.mfaInfo||[],(function(t){(t=$r(t))&&e.push(t)})),e}(t.ed))},e.Ob=function(){return this.a.I().then((function(t){return new no(t,null)}))},e.dc=function(t,e){var n=this,r=this.a.a;return this.Ob().then((function(n){return t.ob(r,n,e)})).then((function(t){return Al(n.a,t),n.a.reload()}))},e.$c=function(t){var e=this,n="string"===typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return Js(r,$s,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=z(e.b,(function(t){return t.uid!=n}));return il(e,r),Al(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},e.v=function(){return{multiFactor:{enrolledFactors:H(this.b,(function(t){return t.v()}
2))}}},ol.prototype.start=function(){this.a=this.c,function t(e,n){e.stop(),e.b=In(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)}(e,n)).then((function(){return function(){var t=u.document,e=null;return Ur()||!t?Ce():new be((function(n){e=function(){Ur()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return e.h()})).then((function(){t(e,!0)})).o((function(n){e.i(n)&&t(e,!1)}))}(this,!0)},ol.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},al.prototype.v=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:sl(this)}},al.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?ke(new S("user-token-expired")):t||!this.b||T()>sl(this)-3e4?this.a?cl(this,{grant_type:"refresh_token",refresh_token:this.a}):Ce(null):Ce({accessToken:this.b.toString(),refreshToken:this.a})},ll.prototype.v=function(){return{lastLoginAt:this.b,createdAt:this.a}},I(fl,bn),fl.prototype.va=function(t){this.oa=t,ts(this.a,t)},fl.prototype.ja=function(){return this.oa},fl.prototype.Ea=function(){return $(this.W)},fl.prototype.Ma=function(){this.B.b&&(this.B.stop(),this.B.start())},Gr(fl.prototype,"providerId","firebase"),(e=fl.prototype).reload=function(){var t=this;return jl(this,Il(this).then((function(){return Pl(t).then((function(){return _l(t)})).then(Tl)})))},e.mc=function(t){return this.I(t).then((function(t){return new Kc(t)}))},e.I=function(t){var e=this;return jl(this,Il(this).then((function(){return e.b.getToken(t)})).then((function(t){if(!t)throw new S("internal-error");return t.accessToken!=e.xa&&(bl(e,t.accessToken),e.dispatchEvent(new nl("tokenChanged"))),Nl(e,"refreshToken",t.refreshToken),t.accessToken})))},e.Ic=function(t){if(!(t=t.users)||!t.length)throw new S("internal-error");El(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?H(t,(function(t){return new hl(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)Cl(this,e[n]);Nl(this,"isAnonymous",!(this.email&&t.passwordHash)&&!(this.providerData&&this.providerData.length)),this.dispatchEvent(new nl("userReloaded",{ed:t}))},e.Jc=function(t){return zr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.pb(t)},e.pb=function(t){var e=this,n=null;return jl(this,t.c(this.a,this.uid).then((function(t){return Al(e,t),n=Rl(e,t,"reauthenticate"),e.h=null,e.reload()})).then((function(){return n})),!0)},e.Ac=function(t){return zr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.mb(t)},e.mb=function(t){var e=this,n=null;return jl(this,Ol(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=Rl(e,t,"link"),Dl(e,t)})).then((function(){return n})))},e.Bc=function(t,e){var n=this;return jl(this,Ol(this,"phone").then((function(){return Gc(yl(n),t,e,w(n.mb,n))})))},e.Kc=function(t,e){var n=this;return jl(this,Ce().then((function(){return Gc(yl(n),t,e,w(n.pb,n))})),!0)},e.xb=function(t){var e=this;return jl(this,this.I().then((function(n){return e.a.xb(n,t)})).then((function(t){return Al(e,t),e.reload()})))},e.cd=function(t){var e=this;return jl(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return Al(e,t),e.reload()})))},e.yb=function(t){var e=this;return jl(this,this.I().then((function(n){return e.a.yb(n,t)})).then((function(t){return Al(e,t),e.reload()})))},e.zb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Il(this);var e=this;return jl(this,this.I().then((function(n){return e.a.zb(n,{displayName:t.displayName,photoUrl:t.photoURL})}
2)).then((function(t){return Al(e,t),Nl(e,"displayName",t.displayName||null),Nl(e,"photoURL",t.photoUrl||null),W(e.providerData,(function(t){"password"===t.providerId&&(Gr(t,"displayName",e.displayName),Gr(t,"photoURL",e.photoURL))})),_l(e)})).then(Tl))},e.ad=function(t){var e=this;return jl(this,Pl(this).then((function(n){return K(Sl(e),t)?function(t,e,n){return Js(t,Is,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then((function(t){var n={};return W(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),W(Sl(e),(function(t){n[t]||kl(e,t)})),n[Ro.PROVIDER_ID]||Gr(e,"phoneNumber",null),_l(e)})):_l(e).then((function(){throw new S("no-such-provider")}))})))},e.delete=function(){var t=this;return jl(this,this.I().then((function(e){return Js(t.a,Ts,{idToken:e})})).then((function(){t.dispatchEvent(new nl("userDeleted"))}))).then((function(){for(var e=0;e<t.N.length;e++)t.N[e].cancel("app-deleted");pl(t,null),vl(t,null),t.N=[],t.D=!0,ml(t),Gr(t,"refreshToken",null),t.i&&xc(t.i,t)}))},e.Cb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.fa||null)==e||"reauthViaRedirect"==t&&(this.fa||null)==e)},e.la=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.w?this.w(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)},e.Da=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?w(this.Hb,this):"reauthViaPopup"==t&&e==(this.g||null)?w(this.Ib,this):"linkViaRedirect"==t&&(this.fa||null)==e?w(this.Hb,this):"reauthViaRedirect"==t&&(this.fa||null)==e?w(this.Ib,this):null},e.Cc=function(t){var e=this;return Ll(this,"linkViaPopup",t,(function(){return Ol(e,t.providerId).then((function(){return _l(e)}))}),!1)},e.Lc=function(t){return Ll(this,"reauthViaPopup",t,(function(){return Ce()}),!0)},e.Dc=function(t){var e=this;return Ml(this,"linkViaRedirect",t,(function(){return Ol(e,t.providerId)}),!1)},e.Mc=function(t){return Ml(this,"reauthViaRedirect",t,(function(){return Ce()}),!0)},e.Hb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return jl(this,this.I().then((function(n){return ys(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=Rl(i,t,"link"),Dl(i,t)})).then((function(){return o})))},e.Ib=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return jl(this,Ce().then((function(){return ao(gs(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=Rl(i,t,"reauthenticate"),Al(i,t),i.h=null,i.reload()})).then((function(){return o})),!0)},e.qb=function(t){var e=this,n=null;return jl(this,this.I().then((function(e){return n=e,"undefined"===typeof t||pt(t)?{}:Mi(new Ci(t))})).then((function(t){return e.a.qb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},e.Ab=function(t,e){var n=this,r=null;return jl(this,this.I().then((function(t){return r=t,"undefined"===typeof e||pt(e)?{}:Mi(new Ci(e))})).then((function(e){return n.a.Ab(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},e.hc=function(t){var e=null,n=this;return jl(this,t=ao(Ce(t),n.uid).then((function(t){return e=Rl(n,t,"reauthenticate"),Al(n,t),n.h=null,n.reload()})).then((function(){return e})),!0)},e.toJSON=function(){return this.v()},e.v=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.b.v(),redirectEventId:this.fa||null};return this.metadata&&yt(t,this.metadata.v()),W(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))})),yt(t,this.O.v()),t};var ql={name:"redirectUser",F:"session"};function Bl(t){return Ju(t.b,ql,t.a)}function Wl(t){this.a=t,this.b=Yu(),this.c=null,this.f=function(t){var e=Gl("local"),n=Gl("session"),r=Gl("none");return function(t,e,n){var r=$u(e,n),i=Xu(t,e.F);return t.get(e,n).then((function(o){var a=null;try{a=Dr(u.localStorage.getItem(r))}catch(s){}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(Hl,t.a).then((function(t){return t?Gl(t):e}))}))}))})).then((function(e){return t.c=e,zl(t,e.F)})).o((function(){t.c||(t.c=e)}))}(this),this.b.addListener(Gl("local"),this.a,w(this.g,this))}function zl(t,e){var n,r=[];for(n in Ku)Ku[n]!==e&&r.push(Ju(t.b,Gl(Ku[n]),t.a));return r.push(Ju(t.b,Hl,t.a)),function(t){return new be((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++)Ne(t[s],E(o,s),a);else e(i)}))}(r)}Wl.prototype.g=function(){var t=this,e=Gl("local");Xl(this,(function(){return Ce().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return zl(t,"local").then((function(){t.c=e}))}))}))};
2var Hl={name:"persistence",F:"session"};function Gl(t){return{name:"authUser",F:t}}function Kl(t,e){return Xl(t,(function(){return t.b.set(t.c,e.v(),t.a)}))}function Ql(t){return Xl(t,(function(){return Ju(t.b,t.c,t.a)}))}function Yl(t,e){return Xl(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),Ul(t||{})}))}))}function Xl(t,e){return t.f=t.f.then(e,e),t.f}function $l(t){if(this.l=!1,Gr(this,"settings",new zc),Gr(this,"app",t),!oh(this).options||!oh(this).options.apiKey)throw new S("invalid-api-key");t=r.a.SDK_VERSION?Ir(r.a.SDK_VERSION):null,this.b=new Ka(oh(this).options&&oh(this).options.apiKey,A(k),t),this.P=[],this.m=[],this.O=[],this.$b=r.a.INTERNAL.createSubscribe(w(this.xc,this)),this.W=void 0,this.ac=r.a.INTERNAL.createSubscribe(w(this.yc,this)),rh(this,null),this.i=new Wl(oh(this).options.apiKey+":"+oh(this).name),this.B=new Vl(oh(this).options.apiKey+":"+oh(this).name),this.Z=ch(this,function(t){var e=oh(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(ql,t.a).then((function(t){return t&&e&&(t.authDomain=e),Ul(t||{})}))}(t.B,oh(t).options.authDomain).then((function(e){return(t.D=e)&&(e.ga=t.B),Bl(t.B)}));return ch(t,e)}(t).then((function(){return Yl(t.i,e)})).then((function(e){return e?(e.ga=t.B,t.D&&(t.D.fa||null)==(e.fa||null)?e:e.reload().then((function(){return Kl(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:Ql(t.i)}))):null})).then((function(e){rh(t,e||null)}));return ch(t,n)}(this)),this.h=ch(this,function(t){return t.Z.then((function(){return eh(t)})).o((function(){})).then((function(){if(!t.l)return t.oa()})).o((function(){})).then((function(){if(!t.l){t.aa=!0;var e=t.i;e.b.addListener(Gl("local"),e.a,t.oa)}}))}(this)),this.aa=!1,this.oa=w(this.Xc,this),this.Ma=w(this.ca,this),this.xa=w(this.jc,this),this.ya=w(this.uc,this),this.za=w(this.vc,this),this.a=null,function(t){var e=oh(t).options.authDomain,n=oh(t).options.apiKey;e&&Nr()&&(t.Zb=t.Z.then((function(){if(!t.l){if(t.a=Fc(e,n,oh(t).name),Nc(t.a,t),ah(t)&&wl(ah(t)),t.D){wl(t.D);var r=t.D;r.va(t.ja()),pl(r,t),dl(r=t.D,t.N),vl(r,t),t.D=null}return t.a}})))}(this),this.INTERNAL={},this.INTERNAL.delete=w(this.delete,this),this.INTERNAL.logFramework=w(this.Ec,this),this.s=0,bn.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.ja()},set:function(t){this.va(t)},enumerable:!1}),t.$=null,Object.defineProperty(t,"ti",{get:function(){return this.S()},set:function(t){this.ub(t)},enumerable:!1}),t.R=null}(this),this.N=[]}function Jl(t){Qe.call(this,"languageCodeChanged"),this.g=t}function Zl(t){Qe.call(this,"frameworkChanged"),this.c=t}function th(t){return t.Zb||ke(new S("auth-domain-config-required"))}function eh(t){if(!Nr())return ke(new S("operation-not-supported-in-this-environment"));var e=th(t).then((function(){return t.a.pa()})).then((function(t){return t?Qr(t):null}));return ch(t,e)}function nh(t,e){var n={};return n.apiKey=oh(t).options.apiKey,n.authDomain=oh(t).options.authDomain,n.appName=oh(t).name,t.Z.then((function(){return function(t,e,n,r){var i=new fl(t,e);return n&&(i.ga=n),r&&dl(i,r),i.reload().then((function(){return i}))}(n,e,t.B,t.Ea())})).then((function(e){return ah(t)&&e.uid==ah(t).uid?(xl(ah(t),e),t.ca(e)):(rh(t,e),wl(e),t.ca(e))})).then((function(){uh(t)}))}function rh(t,e){ah(t)&&(function(t,e){Y(t.R,(function(t){return t==e}))}(ah(t),t.Ma),ln(ah(t),"tokenChanged",t.xa),ln(ah(t),"userDeleted",t.ya),ln(ah(t),"userInvalidated",t.za),ml(ah(t))),e&&(e.R.push(t.Ma),sn(e,"tokenChanged",t.xa),sn(e,"userDeleted",t.ya),sn(e,"userInvalidated",t.za),0<t.s&&gl(e)),Gr(t,"currentUser",e),e&&(e.va(t.ja()),pl(e,t),dl(e,t.N),vl(e,t))}function ih(t,e){var n=null,r=null;return ch(t,e.then((function(e){return n=Lo(e),r=Gi(e),nh(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=Jc(e.v(),t,w(t.ic,t))),n||e})).then((function(){return Qr({user:ah(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function oh(t){return t.app}function ah(t){return t.currentUser}function sh(t){return ah(t)&&ah(t)._lat||null}function uh(t){if(t.aa){for(var e=0;e<t.m.length;e++)t.m[e]&&t.m[e](sh(t));if(t.W!==t.getUid()&&t.O.length)for(t.W=t.getUid(),e=0;e<t.O.length;e++)t.O[e]&&t.O[e](sh(t))}}function ch(t,e){return t.P.push(e),e.ma((function(){Q(t.P,e)})),e}function lh(){}function hh(){this.a={},this.b=1e12}Wl.prototype.tb=function(t){var e=null,n=this;return function(t){var e=new S("invalid-persistence-type"),n=new S("unsupported-persistence-type");t:{for(r in Ku)if(Ku[r]==t){var r=!0;break t}r=!1}if(!r||"string"!==typeof t)throw e;switch(mr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Cu()&&"none"!==t)throw n;break;default:if(!kr()&&"none"!==t)throw n}}(t),Xl(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,zl(n,t)})).then((function(){if(n.c=Gl(t),e)return n.b.set(n.c,e,n.a)})):Ce()}))},I($l,bn),I(Jl,Qe),I(Zl,Qe),(e=$l.prototype).tb=function(t){return ch(this,t=this.i.tb(t))},e.va=function(t){this.$===t||this.l||(this.$=t,ts(this.b,this.$),this.dispatchEvent(new Jl(this.ja())))},e.ja=function(){return this.$},e.dd=function(){var t=u.navigator;this.va(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},e.Ec=function(t){this.N.push(t),es(this.b,r.a.SDK_VERSION?Ir(r.a.SDK_VERSION,this.N):null),this.dispatchEvent(new Zl(this.N))},e.Ea=function(){return $(this.N)},e.ub=function(t){this.R===t||this.l||(this.R=t,this.b.b=this.R)},e.S=function(){return this.R},e.toJSON=function(){return{apiKey:oh(this).options.apiKey,authDomain:oh(this).options.authDomain,appName:oh(this).name,currentUser:ah(this)&&ah(this).v()}},e.Cb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},e.la=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.w?this.w(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)},e.Da=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?w(this.gc,this):null},e.gc=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.Z.then((function(){return ih(i,vs(i.b,o))}))},e.Vc=function(t){if(!Nr())return ke(new S("operation-not-supported-in-this-environment"));var e=this,n=Hi(t.providerId),i=Lr(),o=null;(!Ar()||yr())&&oh(this).options.authDomain&&t.isOAuthProvider&&(o=pu(oh(this).options.authDomain,oh(this).options.apiKey,oh(this).name,"signInViaPopup",t,null,i,r.a.SDK_VERSION||null,null,null,this.S()));var a=hr(o,n&&n.ta,n&&n.sa);return ch(this,n=th(this).then((function(n){return Oc(n,a,"signInViaPopup",t,i,!!o,e.S())})).then((function(){return new be((function(t,n){e.la("signInViaPopup",null,new S("c
2ancelled-popup-request"),e.g),e.f=t,e.w=n,e.g=i,e.c=Lc(e.a,e,"signInViaPopup",a,i)}))})).then((function(t){return a&&lr(a),t?Qr(t):null})).o((function(t){throw a&&lr(a),t})))},e.Wc=function(t){if(!Nr())return ke(new S("operation-not-supported-in-this-environment"));var e=this;return ch(this,th(this).then((function(){return function(t){return Xl(t,(function(){return t.b.set(Hl,t.c.F,t.a)}))}(e.i)})).then((function(){return Dc(e.a,"signInViaRedirect",t,void 0,e.S())})))},e.pa=function(){var t=this;return eh(this).then((function(e){return t.a&&Vc(t.a.b),e})).o((function(e){throw t.a&&Vc(t.a.b),e}))},e.bd=function(t){if(!t)return ke(new S("null-user"));if(this.R!=t.tenantId)return ke(new S("tenant-id-mismatch"));var e=this,n={};n.apiKey=oh(this).options.apiKey,n.authDomain=oh(this).options.authDomain,n.appName=oh(this).name;var r=function(t,e,n,r){var i=t.b,o={};return o[Ya]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new fl(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ga=n),r&&dl(e,r),xl(e,t),e}(t,n,e.B,e.Ea());return ch(this,this.h.then((function(){if(oh(e).options.apiKey!=t.l)return r.reload()})).then((function(){return ah(e)&&t.uid==ah(e).uid?(xl(ah(e),t),e.ca(t)):(rh(e,r),wl(r),e.ca(r))})).then((function(){uh(e)})))},e.wb=function(){var t=this;return ch(this,this.h.then((function(){return t.a&&Vc(t.a.b),ah(t)?(rh(t,null),Ql(t.i).then((function(){uh(t)}))):Ce()})))},e.Xc=function(){var t=this;return Yl(this.i,oh(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=ah(t)&&e){n=ah(t).uid;var r=e.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return xl(ah(t),e),ah(t).I();(ah(t)||e)&&(rh(t,e),e&&(wl(e),e.ga=t.B),t.a&&Nc(t.a,t),uh(t))}}))},e.ca=function(t){return Kl(this.i,t)},e.jc=function(){uh(this),this.ca(ah(this))},e.uc=function(){this.wb()},e.vc=function(){this.wb()},e.ic=function(t){var e=this;return this.h.then((function(){return ih(e,Ce(t))}))},e.xc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(ah(e))}))},e.yc=function(t){var e=this;!function(t,e){t.O.push(e),ch(t,t.h.then((function(){!t.l&&K(t.O,e)&&t.W!==t.getUid()&&(t.W=t.getUid(),e(sh(t)))})))}(this,(function(){t.next(ah(e))}))},e.Gc=function(t,e,n){var r=this;return this.aa&&Promise.resolve().then((function(){d(t)?t(ah(r)):d(t.next)&&t.next(ah(r))})),this.$b(t,e,n)},e.Fc=function(t,e,n){var r=this;return this.aa&&Promise.resolve().then((function(){r.W=r.getUid(),d(t)?t(ah(r)):d(t.next)&&t.next(ah(r))})),this.ac(t,e,n)},e.kc=function(t){var e=this;return ch(this,this.h.then((function(){return ah(e)?ah(e).I(t).then((function(t){return{accessToken:t}})):null})))},e.Rc=function(t){var e=this;return this.h.then((function(){return ih(e,Js(e.b,Gs,{token:t}))})).then((function(t){var n=t.user;return Nl(n,"isAnonymous",!1),e.ca(n),t}))},e.Sc=function(t,e){var n=this;return this.h.then((function(){return ih(n,Js(n.b,Ks,{email:t,password:e}))}))},e.cc=function(t,e){var n=this;return this.h.then((function(){return ih(n,Js(n.b,ws,{email:t,password:e}))}))},e.Ya=function(t){var e=this;return this.h.then((function(){return ih(e,t.ia(e.b))}))},e.Qc=function(t){return zr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.Ya(t)},e.vb=function(){var t=this;return this.h.then((function(){var e=ah(t);if(e&&e.isAnonymous){var n=Qr({providerId:null,isNewUser:!1});return Qr({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return ih(t,t.b.vb()).then((function(e){var n=e.user;return Nl(n,"isAnonymous",!0),t.ca(n),e}))}))},e.getUid=function(){return ah(this)&&ah(this).uid||null},e.bc=function(t){this.addAuthTokenListener(t),this.s++,0<this.s&&ah(this)&&gl(ah(this))},e.Nc=function(t){var e=this;W(this.m,(function(n){n==t&&e.s--})),0>this.s&&(this.s=0),0==this.s&&ah(this)&&ml(ah(this)),this.removeAuthTokenListener(t)},e.addAuthTokenListener=function(t){var e=this;this.m.push(t),ch(this,this.h.then((function(){e.l||K(e.m,t)&&t(sh(e))})))},e.removeAuthTokenListener=function(t){Y(this.m,(function(e){return e==t}))},e.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(Gl("local"),t.a,this.oa),this.a&&(xc(this.a,this),Vc(this.a.b)),Promise.resolve()},e.fc=function(t){return ch(this,function(t,e){return Js(t,Es,{identifier:e,continueUri:xr()?sr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.b,t))},e.zc=function(t){return!!xo(t)},e.sb=function(t,e){var n=this;return ch(this,Ce().then((function(){var t=new Ci(e);if(!t.c)throw new S("argument-error",xi+" must be true when sending sign in link to email");return Mi(t)})).then((function(e){return n.b.sb(t,e)})).then((function(){})))},e.fd=function(t){return this.Pa(t).then((function(t){return t.data.email}))},e.jb=function(t,e){return ch(this,this.b.jb(t,e).then((function(){})))},e.Pa=function(t){return ch(this,this.b.Pa(t).then((function(t){return new ri(t)})))},e.fb=function(t){return ch(this,this.b.fb(t).then((function(){})))},e.rb=function(t,e){var n=this;return ch(this,Ce().then((function(){return"undefined"===typeof e||pt(e)?{}:Mi(new Ci(e))})).then((function(e){return n.b.rb(t,e)})).then((function(){})))},e.Uc=function(t,e){return ch(this,Gc(this,t,e,w(this.Ya,this)))},e.Tc=function(t,e){var n=this;return ch(this,Ce().then((function(){var r=e||sr(),i=No(t,r);if(!(r=xo(r)))throw new S("argument-error","Invalid email link!");if(r.tenantId!==n.S())throw new S("tenant-id-mismatch");return n.Ya(i)})))},lh.prototype.render=function(){},lh.prototype.reset=function(){},lh.prototype.getResponse=function(){},lh.prototype.execute=function(){};var fh=null;function ph(t,e){return(e=dh(e))&&t.a[e]||null}function dh(t){return(t="undefined"===typeof t?1e12:t)?t.toString():null}function vh(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=oe(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():sn(this.f,"click",this.i)}function yh(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function gh(){}function mh(){}hh.prototype.render=function(t,e){return this.a[this.b.toString()]=new vh(t,e),this.b++},hh.prototype.reset=function(t){var e=ph(this,t);
2t=dh(t),e&&t&&(e.delete(),delete this.a[t])},hh.prototype.getResponse=function(t){return(t=ph(this,t))?t.getResponse():null},hh.prototype.execute=function(t){(t=ph(this,t))&&t.execute()},vh.prototype.getResponse=function(){return yh(this),this.b},vh.prototype.execute=function(){yh(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(r){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()}),6e4)}),500))},vh.prototype.delete=function(){yh(this),this.g=!0,clearTimeout(this.a),this.a=null,ln(this.f,"click",this.i)},Gr(gh,"FACTOR_ID","phone"),mh.prototype.g=function(){return fh||(fh=new hh),Ce(fh)},mh.prototype.c=function(){};var bh=null;function _h(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var wh=new mt(wt,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Eh=new jr(3e4,6e4);_h.prototype.g=function(t){var e=this;return new be((function(n,r){var i=setTimeout((function(){r(new S("network-request-failed"))}),Eh.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 S("internal-error"));delete u[e.a]},Ce(Va(St(wh,{onload:e.a,hl:t||""}))).o((function(){clearTimeout(i),r(new S("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(i),n(u.grecaptcha))}))},_h.prototype.c=function(){this.b--};var Th=null;function Ih(t,e,n,r,i,o,a){if(Gr(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.u=e,this.g=null,a?(bh||(bh=new mh),a=bh):(Th||(Th=new _h),a=Th),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[kh])throw new S("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[Nh],!u.document)throw new S("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!oe(e)||!this.i&&oe(e).hasChildNodes())throw new S("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ka(t,o||null,i||null),this.w=r||function(){return null};var s=this;this.l=[];var c=this.a[Sh];this.a[Sh]=function(t){if(xh(s,t),"function"===typeof c)c(t);else if("string"===typeof c){var e=Cr(c,u);"function"===typeof e&&e(t)}};var l=this.a[Ch];this.a[Ch]=function(){if(xh(s,null),"function"===typeof l)l();else if("string"===typeof l){var t=Cr(l,u);"function"===typeof t&&t()}}}var Sh="callback",Ch="expired-callback",kh="sitekey",Nh="size";function xh(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function Ph(t,e){return t.h.push(e),e.ma((function(){Q(t.h,e)})),e}function Ah(t){if(t.D)throw new S("internal-error","RecaptchaVerifier instance has been destroyed.")}function Oh(t,e,n){var i=!1;try{this.b=n||r.a.app()}catch(s){throw new S("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new S("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ea()}catch(s){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}a=r.a.SDK_VERSION?Ir(r.a.SDK_VERSION,a):null,Ih.call(this,n,t,e,(function(){try{var t=o.b.auth().ja()}catch(e){t=null}return t}),a,A(k),i)}function Rh(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 S("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].K(n[i])&&!o){if(e=e[i],0>i||i>=Dh.length)throw new S("internal-error","Argument validator received an unsupported number of arguments.");
2n=Dh[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.J+".";break t}r=null}}if(r)throw new S("argument-error",t+" failed: "+r)}(e=Ih.prototype).Ga=function(){var t=this;return this.f?this.f:this.f=Ph(this,Ce().then((function(){if(xr()&&!gr())return dr();throw new S("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.w())})).then((function(e){return t.g=e,Js(t.s,Ls,{})})).then((function(e){t.a[kh]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},e.render=function(){Ah(this);var t=this;return Ph(this,this.Ga().then((function(){if(null===t.c){var e=t.u;if(!t.i){var n=oe(e);e=function(t,e,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!ie&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Bt(a.name),'"'),a.type){o.push(' type="',Bt(a.type),'"');var s={};yt(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=he(i,o),a&&("string"===typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):ae(o,a)),2<r.length&&le(i,o,r),o}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},e.verify=function(){Ah(this);var t=this;return Ph(this,this.render().then((function(e){return new be((function(n){var r=t.g.getResponse(e);if(r)n(r);else{t.l.push((function e(r){r&&(function(t,e){Y(t.l,(function(t){return t==e}))}(t,e),n(r))})),t.i&&t.g.execute(t.c)}}))})))},e.reset=function(){Ah(this),null!==this.c&&this.g.reset(this.c)},e.clear=function(){Ah(this),this.D=!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=oe(this.u);for(var e;e=t.firstChild;)t.removeChild(e)}},I(Oh,Ih);var Dh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Lh(t,e){return{name:t||"",J:"a valid string",optional:!!e,K:function(t){return"string"===typeof t}}}function Mh(t,e){return{name:t||"",J:"a boolean",optional:!!e,K:function(t){return"boolean"===typeof t}}}function Fh(t,e){return{name:t||"",J:"a valid object",optional:!!e,K:v}}function jh(t,e){return{name:t||"",J:"a function",optional:!!e,K:d}}function Uh(t,e){return{name:t||"",J:"null",optional:!!e,K:function(t){return null===t}}}function Vh(t){return{name:t?t+"Credential":"credential",J:t?"a valid "+t+" credential":"a valid credential",optional:!1,K:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ia||!n)}}}function qh(t,e){return v(t)&&"string"===typeof t.type&&t.type===e&&d(t.Fa)}function Bh(t){return v(t)&&"string"===typeof t.uid}function Wh(){return{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!==typeof t.type||!d(t.verify))}}}function zh(t,e,n,r){return{name:n||"",J:t.J+" or "+e.J,optional:!!r,K:function(n){return t.K(n)||e.K(n)}}}function Hh(t,e){for(var n in e){var r=e[n].name;t[r]=Qh(r,t[n],e[n].j)}}function Gh(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:E((function(t){return this[t]}),n),set:E((function(t,e,n,r){Rh(t,[n],[r],!0),this[e]=r}),r,n,e[n].gb),enumerable:!0})}}function Kh(t,e,n,r){t[e]=Qh(e,n,r)}function Qh(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return Rh(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}Hh($l.prototype,{fb:{name:"applyActionCode",j:[Lh("code")]},Pa:{name:"checkActionCode",j:[Lh("code")]},jb:{name:"confirmPasswordReset",j:[Lh("code"),Lh("newPassword")]},cc:{name:"createUserWithEmailAndPassword",j:[Lh("email"),Lh("password")]},fc:{name:"fetchSignInMethodsForEmail",j:[Lh("email")]},pa:{name:"getRedirectResult",j:[]},zc:{name:"isSignInWithEmailLink",j:[Lh("emailLink")]},Fc:{name:"onAuthStateChanged",j:[zh(Fh(),jh(),"nextOrObserver"),jh("opt_error",!0),jh("opt_completed",!0)]},Gc:{name:"onIdTokenChanged",j:[zh(Fh(),jh(),"nextOrObserver"),jh("opt_error",!0),jh("opt_completed",!0)]},rb:{name:"sendPasswordResetEmail",j:[Lh("email"),zh(Fh("opt_actionCodeSettings",!0),Uh(null,!0),"opt_actionCodeSettings",!0)]},sb:{name:"sendSignInLinkToEmail",j:[Lh("email"),Fh("actionCodeSettings")]},tb:{name:"setPersistence",j:[Lh("persistence")]},Qc:{name:"signInAndRetrieveDataWithCredential",j:[Vh()]},vb:{name:"signInAnonymously",j:[]},Ya:{name:"signInWithCredential",j:[Vh()]},Rc:{name:"signInWithCustomToken",j:[Lh("token")]},Sc:{name:"signInWithEmailAndPassword",j:[Lh("email"),Lh("password")]},Tc:{name:"signInWithEmailLink",j:[Lh("email"),Lh("emailLink",!0)]},Uc:{name:"signInWithPhoneNumber",j:[Lh("phoneNumber"),Wh()]},Vc:{name:"signInWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]}
2,Wc:{name:"signInWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},bd:{name:"updateCurrentUser",j:[zh({name:"user",J:"an instance of Firebase User",optional:!1,K:function(t){return!!(t&&t instanceof fl)}},Uh(),"user")]},wb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Lh(null,!0)]},dd:{name:"useDeviceLanguage",j:[]},fd:{name:"verifyPasswordResetCode",j:[Lh("code")]}}),Gh($l.prototype,{lc:{name:"languageCode",gb:zh(Lh(),Uh(),"languageCode")},ti:{name:"tenantId",gb:zh(Lh(),Uh(),"tenantId")}}),$l.Persistence=Ku,$l.Persistence.LOCAL="local",$l.Persistence.SESSION="session",$l.Persistence.NONE="none",Hh(fl.prototype,{delete:{name:"delete",j:[]},mc:{name:"getIdTokenResult",j:[Mh("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Mh("opt_forceRefresh",!0)]},Ac:{name:"linkAndRetrieveDataWithCredential",j:[Vh()]},mb:{name:"linkWithCredential",j:[Vh()]},Bc:{name:"linkWithPhoneNumber",j:[Lh("phoneNumber"),Wh()]},Cc:{name:"linkWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Dc:{name:"linkWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Jc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Vh()]},pb:{name:"reauthenticateWithCredential",j:[Vh()]},Kc:{name:"reauthenticateWithPhoneNumber",j:[Lh("phoneNumber"),Wh()]},Lc:{name:"reauthenticateWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Mc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},qb:{name:"sendEmailVerification",j:[zh(Fh("opt_actionCodeSettings",!0),Uh(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Lh(null,!0)]},ad:{name:"unlink",j:[Lh("provider")]},xb:{name:"updateEmail",j:[Lh("email")]},yb:{name:"updatePassword",j:[Lh("password")]},cd:{name:"updatePhoneNumber",j:[Vh("phone")]},zb:{name:"updateProfile",j:[Fh("profile")]},Ab:{name:"verifyBeforeUpdateEmail",j:[Lh("email"),zh(Fh("opt_actionCodeSettings",!0),Uh(null,!0),"opt_actionCodeSettings",!0)]}}),Hh(hh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Hh(lh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Hh(be.prototype,{ma:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Gh(zc.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",gb:Mh("appVerificationDisabledForTesting")}}),Hh(Hc.prototype,{confirm:{name:"confirm",j:[Lh("verificationCode")]}}),Kh(oo,"fromJSON",(function(t){t="string"===typeof t?JSON.parse(t):t;for(var e,n=[fo,Co,Ao,co],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[zh(Lh(),Fh(),"json")]),Kh(ko,"credential",(function(t,e){return new So(t,e)}),[Lh("email"),Lh("password")]),Hh(So.prototype,{v:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(go.prototype,{Aa:{name:"addScope",j:[Lh("scope")]},Ia:{name:"setCustomParameters",j:[Fh("customOAuthParameters")]}}),Kh(go,"credential",mo,[zh(Lh(),Fh(),"token")]),Kh(ko,"credentialWithLink",No,[Lh("email"),Lh("emailLink")]),Hh(bo.prototype,{Aa:{name:"addScope",j:[Lh("scope")]},Ia:{name:"setCustomParameters",j:[Fh("customOAuthParameters")]}}),Kh(bo,"credential",_o,[zh(Lh(),Fh(),"token")]),Hh(wo.prototype,{Aa:{name:"addScope",j:[Lh("scope")]},Ia:{name:"setCustomParameters",j:[Fh("customOAuthParameters")]}}),Kh(wo,"credential",Eo,[zh(Lh(),zh(Fh(),Uh()),"idToken"),zh(Lh(),Uh(),"accessToken",!0)]),Hh(To.prototype,{Ia:{name:"setCustomParameters",j:[Fh("customOAuthParameters")]}}),Kh(To,"credential",Io,[zh(Lh(),Fh(),"token"),Lh("secret",!0)]),Hh(yo.prototype,{Aa:{name:"addScope",j:[Lh("scope")]},credential:{name:"credential",j:[zh(Lh(),zh(Fh(),Uh()),"optionsOrIdToken"),zh(Lh(),Uh(),"accessToken",!0)]},Ia:{name:"setCustomParameters",j:[Fh("customOAuthParameters")]}}),Hh(lo.prototype,{v:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(so.prototype,{v:{name:"toJSON",j:[Lh(null,!0)]}}),Kh(Ro,"credential",Do,[Lh("verificationId"),Lh("verificationCode")]),Hh(Ro.prototype,{cb:{name:"verifyPhoneNumber",j:[zh(Lh(),{name:"phoneInfoOptions",J:"valid phone info o
2ptions",optional:!1,K:function(t){return!!t&&(t.session&&t.phoneNumber?qh(t.session,ro)&&"string"===typeof t.phoneNumber:t.session&&t.multiFactorHint?qh(t.session,io)&&Bh(t.multiFactorHint):t.session&&t.multiFactorUid?qh(t.session,io)&&"string"===typeof t.multiFactorUid:!!t.phoneNumber&&"string"===typeof t.phoneNumber)}},"phoneInfoOptions"),Wh()]}}),Hh(Po.prototype,{v:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(S.prototype,{toJSON:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(Wo.prototype,{toJSON:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(Bo.prototype,{toJSON:{name:"toJSON",j:[Lh(null,!0)]}}),Hh($c.prototype,{toJSON:{name:"toJSON",j:[Lh(null,!0)]}}),Hh(Qc.prototype,{Pc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(t){return!!t&&!!t.ob}}]}}),Hh(rl.prototype,{Ob:{name:"getSession",j:[]},dc:{name:"enroll",j:[{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(t){return!!t&&!!t.ob}},Lh("displayName",!0)]},$c:{name:"unenroll",j:[zh({name:"multiFactorInfo",J:"a valid multiFactorInfo",optional:!1,K:Bh},Lh(),"multiFactorInfoIdentifier")]}}),Hh(Oh.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),Kh(gi,"parseLink",Si,[Lh("link")]),Kh(gh,"assertion",(function(t){return new el(t)}),[Vh("phone")]),function(){if("undefined"===typeof r.a||!r.a.INTERNAL||!r.a.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:oi,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:ii,VERIFY_AND_CHANGE_EMAIL:ai,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:$l,AuthCredential:oo,Error:S};Kh(t,"EmailAuthProvider",ko,[]),Kh(t,"FacebookAuthProvider",go,[]),Kh(t,"GithubAuthProvider",bo,[]),Kh(t,"GoogleAuthProvider",wo,[]),Kh(t,"TwitterAuthProvider",To,[]),Kh(t,"OAuthProvider",yo,[Lh("providerId")]),Kh(t,"SAMLAuthProvider",vo,[Lh("providerId")]),Kh(t,"PhoneAuthProvider",Ro,[{name:"auth",J:"an instance of Firebase Auth",optional:!0,K:function(t){return!!(t&&t instanceof $l)}}]),Kh(t,"RecaptchaVerifier",Oh,[zh(Lh(),{name:"",J:"an HTML element",optional:!1,K:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Fh("recaptchaParameters",!0),{name:"app",J:"an instance of Firebase App",optional:!0,K:function(t){return!!(t&&t instanceof r.a.app.App)}}]),Kh(t,"ActionCodeURL",gi,[]),Kh(t,"PhoneMultiFactorGenerator",gh,[]),r.a.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new $l(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"}),r.a.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:w((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:w(t.kc,t),addAuthTokenListener:w(t.bc,t),removeAuthTokenListener:w(t.Nc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.a.registerVersion("@firebase/auth","0.14.7"),r.a.INTERNAL.extendNamespace({User:fl})}()}).apply("undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})}.call(this,n(18))},function(t,e,n){"use strict";(function(r){Object.defineProperty(e,"__esModule",{value:!0});var i,o=(i=n(1))&&"object"===typeof i&&"default"in i?i.default:i,a=n(55),s=n(8),u=n(13),c=n(5),l=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),s.stringify(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:s.jsonEval(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),h=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return s.contains(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),f=function(t){try{if("undefined"!==typeof window&&"undefined"!==typeof window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new l(e)}}catch(n){}return new h},p=f("localStorage"),d=f("sessionStorage"),v=new u.Logger("@firebase/database"),y=function(){var t=1;return function(){return t++}}(),g=function(t){var e=s.stringToByteArray(t),n=new s.Sha1;n.update(e);var r=n.digest();return s.base64.encodeByteArray(r)},m=function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r="",i=0;i<e.length;i++){var o=e[i];Array.isArray(o)||o&&"object"===typeof o&&"number"===typeof o.length?r+=t.apply(null,o):r+="object"===typeof o?s.stringify(o):o,r+=" "}return r},b=null,_=!0,w=function(t,e){s.assert(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(v.logLevel=u.LogLevel.VERBOSE,b=v.log.bind(v),e&&d.set("logging_enabled",!0)):"function"===typeof t?b=t:(b=null,d.remove("logging_enabled"))},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===_&&(_=!1,null===b&&!0===d.get("logging_enabled")&&w(!0)),b){var n=m.apply(null,t);b(n)}},T=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];E.apply(void 0,a.__spread([t],e))}},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+m.apply(void 0,a.__spread(t));v.error(n)},S=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+m.apply(void 0,a.__spread(t));throw v.error(n),new Error(n)},C=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+m.apply(void 0,a.__spread(t));v.warn(n)},k=function(t){return"number"===typeof t&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},N="[MIN_NAME]",x="[MAX_NAME]",P=function(t,e){if(t===e)return 0;if(t===N||e===x)return-1;if(e===N||t===x)return 1;var n=j(t),r=j(e);return null!==n?null!==r?n-r===0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},A=function(t,e){return t===e?0:t<e?-1:1},O=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+s.stringify(e))},R=function t(e){if("object"!==typeof e||null===e)return s.stringify(e);var n=[];for(var r in e)n.push(r);n.sort();for(var i="{",o=0;o<n.length;
2o++)0!==o&&(i+=","),i+=s.stringify(n[o]),i+=":",i+=t(e[n[o]]);return i+="}"},D=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function L(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var M=function(t){s.assert(!k(t),"Invalid JSON number");var e,n,r,i,o;0===t?(n=0,r=0,e=1/t===-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));var a=[];for(o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(e?1:0),a.reverse();var u=a.join(""),c="";for(o=0;o<64;o+=8){var l=parseInt(u.substr(o,8),2).toString(16);1===l.length&&(l="0"+l),c+=l}return c.toLowerCase()},F=new RegExp("^-?(0*)\\d{1,10}$"),j=function(t){if(F.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},U=function(t){try{t()}catch(e){setTimeout((function(){var t=e.stack||"";throw C("Exception was thrown by user callback.",t),e}),Math.floor(0))}},V=function(t,e){var n=setTimeout(t,e);return"object"===typeof n&&n.unref&&n.unref(),n},q=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!0,configurable:!0}),t.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},t.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},t.prototype.popFront=function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)},t.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+encodeURIComponent(String(this.pieces_[e])));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.pieces_.slice(this.pieceNum_+t)},t.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(e instanceof t)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new t(n,0)},t.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=P(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<=this.pieces_.length;e++,n++)if(this.pieces_[e]!==t.pieces_[n])return!1;return!0},t.prototype.contains=function(t){var e=this.pieceNum_,n=t.pieceNum_;if(this.getLength()>t.getLength())return!1;for(;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),B=function(){function t(t,e){this.errorPrefix_=e,this.parts_=t.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=s.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(t,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),t.prototype.push=function(t){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(t),this.byteLength_+=s.stringLength(t),this.checkValid_()},t.prototype.pop=function(){var t=this.parts_.pop();this.byteLength_-=s.stringLength(t),this.parts_.length>0&&(this.byteLength_-=1)},t.prototype.checkValid_=function(){if(this.byteLength_>t.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");
2if(this.parts_.length>t.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},t}(),W=function(){function t(t,e,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.includeNamespaceInQueryParams=o,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=p.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&p.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){var n;if(s.assert("string"===typeof t,"typeof type must == string"),s.assert("object"===typeof e,"typeof params must == object"),"websocket"===t)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==t)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return L(e,(function(t,e){r.push(t+"="+e)})),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}();var z,H,G=function(t){var e=K(t),n=e.namespace;"firebase.com"===e.domain&&S(e.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===e.domain||S("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),e.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&C("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new W(e.host,e.secure,n,r,"",n!==e.subdomain),path:new q(e.pathString)}},K=function(t){var e="",n="",r="",i="",o="",s=!0,u="https",c=443;if("string"===typeof t){var l=t.indexOf("//");l>=0&&(u=t.substring(0,l-1),t=t.substring(l+2));var h=t.indexOf("/");-1===h&&(h=t.length);var f=t.indexOf("?");-1===f&&(f=t.length),e=t.substring(0,Math.min(h,f)),h<f&&(i=function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}e+="/"+i}return e}(t.substring(h,f)));var p=function(t){var e,n,r={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var i=a.__values(t.split("&")),o=i.next();!o.done;o=i.next()){var s=o.value;if(0!==s.length){var u=s.split("=");2===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):C("Invalid query segment '"+s+"' in query '"+t+"'")}}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(t.substring(Math.min(t.length,f)));(l=e.indexOf(":"))>=0?(s="https"===u||"wss"===u,c=parseInt(e.substring(l+1),10)):l=e.length;var d=e.slice(0,l);if("localhost"===d.toLowerCase())n="localhost";else if(d.split(".").length<=2)n=d;else{var v=e.indexOf(".");r=e.substring(0,v).toLowerCase(),n=e.substring(v+1),o=r}"ns"in p&&(o=p.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:s,scheme:u,pathString:i,namespace:o}},Q=/[\[\].#$\/\u0000-\u001F\u007F]/,Y=/[\[\].#$\u0000-\u001F\u007F]/,X=function(t){return"string"===typeof t&&0!==t.length&&!Q.test(t)},$=function(t){return"string"===typeof t&&0!==t.length&&!Y.test(t)},J=function(t){return null===t||"string"===typeof t||"number"===typeof t&&!k(t)||t&&"object"===typeof t&&s.contains(t,".sv")},Z=function(t,e,n,r,i){i&&void 0===n||tt(s.errorPrefix(t,e,i),n,r)},tt=function t(e,n,r){var i=r instanceof q?new B(r,e):r;if(void 0===n)throw new Error(e+"contains undefined "+i.toErrorString());if("function"===typeof n)throw new Error(e+"contains a function "+i.toErrorString()+" with contents = "+n.toString());if(k(n))throw new Error(e+"contains "+n.toString()+" "+i.toErrorString());if("string"===typeof n&&n.length>10485760/3&&s.stringLength(n)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+i.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"===typeof n){var o=!1,a=!1;if(L(n,(function(n,r){if(".value"===n)o=!0;else if(".priority"!==n&&".sv"!==n&&(a=!0,!X(n)))throw new Error(e+" contains an invali
2d key ("+n+") "+i.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(n),t(e,r,i),i.pop()})),o&&a)throw new Error(e+' contains ".value" child '+i.toErrorString()+" in addition to actual children.")}},et=function(t,e,n,r,i){if(!i||void 0!==n){var o=s.errorPrefix(t,e,i);if(!n||"object"!==typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];L(n,(function(t,e){var n=new q(t);if(tt(o,e,r.child(n)),".priority"===n.getBack()&&!J(e))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=(r=e[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!X(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(q.comparePaths);var a=null;for(n=0;n<e.length;n++){if(r=e[n],null!==a&&a.contains(r))throw new Error(t+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(o,a)}},nt=function(t,e,n,r){if(!r||void 0!==n){if(k(n))throw new Error(s.errorPrefix(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!J(n))throw new Error(s.errorPrefix(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},rt=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(s.errorPrefix(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},it=function(t,e,n,r){if((!r||void 0!==n)&&!X(n))throw new Error(s.errorPrefix(t,e,r)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},ot=function(t,e,n,r){if((!r||void 0!==n)&&!$(n))throw new Error(s.errorPrefix(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},at=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),ot(t,e,n,r)},st=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},ut=function(t,e,n){var r=n.path.toString();if("string"!==typeof n.repoInfo.host||0===n.repoInfo.host.length||!X(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),$(t)}(r))throw new Error(s.errorPrefix(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},ct=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!==typeof n)throw new Error(s.errorPrefix(t,e,r)+"must be a boolean.")},lt=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){s.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),s.validateCallback("OnDisconnect.cancel",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){s.validateArgCount("OnDisconnect.remove",0,1,arguments.length),st("OnDisconnect.remove",this.path_),s.validateCallback("OnDisconnect.remove",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){s.validateArgCount("OnDisconnect.set",1,2,arguments.length),st("OnDisconnect.set",this.path_),Z("OnDisconnect.set",1,t,this.path_,!1),s.validateCallback("OnDisconnect.set",2,e,!0);var n=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){s.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),st("OnDisconnect.setWithPriority",this.path_),Z("OnDisconnect.setWithPriority",1,t,this.path_,!1),nt("OnDisconnect.setWithPriority",2,e,!1),s.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new s.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(s.validateArgCount("OnDisconnect.update",1,2,arguments.length),st("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,C("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}et("OnDisconnect.update",1,t,this.path_,!1),s.validateCallback("OnDisconnect.update",2,e,!0);var i=new s.Deferred;return this.repo_.onDisconnectUpdate(this.path_,t,i.wrapCallback(e)),i.promise},t}(),ht=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return s.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),ft=function(){var t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",e=0,n=[];return function(r){var i,o=r===e;e=r;var a=new Array(8);for(i=7;i>=0;i--)a[i]=t.charAt(r%64),r=Math.floor(r/64);s.assert(0===r,"Cannot push at time == 0");var u=a.join("");if(o){for(i=11;i>=0&&63===n[i];i--)n[i]=0;n[i]++}else for(i=0;i<12;i++)n[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)u+=t.charAt(n[i]);return s.assert(20===u.length,"nextPushId: Length should be 20."),u}}(),pt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),dt=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new pt(N,t),r=new pt(N,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return pt.MIN},t}(),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return z},set:function(t){z=t},enumerable:!0,configurable:!0}),e.prototype.compare=function(t,e){return P(t.name,e.name)}
2,e.prototype.isDefinedOn=function(t){throw s.assertionError("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return pt.MIN},e.prototype.maxPost=function(){return new pt(x,z)},e.prototype.makePost=function(t,e){return s.assert("string"===typeof t,"KeyIndex indexValue must always be a string."),new pt(t,z)},e.prototype.toString=function(){return".key"},e}(dt),yt=new vt;var gt,mt,bt,_t=function(t){return"number"===typeof t?"number:"+M(t):"string:"+t},wt=function(t){if(t.isLeafNode()){var e=t.val();s.assert("string"===typeof e||"number"===typeof e||"object"===typeof e&&s.contains(e,".sv"),"Priority must be a string or number.")}else s.assert(t===H||t.isEmpty(),"priority of unexpected type.");s.assert(t===H||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Et=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,s.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),wt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return gt},set:function(t){gt=t},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(s.assert(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+_t(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?M(this.value_):this.value_,this.lazyHash_=g(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(s.assert(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),o=t.VALUE_TYPE_ORDER.indexOf(r);return s.assert(i>=0,"Unknown leaf type: "+n),s.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:o-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.value_===e.value_&&this.priorityNode_.equals(e.priorityNode_)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}();var Tt,It,St=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?P(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return pt.MIN},e.prototype.maxPost=function(){return new pt(x,new Et("[PRIORITY-POST]",bt))},e.prototype.makePost=function(t,e){var n=mt(t);return new pt(e,new Et("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(dt)),Ct=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},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 this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),kt=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:xt.EMPTY_NODE,this.right=null!=o?o:xt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,
2null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},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 xt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return xt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.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.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");
2if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Nt=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new kt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},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.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),xt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,kt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,kt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},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.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new Ct(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Ct(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Ct(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Ct(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Nt,t}(),Pt=Math.log(2),At=function(){function t(t){var e;this.count=(e=t+1,parseInt(Math.log(e)/Pt,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=t+1&r}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),Ot=function(t,e,n,r){t.sort(e);var i=function(e){for(var r=null,i=null,o=t.length,a=function(e,r){var i=o-e,a=o;o-=e;var u=function e(r,i){var o,a,s=i-r;if(0===s)return null;if(1===s)return o=t[r],a=n?n(o):o,new kt(a,o.node,kt.BLACK,null,null);var u=parseInt(s/2,10)+r,c=e(r,u),l=e(u+1,i);return o=t[u],a=n?n(o):o,new kt(a,o.node,kt.BLACK,c,l)}(i+1,a),c=t[i],l=n?n(c):c;s(new kt(l,c.node,r,null,u))},s=function(t){r?(r.left=t,r=t):(i=t,r=t)},u=0;u<e.count;++u){var c=e.nextBitIsOne(),l=Math.pow(2,e.count-(u+1));c?a(l,kt.BLACK):(a(l,kt.BLACK),a(l,kt.RED))}return i}(new At(t.length));return new xt(r||e,i)},Rt={},Dt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return s.assert(Rt&&St,"ChildrenNode.ts has not been loaded"),Tt=Tt||new t({".priority":Rt},{".priority":St})},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var e=s.safeGet(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e instanceof xt?e:null},t.prototype.hasIndex=function(t){return s.contains(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){s.assert(e!==yt,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,u=n.getIterator(pt.Wrap),c=u.getNext();c;)o=o||e.isDefinedOn(c.node),i.push(c),c=u.getNext();r=o?Ot(i,e.getCompare()):Rt;var l=e.toString(),h=a.__assign({},this.indexSet_);h[l]=e;var f=a.__assign({},this.indexes_);return f[l]=r,new t(f,h)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(s.map(this.indexes_,(function(t,i){var o=s.safeGet(r.indexSet_,i);if(s.assert(o,"Missing index implementation for "+i),t===Rt){if(o.isDefinedOn(e.node)){for(var a=[],u=n.getIterator(pt.Wrap),c=u.getNext();c;)c.name!==e.name&&a.push(c),c=u.getNext();return a.push(e),Ot(a,o.getCompare())}return Rt}var l=n.get(e.name),h=t;return l&&(h=h.remove(new pt(e.name,l))),h.insert(e,e.node)})),this.indexSet_)}
2,t.prototype.removeFromIndexes=function(e,n){return new t(s.map(this.indexes_,(function(t){if(t===Rt)return t;var r=n.get(e.name);return r?t.remove(new pt(e.name,r)):t})),this.indexSet_)},t}();function Lt(t,e){return P(t.name,e.name)}function Mt(t,e){return P(t,e)}var Ft=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&wt(this.priorityNode_),this.children_.isEmpty()&&s.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return It||(It=new t(new xt(Mt),null,Dt.Default))},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||It},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?It:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(s.assert(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r=new pt(e,n),i=void 0,o=void 0;n.isEmpty()?(i=this.children_.remove(e),o=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(e,n),o=this.indexMap_.addToIndexes(r,this.children_));var a=i.isEmpty()?It:this.priorityNode_;return new t(i,a,o)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;s.assert(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(St,(function(a,s){n[a]=s.val(e),r++,o&&t.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1})),!e&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+_t(this.getPriority().val())+":"),this.forEachChild(St,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":g(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new pt(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new pt(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new pt(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getIteratorFrom(t.name,pt.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getReverseIteratorFrom(t.name,pt.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===jt?-1:0},t.prototype.withIndex=function(e){if(e===yt||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===yt||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;
2if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(St),r=e.getIterator(St),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===yt?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),jt=new(function(t){function e(){return t.call(this,new xt(Mt),Ft.EMPTY_NODE,Dt.Default)||this}return a.__extends(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Ft.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Ft));Object.defineProperties(pt,{MIN:{value:new pt(N,Ft.EMPTY_NODE)},MAX:{value:new pt(x,jt)}}),vt.__EMPTY_NODE=Ft.EMPTY_NODE,Et.__childrenNodeConstructor=Ft,H=jt,function(t){bt=t}(jt);function Ut(t,e){if(void 0===e&&(e=null),null===t)return Ft.EMPTY_NODE;if("object"===typeof t&&".priority"in t&&(e=t[".priority"]),s.assert(null===e||"string"===typeof e||"number"===typeof e||"object"===typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"===typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!==typeof t||".sv"in t)return new Et(t,Ut(e));if(t instanceof Array){var n=Ft.EMPTY_NODE;return L(t,(function(e,r){if(s.contains(t,e)&&"."!==e.substring(0,1)){var i=Ut(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(e,i))}})),n.updatePriority(Ut(e))}var r=[],i=!1;if(L(t,(function(t,e){if("."!==t.substring(0,1)){var n=Ut(e);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new pt(t,n)))}})),0===r.length)return Ft.EMPTY_NODE;var o=Ot(r,Lt,(function(t){return t.name}),Mt);if(i){var a=Ot(r,St.getCompare());return new Ft(o,Ut(e),new Dt({".priority":a},{".priority":St}))}return new Ft(o,Ut(e),Dt.Default)}!function(t){mt=t}(Ut);var Vt,qt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?P(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return pt.MIN},e.prototype.maxPost=function(){return pt.MAX},e.prototype.makePost=function(t,e){var n=Ut(t);return new pt(e,n)},e.prototype.toString=function(){return".value"},e}(dt)),Bt=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,s.assert(!e.isEmpty()&&".priority"!==e.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return a.__extends(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?P(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=Ut(t),r=Ft.EMPTY_NODE.updateChild(this.indexPath_,n);return new pt(e,r)},e.prototype.maxPost=function(){var t=Ft.EMPTY_NODE.updateChild(this.indexPath_,jt);return new pt(x,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(dt),Wt=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return s.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},t.prototype.exportVal=function(){return s.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return s.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return s.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){s.validateArgCount("DataSnapshot.child",0,1,arguments.length),e=String(e),ot("DataSnapshot.child",1,e,!1);var n=new q(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,St)},t.prototype.hasChild=function(t){s.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),ot("DataSnapshot.hasChild",1,t,!1);var e=new q(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return s.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(s.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),s.validateCallback("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return e(new t(i,n.ref_.child(r),St))}))},t.prototype.hasChildren=function(){return s.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),t.prototype.numChildren=function(){return s.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return s.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),zt=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+s.stringify(this.snapshot.exportVal())},t}(),Ht=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),Gt=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new zt("value",this,new Wt(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Ht(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),Kt=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,s.contains(this.callbacks_,e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Ht(this,t,e):null},t.prototype.createEvent=function(t,e){s.assert(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new zt(t.type,this,new Wt(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){var n=this;if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;
2if(this.context_===e.context_){var r=Object.keys(e.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return s===a&&(!e.callbacks_[a]||!this.callbacks_[s]||e.callbacks_[a]===this.callbacks_[s])}return i.every((function(t){return e.callbacks_[t]===n.callbacks_[t]}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),Qt=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(Vt,"Reference.ts has not been loaded"),Vt},set:function(t){Vt=t},enumerable:!0,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===yt){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==N)throw new Error(r);if("string"!==typeof e)throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==x)throw new Error(r);if("string"!==typeof n)throw new Error(i)}}else if(t.getIndex()===St){if(null!=e&&!J(e)||null!=n&&!J(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(s.assert(t.getIndex()instanceof Bt||t.getIndex()===qt,"unknown index type."),null!=e&&"object"===typeof e||null!=n&&"object"===typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return s.validateArgCount("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){s.validateArgCount("Query.on",2,4,arguments.length),rt("Query.on",1,e,!1),s.validateCallback("Query.on",2,n,!1);var o=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[e]=n,this.onChildEvent(a,o.cancel,o.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new Gt(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new Kt(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){s.validateArgCount("Query.off",0,3,arguments.length),rt("Query.off",1,t,!0),s.validateCallback("Query.off",2,e,!0),s.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var o=e||null;r=new Gt(o,null,n||null)}else t&&(e&&((i={})[t]=e),r=new Kt(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},t.prototype.once=function(e,n,r,i){var o=this;s.validateArgCount("Query.once",1,4,arguments.length),rt("Query.once",1,e,!1),s.validateCallback("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),u=!0,c=new s.Deferred;c.promise.catch((function(){}));var l=function t(r){u&&(u=!1,o.off(e,t),n&&n.bind(a.context)(r),c.resolve(r))};return this.on(e,l,(function(t){o.off(e,l),a.cancel&&a.cancel.bind(a.context)(t),c.reject(t)})),c.promise},t.prototype.limitToFirst=function(e){if(s.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToFirst(e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(s.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set
2(by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToLast(e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(s.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');ot("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new q(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new Bt(n),i=this.queryParams_.orderBy(r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){s.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=this.queryParams_.orderBy(yt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){s.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=this.queryParams_.orderBy(St);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){s.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=this.queryParams_.orderBy(qt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.startAt",0,2,arguments.length),Z("Query.startAt",1,e,this.path,!0),it("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.endAt",0,2,arguments.length),Z("Query.endAt",1,e,this.path,!0),it("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(s.validateArgCount("Query.equalTo",1,2,arguments.length),Z("Query.equalTo",1,t,this.path,!1),it("Query.equalTo",2,e,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return s.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return s.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=R(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(s.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}
2var r=this.repo===e.repo,i=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return r&&i&&o},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,s.validateCallback(t,3,r.cancel,!0),r.context=n,s.validateContextObject(t,4,r.context,!0);else if(e)if("object"===typeof e&&null!==e)r.context=e;else{if("function"!==typeof e)throw new Error(s.errorPrefix(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),Yt=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){return new t(this.node_.getImmediateChild(e))},t.prototype.node=function(){return this.node_},t}(),Xt=function(){function t(t,e){this.syncTree_=t,this.path_=e}return t.prototype.getImmediateChild=function(e){var n=this.path_.child(e);return new t(this.syncTree_,n)},t.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},t}(),$t=function(t,e,n){return t&&"object"===typeof t?(s.assert(".sv"in t,"Unexpected leaf node or priority contents"),"string"===typeof t[".sv"]?Jt(t[".sv"],e,n):"object"===typeof t[".sv"]?Zt(t[".sv"],e):void s.assert(!1,"Unexpected server value: "+JSON.stringify(t,null,2))):t},Jt=function(t,e,n){switch(t){case"timestamp":return n.timestamp;default:s.assert(!1,"Unexpected server value: "+t)}},Zt=function(t,e,n){t.hasOwnProperty("increment")||s.assert(!1,"Unexpected server value: "+JSON.stringify(t,null,2));var r=t.increment;"number"!==typeof r&&s.assert(!1,"Unexpected increment value: "+r);var i=e.node();if(s.assert(null!==i&&"undefined"!==typeof i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i.getValue();return"number"!==typeof o?r:o+r},te=function(t,e,n,r){return ne(e,new Xt(n,t),r)},ee=function(t,e,n){return ne(t,new Yt(e),n)};function ne(t,e,n){var r,i=t.getPriority().val(),o=$t(i,e.getImmediateChild(".priority"),n);if(t.isLeafNode()){var a=t,s=$t(a.getValue(),e,n);return s!==a.getValue()||o!==a.getPriority().val()?new Et(s,Ut(o)):t}var u=t;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new Et(o))),u.forEachChild(St,(function(t,i){var o=ne(i,e.getImmediateChild(t),n);o!==i&&(r=r.updateImmediateChild(t,o))})),r}var re,ie=function(){function t(){this.value=null,this.children=new Map}return t.prototype.find=function(t){if(null!=this.value)return this.value.getChild(t);if(!t.isEmpty()&&this.children.size>0){var e=t.getFront();return t=t.popFront(),this.children.has(e)?this.children.get(e).find(t):null}return null},t.prototype.remember=function(e,n){if(e.isEmpty())this.value=n,this.children.clear();else if(null!==this.value)this.value=this.value.updateChild(e,n);else{var r=e.getFront();this.children.has(r)||this.children.set(r,new t);var i=this.children.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.value=null,this.children.clear(),!0;if(null!==this.value){if(this.value.isLeafNode())return!1;var e=this.value;this.value=null;var n=this;return e.forEachChild(St,(function(t,e){n.remember(new q(t),e)})),this.forget(t)}if(this.children.size>0){var r=t.getFront();if(t=t.popFront(),this.children.has(r))this.children.get(r).forget(t)&&this.children.delete(r);return 0===this.children.size}return!0},t.prototype.forEachTree=function(t,e){null!==this.value?e(t,this.value):this.forEachChild((function(n,r){var i=new q(t.toString()+"/"+n);r.forEachTree(i,e)}))},t.prototype.forEachChild=function(t){this.children.forEach((function(e,n){t(n,e)}))},t}();!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(re||(re={}));var oe,ae,se=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,s.assert(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),ue=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=re.ACK_USER_WRITE,this.source=se.User}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return s.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new q(e));return new t(q.Empty,n,this.revert)}return s.assert(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),ce=function(){function t(t,e){void 0===e&&(oe||(oe=new xt(A)),e=oe),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return L(e,(function(t,e){n=n.set(new q(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:q.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new q(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=(this.children.get(r)||t.Empty).set(e.popFront(),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r=e.getFront(),i=(this.children.get(r)||t.Empty).setTree(e.popFront(),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new t(this.value,o)},t.prototype.fold=function(t){return this.fold_(q.Empty,t)}
2,t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(t.child(r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,q.Empty,e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.findOnPath_(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,q.Empty,e)},t.prototype.foreachOnPath_=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.foreach_(q.Empty,t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(t.child(n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){n.value&&t(e,n.value)}))},t.Empty=new t(null),t}(),le=function(){function t(t,e){this.source=t,this.path=e,this.type=re.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,q.Empty):new t(this.source,this.path.popFront())},t}(),he=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=re.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,q.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),fe=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=re.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new q(e));return n.isEmpty()?null:n.value?new he(this.source,q.Empty,n.value):new t(this.source,q.Empty,n)}return s.assert(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),pe=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),de=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new pe(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new pe(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t.Empty=new t(new pe(Ft.EMPTY_NODE,!1,!1),new pe(Ft.EMPTY_NODE,!1,!1)),t}(),ve=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),ye=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,o){s.assert(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=t.getImmediateChild(e);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?t:(null!=o&&(n.isEmpty()?t.hasChild(e)?o.trackChildChange(ve.childRemovedChange(e,a)):s.assert(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(ve.childAddedChange(e,n)):o.trackChildChange(ve.childChangedChange(e,n,a))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(St,(function(t,r){e.hasChild(t)||n.trackChildChange(ve.childRemovedChange(t,r))})),e.isLeafNode()||e.forEachChild(St,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(ve.childChangedChange(e,r,i))}else n.trackChildChange(ve.childAddedChange(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Ft.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),ge=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;s.assert(e===ve.CHILD_ADDED||e===ve.CHILD_CHANGED||e===ve.CHILD_REMOVED,"Only child changes supported for tracking"),s.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var r=this.changeMap.get(n);if(r){var i=r.type;if(e===ve.CHILD_ADDED&&i===ve.CHILD_REMOVED)this.changeMap.set(n,ve.childChangedChange(n,t.snapshotNode,r.snapshotNode));else if(e===ve.CHILD_REMOVED&&i===ve.CHILD_ADDED)this.changeMap.delete(n);else if(e===ve.CHILD_REMOVED&&i===ve.CHILD_CHANGED)this.changeMap.set(n,ve.childRemovedChange(n,r.oldSnap));else if(e===ve.CHILD_CHANGED&&i===ve.CHILD_ADDED)this.changeMap.set(n,ve.childAddedChange(n,t.snapshotNode));else{if(e!==ve.CHILD_CHANGED||i!==ve.CHILD_CHANGED)throw s.assertionError("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap.set(n,ve.childChangedChange(n,t.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),me=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),be=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new pe(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),_e=function(t,e){this.viewCache=t,this.changes=e},we=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){s.assert(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),s.assert(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var o,a,u=new ge;if(n.type===re.OVERWRITE){var c=n;c.source.fromUser?o=this.applyUserOverwrite_(e,c.path,c.snap,r,i,u):(s.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.getServerCache().isFiltered()&&!c.path.isEmpty(),o=this.applyServerOverwrite_(e,c.path,c.snap,r,i,a,u))}else if(n.type===re.MERGE){var l=n;l.source.fromUser?o=this.applyUserMerge_(e,l.path,l.children,r,i,u):(s.assert(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.getServerCache().isFiltered(),o=this.applyServerMerge_(e,l.path,l.children,r,i,a,u))}else if(n.type===re.ACK_USER_WRITE){var h=n;o=h.revert?this.revertUserWrite_(e,h.path,r,i,u):this.ackUserWrite_(e,h.path,h.affectedTree,r,i,u)}else{if(n.type!==re.LISTEN_COMPLETE)throw s.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(e,n.path,r,u)}var f=u.getChanges();return t.maybeAddValueEvent_(e,o,f),new _e(o,f)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>
20||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(ve.valueChange(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var o=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var a=void 0,u=void 0;if(e.isEmpty())if(s.assert(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var c=t.getCompleteServerSnap(),l=c instanceof Ft?c:Ft.EMPTY_NODE,h=n.calcCompleteEventChildren(l);a=this.filter_.updateFullNode(t.getEventCache().getNode(),h,i)}else{var f=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),f,i)}else{var p=e.getFront();if(".priority"===p){s.assert(1===e.getLength(),"Can't have a priority with additional path components");var d=o.getNode();u=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,d,u);a=null!=v?this.filter_.updatePriority(d,v):o.getNode()}else{var y=e.popFront(),g=void 0;if(o.isCompleteForChild(p)){u=t.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),u);g=null!=m?o.getNode().getImmediateChild(p).updateChild(y,m):o.getNode().getImmediateChild(p)}else g=n.calcCompleteChild(p,t.getServerCache());a=null!=g?this.filter_.updateChild(o.getNode(),p,g,y,r,i):o.getNode()}}return t.updateEventSnap(a,o.isFullyInitialized()||e.isEmpty(),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,a){var s,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())s=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var l=u.getNode().updateChild(e,n);s=c.updateFullNode(u.getNode(),l,null)}else{var h=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var f=e.popFront(),p=u.getNode().getImmediateChild(h).updateChild(f,n);s=".priority"===h?c.updatePriority(u.getNode(),p):c.updateChild(u.getNode(),h,p,f,me,null)}var d=t.updateServerSnap(s,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),v=new be(r,d,i);return this.generateEventCacheAfterServerEvent_(d,e,r,v,a)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var a,s,u=t.getEventCache(),c=new be(r,t,i);if(e.isEmpty())s=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),a=t.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var l=e.getFront();if(".priority"===l)s=this.filter_.updatePriority(t.getEventCache().getNode(),n),a=t.updateEventSnap(s,u.isFullyInitialized(),u.isFiltered());else{var h=e.popFront(),f=u.getNode().getImmediateChild(l),p=void 0;if(h.isEmpty())p=n;else{var d=c.getCompleteChild(l);p=null!=d?".priority"===h.getBack()&&d.getChild(h.parent()).isEmpty()?d:d.updateChild(h,n):Ft.EMPTY_NODE}if(f.equals(p))a=t;else{var v=this.filter_.updateChild(u.getNode(),l,p,h,c,o);a=t.updateEventSnap(v,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,a){var s=this,u=e;return r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())&&(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())||(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),u},t.prototype.applyMerge_=function(t,e){return e.foreach((function(e,n){t=t.updateChild(e,n)})),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,a){var s=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=e.isEmpty()?n:ce.Empty.setTree(e,n);var l=t.getServerCache().getNode();return u.children.inorderTraversal((function(e,n){if(l.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),h=s.applyMerge_(u,n);c=s.applyServerOverwrite_(c,new q(e),h,r,i,o,a)}})),u.children.inorderTraversal((function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!l.hasChild(e)&&!u){var h=t.getServerCache().getNode().getImmediateChild(e),f=s.applyMerge_(h,n);c=s.applyServerOverwrite_(c,new q(e),f,r,i,o,a)}})),c},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var a=t.getServerCache().isFiltered(),s=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,s.getNode().getChild(e),r,i,a,o);if(e.isEmpty()){var u=ce.Empty;
2return s.getNode().forEachChild(yt,(function(t,e){u=u.set(new q(t),e)})),this.applyServerMerge_(t,e,u,r,i,a,o)}return t}var c=ce.Empty;return n.foreach((function(t,n){var r=e.child(t);s.isCompleteForPath(r)&&(c=c.set(t,s.getNode().getChild(r)))})),this.applyServerMerge_(t,e,c,r,i,a,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,me,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var a=new be(n,t,r),u=t.getEventCache().getNode(),c=void 0;if(e.isEmpty()||".priority"===e.getFront()){var l=void 0;if(t.getServerCache().isFullyInitialized())l=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var h=t.getServerCache().getNode();s.assert(h instanceof Ft,"serverChildren would be complete if leaf node"),l=n.calcCompleteEventChildren(h)}l=l,c=this.filter_.updateFullNode(u,l,i)}else{var f=e.getFront(),p=n.calcCompleteChild(f,t.getServerCache());null==p&&t.getServerCache().isCompleteForChild(f)&&(p=u.getImmediateChild(f)),(c=null!=p?this.filter_.updateChild(u,f,p,e.popFront(),a,i):t.getEventCache().getNode().hasChild(f)?this.filter_.updateChild(u,f,Ft.EMPTY_NODE,e.popFront(),a,i):u).isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(c=this.filter_.updateFullNode(c,o,i))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(q.Empty),t.updateEventSnap(c,o,this.filter_.filtersNodes())},t}(),Ee=function(){function t(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach((function(t){t.type===ve.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(ve.childMovedChange(t.childName,t.snapshotNode))})),this.generateEventsForType_(i,ve.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,ve.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,ve.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,ve.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,ve.VALUE,t,n,e),i},t.prototype.generateEventsForType_=function(t,e,n,r,i){var o=this,a=n.filter((function(t){return t.type===e}));a.sort(this.compareChanges_.bind(this)),a.forEach((function(e){var n=o.materializeSingleChange_(e,i);r.forEach((function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.query_))}))}))},t.prototype.materializeSingleChange_=function(t,e){return"value"===t.type||"child_removed"===t.type||(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.index_)),t},t.prototype.compareChanges_=function(t,e){if(null==t.childName||null==e.childName)throw s.assertionError("Should only compare child_ events.");var n=new pt(t.childName,t.snapshotNode),r=new pt(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),Te=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new ye(n.getIndex()),i=n.getNodeFilter();this.processor_=new we(i);var o=e.getServerCache(),a=e.getEventCache(),s=r.updateFullNode(Ft.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(Ft.EMPTY_NODE,a.getNode(),null),c=new pe(s,o.isFullyInitialized(),r.filtersNodes()),l=new pe(u,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=new de(l,c),this.eventGenerator_=new Ee(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){s.assert(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(t){e=e;var i=t.createCancelEvent(e,r);i&&n.push(i)}))}if(t){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===re.MERGE&&null!==t.source.queryId&&(s.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full c
2ache before handling merges"),s.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,t,e,n);return this.processor_.assertIndexed(i.viewCache),s.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];e.getNode().isLeafNode()||e.getNode().forEachChild(St,(function(t,e){n.push(ve.childAddedChange(t,e))}));return e.isFullyInitialized()&&n.push(ve.valueChange(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){var r=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(t,e,r)},t}(),Ie=function(){function t(){this.views=new Map}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(ae,"Reference.ts has not been loaded"),ae},set:function(t){s.assert(!ae,"__referenceConstructor has already been defined"),ae=t},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return 0===this.views.size},t.prototype.applyOperation=function(t,e,n){var r,i,o=t.source.queryId;if(null!==o){var u=this.views.get(o);return s.assert(null!=u,"SyncTree gave us an op for an invalid query."),u.applyOperation(t,e,n)}var c=[];try{for(var l=a.__values(this.views.values()),h=l.next();!h.done;h=l.next()){u=h.value;c=c.concat(u.applyOperation(t,e,n))}}catch(f){r={error:f}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return c},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),a=this.views.get(o);if(!a){var s=n.calcCompleteEventCache(i?r:null),u=!1;s?u=!0:r instanceof Ft?(s=n.calcCompleteEventChildren(r),u=!1):(s=Ft.EMPTY_NODE,u=!1);var c=new de(new pe(s,u,!1),new pe(r,i,!1));a=new Te(t,c),this.views.set(o,a)}return a.addEventRegistration(e),a.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var i,o,s=e.queryIdentifier(),u=[],c=[],l=this.hasCompleteView();if("default"===s)try{for(var h=a.__values(this.views.entries()),f=h.next();!f.done;f=h.next()){var p=a.__read(f.value,2),d=p[0],v=p[1];c=c.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(d),v.getQuery().getQueryParams().loadsAllData()||u.push(v.getQuery()))}}catch(y){i={error:y}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}else(v=this.views.get(s))&&(c=c.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(s),v.getQuery().getQueryParams().loadsAllData()||u.push(v.getQuery())));return l&&!this.hasCompleteView()&&u.push(new t.__referenceConstructor(e.repo,e.path)),{removed:u,events:c}},t.prototype.getQueryViews=function(){var t,e,n=[];try{for(var r=a.__values(this.views.values()),i=r.next();!i.done;i=r.next()){var o=i.value;o.getQuery().getQueryParams().loadsAllData()||n.push(o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.getCompleteServerCache=function(t){var e,n,r=null;try{for(var i=a.__values(this.views.values()),o=i.next();!o.done;o=i.next()){var s=o.value;r=r||s.getCompleteServerCache(t)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return this.views.get(e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){var t,e;try{for(var n=a.__values(this.views.values()),r=n.next();!r.done;r=n.next()){var i=r.value;if(i.getQuery().getQueryParams().loadsAllData())return i}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},t}(),Se=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new ce(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,a=q.relativePath(i,e);return o=o.updateChild(a,n),new t(this.writeTree_.set(i,o))}var s=new ce(n);return new t(this.writeTree_.setTree(e,s))},t.prototype.addWrites=function(t,e){var n=this;return L(e,(function(e,r){n=n.addWrite(t.child(e),r)})),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.writeTree_.setTree(e,ce.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.writeTree_.findRootMostValueAndPath(t);return null!=e?this.writeTree_.get(e.path).getChild(q.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild(St,(function(e,n){t.push(new pt(e,n))}
2)):this.writeTree_.children.inorderTraversal((function(e,n){null!=n.value&&t.push(new pt(e,n.value))})),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new ce(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(t){return function t(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);var i=null;return n.children.inorderTraversal((function(n,o){".priority"===n?(s.assert(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=t(e.child(n),o,r)})),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r}(q.Empty,this.writeTree_,t)},t.Empty=new t(new ce(null)),t}();var Ce=function(){function t(){this.visibleWrites_=Se.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new ke(t,this)},t.prototype.addOverwrite=function(t,e,n,r){s.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){s.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex((function(e){return e.writeId===t}));s.assert(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,o=!1,a=this.allWrites_.length-1;i&&a>=0;){var u=this.allWrites_[a];u.visible&&(a>=n&&this.recordContainsPath_(u,r.path)?i=!1:r.path.contains(u.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):L(r.children,(function(t){e.visibleWrites_=e.visibleWrites_.removeWrite(r.path.child(t))}));return!0}return!1},t.prototype.getCompleteWriteData=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(e);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(q.Empty)){var a=t.layerTree_(this.allWrites_,(function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))}),e);c=n||Ft.EMPTY_NODE;return a.apply(c)}return null}var s=this.visibleWrites_.getCompleteNode(e);if(null!=s)return s;var u=this.visibleWrites_.childCompoundWrite(e);if(u.isEmpty())return n;if(null!=n||u.hasCompleteWrite(q.Empty)){var c=n||Ft.EMPTY_NODE;return u.apply(c)}return null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Ft.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(St,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild(St,(function(t,e){var r=i.childCompoundWrite(new q(t)).apply(e);n=n.updateImmediateChild(t,r)}
2)),i.getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return this.visibleWrites_.childCompoundWrite(t).getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){s.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(e):o.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var a,s=this.visibleWrites_.childCompoundWrite(t),u=s.getCompleteNode(q.Empty);if(null!=u)a=u;else{if(null==e)return[];a=s.apply(e)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var c=[],l=o.getCompare(),h=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),f=h.getNext();f&&c.length<r;)0!==l(f,n)&&c.push(f),f=h.getNext();return c},t.prototype.recordContainsPath_=function(t,e){if(t.snap)return t.path.contains(e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&t.path.child(n).contains(e))return!0;return!1},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,q.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=Se.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var a=o.path,u=void 0;if(o.snap)n.contains(a)?(u=q.relativePath(n,a),r=r.addWrite(u,o.snap)):a.contains(n)&&(u=q.relativePath(a,n),r=r.addWrite(q.Empty,o.snap.getChild(u)));else{if(!o.children)throw s.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))u=q.relativePath(n,a),r=r.addWrites(u,o.children);else if(a.contains(n))if((u=q.relativePath(a,n)).isEmpty())r=r.addWrites(q.Empty,o.children);else{var c=s.safeGet(o.children,u.getFront());if(c){var l=c.getChild(u.popFront());r=r.addWrite(q.Empty,l)}}}}}return r},t}(),ke=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(this.treePath_.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(this.treePath_.child(e),this.writeTree_)},t}(),Ne=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=ce.Empty,this.pendingWriteTree_=new Ce,this.tagToQueryMap=new Map,this.queryToTagMap=new Map}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.pendingWriteTree_.addOverwrite(t,e,n,r),r?this.applyOperationToSyncPoints_(new he(se.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=ce.fromObject(e);return this.applyOperationToSyncPoints_(new fe(se.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t);if(this.pendingWriteTree_.removeWrite(t)){var r=ce.Empty;return null!=n.snap?r=r.set(q.Empty,!0):L(n.children,(function(t,e){r=r.set(new q(t),e)})),this.applyOperationToSyncPoints_(new ue(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new he(se.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=ce.fromObject(e);return this.applyOperationToSyncPoints_(new fe(se.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new le(se.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=q.relativePath(a,e),c=new he(se.forServerTaggedQuery(s),u,n);return this.applyTaggedOperation_(a,c)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.queryKeyForTag_(r);if(i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=q.relativePath(a,e),c=ce.fromObject(n),l=new fe(se.forServerTaggedQuery(s),u,c);return this.applyTaggedOperation_(a,l)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.queryKeyForTag_(n);if(r){var i=t.parseQueryKey_(r),o=i.path,a=i.queryId,s=q.relativePath(o,e),u=new le(se.forServerTaggedQuery(a),s);return this.applyTaggedOperation_(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,(function(t,e){var n=q.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()}));var a,u=this.syncPointTree_.get(r);(u?(o=o||u.hasCompleteView(),i=i||u.getCompleteServerCache(q.Empty)):(u=new Ie,this.syncPointTree_=this.syncPointTree_.set(r,u)),null!=i)?a=!0:(a=!1,i=Ft.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild((function(t,e){var n=e.getCompleteServerCache(q.Empty);n&&(i=i.updateImmediateChild(t,n))}
2)));var c=u.viewExistsForQuery(e);if(!c&&!e.getQueryParams().loadsAllData()){var l=t.makeQueryKey_(e);s.assert(!this.queryToTagMap.has(l),"View does not exist, but we have a tag");var h=t.getNextQueryTag_();this.queryToTagMap.set(l,h),this.tagToQueryMap.set(h,l)}var f=this.pendingWriteTree_.childWrites(r),p=u.addEventRegistration(e,n,f,i,a);if(!c&&!o){var d=u.viewForQuery(e);p=p.concat(this.setupListener_(e,d))}return p},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,a=this.syncPointTree_.get(o),s=[];if(a&&("default"===e.queryIdentifier()||a.viewExistsForQuery(e))){var u=a.removeEventRegistration(e,n,r);a.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;s=u.events;var l=-1!==c.findIndex((function(t){return t.getQueryParams().loadsAllData()})),h=this.syncPointTree_.findOnPath(o,(function(t,e){return e.hasCompleteView()}));if(l&&!h){var f=this.syncPointTree_.subtree(o);if(!f.isEmpty())for(var p=this.collectDistinctViewsForSubTree_(f),d=0;d<p.length;++d){var v=p[d],y=v.getQuery(),g=this.createListenerForView_(v);this.listenProvider_.startListening(t.queryForListening_(y),this.tagForQuery_(y),g.hashFn,g.onComplete)}}if(!h&&c.length>0&&!r)if(l){this.listenProvider_.stopListening(t.queryForListening_(e),null)}else c.forEach((function(e){var n=i.queryToTagMap.get(t.makeQueryKey_(e));i.listenProvider_.stopListening(t.queryForListening_(e),n)}));this.removeTags_(c)}return s},t.prototype.calcCompleteEventCache=function(t,e){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(t,(function(e,n){var r=q.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i}));return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold((function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),L(n,(function(t,e){r=r.concat(e)})),r}))},t.prototype.removeTags_=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.makeQueryKey_(r),o=this.queryToTagMap.get(i);this.queryToTagMap.delete(i),this.tagToQueryMap.delete(o)}}},t.queryForListening_=function(t){return t.getQueryParams().loadsAllData()&&
2!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.setupListener_=function(e,n){var r=e.path,i=this.tagForQuery_(e),o=this.createListenerForView_(n),a=this.listenProvider_.startListening(t.queryForListening_(e),i,o.hashFn,o.onComplete),u=this.syncPointTree_.subtree(r);if(i)s.assert(!u.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var c=u.fold((function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map((function(t){return t.getQuery()})))),L(n,(function(t,e){r=r.concat(e)})),r})),l=0;l<c.length;++l){var h=c[l];this.listenProvider_.stopListening(t.queryForListening_(h),this.tagForQuery_(h))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(t.getServerCache()||Ft.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?n="Client doesn't have permission to access the desired data.":"unavailable"===t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(t,n);return e.removeEventRegistration(n,null,i)}}},t.makeQueryKey_=function(t){return t.path.toString()+"$"+t.queryIdentifier()},t.parseQueryKey_=function(t){var e=t.indexOf("$");return s.assert(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new q(t.substr(0,e))}},t.prototype.queryKeyForTag_=function(t){return this.tagToQueryMap.get(t)},t.prototype.tagForQuery_=function(e){var n=t.makeQueryKey_(e);return this.queryToTagMap.get(n)},t.getNextQueryTag_=function(){return t.nextQueryTag_++},t.prototype.applyTaggedOperation_=function(t,e){var n=this.syncPointTree_.get(t);s.assert(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.applyOperationToSyncPoints_=function(t){return this.applyOperationHelper_(t,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(q.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(q.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(q.Empty));var o=[],a=t.path.getFront(),s=t.operationForChild(a),u=e.children.get(a);if(u&&s){var c=n?n.getImmediateChild(a):null,l=r.child(a);o=o.concat(this.applyOperationHelper_(s,u,c,l))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.applyOperationDescendantsHelper_=function(t,e,n,r){var i=this,o=e.get(q.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(q.Empty));var a=[];return e.children.inorderTraversal((function(e,o){var s=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(a=a.concat(i.applyOperationDescendantsHelper_(c,o,s,u)))})),o&&(a=a.concat(o.applyOperation(t,r,n))),a},t.nextQueryTag_=1,t}(),xe=function(){function t(){this.rootNode_=Ft.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),Pe=function(){function t(t,e){var n=this;this.app_=t,this.authProvider_=e,this.auth_=null,this.auth_=e.getImmediate({optional:!0}),this.auth_||e.get().then((function(t){return n.auth_=t}))}return t.prototype.getToken=function(t){return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(E("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})):Promise.resolve(null)},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):(setTimeout((function(){return t(null)}),0),this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)})))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',C(t)},t}(),Ae=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),s.contains(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return s.deepCopy(this.counters_)},t}(),Oe=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new Ae),this.collections_[e]},t.getOrCreateReporter=function(t,e){var n=t.toString();return this.reporters_[n]||(this.reporters_[n]=e()),this.reporters_[n]},t.collections_={},t.reporters_={},t}(),Re=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=a.__assign({},t);return this.last_&&L(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),De=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Re(t);var n=1e4+2e4*Math.random();V(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.statsToReport_[t]=!0},t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;L(e,(function(e,i){i>0&&s.contains(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),V(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}(),Le=function(){function t(){this.eventLists_=[],this.recursionDepth_=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.eventLists_.push(e),e=null),null===e&&(e=new Me(i)),e.add(r)}e&&this.eventLists_.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.equals(t)}))},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.contains(t)||t.contains(e)}))},t.prototype.raiseQueuedEventsMatchingPredicate_=function(t){this.recursionDepth_++;for(var e=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];if(r)t(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),Me=function(){function t(t){this.path_=t,this.events_=[]}
2return t.prototype.add=function(t){this.events_.push(t)},t.prototype.raise=function(){for(var t=0;t<this.events_.length;t++){var e=this.events_[t];if(null!==e){this.events_[t]=null;var n=e.getEventRunner();b&&E("event: "+e.toString()),U(n)}}},t.prototype.getPath=function(){return this.path_},t}(),Fe=function(){function t(t){this.allowedEvents_=t,this.listeners_={},s.assert(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=a.__spread(this.listeners_[t]),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){s.assert(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),je=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(n="visibilitychange",e="hidden"):"undefined"!==typeof document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document.msHidden?(n="msvisibilitychange",e="msHidden"):"undefined"!==typeof document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return a.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(Fe),Ue=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||s.isMobileCordova()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return a.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(Fe),Ve=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&U((function(){n.onMessage_(t[e])}))},r=0;r<t.length;++r)e(r);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum];){if("break"===r())break}},t}(),qe=function(){function t(t,e,n,r,i){this.connId=t,this.repoInfo=e,this.applicationId=n,this.transportSessionId=r,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=T(t),this.stats_=Oe.getCollection(e),this.urlFn=function(t){return e.connectionURL("long_polling",t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new Ve(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(s.isNodeSdk()||"complete"===document.readyState)t();else{var e=!1,n=function n(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((function(){if(!n.isClosed_){n.scriptTagHolder=new Be((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=a.__read(t,5),i=r[0],o=r[1],s=r[2];r[3],r[4];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"===i)n.id=o,n.password=s;else{if("close"!==i)throw new Error("Unrecognized command received: "+i);o?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(o,(function(){n.onClosed_()}))):n.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=a.__read(t,2),i=r[0],o=r[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(i,o)}),(function(){n.onClosed_()}),n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),n.applicationId&&(t.p=n.applicationId),"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return!s.isNodeSdk()&&(!!t.forceAllow_||!t.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===typeof Windows&&"object"===typeof Windows.UI))},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=s.base64Encode(e),r=D(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!s.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=s.stringify(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),Be=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,s.isNodeSdk())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=y(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createI
2Frame_();var o="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))o='<script>document.domain="'+document.domain+'";<\/script>';var a="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(u){E("frame writing exception"),u.stack&&E(u.stack),E(u)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||E("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)}),Math.floor(0)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e);var r=function(){n.outstandingRequests.delete(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;s.isNodeSdk()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){E("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}}),Math.floor(1))},t}(),We="";var ze=null;"undefined"!==typeof MozWebSocket?ze=MozWebSocket:"undefined"!==typeof WebSocket&&(ze=WebSocket);var He=function(){function t(e,n,r,i,o){this.connId=e,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=T(this.connId),this.stats_=Oe.getCollection(n),this.connURL=t.connectionURL_(n,i,o)}return t.connectionURL_=function(t,e,n){var r={v:"5"};return!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL("websocket",r)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,p.set("previous_websocket_failure",!0);try{if(s.isNodeSdk()){var i=s.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+We+"/"+r.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},a=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}),u=0===this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;u&&(o.proxy={origin:u}),this.mySock=new ze(this.connURL,[],o)}else{o={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new ze(this.connURL,[],o)}}catch(l){this.log_("Error instantiating WebSocket.");var c=l.message||l.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0}
2,this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error. Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==ze&&!t.forceDisallow_},t.previouslyFailed=function(){return p.isInMemoryStorage||!0===p.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){p.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var n=s.jsonEval(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if(s.assert(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=D(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Ge=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[qe,He]},enumerable:!0,configurable:!0}),t.prototype.initTransports_=function(e){var n,r,i=He&&He.isAvailable(),o=i&&!He.previouslyFailed();if(e.webSocketOnly&&(i||C("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),o=!0),o)this.transports_=[He];else{var s=this.transports_=[];try{for(var u=a.__values(t.ALL_TRANSPORTS),c=u.next();!c.done;c=u.next()){var l=c.value;l&&l.isAvailable()&&s.push(l)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),Ke=function(){function t(t,e,n,r,i,o,a,s){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=a,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=T("c:"+this.id+":"),this.transportManager_=new Ge(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=V((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>
2102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes. Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes. Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=O("t",t),n=O("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=O("t",t),n=O("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=O("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?I("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):I("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.updateHost(r),0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==n&&C("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),V((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received. New host: "+t),this.repoInfo_.updateHost(t),1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(p.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},t}(),Qe=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),Ye=function(t){function e(n,r,i,o,a,u,c){var l=t.call(this)||this;if(l.repoInfo_=n,l.applicationId_=r,l.onDataUpdate_=i,l.onConnectStatus_=o,l.onServerInfoUpdate_=a,l.authTokenProvider_=u,l.authOverride_=c,l.id=e.nextPersistentConnectionId_++,l.log_=T("p:"+l.id+":"),l.interruptReasons_={},l.listens=new Map,l.outstandingPuts_=[],l.outstandingPutCount_=0,l.onDisconnectRequestQueue_=[],l.connected_=!1,l.reconnectDelay_=1e3,l.maxReconnectDelay_=3e5,l.securityDebugCallback_=null,l.lastSessionId=null,l.establishConnectionTimer_=null,l.visible_=!1,l.requestCBHash_={},l.requestNumber_=0,l.realtime_=null,l.authToken_=null,l.forceTokenRefresh_=!1,l.invali
2dAuthTokenCount_=0,l.firstConnection_=!0,l.lastConnectionAttemptTime_=null,l.lastConnectionEstablishedTime_=null,c&&!s.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return l.scheduleConnect_(0),je.getInstance().on("visible",l.onVisible_,l),-1===n.host.indexOf("fblocal")&&Ue.getInstance().on("online",l.onOnline_,l),l}return a.__extends(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r:r,a:t,b:e};this.log_(s.stringify(i)),s.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),o=t.path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),s.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),s.assert(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:e,query:t,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};t.tag&&(a.q=r.queryObject(),a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,u=a.s;e.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===t&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,s))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"===typeof t&&s.contains(t,"w")){var n=s.safeGet(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',i=e.path.toString();C("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||s.isAdmin(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=s.isValidFormat(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"===typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),s.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){if("ok"!==t.s){var n=t.d;e.log_("reportStats","Error sending stats: "+n)}}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+s.stringify(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):I("Unrecognized action received from server: "+s.stringify(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;s.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);
2e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var t=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,o=this,a=this.lastSessionId,u=!1,c=null,l=function(){c?c.close():(u=!0,r())};this.realtime_={close:l,sendRequest:function(t){s.assert(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(t)}};var h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(h).then((function(e){u?E("getToken() completed but was canceled"):(E("getToken() completed. Creating connection."),o.authToken_=e&&e.accessToken,c=new Ke(i,o.repoInfo_,o.applicationId_,t,n,r,(function(t){C(t+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")}),a))})).then(null,(function(t){o.log_("Failed to get token: "+t),u||(s.CONSTANTS.NODE_ADMIN&&C(t),l())}))}},e.prototype.interrupt=function(t){E("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){E("Resuming connection for reason: "+t),delete this.interruptReasons_[t],s.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map((function(t){return R(t)})).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new q(t).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(e),i.delete(e),0===i.size&&this.listens.delete(r)}else n=void 0;return n},e.prototype.onAuthRevoked_=function(t,e){E("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t,e,n,r;this.tryAuth();try{for(var i=a.__values(this.listens.values()),o=i.next();!o.done;o=i.next()){var s=o.value;try{for(var u=(n=void 0,a.__values(s.values())),c=u.next();!c.done;c=u.next()){var l=c.value;this.sendListen_(l)}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(d){t={error:d}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var f=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(f.action,f.pathString,f.data,f.onComplete)}},e.prototype.sendConnectStats_=function(){var t={},e="js";s.CONSTANTS.NODE_ADMIN?e="admin_node":s.CONSTANTS.NODE_CLIENT&&(e="node"),t["sdk."+e+"."+We.replace(/\./g,"-")]=1,s.isMobileCordova()?t["framework.cordova"]=1:s.isReactNative()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=Ue.getInstance().currentlyOnline();return s.isEmpty(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(Qe),Xe=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=T("p:rest:"),i.listens_={},i}return a.__extends(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(s.assert(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var o=this,a=t.path.toString();this.log_("Listen called for "+a+" "+t.queryIdentifier());var u=e.getListenId_(t,r),c={};this.listens_[u]=c;var l=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",l,(function(t,e){var n=e;(404===t&&(n=null,t=null),null===t&&o.onDataUpdate_(a,n,!1,r),s.safeGet(o.listens_,u)===c)&&i(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var o=i&&i.accessToken;o&&(e.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+s.querystring(e);r.log_("Sending REST request for "+a);var u=new XMLHttpRequest;u.onreadystatechange=function(){if(n&&4===u.readyState){r.log_("REST Response for "+a+" received. status:",u.status,"response:",u.responseText);var t=null;if(u.status>=200&&u.status<300){try{t=s.jsonEval(u.responseText)}catch(e){C("Failed to parse JSON response for "+a+": "+u.responseText)}n(null,t)}else 401!==u.status&&404!==u.status&&C("Got unsuccessful REST response for "+a+" Status: "+u.status),n(u.status);n=null}},u.open("GET",a,!0),u.send()}))},e}(Qe),$e=function(){function t(t,e,n,r){var i=this;this.repoInfo_=t,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Le,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new ie,this.persistentConnection_=null;
2var o=new Pe(n,r);if(this.stats_=Oe.getCollection(t),e||("object"===typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new Xe(this.repoInfo_,this.onDataUpdate_.bind(this),o),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var a=n.options.databaseAuthVariableOverride;if("undefined"!==typeof a&&null!==a){if("object"!==typeof a)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{s.stringify(a)}catch(u){throw new Error("Invalid authOverride provided: "+u)}}this.persistentConnection_=new Ye(this.repoInfo_,n.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),o,a),this.server_=this.persistentConnection_}o.addTokenChangeListener((function(t){i.server_.refreshAuthToken(t)})),this.statsReporter_=Oe.getOrCreateReporter(t,(function(){return new De(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new xe,this.infoSyncTree_=new Ne({startListening:function(t,e,n,r){var o=[],a=i.infoData_.getNode(t.path);return a.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(t.path,a),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Ne({startListening:function(t,e,n,r){return i.server_.listen(t,n,e,(function(e,n){var o=r(e,n);i.eventQueue_.raiseEventsForChangedPath(t.path,o)})),[]},stopListening:function(t,e){i.server_.unlisten(t,e)}})}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t.prototype.name=function(){return this.repoInfo_.namespace},t.prototype.serverTime=function(){var t=this.infoData_.getNode(new q(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t},t.prototype.generateServerValues=function(){return(t=(t={timestamp:this.serverTime()})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new q(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var o=[];if(r)if(n){var a=s.map(e,(function(t){return Ut(t)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var u=Ut(e);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,u,r)}else if(n){var c=s.map(e,(function(t){return Ut(t)}));o=this.serverSyncTree_.applyServerMerge(i,c)}else{var l=Ut(e);o=this.serverSyncTree_.applyServerOverwrite(i,l)}var h=i;o.length>0&&(h=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(h,o)},t.prototype.interceptServerData_=function(t){this.interceptServerDataCallback_=t},t.prototype.onConnectStatus_=function(t){this.updateInfo_("connected",t),!1===t&&this.runOnDisconnectEvents_()},t.prototype.onServerInfoUpdate_=function(t){var e=this;L(t,(function(t,n){e.updateInfo_(t,n)}))},t.prototype.updateInfo_=function(t,e){var n=new q("/.info/"+t),r=Ut(e);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},t.prototype.getNextWriteId_=function(){return this.nextWriteId_++},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.log_("set",{path:t.toString(),value:e,priority:n});var o=this.generateServerValues(),a=Ut(e,n),s=this.serverSyncTree_.calcCompleteEventCache(t),u=ee(a,s,o),c=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserOverwrite(t,u,c,!0);this.eventQueue_.queueEvents(l),this.server_.put(t.toString(),a.val(!0),(function(e,n){var o="ok"===e;o||C("set at "+t+" failed: "+e);var a=i.serverSyncTree_.ackUserWrite(c,!o);i.eventQueue_.raiseEventsForChangedPath(t,a),i.callOnCompleteCallback(r,e,n)}));var h=this.abortTransactions_(t);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},t.prototype.update=function(t,e,n){var r=this;this.log_("update",{path:t.toString(),value:e});var i=!0,o=this.generateServerValues(),a={};if(L(e,(function(e,n){i=!1,a[e]=te(t.child(e),Ut(n),r.serverSyncTree_,o)})),i)E("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserMerge(t,a,s);this.eventQueue_.queueEvents(u),this.server_.merge(t.toString(),e,(function(e,i){var o="ok"===e;o||C("update at "+t+" failed: "+e);var a=r.serverSyncTree_.ackUserWrite(s,!o),u=a.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(u,a),r.callOnCompleteCallback(n,e,i)})),L(e,(function(e){var n=r.abortTransactions_(t.child(e));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(t,[])}},t.prototype.runOnDisconnectEvents_=function(){var t=this;this.log_("onDisconnectEvents");var e=this.generateServerValues(),n=new ie;this.onDisconnect_.forEachTree(q.Empty,(function(r,i){var o=te(r,i,t.serverSyncTree_,e);n.remember(r,o)}));var r=[];
2n.forEachTree(q.Empty,(function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)})),this.onDisconnect_=new ie,this.eventQueue_.raiseEventsForChangedPath(q.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.server_.onDisconnectCancel(t.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(t),n.callOnCompleteCallback(e,r,i)}))},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=Ut(e);this.server_.onDisconnectPut(t.toString(),i.val(!0),(function(e,o){"ok"===e&&r.onDisconnect_.remember(t,i),r.callOnCompleteCallback(n,e,o)}))},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=Ut(e,n);this.server_.onDisconnectPut(t.toString(),o.val(!0),(function(e,n){"ok"===e&&i.onDisconnect_.remember(t,o),i.callOnCompleteCallback(r,e,n)}))},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(s.isEmpty(e))return E("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(t.toString(),e,(function(i,o){"ok"===i&&L(e,(function(e,n){var i=Ut(n);r.onDisconnect_.remember(t.child(e),i)})),r.callOnCompleteCallback(n,i,o)}))},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.addEventRegistration(t,e):this.serverSyncTree_.addEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.removeEventRegistration(t,e):this.serverSyncTree_.removeEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!==typeof console){var e;t?(this.statsListener_||(this.statsListener_=new Re(this.stats_)),e=this.statsListener_.get()):e=this.stats_.get();var n=Object.keys(e).reduce((function(t,e){return Math.max(e.length,t)}),0);L(e,(function(t,e){for(var r=t,i=t.length;i<n+2;i++)r+=" ";console.log(r+e)}))}},t.prototype.statsIncrementCounter=function(t){this.stats_.incrementCounter(t),this.statsReporter_.includeStat(t)},t.prototype.log_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),E.apply(void 0,a.__spread([n],t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&U((function(){if("ok"===e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,t(o)}}))},Object.defineProperty(t.prototype,"database",{get:function(){return this.__database||(this.__database=new un(this))},enumerable:!0,configurable:!0}),t}(),Je=function(){function t(e){this.indexedFilter_=new ye(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new pt(e,n))||(n=Ft.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Ft.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(Ft.EMPTY_NODE);var i=this;return e.forEachChild(St,(function(t,e){i.matches(new pt(t,e))||(r=r.updateImmediateChild(t,Ft.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}
2(),Ze=function(){function t(t){this.rangedFilter_=new Je(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new pt(e,n))||(n=Ft.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Ft.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=Ft.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(Ft.EMPTY_NODE);var s=void 0,u=void 0,c=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();c=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),c=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){a=i.getNext();!h&&c(s,a)<=0&&(h=!0),h&&o<this.limit_&&c(a,u)<=0?o++:r=r.updateImmediateChild(a.name,Ft.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(t,e){return a(e,t)}}else o=this.index_.getCompare();var u=t;s.assert(u.numChildren()===this.limit_,"");var c=new pt(e,n),l=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),h=this.rangedFilter_.matches(c);if(u.hasChild(e)){for(var f=u.getImmediateChild(e),p=r.getChildAfterChild(this.index_,l,this.reverse_);null!=p&&(p.name===e||u.hasChild(p.name));)p=r.getChildAfterChild(this.index_,p,this.reverse_);var d=null==p?1:o(p,c);if(h&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(ve.childChangedChange(e,n,f)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(ve.childRemovedChange(e,f));var v=u.updateImmediateChild(e,Ft.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=i&&i.trackChildChange(ve.childAddedChange(p.name,p.node)),v.updateImmediateChild(p.name,p.node)):v}return n.isEmpty()?t:h&&o(l,c)>=0?(null!=i&&(i.trackChildChange(ve.childRemovedChange(l.name,l.node)),i.trackChildChange(ve.childAddedChange(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(l.name,Ft.EMPTY_NODE)):t},t}(),tn=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=St}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:N},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:x},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return s.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.copy_=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t.prototype.limit=function(t){var e=this.copy_();return e.limitSet_=!0,e.limit_=t,e.viewFrom_="",e},t.prototype.limitToFirst=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.copy_();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=e?(n.startNameSet_=!0,n.indexStartName_=e):(n.startNameSet_=!1,n.indexStartName_=""),n},t.prototype.endAt=function(t,e){var n=this.copy_();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==e?(n.endNameSet_=!0,n.indexEndName_=e):(n.endNameSet_=!1,n.indexEndName_=""),n},t.prototype.orderBy=function(t){var e=this.copy_();return e.index_=t,e},t.prototype.getQueryObject=function(){var e=t.WIRE_PROTOCOL_CONSTANTS_,n={};
2if(this.startSet_&&(n[e.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[e.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[e.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[e.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[e.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.index_!==St&&(n[e.INDEX]=this.index_.toString()),n},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===St},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new ye(this.getIndex()):this.hasLimit()?new Ze(this):new Je(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===St?e=n.PRIORITY_INDEX:this.index_===qt?e=n.VALUE_INDEX:this.index_===yt?e=n.KEY_INDEX:(s.assert(this.index_ instanceof Bt,"Unrecognized index type!"),e=this.index_.toString()),r[n.ORDER_BY]=s.stringify(e),this.startSet_&&(r[n.START_AT]=s.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+s.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=s.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+s.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},t.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},t.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},t.DEFAULT=new t,t}(),en=function(t){function e(e,n){if(!(e instanceof $e))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,tn.DEFAULT,!1)||this}return a.__extends(e,t),e.prototype.getKey=function(){return s.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return s.validateArgCount("Reference.child",1,1,arguments.length),"number"===typeof t?t=String(t):t instanceof q||(null===this.path.getFront()?at("Reference.child",1,t,!1):ot("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){s.validateArgCount("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){s.validateArgCount("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){s.validateArgCount("Reference.set",1,2,arguments.length),st("Reference.set",this.path),Z("Reference.set",1,t,this.path,!1),s.validateCallback("Reference.set",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(s.validateArgCount("Reference.update",1,2,arguments.length),st("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,C("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}et("Reference.update",1,t,this.path,!1),s.validateCallback("Reference.update",2,e,!0);var i=new s.Deferred;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(s.validateArgCount("Reference.setWithPriority",2,3,arguments.length),st("Reference.setWithPriority",this.path),Z("Reference.setWithPriority",1,t,this.path,!1),nt("Reference.setWithPriority",2,e,!1),s.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new s.Deferred;return this.repo.setWithPriority(this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return s.validateArgCount("Reference.remove",0,1,arguments.length),st("Reference.remove",this.path),s.validateCallback("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(s.validateArgCount("Reference.transaction",1,3,arguments.length),st("Reference.transaction",this.path),s.validateCallback("Reference.transaction",1,t,!1),s.validateCallback("Reference.transaction",2,e,!0),ct("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new s.Deferred;"function"===typeof e&&r.promise.catch((function(){}));var i=function(t,n,i){t?r.reject(t):r.resolve(new ht(n,i)),"function"===typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){s.validateArgCount("Reference.setPriority",1,2,arguments.length),st("Reference.setPriority",this.path),nt("Reference.setPriority",1,t,!1),s.validateCallback("Reference.setPriority",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){s.validateArgCount("Reference.push",0,2,arguments.length),st("Reference.push",this.path),Z("Reference.push",1,t,this.path,!0),s.validateCallback("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=ft(r),o=this.child(i),a=this.child(i);return n=null!=t?o.set(t,e).then((function(){return a})):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"===typeof e&&n.catch((function(){})),o},e.prototype.onDisconnect=function(){return st("Reference.onDisconnect",this.path),new lt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),e}(Qt);Qt.__referenceConstructor=en,Ie.__referenceConstructor=en;var nn,rn=function(){this.children={},this.childCount=0,this.value=null},on=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new rn),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){for(var n=e instanceof q?e:new q(e),r=this,i=n.getFront();null!==i;){r=new t(i,r,s.safeGet(r.node_.children,i)||new rn),i=(n=n.popFront()).getFront()}return r},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){s.assert("undefined"!==typeof t,"Cannot set value to undefined"),this.node_.value=t,this.updateParents_()},t.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},t.prototype.hasChildren=function(){return this.node_.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;L(this.node_.children,(function(r,i){e(new t(r,n,i))}))},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild((function(e){e.forEachDescendant(t,!0,n)})),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild((function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)}))},t.prototype.path=function(){return new q(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},t.prototype.name=function(){return this.name_},t.prototype.parent=function(){return this.parent_},t.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},t.prototype.updateChild_=function(t,e){var n=e.isEmpty(),r=s.contains(this.node_.children,t);n&&r?(delete this.node_.children[t],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[t]=e.node_,this.node_.childCount++,this.updateParents_())},t}();!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}(nn||(nn={})),$e.MAX_TRANSACTION_RETRIES_=25,$e.prototype.transactionsInit_=function(){this.transactionQueueTree_=new on},$e.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var i=function(){},o=new en(this,t);o.on("value",i);var a={path:t,update:e,onComplete:n,status:null,order:y(),applyLocally:r,retryCount:0,unwatcher:function(){o.off("value",i)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},u=this.getLatestState_(t);a.currentInputSnapshot=u;var c=a.update(u.val());if(void 0===c){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var l=new Wt(a.currentInputSnapshot,new en(this,a.path),St);a.onComplete(null,!1,l)}}else{tt("transaction failed: Data returned ",c,a.path),a.status=nn.RUN;var h=this.transactionQueueTree_.subTree(t),f=h.getValue()||[];f.push(a),h.setValue(f);var p=void 0;
2if("object"===typeof c&&null!==c&&s.contains(c,".priority"))p=s.safeGet(c,".priority"),s.assert(J(p),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else p=(this.serverSyncTree_.calcCompleteEventCache(t)||Ft.EMPTY_NODE).getPriority().val();p=p;var d=this.generateServerValues(),v=Ut(c,p),g=ee(v,u,d);a.currentOutputSnapshotRaw=v,a.currentOutputSnapshotResolved=g,a.currentWriteId=this.getNextWriteId_();var m=this.serverSyncTree_.applyUserOverwrite(t,g,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,m),this.sendReadyTransactions_()}},$e.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||Ft.EMPTY_NODE},$e.prototype.sendReadyTransactions_=function(t){var e=this;if(void 0===t&&(t=this.transactionQueueTree_),t||this.pruneCompletedTransactionsBelowNode_(t),null!==t.getValue()){var n=this.buildTransactionQueue_(t);s.assert(n.length>0,"Sending zero length transaction queue"),n.every((function(t){return t.status===nn.RUN}))&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild((function(t){e.sendReadyTransactions_(t)}))},$e.prototype.sendTransactionQueue_=function(t,e){for(var n=this,r=e.map((function(t){return t.currentWriteId})),i=this.getLatestState_(t,r),o=i,a=i.hash(),u=0;u<e.length;u++){var c=e[u];s.assert(c.status===nn.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),c.status=nn.SENT,c.retryCount++;var l=q.relativePath(t,c.path);o=o.updateChild(l,c.currentOutputSnapshotRaw)}var h=o.val(!0),f=t;this.server_.put(f.toString(),h,(function(r){n.log_("transaction put response",{path:f.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=0;a<e.length;a++){if(e[a].status=nn.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[a].currentWriteId)),e[a].onComplete){var s=e[a].currentOutputSnapshotResolved,u=new en(n,e[a].path),c=new Wt(s,u,St);o.push(e[a].onComplete.bind(null,null,!0,c))}e[a].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i);for(a=0;a<o.length;a++)U(o[a])}else{if("datastale"===r)for(a=0;a<e.length;a++)e[a].status===nn.SENT_NEEDS_ABORT?e[a].status=nn.NEEDS_ABORT:e[a].status=nn.RUN;else{C("transaction at "+f.toString()+" failed: "+r);for(a=0;a<e.length;a++)e[a].status=nn.NEEDS_ABORT,e[a].abortReason=r}n.rerunTransactions_(t)}}),a)},$e.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},$e.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n,r=[],i=[],o=t.filter((function(t){return t.status===nn.RUN})).map((function(t){return t.currentWriteId})),a=0;a<t.length;a++){var u=t[a],c=q.relativePath(e,u.path),l=!1,h=void 0;if(s.assert(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),u.status===nn.NEEDS_ABORT)l=!0,h=u.abortReason,i=i.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0));else if(u.status===nn.RUN)if(u.retryCount>=$e.MAX_TRANSACTION_RETRIES_)l=!0,h="maxretry",i=i.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0));else{var f=this.getLatestState_(u.path,o);u.currentInputSnapshot=f;var p=t[a].update(f.val());if(void 0!==p){tt("transaction failed: Data returned ",p,u.path);var d=Ut(p);"object"===typeof p&&null!=p&&s.contains(p,".priority")||(d=d.updatePriority(f.getPriority()));var v=u.currentWriteId,y=this.generateServerValues(),g=ee(d,f,y);u.currentOutputSnapshotRaw=d,u.currentOutputSnapshotResolved=g,u.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(v),1),i=(i=i.concat(this.serverSyncTree_.applyUserOverwrite(u.path,g,u.currentWriteId,u.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(v,!0))}else l=!0,h="nodata",i=i.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,i),i=[],l&&(t[a].status=nn.COMPLETED,n=t[a].unwatcher,setTimeout(n,Math.floor(0)),t[a].onComplete))if("nodata"===h){var m=new en(this,t[a].path),b=t[a].currentInputSnapshot,_=new Wt(b,m,St);r.push(t[a].onComplete.bind(null,null,!1,_))}else r.push(t[a].onComplete.bind(null,new Error(h),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(a=0;a<r.length;a++)U(r[a]);this.sendReadyTransactions_()}},$e.prototype.getAncestorTransactionNode_=function(t){var e,n=this.transactionQueueTree_;
2for(e=t.getFront();null!==e&&null===n.getValue();)n=n.subTree(e),e=(t=t.popFront()).getFront();return n},$e.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort((function(t,e){return t.order-e.order})),e},$e.prototype.aggregateTransactionQueuesForNode_=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild((function(t){n.aggregateTransactionQueuesForNode_(t,e)}))},$e.prototype.pruneCompletedTransactionsBelowNode_=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==nn.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild((function(t){e.pruneCompletedTransactionsBelowNode_(t)}))},$e.prototype.abortTransactions_=function(t){var e=this,n=this.getAncestorTransactionNode_(t).path(),r=this.transactionQueueTree_.subTree(t);return r.forEachAncestor((function(t){e.abortTransactionsOnNode_(t)})),this.abortTransactionsOnNode_(r),r.forEachDescendant((function(t){e.abortTransactionsOnNode_(t)})),n},$e.prototype.abortTransactionsOnNode_=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,o=0;o<e.length;o++)if(e[o].status===nn.SENT_NEEDS_ABORT);else if(e[o].status===nn.SENT)s.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=nn.SENT_NEEDS_ABORT,e[o].abortReason="set";else if(s.assert(e[o].status===nn.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r=r.concat(this.serverSyncTree_.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete){n.push(e[o].onComplete.bind(null,new Error("set"),!1,null))}-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r);for(o=0;o<n.length;o++)U(n[o])}};var an,sn=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return an||(an=new t),an},t.prototype.interrupt=function(){var t,e,n,r;try{for(var i=a.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var s=o.value;try{for(var u=(n=void 0,a.__values(Object.keys(this.repos_[s]))),c=u.next();!c.done;c=u.next()){var l=c.value;this.repos_[s][l].interrupt()}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){t={error:f}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.resume=function(){var t,e,n,r;try{for(var i=a.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var s=o.value;try{for(var u=(n=void 0,a.__values(Object.keys(this.repos_[s]))),c=u.next();!c.done;c=u.next()){var l=c.value;this.repos_[s][l].resume()}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){t={error:f}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.databaseFromApp=function(t,e,n){var i=n||t.options.databaseURL;void 0===i&&S("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var o=G(i),a=o.repoInfo,s=void 0;return"undefined"!==typeof r&&(s=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).FIREBASE_DATABASE_EMULATOR_HOST),s&&(i="http://"+s+"?ns="+a.namespace,a=(o=G(i)).repoInfo),ut("Invalid Firebase Database URL",1,o),o.path.isEmpty()||S("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(a,t,e).database},t.prototype.deleteRepo=function(t){var e=s.safeGet(this.repos_,t.app.name);e&&s.safeGet(e,t.repoInfo_.toURLString())===t||S("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),t.interrupt(),delete e[t.repoInfo_.toURLString()]},t.prototype.createRepo=function(t,e,n){var r=s.safeGet(this.repos_,e.name);r||(r={},this.repos_[e.name]=r);var i=s.safeGet(r,t.toURLString());return i&&S("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new $e(t,this.useRestClient_,e,n),r[t.toURLString()]=i,i},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),un=function(){function t(t){this.repo_=t,t instanceof $e||S("Don't call new Database() directly - please use firebase.database()."),this.root_=new en(t,q.Empty),this.INTERNAL=new cn(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),t.prototype.ref=function(t){return this.checkDeleted_("ref"),s.validateArgCount("database.ref",0,1,arguments.length),t instanceof en?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),s.validateArgCount(e,1,1,arguments.length);var n=G(t);ut(e,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&S(e+": Host name does not match the current database: (found "+r.host
2+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repo_&&S("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){s.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},t.prototype.goOnline=function(){s.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(t){return{".sv":{increment:t}}}},t}(),cn=function(){function t(t){this.database=t}return t.prototype.delete=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){return this.database.checkDeleted_("delete"),sn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]}))}))},t}(),ln=Object.freeze({__proto__:null,forceLongPolling:function(){He.forceDisallow(),qe.forceAllow()},forceWebSockets:function(){qe.forceDisallow()},isWebSocketsAvailable:function(){return He.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){t.repo.stats(e)},statsIncrementCounter:function(t,e){t.repo.statsIncrementCounter(e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return t.repo.interceptServerData_(e)}}),hn=Ye;Ye.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},Ye.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var fn=Ke,pn=W,dn=Object.freeze({__proto__:null,DataConnection:hn,RealTimeConnection:fn,hijackHash:function(t){var e=Ye.prototype.put;return Ye.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){Ye.prototype.put=e}},ConnectionTarget:pn,queryIdentifier:function(t){return t.queryIdentifier()},forceRestClient:function(t){sn.getInstance().forceRestClient(t)}}),vn=un.ServerValue;function yn(e){!function(t){We=t}(e.SDK_VERSION);var n=e.INTERNAL.registerComponent(new c.Component("database",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return sn.getInstance().databaseFromApp(n,r,e)}),"PUBLIC").setServiceProps({Reference:en,Query:Qt,Database:un,DataSnapshot:Wt,enableLogging:w,INTERNAL:ln,ServerValue:vn,TEST_ACCESS:dn}).setMultipleInstances(!0));e.registerVersion("@firebase/database","0.6.5"),s.isNodeSdk()&&(t.exports=n)}yn(o),e.DataSnapshot=Wt,e.Database=un,e.OnDisconnect=lt,e.Query=Qt,e.Reference=en,e.ServerValue=vn,e.enableLogging=w,e.registerDatabase=yn}).call(this,n(28))},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";
2Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(57),o=(r=n(1))&&"object"==typeof r&&"default"in r?r.default:r,a=n(13),s=n(8),u=n(5),c=n(58),l=o.SDK_VERSION,h=function(){function t(t){this.uid=t}return t.prototype.t=function(){return null!=this.uid},t.prototype.s=function(){return this.t()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();h.UNAUTHENTICATED=new h(null),h.i=new h("google-credentials-uid"),h.h=new h("first-party-uid");var f={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},p=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 i.__extends(e,t),e}(Error),d=function(t,e){this.user=e,this.type="OAuth",this.o={},this.o.Authorization="Bearer "+t},v=function(){function t(){this.u=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype._=function(){},t.prototype.l=function(t){this.u=t,t(h.UNAUTHENTICATED)},t.prototype.T=function(){this.u=null},t}(),y=function(){function t(t){var e=this;this.I=null,this.currentUser=h.UNAUTHENTICATED,this.R=!1,this.A=0,this.u=null,this.forceRefresh=!1,this.I=function(){e.A++,e.currentUser=e.m(),e.R=!0,e.u&&e.u(e.currentUser)},this.A=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.I):(this.I(null),t.get().then((function(t){e.auth=t,e.I&&e.auth.addAuthTokenListener(e.I)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.A,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.A!==e?(ve("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(be("string"==typeof n.accessToken),new d(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype._=function(){this.forceRefresh=!0},t.prototype.l=function(t){this.u=t,this.R&&t(this.currentUser)},t.prototype.T=function(){this.auth&&this.auth.removeAuthTokenListener(this.I),this.I=null,this.u=null},t.prototype.m=function(){var t=this.auth&&this.auth.getUid();return be(null===t||"string"==typeof t),new h(t)},t}(),g=function(){function t(t,e){this.P=t,this.V=e,this.type="FirstParty",this.user=h.h}return Object.defineProperty(t.prototype,"o",{get:function(){var t={"X-Goog-AuthUser":this.V},e=this.P.auth.g([]);return e&&(t.Authorization=e),t},enumerable:!0,configurable:!0}),t}(),m=function(){function t(t,e){this.P=t,this.V=e}return t.prototype.getToken=function(){return Promise.resolve(new g(this.P,this.V))},t.prototype.l=function(t){t(h.h)},t.prototype.T=function(){},t.prototype._=function(){},t}(),b=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new p(f.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new p(f.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new p(f.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new p(f.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,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.p=function(t){return this.seconds===t.seconds?Ee(this.nanoseconds,t.nanoseconds):Ee(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.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
2,t}(),_=function(){function t(t){this.timestamp=t}return t.v=function(e){return new t(e)},t.min=function(){return new t(new b(0,0))},t.prototype.S=function(t){return this.timestamp.p(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.D=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.C=function(){return this.timestamp},t}(),w=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&me(),void 0===n?n=t.length-e:n>t.length-e&&me(),this.segments=t,this.offset=e,this.F=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.F},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.N(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.k(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.M=function(t){return t=void 0===t?1:t,this.k(this.segments,this.offset+t,this.length-t)},t.prototype.$=function(){return this.k(this.segments,this.offset,this.length-1)},t.prototype.O=function(){return this.segments[this.offset]},t.prototype.L=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.B=function(){return 0===this.length},t.prototype.q=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.U=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.W=function(){return this.segments.slice(this.offset,this.limit())},t.N=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}(),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.k=function(t,n,r){return new e(t,n,r)},e.prototype.j=function(){return this.W().join("/")},e.prototype.toString=function(){return this.j()},e.K=function(t){if(t.indexOf("//")>=0)throw new p(f.INVALID_ARGUMENT,"Invalid path ("+t+"). Paths must not contain // in them.");return new e(t.split("/").filter((function(t){return t.length>0})))},e}(w);E.G=new E([]);var T=/^[_a-zA-Z][_a-zA-Z0-9]*$/,I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.k=function(t,n,r){return new e(t,n,r)},e.H=function(t){return T.test(t)},e.prototype.j=function(){return this.W().map((function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.H(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.j()},e.prototype.Y=function(){return 1===this.length&&"__name__"===this.get(0)},e.J=function(){return new e(["__name__"])},e.X=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new p(f.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 p(f.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new p(f.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 p(f.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e}(w);I.G=new I([]);var S=function(){function t(t){this.path=t}return t.Z=function(e){return new t(E.K(e).M(5))},t.prototype.tt=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===E.N(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.N=function(t,e){return E.N(t.path,e.path)},t.et=function(t){return t.length%2==0},t.st=function(e){return new t(new E(e.slice()))},t}();function C(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function k(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function N(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}
2S.EMPTY=new S(new E([]));var x=function(){function t(t){this.it=t}return t.fromBase64String=function(e){return new t(fe.nt().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 fe.nt().btoa(this.it)},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.it)},t.prototype.rt=function(){return 2*this.it.length},t.prototype.S=function(t){return Ee(this.it,t.it)},t.prototype.isEqual=function(t){return this.it===t.it},t}();function P(t){return null==t}function A(t){return-0===t&&1/t==-1/0}function O(t){return"number"==typeof t&&Number.isInteger(t)&&!A(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}function R(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 D(t){var e=B(t.mapValue.fields.__local_write_time__.timestampValue);return new b(e.seconds,e.nanos)}x.ht=new x("");var L=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function M(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?R(t)?4:10:me()}function F(t,e){var n=M(t);if(n!==M(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return D(t).isEqual(D(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=B(t.timestampValue),r=B(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 z(t.bytesValue).isEqual(z(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return W(t.geoPointValue.latitude)===W(e.geoPointValue.latitude)&&W(t.geoPointValue.longitude)===W(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return W(t.integerValue)===W(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=W(t.doubleValue),r=W(e.doubleValue);return n===r?A(n)===A(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Te(t.arrayValue.values||[],e.arrayValue.values||[],F);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(C(n)!==C(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!F(n[i],r[i])))return!1;return!0}(t,e);default:return me()}}function j(t,e){return void 0!==(t.values||[]).find((function(t){return F(t,e)}))}function U(t,e){var n=M(t),r=M(e);if(n!==r)return Ee(n,r);switch(n){case 0:return 0;case 1:return Ee(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=W(t.integerValue||t.doubleValue),r=W(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 V(t.timestampValue,e.timestampValue);case 4:return V(D(t),D(e));case 5:return Ee(t.stringValue,e.stringValue);case 6:return function(t,e){var n=z(t),r=z(e);return n.S(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=Ee(n[i],r[i]);if(0!==o)return o}return Ee(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Ee(W(t.latitude),W(e.latitude));return 0!==n?n:Ee(W(t.longitude),W(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=U(n[i],r[i]);if(o)return o}return Ee(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=Ee(r[a],o[a]);if(0!==s)return s;var u=U(n[r[a]],i[o[a]]);if(0!==u)return u}return Ee(r.length,o.length)}(t.mapValue,e.mapValue);default:throw me()}}function V(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Ee(t,e);var n=B(t),r=B(e),i=Ee(n.seconds,r.seconds);return 0!==i?i:Ee(n.nanos,r.nanos)}function q(t){return function t(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(t){var e=B(t);return"time("+e.seconds+","+e.nanos+")"}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?z(e.bytesValue).toBase64():"referenceValue"in e?(r=e.referenceValue,S.Z(r).toString()):"geoPointValue"in e?"geo("+(n=e.geoPointValue).latitude+","+n.longitude+")":"arrayValue"in e?function(e){for(var n="[",r=!0,i=0,o=e.values||[];i<o.length;i++){var a=o[i];r?r=!1:n+=",",n+=t(a)}return n+"]"}(e.arrayValue):"mapValue"in e?function(e){for(var n="{",r=!0,i=0,o=Object.keys(e.fields||{}).sort();i<o.length;i++){var a=o[i];r?r=!1:n+=",",n+=a+":"+t(e.fields[a])}return n+"}"}(e.mapValue):me();var n,r}(t)}function B(t){if(be(!!t),"string"==typeof t){var e=0,n=L.exec(t);if(be(!!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:W(t.seconds),nanos:W(t.nanos)}}function W(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function z(t){return"string"==typeof t?x.fromBase64String(t):x.fromUint8Array(t)}function H(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.j()}}function G(t){return!!t&&"integerValue"in t}function K(t){return!!t&&"arrayValue"in t}function Q(t){return!!t&&"nullValue"in t}function Y(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function X(t){return!!t&&"mapValue"in t}var $=function(){function t(){}return t.prototype.ot=function(t,e){return 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}}(e,t)},t.prototype.at=function(t,e){return e},t.prototype.ut=function(t){return null},t.prototype.isEqual=function(e){return e instanceof t},t}();$.instance=new $;var J=function(){function t(t){this.elements=t}return t.prototype.ot=function(t,e){return this.apply(t)},t.prototype.at=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=et(t),n=function(t){e.some((function(e){return F(e,t)}))||e.push(t)},r=0,i=this.elements;r<i.length;r++)n(i[r]);return{arrayValue:{values:e}}},t.prototype.ut=function(t){return null},t.prototype.isEqual=function(e){return e instanceof t&&Te(this.elements,e.elements,F)},t}(),Z=function(){function t(t){this.elements=t}return t.prototype.ot=function(t,e){return this.apply(t)},t.prototype.at=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=et(t),n=function(t){e=e.filter((function(e){return!F(e,t)}))},r=0,i=this.elements;r<i.length;r++)n(i[r]);return{arrayValue:{values:e}}},t.prototype.ut=function(t){return null},t.prototype.isEqual=function(e){return e instanceof t&&Te(this.elements,e.elements,F)},t}
2(),tt=function(){function t(t,e){this.serializer=t,this.ct=e}return t.prototype.ot=function(t,e){var n=this.ut(t),r=this.asNumber(n)+this.asNumber(this.ct);return G(n)&&G(this.ct)?this.serializer._t(r):this.serializer.lt(r)},t.prototype.at=function(t,e){return e},t.prototype.ut=function(t){return G(e=t)||function(t){return!!t&&"doubleValue"in t}(e)?t:{integerValue:0};var e},t.prototype.isEqual=function(e){return e instanceof t&&F(this.ct,e.ct)},t.prototype.asNumber=function(t){return W(t.integerValue||t.doubleValue)},t}();function et(t){return K(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var nt=function(){function t(t){this.fields=t,t.sort(I.N)}return t.prototype.dt=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].q(t))return!0;return!1},t.prototype.isEqual=function(t){return Te(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),rt=function(){function t(t,e){this.field=t,this.transform=e}return t.prototype.isEqual=function(t){return this.field.isEqual(t.field)&&this.transform.isEqual(t.transform)},t}(),it=function(t,e){this.version=t,this.transformResults=e},ot=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.ft=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,"Tt",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),t.prototype.Et=function(t){return void 0!==this.updateTime?t instanceof mt&&t.version.isEqual(this.updateTime):void 0===this.exists||this.exists===t instanceof mt},t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}(),at=function(){function t(){}return t.prototype.It=function(t){},t.wt=function(t){return t instanceof mt?t.version:_.min()},t}(),st=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).key=e,i.value=n,i.Rt=r,i.type=0,i}return i.__extends(e,t),e.prototype.at=function(t,e){this.It(t);var n=e.version;return new mt(this.key,n,this.value,{hasCommittedMutations:!0})},e.prototype.ot=function(t,e,n){if(this.It(t),!this.Rt.Et(t))return t;var r=at.wt(t);return new mt(this.key,r,this.value,{At:!0})},e.prototype.Pt=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.value.isEqual(t.value)&&this.Rt.isEqual(t.Rt)},e}(at),ut=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this)||this).key=e,o.data=n,o.Vt=r,o.Rt=i,o.type=1,o}return i.__extends(e,t),e.prototype.at=function(t,e){if(this.It(t),!this.Rt.Et(t))return new _t(this.key,e.version);var n=this.gt(t);return new mt(this.key,e.version,n,{hasCommittedMutations:!0})},e.prototype.ot=function(t,e,n){if(this.It(t),!this.Rt.Et(t))return t;var r=at.wt(t),i=this.gt(t);return new mt(this.key,r,i,{At:!0})},e.prototype.Pt=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.Vt.isEqual(t.Vt)&&this.Rt.isEqual(t.Rt)},e.prototype.gt=function(t){var e;return e=t instanceof mt?t.data():ft.empty(),this.pt(e)},e.prototype.pt=function(t){var e=this,n=new pt(t);return this.Vt.fields.forEach((function(t){if(!t.B()){var r=e.data.field(t);null!==r?n.set(t,r):n.delete(t)}})),n.yt()},e}(at),ct=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.fieldTransforms=n,r.type=2,r.Rt=ot.exists(!0),r}return i.__extends(e,t),e.prototype.at=function(t,e){if(this.It(t),be(null!=e.transformResults),!this.Rt.Et(t))return new _t(this.key,e.version);var n=this.bt(t),r=this.vt(t,e.transformResults),i=e.version,o=this.St(n.data(),r);return new mt(this.key,i,o,{hasCommittedMutations:!0})},e.prototype.ot=function(t,e,n){if(this.It(t),!this.Rt.Et(t))return t;var r=this.bt(t),i=this.Dt(n,t,e),o=this.St(r.data(),i);return new mt(this.key,r.version,o,{At:!0})},e.prototype.Pt=function(t){for(var e=null,n=0,r=this.fieldTransforms;n<r.length;n++){var i=r[n],o=t instanceof mt?t.field(i.field):void 0,a=i.transform.ut(o||null);null!=a&&(e=null==e?(new pt).set(i.field,a):e.set(i.field,a))}return e?e.yt():null},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&Te(this.fieldTransforms,t.fieldTransforms,(function(t,e){return t.isEqual(e)}))&&this.Rt.isEqual(t.Rt)},e.prototype.bt=function(t){return t},e.prototype.vt=function(t,e){var n=[];be(this.fieldTransforms.length===e.length);for(var r=0;r<e.length;r++){var i=this.fieldTransforms[r],o=i.transform,a=null;t instanceof mt&&(a=t.field(i.field)),n.push(o.at(a,e[r]))}return n},e.prototype.Dt=function(t,e,n){for(var r=[],i=0,o=this.fieldTransforms;i<o.length;i++){var a=o[i],s=a.transform,u=null;e instanceof mt&&(u=e.field(a.field)),null===u&&n instanceof mt&&(u=n.field(a.field)),r.push(s.ot(u,t))}return r},e.prototype.St=function(t,e){for(var n=new pt(t),r=0;r<this.fieldTransforms.length;r++){var i=this.fieldTransforms[r].field;n.set(i,e[r])}return n.yt()},e}(at),lt=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Rt=n,r.type=3,r}return i.__extends(e,t),e.prototype.at=function(t,e){return this.It(t),new bt(this.key,e.version,{hasCommittedMutations:!0})},e.prototype.ot=function(t,e,n){return this.It(t),this.Rt.Et(t)?new bt(this.key,_.min()):t},e.prototype.Pt=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.Rt.isEqual(t.Rt)},e}(at),ht=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Rt=n,r.type=4,r}return i.__extends(e,t),e.prototype.at=function(t,e){me()}
2,e.prototype.ot=function(t,e,n){me()},e.prototype.Pt=function(t){me()},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.Rt.isEqual(t.Rt)},e}(at),ft=function(){function t(t){this.proto=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.B())return this.proto;for(var e=this.proto,n=0;n<t.length-1;++n){if(!e.mapValue.fields)return null;if(!X(e=e.mapValue.fields[t.get(n)]))return null}return(e=(e.mapValue.fields||{})[t.L()])||null},t.prototype.isEqual=function(t){return F(this.proto,t.proto)},t}(),pt=function(){function t(t){void 0===t&&(t=ft.empty()),this.Ct=t,this.Ft=new Map}return t.prototype.set=function(t,e){return this.Nt(t,e),this},t.prototype.delete=function(t){return this.Nt(t,null),this},t.prototype.Nt=function(t,e){for(var n=this.Ft,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===M(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(t.L(),e)},t.prototype.yt=function(){var t=this.kt(I.G,this.Ft);return null!=t?new ft(t):this.Ct},t.prototype.kt=function(t,e){var n=this,r=!1,i=this.Ct.field(t),o=X(i)?Object.assign({},i.mapValue.fields):{};return e.forEach((function(e,i){if(e instanceof Map){var a=n.kt(t.child(i),e);null!=a&&(o[i]=a,r=!0)}else null!==e?(o[i]=e,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},t}();function dt(t){var e=[];return k(t.fields||{},(function(t,n){var r=new I([t]);if(X(n)){var i=dt(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 nt(e)}var vt,yt,gt=function(t,e){this.key=t,this.version=e},mt=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this,e,n)||this).Mt=r,o.At=!!i.At,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return i.__extends(e,t),e.prototype.field=function(t){return this.Mt.field(t)},e.prototype.data=function(){return this.Mt},e.prototype.xt=function(){return this.Mt.proto},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.At===t.At&&this.hasCommittedMutations===t.hasCommittedMutations&&this.Mt.isEqual(t.Mt)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.Mt.toString()+", {hasLocalMutations: "+this.At+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.At||this.hasCommittedMutations},enumerable:!0,configurable:!0}),e}(gt),bt=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n)||this).hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return i.__extends(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(gt),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(gt),wt=function(){function t(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.$t=null}return t.prototype.canonicalId=function(){if(null===this.$t){var t=this.path.j();null!==this.collectionGroup&&(t+="|cg:"+this.collectionGroup),t+="|f:",t+=this.filters.map((function(t){return t.canonicalId()})).join(","),t+="|ob:",t+=this.orderBy.map((function(t){return t.canonicalId()})).join(","),P(this.limit)||(t+="|l:",t+=this.limit),this.startAt&&(t+="|lb:",t+=this.startAt.canonicalId()),this.endAt&&(t+="|ub:",t+=this.endAt.canonicalId()),this.$t=t}return this.$t},t.prototype.toString=function(){var t=this.path.j();return null!==this.collectionGroup&&(t+=" collectionGroup="+this.collectionGroup),this.filters.length>0&&(t+=", filters: ["+this.filters.join(", ")+"]"),P(this.limit)||(t+=", limit: "+this.limit),this.orderBy.length>0&&(t+=", orderBy: ["+this.orderBy.join(", ")+"]"),this.startAt&&(t+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(t+=", endAt: "+this.endAt.canonicalId()),"Target("+t+")"},t.prototype.isEqual=function(t){if(this.limit!==t.limit)return!1;if(this.orderBy.length!==t.orderBy.length)return!1;for(var e=0;e<this.orderBy.length;e++)if(!this.orderBy[e].isEqual(t.orderBy[e]))return!1;if(this.filters.length!==t.filters.length)return!1;for(var n=0;n<this.filters.length;n++)if(!this.filters[n].isEqual(t.filters[n]))return!1;return this.collectionGroup===t.collectionGroup&&!!this.path.isEqual(t.path)&&!!(null!==this.startAt?this.startAt.isEqual(t.startAt):null===t.startAt)&&(null!==this.endAt?this.endAt.isEqual(t.endAt):null===t.endAt)},t.prototype.Ot=function(){return S.et(this.path)&&null===this.collectionGroup&&0===this.filters.length},t}(),Et=function(){function t(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.Lt=n,this.filters=r,this.limit=i,this.Bt=o,this.startAt=a,this.endAt=s,this.qt=null,this.Ut=null,this.startAt&&this.Qt(this.startAt),this.endAt&&this.Qt(this.endAt)}return t.Wt=function(e){return new t(e)},Object.defineProperty(t.prototype,"orderBy",{get:function(){if(null===this.qt){this.qt=[];var t=this.jt(),e=this.Kt();if(null!==t&&null===e)t.Y()||this.qt.push(new Pt(t)),this.qt.push(new Pt(I.J(),"asc"));else{for(var n=!1,r=0,i=this.Lt;r<i.length;r++){var o=i[r];this.qt.push(o),o.field.Y()&&(n=!0)}if(!n){var a=this.Lt.length>0?this.Lt[this.Lt.length-1].dir:"asc";this.qt.push(new Pt(I.J(),a))}}}return this.qt},enumerable:!0,configurable:!0}),t.prototype.Gt=function(e){var n=this.filters.concat([e]);return new t(this.path,this.collectionGroup,this.Lt.slice(),n,this.limit,this.Bt,this.startAt,this.endAt)},t.prototype.zt=function(e){var n=this.Lt.concat([e]);return new t(this.path,this.collectionGroup,n,this.filters.slice(),this.limit,this.Bt,this.startAt,this.endAt)},t.prototype.Ht=function(e){return new t(this.path,this.collectionGroup,this.Lt.slice(),this.filters.slice(),e,"F",this.startAt,this.endAt)},t.prototype.Yt=function(e){return new t(this.path,this.collectionGroup,this.Lt.slice(),this.filters.slice(),e,"L",this.startAt,this.endAt)},t.prototype.Jt=function(e){return new t(this.path,this.collectionGroup,this.Lt.slice(),this.filters.slice(),this.limit,this.Bt,e,this.endAt)},t.prototype.Xt=function(e){return new t(this.path,this.collectionGroup,this.Lt.slice(),this.filters.slice(),this.limit,this.Bt,this.startAt,e)},t.prototype.Zt=function(e){return new t(e,null,this.Lt.slice(),this.filters.slice(),this.limit,this.Bt,this.startAt,this.endAt)},t.prototype.te=function(){return 0===this.filters.length&&null===this.limit&&null==this.startAt&&null==this.endAt&&(0===this.Lt.length||1===this.Lt.length&&this.Lt[0].field.Y())},t.prototype.canonicalId=function(){return this.ee().canonicalId()+"|lt:"+this.Bt},t.prototype.toString=function(){return"Query(target="+this.ee().toString()+"; limitType="+this.Bt+")"},t.prototype.isEqual=function(t){return this.ee().isEqual(t.ee())&&this.Bt===t.Bt},t.prototype.se=function(t,e){for(var n=!1,r=0,i=this.orderBy;r<i.length;r++){var o=i[r],a=o.compare(t,e);if(0!==a)return a;n=n||o.field.Y()}return 0},t.prototype.matches=function(t){return this.ie(t)&&this.ne(t)&&this.re(t)&&this.he(t)},t.prototype.oe=function(){return!P(this.limit)&&"F"===this.Bt},t.prototype.ae=function(){return!P(this.limit)&&"L"===this.Bt},t.prototype.Kt=function(){return this.Lt.length>0?this.Lt[0].field:null},t.prototype.jt=function(){for(var t=0,e=this.filters;t<e.length;t++){var n=e[t];if(n instanceof Tt&&n.ue())return n.field}return null},t.prototype.ce=function(t){for(var e=0,n=this.filters;e<n.length;e++){var r=n[e];if(r instanceof Tt&&t.indexOf(r.op)>=0)return r.op}return null},t.prototype.Ot=function(){return this.ee().Ot()},t.prototype._e=function(){return null!==this.collectionGroup},t.prototype.ee=function(){if(!this.Ut)if("F"===this.Bt)this.Ut=new wt(this.path,this.collectionGroup,this.orderBy,this.filters,this.limit,this.startAt,this.endAt);else{for(var t=[],e=0,n=this.orderBy;e<n.length;e++){var r=n[e],i="desc"===r.dir?"asc":"desc";t.push(new Pt(r.field,i))}var o=this.endAt?new xt(this.endAt.position,!this.endAt.before):null,a=this.startAt?new xt(this.startAt.position,!this.startAt.before):null;this.Ut=new wt(this.path,this.collectionGroup,t,this.filters,this.limit,o,a)}return this.Ut},t.prototype.ie=function(t){var e=t.key.path;return null!==this.collectionGroup?t.key.tt(this.collectionGroup)&&this.path.q(e):S.et(this.path)?this.path.isEqual(e):this.path.U(e)},t.prototype.ne=function(t){for(var e=0,n=this.Lt;e<n.length;e++){var r=n[e];if(!r.field.Y()&&null===t.field(r.field))return!1}return!0},t.prototype.re=function(t){for(var e=0,n=this.filters;e<n.length;e++)if(!n[e].matches(t))return!1;return!0},t.prototype.he=function(t){return!(this.startAt&&!this.startAt.le(this.orderBy,t)||this.endAt&&this.endAt.le(this.orderBy,t))},t.prototype.Qt=function(t){},t}(),Tt=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 i.__extends(e,t),e.create=function(t,n,r){if(t.Y())return"in"===n?new St(t,r):new It(t,n,r);if(Q(r)){if("=="!==n)throw new p(f.INVALID_ARGUMENT,"Invalid query. Null supports only equality comparisons.");return new e(t,n,r)}if(Y(r)){if("=="!==n)throw new p(f.INVALID_ARGUMENT,"Invalid query. NaN supports only equality comparisons.");return new e(t,n,r)}return"array-contains"===n?new Ct(t,r):"in"===n?new kt(t,r):"array-contains-any"===n?new Nt(t,r):new e(t,n,r)},e.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&M(this.value)===M(e)&&this.de(U(e,this.value))},e.prototype.de=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case">":return t>0;case">=":return t>=0;default:return me()}},e.prototype.ue=function(){return["<","<=",">",">="].indexOf(this.op)>=0},e.prototype.canonicalId=function(){return this.field.j()+this.op.toString()+q(this.value)},e.prototype.isEqual=function(t){return t instanceof e&&this.op===t.op&&this.field.isEqual(t.field)&&F(this.value,t.value)},e.prototype.toString=function(){return this.field.j()+" "+this.op+" "+q(this.value)},e}((function(){})),It=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=S.Z(r.referenceValue),i}return i.__extends(e,t),e.prototype.matches=function(t){var e=S.N(t.key,this.key);return this.de(e)},e}(Tt),St=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=(n.arrayValue.values||[]).map((function(t){return S.Z(t.referenceValue)})),r}return i.__extends(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Tt),Ct=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return i.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return K(e)&&j(e.arrayValue,this.value)},e}(Tt),kt=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return i.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&j(this.value.arrayValue,e)},e}(Tt),Nt=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return i.__extends(e,t),e.prototype.matches=function(t){var e=this,n=t.field(this.field);return!(!K(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return j(e.value.arrayValue,t)}))},e}(Tt),xt=function(){function t(t,e){this.position=t,this.before=e}return t.prototype.canonicalId=function(){return(this.before?"b":"a")+":"+this.position.map((function(t){return q(t)})).join(",")},t.prototype.le=function(t,e){for(var n=0,r=0;r<this.position.length;r++){var i=t[r],o=this.position[r];if(n=i.field.Y()?S.N(S.Z(o.referenceValue),e.key):U(o,e.field(i.field)),"desc"===i.dir&&(n*=-1),0!==n)break}return this.before?n<=0:n<0},t.prototype.isEqual=function(t){if(null===t)return!1;if(this.before!==t.before||this.position.length!==t.position.length)return!1;for(var e=0;e<this.position.length;e++)if(!F(this.position[e],t.position[e]))return!1;return!0},t}(),Pt=function(){function t(t,e){this.field=t,void 0===e&&(e="asc"),this.dir=e,this.fe=t.Y()}return t.prototype.compare=function(t,e){var n=this.fe?S.N(t.key,e.key):function(t,e,n){var r=e.field(t),i=n.field(t);return null!==r&&null!==i?U(r,i):me()}(this.field,t,e);switch(this.dir){case"asc":return n;
2case"desc":return-1*n;default:return me()}},t.prototype.canonicalId=function(){return this.field.j()+this.dir.toString()},t.prototype.toString=function(){return this.field.j()+" ("+this.dir+")"},t.prototype.isEqual=function(t){return this.dir===t.dir&&this.field.isEqual(t.field)},t}(),At=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=_.min()),void 0===o&&(o=_.min()),void 0===a&&(a=x.ht),this.target=t,this.targetId=e,this.Te=n,this.sequenceNumber=r,this.Ee=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return t.prototype.Ie=function(e){return new t(this.target,this.targetId,this.Te,e,this.Ee,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.we=function(e,n){return new t(this.target,this.targetId,this.Te,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.Re=function(e){return new t(this.target,this.targetId,this.Te,this.sequenceNumber,this.Ee,e,this.resumeToken)},t}(),Ot=function(t){this.count=t};function Rt(t){switch(t){case f.OK:return me();case f.CANCELLED:case f.UNKNOWN:case f.DEADLINE_EXCEEDED:case f.RESOURCE_EXHAUSTED:case f.INTERNAL:case f.UNAVAILABLE:case f.UNAUTHENTICATED:return!1;case f.INVALID_ARGUMENT:case f.NOT_FOUND:case f.ALREADY_EXISTS:case f.PERMISSION_DENIED:case f.FAILED_PRECONDITION:case f.ABORTED:case f.OUT_OF_RANGE:case f.UNIMPLEMENTED:case f.DATA_LOSS:return!0;default:return me()}}function Dt(t){if(void 0===t)return ye("GRPC error has no .code"),f.UNKNOWN;switch(t){case vt.OK:return f.OK;case vt.CANCELLED:return f.CANCELLED;case vt.UNKNOWN:return f.UNKNOWN;case vt.DEADLINE_EXCEEDED:return f.DEADLINE_EXCEEDED;case vt.RESOURCE_EXHAUSTED:return f.RESOURCE_EXHAUSTED;case vt.INTERNAL:return f.INTERNAL;case vt.UNAVAILABLE:return f.UNAVAILABLE;case vt.UNAUTHENTICATED:return f.UNAUTHENTICATED;case vt.INVALID_ARGUMENT:return f.INVALID_ARGUMENT;case vt.NOT_FOUND:return f.NOT_FOUND;case vt.ALREADY_EXISTS:return f.ALREADY_EXISTS;case vt.PERMISSION_DENIED:return f.PERMISSION_DENIED;case vt.FAILED_PRECONDITION:return f.FAILED_PRECONDITION;case vt.ABORTED:return f.ABORTED;case vt.OUT_OF_RANGE:return f.OUT_OF_RANGE;case vt.UNIMPLEMENTED:return f.UNIMPLEMENTED;case vt.DATA_LOSS:return f.DATA_LOSS;default:return me()}}(yt=vt||(vt={}))[yt.OK=0]="OK",yt[yt.CANCELLED=1]="CANCELLED",yt[yt.UNKNOWN=2]="UNKNOWN",yt[yt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",yt[yt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",yt[yt.NOT_FOUND=5]="NOT_FOUND",yt[yt.ALREADY_EXISTS=6]="ALREADY_EXISTS",yt[yt.PERMISSION_DENIED=7]="PERMISSION_DENIED",yt[yt.UNAUTHENTICATED=16]="UNAUTHENTICATED",yt[yt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",yt[yt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",yt[yt.ABORTED=10]="ABORTED",yt[yt.OUT_OF_RANGE=11]="OUT_OF_RANGE",yt[yt.UNIMPLEMENTED=12]="UNIMPLEMENTED",yt[yt.INTERNAL=13]="INTERNAL",yt[yt.UNAVAILABLE=14]="UNAVAILABLE",yt[yt.DATA_LOSS=15]="DATA_LOSS";var Lt=function(){function t(t,e){this.N=t,this.root=e||Ft.EMPTY}return t.prototype.Ae=function(e,n){return new t(this.N,this.root.Ae(e,n,this.N).me(null,null,Ft.Pe,null,null))},t.prototype.remove=function(e){return new t(this.N,this.root.remove(e,this.N).me(null,null,Ft.Pe,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.B();){var n=this.N(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.B();){var r=this.N(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.B=function(){return this.root.B()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),t.prototype.Ve=function(){return this.root.Ve()},t.prototype.ge=function(){return this.root.ge()},t.prototype.pe=function(t){return this.root.pe(t)},t.prototype.forEach=function(t){this.pe((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.pe((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.ye=function(t){return this.root.ye(t)},t.prototype.be=function(){return new Mt(this.root,null,this.N,!1)},t.prototype.ve=function(t){return new Mt(this.root,t,this.N,!1)},t.prototype.Se=function(){return new Mt(this.root,null,this.N,!0)},t.prototype.De=function(t){return new Mt(this.root,t,this.N,!0)},t}(),Mt=function(){function t(t,e,n,r){this.Ce=r,this.Fe=[];for(var i=1;!t.B();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.Ce?t.left:t.right;else{if(0===i){this.Fe.push(t);break}this.Fe.push(t),t=this.Ce?t.right:t.left}}return t.prototype.Ne=function(){var t=this.Fe.pop(),e={key:t.key,value:t.value};if(this.Ce)for(t=t.left;!t.B();)this.Fe.push(t),t=t.right;else for(t=t.right;!t.B();)this.Fe.push(t),t=t.left;return e},t.prototype.ke=function(){return this.Fe.length>0},t.prototype.Me=function(){if(0===this.Fe.length)return null;var t=this.Fe[this.Fe.length-1];return{key:t.key,value:t.value}},t}(),Ft=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.me=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,
2null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.B=function(){return!1},t.prototype.pe=function(t){return this.left.pe(t)||t(this.key,this.value)||this.right.pe(t)},t.prototype.ye=function(t){return this.right.ye(t)||t(this.key,this.value)||this.left.ye(t)},t.prototype.min=function(){return this.left.B()?this:this.left.min()},t.prototype.Ve=function(){return this.min().key},t.prototype.ge=function(){return this.right.B()?this.key:this.right.ge()},t.prototype.Ae=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.me(null,null,null,r.left.Ae(t,e,n),null):0===i?r.me(null,e,null,null,null):r.me(null,null,null,null,r.right.Ae(t,e,n))).xe()},t.prototype.$e=function(){if(this.left.B())return t.EMPTY;var e=this;return e.left.Oe()||e.left.left.Oe()||(e=e.Le()),(e=e.me(null,null,null,e.left.$e(),null)).xe()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.B()||i.left.Oe()||i.left.left.Oe()||(i=i.Le()),i=i.me(null,null,null,i.left.remove(e,n),null);else{if(i.left.Oe()&&(i=i.Be()),i.right.B()||i.right.Oe()||i.right.left.Oe()||(i=i.qe()),0===n(e,i.key)){if(i.right.B())return t.EMPTY;r=i.right.min(),i=i.me(r.key,r.value,null,null,i.right.$e())}i=i.me(null,null,null,null,i.right.remove(e,n))}return i.xe()},t.prototype.Oe=function(){return this.color},t.prototype.xe=function(){var t=this;return t.right.Oe()&&!t.left.Oe()&&(t=t.Ue()),t.left.Oe()&&t.left.left.Oe()&&(t=t.Be()),t.left.Oe()&&t.right.Oe()&&(t=t.Qe()),t},t.prototype.Le=function(){var t=this.Qe();return t.right.left.Oe()&&(t=(t=(t=t.me(null,null,null,null,t.right.Be())).Ue()).Qe()),t},t.prototype.qe=function(){var t=this.Qe();return t.left.left.Oe()&&(t=(t=t.Be()).Qe()),t},t.prototype.Ue=function(){var e=this.me(null,null,t.RED,null,this.right.left);return this.right.me(null,null,this.color,e,null)},t.prototype.Be=function(){var e=this.me(null,null,t.RED,this.left.right,null);return this.left.me(null,null,this.color,null,e)},t.prototype.Qe=function(){var t=this.left.me(null,null,!this.left.color,null,null),e=this.right.me(null,null,!this.right.color,null,null);return this.me(null,null,!this.color,t,e)},t.prototype.We=function(){var t=this.je();return Math.pow(2,t)<=this.size+1},t.prototype.je=function(){if(this.Oe()&&this.left.Oe())throw me();if(this.right.Oe())throw me();var t=this.left.je();if(t!==this.right.je())throw me();return t+(this.Oe()?0:1)},t}();Ft.EMPTY=null,Ft.RED=!0,Ft.Pe=!1,Ft.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw me()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw me()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw me()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw me()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw me()},enumerable:!0,configurable:!0}),t.prototype.me=function(t,e,n,r,i){return this},t.prototype.Ae=function(t,e,n){return new Ft(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.B=function(){return!0},t.prototype.pe=function(t){return!1},t.prototype.ye=function(t){return!1},t.prototype.Ve=function(){return null},t.prototype.ge=function(){return null},t.prototype.Oe=function(){return!1},t.prototype.We=function(){return!0},t.prototype.je=function(){return 0},t}());var jt=function(){function t(t){this.N=t,this.data=new Lt(this.N)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.Ve()},t.prototype.last=function(){return this.data.ge()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.pe((function(e,n){return t(e),!1}))},t.prototype.Ke=function(t,e){for(var n=this.data.ve(t[0]);n.ke();){var r=n.Ne();if(this.N(r.key,t[1])>=0)return;e(r.key)}},t.prototype.Ge=function(t,e){var n;for(n=void 0!==e?this.data.ve(e):this.data.be();n.ke();
2)if(!t(n.Ne().key))return},t.prototype.ze=function(t){var e=this.data.ve(t);return e.ke()?e.Ne().key:null},t.prototype.be=function(){return new Ut(this.data.be())},t.prototype.ve=function(t){return new Ut(this.data.ve(t))},t.prototype.add=function(t){return this.me(this.data.remove(t).Ae(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.me(this.data.remove(t)):this},t.prototype.B=function(){return this.data.B()},t.prototype.He=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.be(),r=e.data.be();n.ke();){var i=n.Ne().key,o=r.Ne().key;if(0!==this.N(i,o))return!1}return!0},t.prototype.W=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.me=function(e){var n=new t(this.N);return n.data=e,n},t}(),Ut=function(){function t(t){this.Ye=t}return t.prototype.Ne=function(){return this.Ye.Ne().key},t.prototype.ke=function(){return this.Ye.ke()},t}(),Vt=new Lt(S.N);function qt(){return Vt}function Bt(){return qt()}var Wt=new Lt(S.N);function zt(){return Wt}var Ht=new Lt(S.N),Gt=new jt(S.N);function Kt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Gt,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var Qt=new jt(Ee);function Yt(){return Qt}var Xt=function(){function t(t){this.N=t?function(e,n){return t(e,n)||S.N(e.key,n.key)}:function(t,e){return S.N(t.key,e.key)},this.Je=zt(),this.Xe=new Lt(this.N)}return t.Ze=function(e){return new t(e.N)},t.prototype.has=function(t){return null!=this.Je.get(t)},t.prototype.get=function(t){return this.Je.get(t)},t.prototype.first=function(){return this.Xe.Ve()},t.prototype.last=function(){return this.Xe.ge()},t.prototype.B=function(){return this.Xe.B()},t.prototype.indexOf=function(t){var e=this.Je.get(t);return e?this.Xe.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.Xe.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.Xe.pe((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.me(e.Je.Ae(t.key,t),e.Xe.Ae(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.me(this.Je.remove(t),this.Xe.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.Xe.be(),r=e.Xe.be();n.ke();){var i=n.Ne().key,o=r.Ne().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.me=function(e,n){var r=new t;return r.N=this.N,r.Je=e,r.Xe=n,r},t}(),$t=function(){function t(){this.ts=new Lt(S.N)}return t.prototype.track=function(t){var e=t.doc.key,n=this.ts.get(e);n?0!==t.type&&3===n.type?this.ts=this.ts.Ae(e,t):3===t.type&&1!==n.type?this.ts=this.ts.Ae(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.ts=this.ts.Ae(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.ts=this.ts.Ae(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.ts=this.ts.remove(e):1===t.type&&2===n.type?this.ts=this.ts.Ae(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.ts=this.ts.Ae(e,{type:2,doc:t.doc}
2):me():this.ts=this.ts.Ae(e,t)},t.prototype.es=function(){var t=[];return this.ts.pe((function(e,n){t.push(n)})),t},t}(),Jt=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.ss=n,this.docChanges=r,this.ns=i,this.fromCache=o,this.rs=a,this.hs=s}return t.os=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,Xt.Ze(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.ns.B()},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.rs===t.rs&&this.ns.isEqual(t.ns)&&this.query.isEqual(t.query)&&this.docs.isEqual(t.docs)&&this.ss.isEqual(t.ss)))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}(),Zt=function(){function t(t,e,n,r,i){this.Ee=t,this.as=e,this.us=n,this.cs=r,this._s=i}return t.ls=function(e,n){var r=new Map;return r.set(e,te.ds(e,n)),new t(_.min(),r,Yt(),qt(),Kt())},t}(),te=function(){function t(t,e,n,r,i){this.resumeToken=t,this.fs=e,this.Ts=n,this.Es=r,this.Is=i}return t.ds=function(e,n){return new t(x.ht,n,Kt(),Kt(),Kt())},t}(),ee=function(t,e,n,r){this.ws=t,this.removedTargetIds=e,this.key=n,this.Rs=r},ne=function(t,e){this.targetId=t,this.As=e},re=function(t,e,n,r){void 0===n&&(n=x.ht),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},ie=function(){function t(){this.ms=0,this.Ps=se(),this.Vs=x.ht,this.gs=!1,this.ps=!0}return Object.defineProperty(t.prototype,"fs",{get:function(){return this.gs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.Vs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ys",{get:function(){return 0!==this.ms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bs",{get:function(){return this.ps},enumerable:!0,configurable:!0}),t.prototype.vs=function(t){t.rt()>0&&(this.ps=!0,this.Vs=t)},t.prototype.Ss=function(){var t=Kt(),e=Kt(),n=Kt();return this.Ps.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:me()}})),new te(this.Vs,this.gs,t,e,n)},t.prototype.Ds=function(){this.ps=!1,this.Ps=se()},t.prototype.Cs=function(t,e){this.ps=!0,this.Ps=this.Ps.Ae(t,e)},t.prototype.Fs=function(t){this.ps=!0,this.Ps=this.Ps.remove(t)},t.prototype.Ns=function(){this.ms+=1},t.prototype.ks=function(){this.ms-=1},t.prototype.Ms=function(){this.ps=!0,this.gs=!0},t}(),oe=function(){function t(t){this.xs=t,this.$s=new Map,this.Os=qt(),this.Ls=ae(),this.Bs=new jt(Ee)}return t.prototype.qs=function(t){for(var e=0,n=t.ws;e<n.length;e++){var r=n[e];t.Rs instanceof mt?this.Us(r,t.Rs):t.Rs instanceof bt&&this.Qs(r,t.key,t.Rs)}for(var i=0,o=t.removedTargetIds;i<o.length;i++){var a=o[i];this.Qs(a,t.key,t.Rs)}},t.prototype.Ws=function(t){var e=this;this.js(t,(function(n){var r=e.Ks(n);switch(t.state){case 0:e.Gs(n)&&r.vs(t.resumeToken);break;case 1:r.ks(),r.ys||r.Ds(),r.vs(t.resumeToken);break;case 2:r.ks(),r.ys||e.removeTarget(n);break;case 3:e.Gs(n)&&(r.Ms(),r.vs(t.resumeToken));break;case 4:e.Gs(n)&&(e.zs(n),r.vs(t.resumeToken));break;default:me()}}))},t.prototype.js=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.$s.forEach((function(t,r){n.Gs(r)&&e(r)}))},t.prototype.Hs=function(t){var e=t.targetId,n=t.As.count,r=this.Ys(e);if(r){var i=r.target;if(i.Ot())if(0===n){var o=new S(i.path);this.Qs(e,o,new bt(o,_.min()))}else be(1===n);else this.Js(e)!==n&&(this.zs(e),this.Bs=this.Bs.add(e))}},t.prototype.Xs=function(t){var e=this,n=new Map;this.$s.forEach((function(r,i){var o=e.Ys(i);if(o){if(r.fs&&o.target.Ot()){var a=new S(o.target.path);null!==e.Os.get(a)||e.Zs(i,a)||e.Qs(i,a,new bt(a,t))}r.bs&&(n.set(i,r.Ss()),r.Ds())}}));var r=Kt();this.Ls.forEach((function(t,n){var i=!0;n.Ge((function(t){var n=e.Ys(t);return!n||2===n.Te||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new Zt(t,n,this.Bs,this.Os,r);return this.Os=qt(),this.Ls=ae(),this.Bs=new jt(Ee),i},t.prototype.Us=function(t,e){if(this.Gs(t)){var n=this.Zs(t,e.key)?2:0;this.Ks(t).Cs(e.key,n),this.Os=this.Os.Ae(e.key,e),this.Ls=this.Ls.Ae(e.key,this.ti(e.key).add(t))}},t.prototype.Qs=function(t,e,n){if(this.Gs(t)){var r=this.Ks(t);this.Zs(t,e)?r.Cs(e,1):r.Fs(e),this.Ls=this.Ls.Ae(e,this.ti(e).delete(t)),n&&(this.Os=this.Os.Ae(e,n))}},t.prototype.removeTarget=function(t){this.$s.delete(t)},t.prototype.Js=function(t){var e=this.Ks(t).Ss();return this.xs.ei(t).size+e.Ts.size-e.Is.size},t.prototype.Ns=function(t){this.Ks(t).Ns()},t.prototype.Ks=function(t){var e=this.$s.get(t);return e||(e=new ie,this.$s.set(t,e)),e},t.prototype.ti=function(t){var e=this.Ls.get(t);return e||(e=new jt(Ee),this.Ls=this.Ls.Ae(t,e)),e},t.prototype.Gs=function(t){var e=null!==this.Ys(t);return e||ve("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.Ys=function(t){var e=this.$s.get(t);return e&&e.ys?null:this.xs.si(t)},t.prototype.zs=function(t){var e=this;this.$s.set(t,new ie),this.xs.ei(t).forEach((function(n){e.Qs(t,n,null)}))},t.prototype.Zs=function(t,e){return this.xs.ei(t).has(e)},t}();function ae(){return new Lt(S.N)}function se(){return new Lt(S.N)}var ue={asc:"ASCENDING",desc:"DESCENDING"},ce={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","array-contains-any":"ARRAY_CONTAINS_ANY"},le=function(){function t(t,e){this.ii=t,this.options=e}return t.prototype.ni=function(t){var e=void 0===t.code?f.UNKNOWN:Dt(t.code);return new p(e,t.message||"")},t.prototype.ri=function(t){return this.options.hi||P(t)?t:{value:t}},t.prototype.oi=function(t){var e;return P(e="object"==typeof t?t.value:t)?null:e},t.prototype._t=function(t){return{integerValue:""+t}},t.prototype.lt=function(t){if(this.options.hi){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:A(t)?"-0":t}},t.prototype.ai=function(t){return O(t)?this._t(t):this.lt(t)},t.prototype.C=function(t){return this.options.hi?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}},t.prototype.v=function(t){var e=B(t);return new b(e.seconds,e.nanos)},t.prototype.ui=function(t){return this.options.hi?t.toBase64():t.toUint8Array()},t.prototype.ci=function(t){return this.options.hi?(be(void 0===t||"string"==typeof t),x.fromBase64String(t||"")):(be(void 0===t||t instanceof Uint8Array),x.fromUint8Array(t||new Uint8Array))},t.prototype.toVersion=function(t){return this.C(t.C())},t.prototype.fromVersion=function(t){return be(!!t),_.v(this.v(t))},t.prototype._i=function(t,e){return this.li(e||this.ii).child("documents").child(t).j()},t.prototype.di=function(t){var e=E.K(t);return be(he(e)),e},t.prototype.fi=function(t){return this._i(t.path)},t.prototype.Z=function(t){var e=this.di(t);return be(e.get(1)===this.ii.projectId),be(!e.get(3)&&!this.ii.database||e.get(3)===this.ii.database),new S(this.Ti(e))},t.prototype.Ei=function(t){return this._i(t)},t.prototype.Ii=function(t){var e=this.di(t);return 4===e.length?E.G:this.Ti(e)},Object.defineProperty(t.prototype,"wi",{get:function(){return new E(["projects",this.ii.projectId,"databases",this.ii.database]).j()},enumerable:!0,configurable:!0}),t.prototype.li=function(t){return new E(["projects",t.projectId,"databases",t.database])},t.prototype.Ti=function(t){return be(t.length>4&&"documents"===t.get(4)),t.M(5)},t.prototype.Ri=function(t,e){return{name:this.fi(t),fields:e.proto.mapValue.fields}},t.prototype.Ai=function(t){return{name:this.fi(t.key),fields:t.xt().mapValue.fields,updateTime:this.C(t.version.C())}},t.prototype.mi=function(t,e){var n=this.Z(t.name),r=this.fromVersion(t.updateTime),i=new ft({mapValue:{fields:t.fields}});return new mt(n,r,i,{hasCommittedMutations:!!e})},t.prototype.Pi=function(t){be(!!t.found),t.found.name,t.found.updateTime;var e=this.Z(t.found.name),n=this.fromVersion(t.found.updateTime),r=new ft({mapValue:{fields:t.found.fields}});return new mt(e,n,r,{})},t.prototype.Vi=function(t){be(!!t.missing),be(!!t.readTime);var e=this.Z(t.missing),n=this.fromVersion(t.readTime);return new bt(e,n)},t.prototype.gi=function(t){return"found"in t?this.Pi(t):"missing"in t?this.Vi(t):me()},t.prototype.pi=function(t){var e;if("targetChange"in t){t.targetChange;var n=this.yi(t.targetChange.targetChangeType||"NO_CHANGE"),r=t.targetChange.targetIds||[],i=this.ci(t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&this.ni(o);e=new re(n,r,i,a||null)}else if("documentChange"in t){t.documentChange;var s=t.documentChange;s.document,s.document.name,s.document.updateTime;var u=this.Z(s.document.name),c=this.fromVersion(s.document.updateTime),l=new ft({mapValue:{fields:s.document.fields}}),h=new mt(u,c,l,{}),f=s.targetIds||[],p=s.removedTargetIds||[];
2e=new ee(f,p,h.key,h)}else if("documentDelete"in t){t.documentDelete;var d=t.documentDelete;d.document;var v=this.Z(d.document),y=d.readTime?this.fromVersion(d.readTime):_.min(),g=new bt(v,y),m=d.removedTargetIds||[];e=new ee([],m,g.key,g)}else if("documentRemove"in t){t.documentRemove;var b=t.documentRemove;b.document;var w=this.Z(b.document),E=b.removedTargetIds||[];e=new ee([],E,w,null)}else{if(!("filter"in t))return me();t.filter;var T=t.filter;T.targetId;var I=T.count||0,S=new Ot(I),C=T.targetId;e=new ne(C,S)}return e},t.prototype.yi=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:me()},t.prototype.bi=function(t){if(!("targetChange"in t))return _.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?_.min():e.readTime?this.fromVersion(e.readTime):_.min()},t.prototype.vi=function(t){var e,n=this;if(t instanceof st)e={update:this.Ri(t.key,t.value)};else if(t instanceof lt)e={delete:this.fi(t.key)};else if(t instanceof ut)e={update:this.Ri(t.key,t.data),updateMask:this.Si(t.Vt)};else if(t instanceof ct)e={transform:{document:this.fi(t.key),fieldTransforms:t.fieldTransforms.map((function(t){return n.Di(t)}))}};else{if(!(t instanceof ht))return me();e={verify:this.fi(t.key)}}return t.Rt.Tt||(e.currentDocument=this.Ci(t.Rt)),e},t.prototype.Fi=function(t){var e=this,n=t.currentDocument?this.Ni(t.currentDocument):ot.ft();if(t.update){t.update.name;var r=this.Z(t.update.name),i=new ft({mapValue:{fields:t.update.fields}});if(t.updateMask){var o=this.ki(t.updateMask);return new ut(r,i,o,n)}return new st(r,i,n)}if(t.delete){var a=this.Z(t.delete);return new lt(a,n)}if(t.transform){var s=this.Z(t.transform.document),u=t.transform.fieldTransforms.map((function(t){return e.Mi(t)}));return be(!0===n.exists),new ct(s,u)}if(t.verify){var c=this.Z(t.verify);return new ht(c,n)}return me()},t.prototype.Ci=function(t){return void 0!==t.updateTime?{updateTime:this.toVersion(t.updateTime)}:void 0!==t.exists?{exists:t.exists}:me()},t.prototype.Ni=function(t){return void 0!==t.updateTime?ot.updateTime(this.fromVersion(t.updateTime)):void 0!==t.exists?ot.exists(t.exists):ot.ft()},t.prototype.xi=function(t,e){var n=t.updateTime?this.fromVersion(t.updateTime):this.fromVersion(e);n.isEqual(_.min())&&(n=this.fromVersion(e));var r=null;return t.transformResults&&t.transformResults.length>0&&(r=t.transformResults),new it(n,r)},t.prototype.$i=function(t,e){var n=this;return t&&t.length>0?(be(void 0!==e),t.map((function(t){return n.xi(t,e)}))):[]},t.prototype.Di=function(t){var e=t.transform;if(e instanceof $)return{fieldPath:t.field.j(),setToServerValue:"REQUEST_TIME"};if(e instanceof J)return{fieldPath:t.field.j(),appendMissingElements:{values:e.elements}};if(e instanceof Z)return{fieldPath:t.field.j(),removeAllFromArray:{values:e.elements}};if(e instanceof tt)return{fieldPath:t.field.j(),increment:e.ct};throw me()},t.prototype.Mi=function(t){var e=null;if("setToServerValue"in t)be("REQUEST_TIME"===t.setToServerValue),e=$.instance;else if("appendMissingElements"in t){var n=t.appendMissingElements.values||[];e=new J(n)}else if("removeAllFromArray"in t){var r=t.removeAllFromArray.values||[];e=new Z(r)}else"increment"in t?e=new tt(this,t.increment):me();var i=I.X(t.fieldPath);return new rt(i,e)},t.prototype.Oi=function(t){return{documents:[this.Ei(t.path)]}},t.prototype.Li=function(t){be(1===t.documents.length);var e=t.documents[0];return Et.Wt(this.Ii(e)).ee()},t.prototype.Bi=function(t){var e={structuredQuery:{}},n=t.path;null!==t.collectionGroup?(e.parent=this.Ei(n),e.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(e.parent=this.Ei(n.$()),e.structuredQuery.from=[{collectionId:n.L()}]);var r=this.qi(t.filters);r&&(e.structuredQuery.where=r);var i=this.Ui(t.orderBy);i&&(e.structuredQuery.orderBy=i);var o=this.ri(t.limit);return null!==o&&(e.structuredQuery.limit=o),t.startAt&&(e.structuredQuery.startAt=this.Qi(t.startAt)),t.endAt&&(e.structuredQuery.endAt=this.Qi(t.endAt)),e},t.prototype.Wi=function(t){var e=this.Ii(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){be(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var a=[];n.where&&(a=this.ji(n.where));var s=[];n.orderBy&&(s=this.Ki(n.orderBy));var u=null;n.limit&&(u=this.oi(n.limit));var c=null;n.startAt&&(c=this.Gi(n.startAt));var l=null;return n.endAt&&(l=this.Gi(n.endAt)),new Et(e,i,s,a,u,"F",c,l).ee()},t.prototype.zi=function(t){var e=this.Hi(t.Te);return null==e?null:{"goog-listen-tags":e}},t.prototype.Hi=function(t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return me()}},t.prototype.ee=function(t){var e,n=t.target;return(e=n.Ot()?{documents:this.Oi(n)}:{query:this.Bi(n)}).targetId=t.targetId,t.resumeToken.rt()>0&&(e.resumeToken=this.ui(t.resumeToken)),e},t.prototype.qi=function(t){var e=this;if(0!==t.length){var n=t.map((function(t){return t instanceof Tt?e.Yi(t):me()}));return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},t.prototype.ji=function(t){var e=this;return t?void 0!==t.unaryFilter?[this.Ji(t)]:void 0!==t.fieldFilter?[this.Xi(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e.ji(t)})).reduce((function(t,e){return t.concat(e)})):me():[]},t.prototype.Ui=function(t){var e=this;if(0!==t.length)return t.map((function(t){return e.Zi(t)}))},t.prototype.Ki=function(t){var e=this;return t.map((function(t){return e.tn(t)}))},t.prototype.Qi=function(t){return{before:t.before,values:t.position}},t.prototype.Gi=function(t){var e=!!t.before,n=t.values||[];return new xt(n,e)},t.prototype.en=function(t){return ue[t]},t.prototype.sn=function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}},t.prototype.nn=function(t){return ce[t]},t.prototype.rn=function(t){switch(t){case"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"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return me()}},t.prototype.hn=function(t){return{fieldPath:t.j()}},t.prototype.on=function(t){return I.X(t.fieldPath)},t.prototype.Zi=function(t){return{field:this.hn(t.field),direction:this.en(t.dir)}},t.prototype.tn=function(t){return new Pt(this.on(t.field),this.sn(t.direction))},t.prototype.Xi=function(t){return Tt.create(this.on(t.fieldFilter.field),this.rn(t.fieldFilter.op),t.fieldFilter.value)},t.prototype.Yi=function(t){if("=="===t.op){if(Y(t.value))return{unaryFilter:{field:this.hn(t.field),op:"IS_NAN"}};if(Q(t.value))return{unaryFilter:{field:this.hn(t.field),op:"IS_NULL"}}}return{fieldFilter:{field:this.hn(t.field),op:this.nn(t.op),value:t.value}}},t.prototype.Ji=function(t){switch(t.unaryFilter.op){case"IS_NAN":var e=this.on(t.unaryFilter.field);return Tt.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=this.on(t.unaryFilter.field);return Tt.create(n,"==",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return me()}},t.prototype.Si=function(t){var e=[];return t.fields.forEach((function(t){return e.push(t.j())})),{fieldPaths:e}},t.prototype.ki=function(t){var e=t.fieldPaths||[];return new nt(e.map((function(t){return I.X(t)})))},t}();function he(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}var fe=function(){function t(){}return t.an=function(e){t.platform&&me(),t.platform=e},t.nt=function(){return t.platform||me(),t.platform},t}(),pe=new a.Logger("@firebase/firestore");function de(){return pe.logLevel}function ve(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(pe.logLevel<=a.LogLevel.DEBUG){var r=e.map(ge);pe.debug.apply(pe,i.__spreadArrays(["Firestore ("+l+"): "+t],r))}}function ye(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(pe.logLevel<=a.LogLevel.ERROR){var r=e.map(ge);pe.error.apply(pe,i.__spreadArrays(["Firestore ("+l+"): "+t],r))}}function ge(t){if("string"==typeof t)return t;var e=fe.nt();try{return e.un(t)}catch(e){return t}}function me(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE ("+l+") INTERNAL ASSERTION FAILED: "+t;throw ye(e),new Error(e)}function be(t,e){t||me()}function _e(t,e){return t}var we=function(){function t(){}return t.cn=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=fe.nt()._n(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Ee(t,e){return t<e?-1:t>e?1:0}function Te(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function Ie(t){return t+"\0"}var Se=function(t,e,n,r,i){this.ii=t,this.persistenceKey=e,this.host=n,this.ssl=r,this.forceLongPolling=i},Ce=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"ln",{get:function(){return"(default)"===this.database},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t.prototype.S=function(t){return Ee(this.projectId,t.projectId)||Ee(this.database,t.database)},t}(),ke=function(){function t(t){this.dn=t,this.fn={}}return t.prototype.get=function(t){var e=this.dn(t),n=this.fn[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(a.isEqual(t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.dn(t),r=this.fn[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(r[i][0].isEqual(t))return void(r[i]=[t,e]);r.push([t,e])}else this.fn[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.dn(t),n=this.fn[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(n[r][0].isEqual(t))return 1===n.length?delete this.fn[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){k(this.fn,(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.B=function(){return N(this.fn)},t}(),Ne=function(){function t(t,e,n,r){this.batchId=t,this.Tn=e,this.baseMutations=n,this.mutations=r}return t.prototype.at=function(t,e,n){for(var r=n.En,i=0;i<this.mutations.length;i++){var o=this.mutations[i];if(o.key.isEqual(t)){var a=r[i];e=o.at(e,a)}}return e},t.prototype.ot=function(t,e){for(var n=0,r=this.baseMutations;n<r.length;n++){var i=r[n];i.key.isEqual(t)&&(e=i.ot(e,e,this.Tn))}for(var o=e,a=0,s=this.mutations;a<s.length;a++){var u=s[a];u.key.isEqual(t)&&(e=u.ot(e,o,this.Tn))}return e},t.prototype.In=function(t){var e=this,n=t;return this.mutations.forEach((function(r){var i=e.ot(r.key,t.get(r.key));i&&(n=n.Ae(r.key,i))})),n},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),Kt())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Te(this.mutations,t.mutations,(function(t,e){return t.isEqual(e)}))&&Te(this.baseMutations,t.baseMutations,(function(t,e){return t.isEqual(e)}))},t}(),xe=function(){function t(t,e,n,r){this.batch=t,this.wn=e,this.En=n,this.Rn=r}return t.from=function(e,n,r){be(e.mutations.length===r.length);for(var i=Ht,o=e.mutations,a=0;a<o.length;a++)i=i.Ae(o[a].key,r[a].version);return new t(e,n,r,i)},t}(),Pe=function(){function t(t){var e=this;this.An=null,this.mn=null,this.result=void 0,this.error=void 0,this.Pn=!1,this.Vn=!1,t((function(t){e.Pn=!0,e.result=t,e.An&&e.An(t)}),(function(t){e.Pn=!0,e.error=t,e.mn&&e.mn(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.Vn&&me(),this.Vn=!0,this.Pn?this.error?this.gn(n,this.error):this.pn(e,this.result):new t((function(t,i){r.An=function(n){r.pn(e,n).next(t,i)},r.mn=function(e){r.gn(n,e).next(t,i)}}))},t.prototype.yn=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.bn=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.pn=function(e,n){return e?this.bn((function(){return e(n)})):t.resolve(n)},t.prototype.gn=function(e,n){return e?this.bn((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.vn=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.Sn=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.vn(r)},t}(),Ae=function(){function t(){this.Dn=new ke((function(t){return t.toString()})),this.Cn=!1}return Object.defineProperty(t.prototype,"readTime",{get:function(){return this.Fn},set:function(t){this.Fn=t},enumerable:!0,configurable:!0}),t.prototype.Nn=function(t,e){this.kn(),this.readTime=e,this.Dn.set(t.key,t)},t.prototype.Mn=function(t,e){this.kn(),e&&(this.readTime=e),this.Dn.set(t,null)},t.prototype.xn=function(t,e){this.kn();var n=this.Dn.get(e);return void 0!==n?Pe.resolve(n):this.$n(t,e)},t.prototype.getEntries=function(t,e){return this.On(t,e)},t.prototype.apply=function(t){return this.kn(),this.Cn=!0,this.Ln(t)},t.prototype.kn=function(){},t}(),Oe="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Re=function(){function t(){this.Bn=[]}return t.prototype.qn=function(t){this.Bn.push(t)},t.prototype.Un=function(){this.Bn.forEach((function(t){return t()}))},t}(),De=function(){function t(t,e,n){this.Qn=t,this.Wn=e,this.jn=n}return t.prototype.Kn=function(t,e){var n=this;return this.Wn.Gn(t,e).next((function(r){return n.zn(t,e,r)}))},t.prototype.zn=function(t,e,n){return this.Qn.xn(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].ot(e,t);return t}))},t.prototype.Hn=function(t,e,n){var r=Bt();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].ot(t,e);r=r.Ae(t,e)})),r},t.prototype.Yn=function(t,e){var n=this;return this.Qn.getEntries(t,e).next((function(e){return n.Jn(t,e)}))},t.prototype.Jn=function(t,e){var n=this;return this.Wn.Xn(t,e).next((function(r){var i=n.Hn(t,e,r),o=qt();
2return i.forEach((function(t,e){e||(e=new bt(t,_.min())),o=o.Ae(t,e)})),o}))},t.prototype.Zn=function(t,e,n){return e.Ot()?this.tr(t,e.path):e._e()?this.er(t,e,n):this.sr(t,e,n)},t.prototype.tr=function(t,e){return this.Kn(t,new S(e)).next((function(t){var e=zt();return t instanceof mt&&(e=e.Ae(t.key,t)),e}))},t.prototype.er=function(t,e,n){var r=this,i=e.collectionGroup,o=zt();return this.jn.ir(t,i).next((function(a){return Pe.forEach(a,(function(a){var s=e.Zt(a.child(i));return r.sr(t,s,n).next((function(t){t.forEach((function(t,e){o=o.Ae(t,e)}))}))})).next((function(){return o}))}))},t.prototype.sr=function(t,e,n){var r,i,o=this;return this.Qn.Zn(t,e,n).next((function(n){return r=n,o.Wn.nr(t,e)})).next((function(e){return i=e,o.rr(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,l=r.get(c),h=u.ot(l,l,o.Tn);r=h instanceof mt?r.Ae(c,h):r.remove(c)}}))})).next((function(){return r.forEach((function(t,n){e.matches(n)||(r=r.remove(t))})),r}))},t.prototype.rr=function(t,e,n){for(var r=Kt(),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 ut&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.Qn.getEntries(t,r).next((function(t){return t.forEach((function(t,e){null!==e&&e instanceof mt&&(c=c.Ae(t,e))})),c}))},t}(),Le=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.hr=n,this.or=r}return t.ar=function(e,n){for(var r=Kt(),i=Kt(),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}(),Me=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.ur=function(t){return n.cr(t)},this._r=function(t){return e.lr(t)})}return t.prototype.cr=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this._r&&this._r(t),t},t}();Me.dr=-1;var Fe=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},je=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.Tr=t,this.Er=e,this.Ir=n,this.wr=r,this.Rr=i,this.Ar=0,this.mr=null,this.Pr=Date.now(),this.reset()}return t.prototype.reset=function(){this.Ar=0},t.prototype.Vr=function(){this.Ar=this.Rr},t.prototype.gr=function(t){var e=this;this.cancel();var n=Math.floor(this.Ar+this.pr()),r=Math.max(0,Date.now()-this.Pr),i=Math.max(0,n-r);i>0&&ve("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.Ar+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.mr=this.Tr.yr(this.Er,i,(function(){return e.Pr=Date.now(),t()})),this.Ar*=this.wr,this.Ar<this.Ir&&(this.Ar=this.Ir),this.Ar>this.Rr&&(this.Ar=this.Rr)},t.prototype.br=function(){null!==this.mr&&(this.mr.vr(),this.mr=null)},t.prototype.cancel=function(){null!==this.mr&&(this.mr.cancel(),this.mr=null)},t.prototype.pr=function(){return(Math.random()-.5)*this.Ar},t}();function Ue(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=qe(e)),e=Ve(t.get(n),e);return qe(e)}function Ve(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=o}}return n}function qe(t){return t+"\x01\x01"}function Be(t){var e=t.length;if(be(e>=2),2===e)return be("\x01"===t.charAt(0)&&"\x01"===t.charAt(1)),E.G;for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("\x01",o);switch((a<0||a>n)&&me(),t.charAt(a+1)){case"\x01":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"\x10":i+=t.substring(o,a),i+="\0";break;case"\x11":i+=t.substring(o,a+1);break;default:me()}o=a+2}return new E(r)}var We=function(){function t(){this.Sr=new ze}return t.prototype.Dr=function(t,e){return this.Sr.add(e),Pe.resolve()},t.prototype.ir=function(t,e){return Pe.resolve(this.Sr.getEntries(e))},t}(),ze=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.L(),n=t.$(),r=this.index[e]||new jt(E.N),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.L(),n=t.$(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new jt(E.N)).W()},t}(),He=function(){function t(){this.Cr=new ze}return t.prototype.Dr=function(t,e){var n=this;if(!this.Cr.has(e)){var r=e.L(),i=e.$();t.qn((function(){n.Cr.add(e)}));var o={collectionId:r,parent:Ue(i)};return Ge(t).put(o)}return Pe.resolve()},t.prototype.ir=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[Ie(e),""],!1,!0);return Ge(t).Fr(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(Be(o.parent))}return n}))},t}();function Ge(t){return sn.Nr(t,On.store)}
2var Ke=function(){function t(t,e){this.serializer=t,this.jn=e}return t.prototype.Nn=function(t,e,n){return Ye(t).put(Xe(e),n)},t.prototype.Mn=function(t,e){var n=Ye(t),r=Xe(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.kr(t,r)}))},t.prototype.xn=function(t,e){var n=this;return Ye(t).get(Xe(e)).next((function(t){return n.Mr(t)}))},t.prototype.xr=function(t,e){var n=this;return Ye(t).get(Xe(e)).next((function(t){var e=n.Mr(t);return e?{$r:e,size:$e(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=Bt();return this.Or(t,e,(function(t,e){var i=n.Mr(e);r=r.Ae(t,i)})).next((function(){return r}))},t.prototype.Lr=function(t,e){var n=this,r=Bt(),i=new Lt(S.N);return this.Or(t,e,(function(t,e){var o=n.Mr(e);o?(r=r.Ae(t,o),i=i.Ae(t,$e(e))):(r=r.Ae(t,null),i=i.Ae(t,0))})).next((function(){return{Br:r,qr:i}}))},t.prototype.Or=function(t,e,n){if(e.B())return Pe.resolve();var r=IDBKeyRange.bound(e.first().path.W(),e.last().path.W()),i=e.be(),o=i.Ne();return Ye(t).Ur({range:r},(function(t,e,r){for(var a=S.st(t);o&&S.N(o,a)<0;)n(o,null),o=i.Ne();o&&o.isEqual(a)&&(n(o,e),o=i.ke()?i.Ne():null),o?r.Qr(o.path.W()):r.done()})).next((function(){for(;o;)n(o,null),o=i.ke()?i.Ne():null}))},t.prototype.Zn=function(t,e,n){var r=this,i=zt(),o=e.path.length+1,a={};if(n.isEqual(_.min())){var s=e.path.W();a.range=IDBKeyRange.lowerBound(s)}else{var u=e.path.W(),c=this.serializer.Wr(n);a.range=IDBKeyRange.lowerBound([u,c],!0),a.index=kn.collectionReadTimeIndex}return Ye(t).Ur(a,(function(t,n,a){if(t.length===o){var s=r.serializer.jr(n);e.path.q(s.key.path)?s instanceof mt&&e.matches(s)&&(i=i.Ae(s.key,s)):a.done()}})).next((function(){return i}))},t.prototype.Kr=function(t,e){var n=this,r=qt(),i=this.serializer.Wr(e),o=Ye(t),a=IDBKeyRange.lowerBound(i,!0);return o.Ur({index:kn.readTimeIndex,range:a},(function(t,e){var o=n.serializer.jr(e);r=r.Ae(o.key,o),i=e.readTime})).next((function(){return{Gr:r,readTime:n.serializer.zr(i)}}))},t.prototype.Hr=function(t){var e=this,n=Ye(t),r=_.min();return n.Ur({index:kn.readTimeIndex,reverse:!0},(function(t,n,i){n.readTime&&(r=e.serializer.zr(n.readTime)),i.done()})).next((function(){return r}))},t.prototype.Yr=function(e){return new t.Jr(this,!!e&&e.Xr)},t.prototype.Zr=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return Qe(t).get(Nn.key).next((function(t){return be(!!t),t}))},t.prototype.kr=function(t,e){return Qe(t).put(Nn.key,e)},t.prototype.Mr=function(t){if(t){var e=this.serializer.jr(t);return e instanceof bt&&e.version.isEqual(_.min())?null:e}return null},t}();function Qe(t){return sn.Nr(t,Nn.store)}function Ye(t){return sn.Nr(t,kn.store)}function Xe(t){return t.path.W()}function $e(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw me();e=t.noDocument}return JSON.stringify(e).length}Ke.Jr=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).th=e,r.Xr=n,r.eh=new ke((function(t){return t.toString()})),r}return i.__extends(e,t),e.prototype.Ln=function(t){var e=this,n=[],r=0,i=new jt((function(t,e){return Ee(t.j(),e.j())}));return this.Dn.forEach((function(o,a){var s=e.eh.get(o);if(a){var u=e.th.serializer.sh(a,e.readTime);i=i.add(o.path.$());var c=$e(u);r+=c-s,n.push(e.th.Nn(t,o,u))}else if(r-=s,e.Xr){var l=e.th.serializer.sh(new bt(o,_.min()),e.readTime);n.push(e.th.Nn(t,o,l))}else n.push(e.th.Mn(t,o))})),i.forEach((function(r){n.push(e.th.jn.Dr(t,r))})),n.push(this.th.updateMetadata(t,r)),Pe.vn(n)},e.prototype.$n=function(t,e){var n=this;return this.th.xr(t,e).next((function(t){return null===t?(n.eh.set(e,0),null):(n.eh.set(e,t.size),t.$r)}))},e.prototype.On=function(t,e){var n=this;return this.th.Lr(t,e).next((function(t){var e=t.Br;return t.qr.forEach((function(t,e){n.eh.set(t,e)})),e}))},e}(Ae);var Je=function(){function t(t){this.ih=t}return t.prototype.next=function(){return this.ih+=2,this.ih},t.nh=function(){return new t(0)},t.rh=function(){return new t(-1)},t}
2(),Ze=function(){function t(t,e){this.hh=t,this.serializer=e}return t.prototype.oh=function(t){var e=this;return this.ah(t).next((function(n){var r=new Je(n.highestTargetId);return n.highestTargetId=r.next(),e.uh(t,n).next((function(){return n.highestTargetId}))}))},t.prototype._h=function(t){return this.ah(t).next((function(t){return _.v(new b(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.lh=function(t){return this.ah(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.dh=function(t,e,n){var r=this;return this.ah(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.C()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.uh(t,i)}))},t.prototype.fh=function(t,e){var n=this;return this.Th(t,e).next((function(){return n.ah(t).next((function(r){return r.targetCount+=1,n.Eh(e,r),n.uh(t,r)}))}))},t.prototype.Ih=function(t,e){return this.Th(t,e)},t.prototype.wh=function(t,e){var n=this;return this.Rh(t,e.targetId).next((function(){return tn(t).delete(e.targetId)})).next((function(){return n.ah(t)})).next((function(e){return be(e.targetCount>0),e.targetCount-=1,n.uh(t,e)}))},t.prototype.Ah=function(t,e,n){var r=this,i=0,o=[];return tn(t).Ur((function(a,s){var u=r.serializer.mh(s);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.wh(t,u)))})).next((function(){return Pe.vn(o)})).next((function(){return i}))},t.prototype.js=function(t,e){var n=this;return tn(t).Ur((function(t,r){var i=n.serializer.mh(r);e(i)}))},t.prototype.ah=function(t){return en(t).get(An.key).next((function(t){return be(null!==t),t}))},t.prototype.uh=function(t,e){return en(t).put(An.key,e)},t.prototype.Th=function(t,e){return tn(t).put(this.serializer.Ph(e))},t.prototype.Eh=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.Vh=function(t){return this.ah(t).next((function(t){return t.targetCount}))},t.prototype.gh=function(t,e){var n=this,r=e.canonicalId(),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return tn(t).Ur({range:i,index:xn.queryTargetsIndexName},(function(t,r,i){var a=n.serializer.mh(r);e.isEqual(a.target)&&(o=a,i.done())})).next((function(){return o}))},t.prototype.ph=function(t,e,n){var r=this,i=[],o=nn(t);return e.forEach((function(e){var a=Ue(e.path);i.push(o.put(new Pn(n,a))),i.push(r.hh.yh(t,n,e))})),Pe.vn(i)},t.prototype.bh=function(t,e,n){var r=this,i=nn(t);return Pe.forEach(e,(function(e){var o=Ue(e.path);return Pe.vn([i.delete([n,o]),r.hh.vh(t,n,e)])}))},t.prototype.Rh=function(t,e){var n=nn(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.Sh=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=nn(t),i=Kt();return r.Ur({range:n,Dh:!0},(function(t,e,n){var r=Be(t[1]),o=new S(r);i=i.add(o)})).next((function(){return i}))},t.prototype.Ch=function(t,e){var n=Ue(e.path),r=IDBKeyRange.bound([n],[Ie(n)],!1,!0),i=0;return nn(t).Ur({index:Pn.documentTargetsIndex,Dh:!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.si=function(t,e){var n=this;return tn(t).get(e).next((function(t){return t?n.serializer.mh(t):null}))},t}();function tn(t){return sn.Nr(t,xn.store)}function en(t){return sn.Nr(t,An.store)}function nn(t){return sn.Nr(t,Pn.store)}var rn=function(){function t(t){this.Fh=t}return t.prototype.jr=function(t){if(t.document)return this.Fh.mi(t.document,!!t.hasCommittedMutations);if(t.noDocument){var e=S.st(t.noDocument.path),n=this.Nh(t.noDocument.readTime);return new bt(e,n,{hasCommittedMutations:!!t.hasCommittedMutations})}if(t.unknownDocument){var r=S.st(t.unknownDocument.path),i=this.Nh(t.unknownDocument.version);return new _t(r,i)}return me()},t.prototype.sh=function(t,e){var n=this.Wr(e),r=t.key.path.$().W();if(t instanceof mt){var i=this.Fh.Ai(t),o=t.hasCommittedMutations;return new kn(null,null,i,o,n,r)}if(t instanceof bt){var a=t.key.path.W(),s=this.kh(t.version),u=t.hasCommittedMutations;return new kn(null,new Sn(a,s),null,u,n,r)}if(t instanceof _t){var c=t.key.path.W(),l=this.kh(t.version);
2return new kn(new Cn(c,l),null,null,!0,n,r)}return me()},t.prototype.Wr=function(t){var e=t.C();return[e.seconds,e.nanoseconds]},t.prototype.zr=function(t){var e=new b(t[0],t[1]);return _.v(e)},t.prototype.kh=function(t){var e=t.C();return new _n(e.seconds,e.nanoseconds)},t.prototype.Nh=function(t){var e=new b(t.seconds,t.nanoseconds);return _.v(e)},t.prototype.Mh=function(t,e){var n=this,r=e.baseMutations.map((function(t){return n.Fh.vi(t)})),i=e.mutations.map((function(t){return n.Fh.vi(t)}));return new Tn(t,e.batchId,e.Tn.toMillis(),r,i)},t.prototype.xh=function(t){var e=this,n=(t.baseMutations||[]).map((function(t){return e.Fh.Fi(t)})),r=t.mutations.map((function(t){return e.Fh.Fi(t)})),i=b.fromMillis(t.localWriteTimeMs);return new Ne(t.batchId,i,n,r)},t.prototype.mh=function(t){var e,n=this.Nh(t.readTime),r=void 0!==t.lastLimboFreeSnapshotVersion?this.Nh(t.lastLimboFreeSnapshotVersion):_.min();return e=void 0!==t.query.documents?this.Fh.Li(t.query):this.Fh.Wi(t.query),new At(e,t.targetId,0,t.lastListenSequenceNumber,n,r,x.fromBase64String(t.resumeToken))},t.prototype.Ph=function(t){var e,n=this.kh(t.Ee),r=this.kh(t.lastLimboFreeSnapshotVersion);e=t.target.Ot()?this.Fh.Oi(t.target):this.Fh.Bi(t.target);var i=t.resumeToken.toBase64();return new xn(t.targetId,t.target.canonicalId(),n,i,t.sequenceNumber,r,e)},t}(),on="Failed to obtain exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",an=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).$h=e,r.Oh=n,r}return i.__extends(e,t),e}(Re),sn=function(){function t(e,n,r,i,o,a,s,u,c){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Tr=a,this.Lh=u,this.Bh=c,this.qh=null,this.Uh=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Qh=null,this.inForeground=!1,this.Wh=null,this.jh=null,this.Kh=Number.NEGATIVE_INFINITY,this.Gh=function(t){return Promise.resolve()},!t.zh())throw new p(f.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.hh=new ln(this,o),this.Hh=n+t.Yh,this.serializer=new rn(s),this.document=i.document,this.Jh=new Ze(this.hh,this.serializer),this.jn=new He,this.Qn=new Ke(this.serializer,this.jn),this.window=i.window,i.window&&i.window.localStorage?this.Xh=i.window.localStorage:(this.Xh=null,!1===c&&ye("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.Nr=function(t,e){if(t instanceof an)return Mn.Nr(t.$h,e);throw me()},t.prototype.start=function(){var t=this;return Mn.Zh(this.Hh,mn,new bn(this.serializer)).then((function(e){return t.to=e,t.eo()})).then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new p(f.FAILED_PRECONDITION,on);return t.so(),t.io(),t.no(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.Jh.lh(e)}))})).then((function(e){t.qh=new Me(e,t.Lh)})).then((function(){t.Uh=!0})).catch((function(e){return t.to&&t.to.close(),Promise.reject(e)}))},t.prototype.ro=function(t){var e=this;return this.Gh=function(n){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.ho?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.oo=function(t){var e=this;this.to.ao((function(n){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(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]}}
2))}))}))},t.prototype.uo=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Tr.co((function(){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.ho?[4,this.eo()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.eo=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return cn(e).put(new Dn(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t._o(e).next((function(e){e||(t.isPrimary=!1,t.Tr.lo((function(){return t.Gh(!1)})))}))})).next((function(){return t.do(e)})).next((function(n){return t.isPrimary&&!n?t.fo(e).next((function(){return!1})):!!n&&t.To(e).next((function(){return!0}))}))})).catch((function(e){if(Un(e))return ve("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return ve("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Tr.lo((function(){return t.Gh(e)})),t.isPrimary=e}))},t.prototype._o=function(t){var e=this;return un(t).get(wn.key).next((function(t){return Pe.resolve(e.Eo(t))}))},t.prototype.Io=function(t){return cn(t).delete(this.clientId)},t.prototype.wo=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a=this;return i.__generator(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.Ro(this.Kh,18e5)?[3,2]:(this.Kh=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var n=t.Nr(e,Dn.store);return n.Fr().next((function(t){var e=a.Ao(t,18e5),r=t.filter((function(t){return-1===e.indexOf(t)}));return Pe.forEach(r,(function(t){return n.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=i.sent(),this.Xh)for(n=0,r=e;n<r.length;n++)o=r[n],this.Xh.removeItem(this.mo(o.clientId));i.label=2;case 2:return[2]}}
2))}))},t.prototype.no=function(){var t=this;this.jh=this.Tr.yr("client_metadata_refresh",4e3,(function(){return t.eo().then((function(){return t.wo()})).then((function(){return t.no()}))}))},t.prototype.Eo=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.do=function(t){var e=this;return this.Bh?Pe.resolve(!0):un(t).get(wn.key).next((function(n){if(null!==n&&e.Ro(n.leaseTimestampMs,5e3)&&!e.Po(n.ownerId)){if(e.Eo(n)&&e.networkEnabled)return!0;if(!e.Eo(n)){if(!n.allowTabSynchronization)throw new p(f.FAILED_PRECONDITION,on);return!1}}return!(!e.networkEnabled||!e.inForeground)||cn(t).Fr().next((function(t){return void 0===e.Ao(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&&ve("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.Vo=function(){return i.__awaiter(this,void 0,void 0,(function(){var t=this;return i.__generator(this,(function(e){switch(e.label){case 0:return this.Uh=!1,this.po(),this.jh&&(this.jh.cancel(),this.jh=null),this.yo(),this.bo(),[4,this.runTransaction("shutdown","readwrite",(function(e){return t.fo(e).next((function(){return t.Io(e)}))})).catch((function(t){ve("IndexedDbPersistence","Proceeding with shutdown despite failure: ",t)}))];case 1:return e.sent(),this.to.close(),this.vo(),[2]}}))}))},t.prototype.Ao=function(t,e){var n=this;return t.filter((function(t){return n.Ro(t.updateTimeMs,e)&&!n.Po(t.clientId)}))},t.prototype.So=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return cn(e).Fr().next((function(e){return t.Ao(e,18e5).map((function(t){return t.clientId}))}))}))},t.clearPersistence=function(e){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:return t.zh()?(n=e+t.Yh,[4,Mn.delete(n)]):[2,Promise.resolve()];case 1:return r.sent(),[2]}}))}))},Object.defineProperty(t.prototype,"ho",{get:function(){return this.Uh},enumerable:!0,configurable:!0}),t.prototype.Do=function(t){return fn.Co(t,this.serializer,this.jn,this.hh)},t.prototype.Fo=function(){return this.Jh},t.prototype.No=function(){return this.Qn},t.prototype.ko=function(){return this.jn},t.prototype.runTransaction=function(t,e,n){var r=this;ve("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.to.runTransaction(o,Ln,(function(o){return i=new an(o,r.qh?r.qh.next():Me.dr),"readwrite-primary"===e?r._o(i).next((function(t){return!!t||r.do(i)})).next((function(e){if(!e)throw ye("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Tr.lo((function(){return r.Gh(!1)})),new p(f.FAILED_PRECONDITION,Oe);return n(i)})).next((function(t){return r.To(i).next((function(){return t}))})):r.Mo(i).next((function(){return n(i)}))})).then((function(t){return i.Un(),t}))},t.prototype.Mo=function(t){var e=this;return un(t).get(wn.key).next((function(t){if(null!==t&&e.Ro(t.leaseTimestampMs,5e3)&&!e.Po(t.ownerId)&&!e.Eo(t)&&!(e.Bh||e.allowTabSynchronization&&t.allowTabSynchronization))throw new p(f.FAILED_PRECONDITION,on)}))},t.prototype.To=function(t){var e=new wn(this.clientId,this.allowTabSynchronization,Date.now());return un(t).put(wn.key,e)},t.zh=function(){return Mn.zh()},t.xo=function(t){var e=t.ii.projectId;return t.ii.ln||(e+="."+t.ii.database),"firestore/"+t.persistenceKey+"/"+e+"/"},t.prototype.fo=function(t){var e=this,n=un(t);return n.get(wn.key).next((function(t){return e.Eo(t)?(ve("IndexedDbPersistence","Releasing primary lease."),n.delete(wn.key)):Pe.resolve()}))},t.prototype.Ro=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(ye("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.so=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Wh=function(){t.Tr.co((function(){return t.inForeground="visible"===t.document.visibilityState,t.eo()}))},this.document.addEventListener("visibilitychange",this.Wh),this.inForeground="visible"===this.document.visibilityState)},t.prototype.yo=function(){this.Wh&&(this.document.removeEventListener("visibilitychange",this.Wh),this.Wh=null)},t.prototype.io=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Qh=function(){e.po(),e.Tr.co((function(){return e.Vo()}))},this.window.addEventListener("unload",this.Qh))},t.prototype.bo=function(){this.Qh&&(this.window.removeEventListener("unload",this.Qh),this.Qh=null)},t.prototype.Po=function(t){var e;try{var n=null!==(null===(e=this.Xh)||void 0===e?void 0:e.getItem(this.mo(t)));return ve("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return ye("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.po=function(){if(this.Xh)try{this.Xh.setItem(this.mo(this.clientId),String(Date.now()))}catch(t){ye("Failed to set zombie client id.",t)}},t.prototype.vo=function(){if(this.Xh)try{this.Xh.removeItem(this.mo(this.clientId))}catch(t){}},t.prototype.mo=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function un(t){return sn.Nr(t,wn.store)}function cn(t){return sn.Nr(t,Dn.store)}sn.Yh="main";var ln=function(){function t(t,e){this.db=t,this.$o=new Zn(this,e)}return t.prototype.Oo=function(t){var e=this.Lo(t);return this.db.Fo().Vh(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.Lo=function(t){var e=0;return this.Bo(t,(function(t){e++})).next((function(){return e}))},t.prototype.js=function(t,e){return this.db.Fo().js(t,e)},t.prototype.Bo=function(t,e){return this.qo(t,(function(t,n){return e(n)}))},t.prototype.yh=function(t,e,n){return hn(t,n)},t.prototype.vh=function(t,e,n){return hn(t,n)},t.prototype.Ah=function(t,e,n){return this.db.Fo().Ah(t,e,n)},t.prototype.Uo=function(t,e){return hn(t,e)},t.prototype.Qo=function(t,e){return function(t,e){var n=!1;return gn(t).Wo((function(r){return pn(t,r,e).next((function(t){return t&&(n=!0),Pe.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.jo=function(t,e){var n=this,r=this.db.No().Yr(),i=[],o=0;return this.qo(t,(function(a,s){if(s<=e){var u=n.Qo(t,a).next((function(e){if(!e)return o++,r.xn(t,a).next((function(){return r.Mn(a),nn(t).delete([0,Ue(a.path)])}))}));i.push(u)}})).next((function(){return Pe.vn(i)})).next((function(){return r.apply(t)})).next((function(){return o}
2))},t.prototype.removeTarget=function(t,e){var n=e.Ie(t.Oh);return this.db.Fo().Ih(t,n)},t.prototype.Ko=function(t,e){return hn(t,e)},t.prototype.qo=function(t,e){var n,r=nn(t),i=Me.dr;return r.Ur({index:Pn.documentTargetsIndex},(function(t,r){var o=t[0],a=(t[1],r.path),s=r.sequenceNumber;0===o?(i!==Me.dr&&e(new S(Be(n)),i),i=s,n=a):i=Me.dr})).next((function(){i!==Me.dr&&e(new S(Be(n)),i)}))},t.prototype.Go=function(t){return this.db.No().Zr(t)},t}();function hn(t,e){return nn(t).put(function(t,e){return new Pn(0,Ue(t.path),e)}(e,t.Oh))}var fn=function(){function t(t,e,n,r){this.userId=t,this.serializer=e,this.jn=n,this.hh=r,this.zo={}}return t.Co=function(e,n,r,i){return be(""!==e.uid),new t(e.t()?e.uid:"",n,r,i)},t.prototype.Ho=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return vn(t).Ur({index:Tn.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.Yo=function(t,e,n,r){var i=this,o=yn(t),a=vn(t);return a.add({}).next((function(s){be("number"==typeof s);for(var u=new Ne(s,e,n,r),c=i.serializer.Mh(i.userId,u),l=[],h=new jt((function(t,e){return Ee(t.j(),e.j())})),f=0,p=r;f<p.length;f++){var d=p[f],v=In.key(i.userId,d.key.path,s);h=h.add(d.key.path.$()),l.push(a.put(c)),l.push(o.put(v,In.PLACEHOLDER))}return h.forEach((function(e){l.push(i.jn.Dr(t,e))})),t.qn((function(){i.zo[s]=u.keys()})),Pe.vn(l).next((function(){return u}))}))},t.prototype.Jo=function(t,e){var n=this;return vn(t).get(e).next((function(t){return t?(be(t.userId===n.userId),n.serializer.xh(t)):null}))},t.prototype.Xo=function(t,e){var n=this;return this.zo[e]?Pe.resolve(this.zo[e]):this.Jo(t,e).next((function(t){if(t){var r=t.keys();return n.zo[e]=r,r}return null}))},t.prototype.Zo=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return vn(t).Ur({index:Tn.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(be(e.batchId>=r),o=n.serializer.xh(e)),i.done()})).next((function(){return o}))},t.prototype.ta=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return vn(t).Ur({index:Tn.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.ea=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return vn(t).Fr(Tn.userMutationsIndex,n).next((function(t){return t.map((function(t){return e.serializer.xh(t)}))}))},t.prototype.Gn=function(t,e){var n=this,r=In.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return yn(t).Ur({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],l=Be(u);if(s===n.userId&&e.path.isEqual(l))return vn(t).get(c).next((function(t){if(!t)throw me();be(t.userId===n.userId),o.push(n.serializer.xh(t))}));a.done()})).next((function(){return o}))},t.prototype.Xn=function(t,e){var n=this,r=new jt(Ee),i=[];return e.forEach((function(e){var o=In.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=yn(t).Ur({range:a},(function(t,i,o){var a=t[0],s=t[1],u=t[2],c=Be(s);a===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),Pe.vn(i).next((function(){return n.sa(t,r)}))},t.prototype.nr=function(t,e){var n=this,r=e.path,i=r.length+1,o=In.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new jt(Ee);return yn(t).Ur({range:a},(function(t,e,o){var a=t[0],u=t[1],c=t[2],l=Be(u);a===n.userId&&r.q(l)?l.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.sa(t,s)}))},t.prototype.sa=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(vn(t).get(e).next((function(t){if(null===t)throw me();be(t.userId===n.userId),r.push(n.serializer.xh(t))})))})),Pe.vn(i).next((function(){return r}))},t.prototype.ia=function(t,e){var n=this;return dn(t.$h,this.userId,e).next((function(r){return t.qn((function(){n.na(e.batchId)})),Pe.forEach(r,(function(e){return n.hh.Uo(t,e)}))}))},t.prototype.na=function(t){delete this.zo[t]},t.prototype.ra=function(t){var e=this;return this.Ho(t).next((function(n){if(!n)return Pe.resolve();
2var r=IDBKeyRange.lowerBound(In.prefixForUser(e.userId)),i=[];return yn(t).Ur({range:r},(function(t,n,r){if(t[0]===e.userId){var o=Be(t[1]);i.push(o)}else r.done()})).next((function(){be(0===i.length)}))}))},t.prototype.Ch=function(t,e){return pn(t,this.userId,e)},t.prototype.ha=function(t){var e=this;return gn(t).get(this.userId).next((function(t){return t||new En(e.userId,-1,"")}))},t}();function pn(t,e,n){var r=In.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return yn(t).Ur({range:o,Dh:!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 dn(t,e,n){var r=t.store(Tn.store),i=t.store(In.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.Ur({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){be(1===s)})));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var f=h[l],p=In.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return Pe.vn(o).next((function(){return c}))}function vn(t){return sn.Nr(t,Tn.store)}function yn(t){return sn.Nr(t,In.store)}function gn(t){return sn.Nr(t,En.store)}var mn=10,bn=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;be(n<r&&n>=0&&r<=mn);var o=new Vn(e);n<1&&r>=1&&(function(t){t.createObjectStore(wn.store)}(t),function(t){t.createObjectStore(En.store,{keyPath:En.keyPath}),t.createObjectStore(Tn.store,{keyPath:Tn.keyPath,autoIncrement:!0}).createIndex(Tn.userMutationsIndex,Tn.userMutationsKeyPath,{unique:!0}),t.createObjectStore(In.store)}(t),Rn(t),function(t){t.createObjectStore(kn.store)}(t));var a=Pe.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(Pn.store),t.deleteObjectStore(xn.store),t.deleteObjectStore(An.store)}(t),Rn(t)),a=a.next((function(){return function(t){var e=t.store(An.store),n=new An(0,0,_.min().C(),0);return e.put(An.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(t,e){return e.store(Tn.store).Fr().next((function(n){t.deleteObjectStore(Tn.store),t.createObjectStore(Tn.store,{keyPath:Tn.keyPath,autoIncrement:!0}).createIndex(Tn.userMutationsIndex,Tn.userMutationsKeyPath,{unique:!0});var r=e.store(Tn.store),i=n.map((function(t){return r.put(t)}));return Pe.vn(i)}))}(t,o)}))),a=a.next((function(){!function(t){t.createObjectStore(Dn.store,{keyPath:Dn.keyPath})}(t)}))),n<5&&r>=5&&(a=a.next((function(){return i.removeAcknowledgedMutations(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(t){t.createObjectStore(Nn.store)}(t),i.addDocumentGlobal(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ensureSequenceNumbers(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.createCollectionParentIndex(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(kn.store);e.createIndex(kn.readTimeIndex,kn.readTimeIndexPath,{unique:!1}),e.createIndex(kn.collectionReadTimeIndex,kn.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(a=a.next((function(){return i.rewriteCanonicalIds(o)}))),a},t.prototype.addDocumentGlobal=function(t){var e=0;return t.store(kn.store).Ur((function(t,n){e+=$e(n)})).next((function(){var n=new Nn(e);return t.store(Nn.store).put(Nn.key,n)}))},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(En.store),r=t.store(Tn.store);return n.Fr().next((function(n){return Pe.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Fr(Tn.userMutationsIndex,i).next((function(r){return Pe.forEach(r,(function(r){be(r.userId===n.userId);var i=e.serializer.xh(r);return dn(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(Pn.store),n=t.store(kn.store);return t.store(An.store).get(An.key).next((function(t){var r=[];return n.Ur((function(n,i){var o=new E(n),a=function(t){return[0,Ue(t)]}(o);r.push(e.get(a).next((function(n){return n?Pe.resolve():function(n){return e.put(new Pn(0,Ue(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return Pe.vn(r)}))}
2))},t.prototype.createCollectionParentIndex=function(t,e){t.createObjectStore(On.store,{keyPath:On.keyPath});var n=e.store(On.store),r=new ze,i=function(t){if(r.add(t)){var e=t.L(),i=t.$();return n.put({collectionId:e,parent:Ue(i)})}};return e.store(kn.store).Ur({Dh:!0},(function(t,e){var n=new E(t);return i(n.$())})).next((function(){return e.store(In.store).Ur({Dh:!0},(function(t,e){t[0];var n=t[1],r=(t[2],Be(n));return i(r.$())}))}))},t.prototype.rewriteCanonicalIds=function(t){var e=this,n=t.store(xn.store);return n.Ur((function(t,r){var i=e.serializer.mh(r),o=e.serializer.Ph(i);return n.put(o)}))},t}(),_n=function(t,e){this.seconds=t,this.nanoseconds=e},wn=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};wn.store="owner",wn.key="owner";var En=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};En.store="mutationQueues",En.keyPath="userId";var Tn=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Tn.store="mutations",Tn.keyPath="batchId",Tn.userMutationsIndex="userMutationsIndex",Tn.userMutationsKeyPath=["userId","batchId"];var In=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,Ue(e)]},t.key=function(t,e,n){return[t,Ue(e),n]},t}();In.store="documentMutations",In.PLACEHOLDER=new In;var Sn=function(t,e){this.path=t,this.readTime=e},Cn=function(t,e){this.path=t,this.version=e},kn=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};kn.store="remoteDocuments",kn.readTimeIndex="readTimeIndex",kn.readTimeIndexPath="readTime",kn.collectionReadTimeIndex="collectionReadTimeIndex",kn.collectionReadTimeIndexPath=["parentPath","readTime"];var Nn=function(t){this.byteSize=t};Nn.store="remoteDocumentGlobal",Nn.key="remoteDocumentGlobalKey";var xn=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};xn.store="targets",xn.keyPath="targetId",xn.queryTargetsIndexName="queryTargetsIndex",xn.queryTargetsKeyPath=["canonicalId","targetId"];var Pn=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};Pn.store="targetDocuments",Pn.keyPath=["targetId","path"],Pn.documentTargetsIndex="documentTargetsIndex",Pn.documentTargetsKeyPath=["path","targetId"];var An=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};An.key="targetGlobalKey",An.store="targetGlobal";var On=function(t,e){this.collectionId=t,this.parent=e};function Rn(t){t.createObjectStore(Pn.store,{keyPath:Pn.keyPath}).createIndex(Pn.documentTargetsIndex,Pn.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(xn.store,{keyPath:xn.keyPath}).createIndex(xn.queryTargetsIndexName,xn.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(An.store)}On.store="collectionParents",On.keyPath=["collectionId","parent"];var Dn=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Dn.store="clientMetadata",Dn.keyPath="clientId";var Ln=i.__spreadArrays(i.__spreadArrays(i.__spreadArrays([En.store,Tn.store,In.store,kn.store,xn.store,wn.store,An.store,Pn.store],[Dn.store]),[Nn.store]),[On.store]),Mn=function(){function t(e){this.db=e,12.2===t.oa(s.getUA())&&ye("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.Zh=function(e,n,r){return ve("SimpleDb","Opening database:",e),new Pe((function(i,o){var a=indexedDB.open(e,n);a.onsuccess=function(e){var n=e.target.result;i(new t(n))},a.onblocked=function(){o(new p(f.FAILED_PRECONDITION,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},a.onerror=function(t){var e=t.target.error;"VersionError"===e.name?o(new p(f.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):o(e)},a.onupgradeneeded=function(t){ve("SimpleDb",'Database "'+e+'" requires upgrade from version:',t.oldVersion);var n=t.target.result;r.createOrUpgrade(n,a.transaction,t.oldVersion,mn).next((function(){ve("SimpleDb","Database upgrade to version "+mn+" complete")}
2))}})).yn()},t.delete=function(t){return ve("SimpleDb","Removing database:",t),Bn(window.indexedDB.deleteDatabase(t)).yn()},t.zh=function(){if("undefined"==typeof indexedDB)return!1;if(t.aa())return!0;var e=s.getUA(),n=t.oa(e),r=0<n&&n<10,i=t.ua(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)},t.aa=function(){var t;return"undefined"!=typeof __PRIVATE_process&&"YES"===(null===(t=__PRIVATE_process.__PRIVATE_env)||void 0===t?void 0:t.ca)},t.Nr=function(t,e){return t.store(e)},t.oa=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.ua=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.ao=function(t){this.db.onversionchange=function(e){return t(e)}},t.prototype.runTransaction=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,u;return i.__generator(this,(function(c){switch(c.label){case 0:r="readonly"===t,o=0,a=function(){var t,a,u,c,l;return i.__generator(this,(function(i){switch(i.label){case 0:++o,t=Vn.open(s.db,r?"readonly":"readwrite",e),i.label=1;case 1:return i.trys.push([1,3,,4]),a=n(t).catch((function(e){return t.abort(e),Pe.reject(e)})).yn(),u={},a.catch((function(){})),[4,t._a];case 2:return[2,(u.value=(i.sent(),a),u)];case 3:return c=i.sent(),l="FirebaseError"!==c.name&&o<3,ve("SimpleDb","Transaction failed with error: %s. Retrying: %s.",c.message,l),l?[3,4]:[2,{value:Promise.reject(c)}];case 4:return[2]}}
2))},s=this,c.label=1;case 1:return[5,a()];case 2:if("object"==typeof(u=c.sent()))return[2,u.value];c.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db.close()},t}(),Fn=function(){function t(t){this.la=t,this.da=!1,this.fa=null}return Object.defineProperty(t.prototype,"Pn",{get:function(){return this.da},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Ta",{get:function(){return this.fa},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.la=t},enumerable:!0,configurable:!0}),t.prototype.done=function(){this.da=!0},t.prototype.Qr=function(t){this.fa=t},t.prototype.delete=function(){return Bn(this.la.delete())},t}(),jn=function(t){function e(e){var n=this;return(n=t.call(this,f.UNAVAILABLE,"IndexedDB transaction failed: "+e)||this).name="IndexedDbTransactionError",n}return i.__extends(e,t),e}(p);function Un(t){return"IndexedDbTransactionError"===t.name}var Vn=function(){function t(t){var e=this;this.transaction=t,this.aborted=!1,this.Ea=new Fe,this.transaction.oncomplete=function(){e.Ea.resolve()},this.transaction.onabort=function(){t.error?e.Ea.reject(new jn(t.error)):e.Ea.resolve()},this.transaction.onerror=function(t){var n=zn(t.target.error);e.Ea.reject(new jn(n))}}return t.open=function(e,n,r){return new t(e.transaction(r,n))},Object.defineProperty(t.prototype,"_a",{get:function(){return this.Ea.promise},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){t&&this.Ea.reject(t),this.aborted||(ve("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 qn(e)},t}(),qn=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(ve("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(ve("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Bn(n)},t.prototype.add=function(t){return ve("SimpleDb","ADD",this.store.name,t,t),Bn(this.store.add(t))},t.prototype.get=function(t){var e=this;return Bn(this.store.get(t)).next((function(n){return void 0===n&&(n=null),ve("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return ve("SimpleDb","DELETE",this.store.name,t),Bn(this.store.delete(t))},t.prototype.count=function(){return ve("SimpleDb","COUNT",this.store.name),Bn(this.store.count())},t.prototype.Fr=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.Ia(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.wa=function(t,e){ve("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.Dh=!1;var r=this.cursor(n);return this.Ia(r,(function(t,e,n){return n.delete()}))},t.prototype.Ur=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.Ia(r,e)},t.prototype.Wo=function(t){var e=this.cursor({});return new Pe((function(n,r){e.onerror=function(t){var e=zn(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.Ia=function(t,e){var n=[];return new Pe((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 Fn(i),a=e(i.primaryKey,i.value,o);if(a instanceof Pe){var s=a.catch((function(t){return o.done(),Pe.reject(t)}));n.push(s)}o.Pn?r():null===o.Ta?i.continue():i.continue(o.Ta)}else r()}})).next((function(){return Pe.vn(n)}))},t.prototype.options=function(t,e){var n=void 0;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.Dh?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Bn(t){return new Pe((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=zn(t.target.error);n(e)}}))}var Wn=!1;function zn(t){var e=Mn.oa(s.getUA());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 p("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Wn||(Wn=!0,setTimeout((function(){throw r}),0)),r}}return t}var Hn=function(){function t(t,e,n,r,i){this.Ra=t,this.Er=e,this.Aa=n,this.op=r,this.ma=i,this.Pa=new Fe,this.then=this.Pa.promise.then.bind(this.Pa.promise),this.Pa.promise.catch((function(t){}))}return t.Va=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.ga=setTimeout((function(){return e.pa()}),t)},t.prototype.vr=function(){return this.pa()},t.prototype.cancel=function(t){null!==this.ga&&(this.clearTimeout(),this.Pa.reject(new p(f.CANCELLED,"Operation cancelled"+(t?": "+t:"")))
2)},t.prototype.pa=function(){var t=this;this.Ra.co((function(){return null!==t.ga?(t.clearTimeout(),t.op().then((function(e){return t.Pa.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.ga&&(this.ma(this),clearTimeout(this.ga),this.ga=null)},t}(),Gn=function(){function t(){var t=this;this.ya=Promise.resolve(),this.ba=Promise.resolve(),this.va=!1,this.Sa=[],this.Da=null,this.Ca=!1,this.Fa=[],this.Na=new je(this,"async_queue_retry"),this.ka=function(){return t.Na.br()};var e=fe.nt().window;e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.ka)}return Object.defineProperty(t.prototype,"Ma",{get:function(){return this.va},enumerable:!0,configurable:!0}),t.prototype.co=function(t){this.enqueue(t)},t.prototype.xa=function(t){this.$a(),this.Oa(t)},t.prototype.La=function(t){return this.$a(),this.Oa(t)},t.prototype.Ba=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e;return i.__generator(this,(function(n){switch(n.label){case 0:return this.$a(),this.va?[3,2]:(this.va=!0,(e=fe.nt().window)&&e.removeEventListener("visibilitychange",this.ka),[4,this.La(t)]);case 1:n.sent(),n.label=2;case 2:return[2]}}
2))}))},t.prototype.enqueue=function(t){return this.$a(),this.va?new Promise((function(t){})):this.Oa(t)},t.prototype.lo=function(t){var e=this;this.$a(),this.va||(this.ba=this.ba.then((function(){var n=new Fe;return e.co((function r(){return i.__awaiter(e,void 0,void 0,(function(){var e;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t()];case 1:return i.sent(),n.resolve(),this.Na.reset(),[3,3];case 2:if(!Un(e=i.sent()))throw n.resolve(),e;return ve("AsyncQueue","Operation failed with retryable error: "+e),this.Na.gr(r),[3,3];case 3:return[2]}}))}))})),n.promise})))},t.prototype.Oa=function(t){var e=this,n=this.ya.then((function(){return e.Ca=!0,t().catch((function(t){throw e.Da=t,e.Ca=!1,ye("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.Ca=!1,t}))}));return this.ya=n,n},t.prototype.yr=function(t,e,n){var r=this;this.$a(),this.Fa.indexOf(t)>-1&&(e=0);var i=Hn.Va(this,t,e,n,(function(t){return r.qa(t)}));return this.Sa.push(i),i},t.prototype.$a=function(){this.Da&&me()},t.prototype.Ua=function(){},t.prototype.Qa=function(){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(e){switch(e.label){case 0:return[4,t=this.ya];case 1:e.sent(),e.label=2;case 2:if(t!==this.ya)return[3,0];e.label=3;case 3:return[2]}}
2))}))},t.prototype.Wa=function(t){for(var e=0,n=this.Sa;e<n.length;e++)if(n[e].Er===t)return!0;return!1},t.prototype.ja=function(t){var e=this;return this.Qa().then((function(){e.Sa.sort((function(t,e){return t.Aa-e.Aa}));for(var n=0,r=e.Sa;n<r.length;n++){var i=r[n];if(i.vr(),"all"!==t&&i.Er===t)break}return e.Qa()}))},t.prototype.Ka=function(t){this.Fa.push(t)},t.prototype.qa=function(t){var e=this.Sa.indexOf(t);this.Sa.splice(e,1)},t}();function Kn(t,e){if(ye("AsyncQueue",e+": "+t),Un(t))return new p(f.UNAVAILABLE,e+": "+t);throw t}function Qn(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Ee(n,i);return 0===a?Ee(r,o):a}var Yn=function(){function t(t){this.Ga=t,this.buffer=new jt(Qn),this.za=0}return t.prototype.Ha=function(){return++this.za},t.prototype.Ya=function(t){var e=[t,this.Ha()];if(this.buffer.size<this.Ga)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();Qn(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),t}(),Xn={Ja:!1,Xa:0,Za:0,tu:0},$n=function(){function t(t,e,n){this.eu=t,this.su=e,this.iu=n}return t.nu=function(e){return new t(e,t.ru,t.hu)},t}();$n.ou=-1,$n.au=1048576,$n.uu=41943040,$n.ru=10,$n.hu=1e3,$n.cu=new $n($n.uu,$n.ru,$n.hu),$n.DISABLED=new $n($n.ou,0,0);var Jn=function(){function t(t,e){this.$o=t,this.Ra=e,this._u=!1,this.lu=null}return t.prototype.start=function(t){this.$o.du.eu!==$n.ou&&this.fu(t)},t.prototype.stop=function(){this.lu&&(this.lu.cancel(),this.lu=null)},Object.defineProperty(t.prototype,"ho",{get:function(){return null!==this.lu},enumerable:!0,configurable:!0}),t.prototype.fu=function(t){var e=this,n=this._u?3e5:6e4;ve("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.lu=this.Ra.yr("lru_garbage_collection",n,(function(){return i.__awaiter(e,void 0,void 0,(function(){var e;return i.__generator(this,(function(n){switch(n.label){case 0:this.lu=null,this._u=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.Tu(this.$o)];case 2:return n.sent(),[3,7];case 3:return Un(e=n.sent())?(ve("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,nr(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.fu(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),Zn=function(){function t(t,e){this.Eu=t,this.du=e}return t.prototype.Iu=function(t,e){return this.Eu.Oo(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.wu=function(t,e){var n=this;if(0===e)return Pe.resolve(Me.dr);var r=new Yn(e);return this.Eu.js(t,(function(t){return r.Ya(t.sequenceNumber)})).next((function(){return n.Eu.Bo(t,(function(t){return r.Ya(t)}))})).next((function(){return r.maxValue}))},t.prototype.Ah=function(t,e,n){return this.Eu.Ah(t,e,n)},t.prototype.jo=function(t,e){return this.Eu.jo(t,e)},t.prototype.Ru=function(t,e){var n=this;return this.du.eu===$n.ou?(ve("LruGarbageCollector","Garbage collection skipped; disabled"),Pe.resolve(Xn)):this.Go(t).next((function(r){return r<n.du.eu?(ve("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.du.eu),Xn):n.Au(t,e)}))},t.prototype.Go=function(t){return this.Eu.Go(t)},t.prototype.Au=function(t,e){var n,r,i,o,s,u,c,l=this,h=Date.now();return this.Iu(t,this.du.su).next((function(e){return e>l.du.iu?(ve("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.du.iu+" from "+e),r=l.du.iu):r=e,o=Date.now(),l.wu(t,r)})).next((function(r){return n=r,s=Date.now(),l.Ah(t,n,e)})).next((function(e){return i=e,u=Date.now(),l.jo(t,n)})).next((function(t){return c=Date.now(),de()<=a.LogLevel.DEBUG&&ve("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-h)+"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-h)+"ms"),Pe.resolve({Ja:!0,Xa:r,Za:i,tu:t})}))},t}(),tr=function(){function t(t,e,n){this.persistence=t,this.mu=e,this.Pu=new Lt(Ee),this.Vu=new ke((function(t){return t.canonicalId()})),this.gu=_.min(),this.Wn=t.Do(n),this.pu=t.No(),this.Jh=t.Fo(),this.yu=new De(this.pu,this.Wn,this.persistence.ko()),this.mu.bu(this.yu)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.vu=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return e=this.Wn,n=this.yu,[4,this.persistence.runTransaction("Handle user change","readonly",(function(r){var i;return o.Wn.ea(r).next((function(a){return i=a,e=o.persistence.Do(t),n=new De(o.pu,e,o.persistence.ko()),e.ea(r)})).next((function(t){for(var e=[],o=[],a=Kt(),s=0,u=i;s<u.length;s++){var c=u[s];e.push(c.batchId);for(var l=0,h=c.mutations;l<h.length;l++){var f=h[l];a=a.add(f.key)}}for(var p=0,d=t;p<d.length;p++){var v=d[p];o.push(v.batchId);for(var y=0,g=v.mutations;y<g.length;y++){var m=g[y];a=a.add(m.key)}}return n.Yn(r,a).next((function(t){return{Su:t,Du:e,Cu:o}}))}))}))];case 1:return r=i.sent(),[2,(this.Wn=e,this.yu=n,this.mu.bu(this.yu),r)]}}))}))},t.prototype.Fu=function(t){var e,n=this,r=b.now(),i=t.reduce((function(t,e){return t.add(e.key)}),Kt());return this.persistence.runTransaction("Locally write mutations","readwrite",(function(o){return n.yu.Yn(o,i).next((function(i){e=i;for(var a=[],s=0,u=t;s<u.length;s++){var c=u[s],l=c.Pt(e.get(c.key));null!=l&&a.push(new ut(c.key,l,dt(l.proto.mapValue),ot.exists(!0)))}return n.Wn.Yo(o,r,a,t)}))})).then((function(t){var n=t.In(e);return{batchId:t.batchId,Dn:n}}))},t.prototype.Nu=function(t){var e=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(n){var r=t.batch.keys(),i=e.pu.Yr({Xr:!0});
2return e.ku(n,t,i).next((function(){return i.apply(n)})).next((function(){return e.Wn.ra(n)})).next((function(){return e.yu.Yn(n,r)}))}))},t.prototype.Mu=function(t){var e=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",(function(n){var r;return e.Wn.Jo(n,t).next((function(t){return be(null!==t),r=t.keys(),e.Wn.ia(n,t)})).next((function(){return e.Wn.ra(n)})).next((function(){return e.yu.Yn(n,r)}))}))},t.prototype.ta=function(){var t=this;return this.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(e){return t.Wn.ta(e)}))},t.prototype._h=function(){var t=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.Jh._h(e)}))},t.prototype.xu=function(e){var n=this,r=e.Ee,i=this.Pu;return this.persistence.runTransaction("Apply remote event","readwrite-primary",(function(o){var a=n.pu.Yr({Xr:!0});i=n.Pu;var s=[];e.as.forEach((function(e,a){var u=i.get(a);if(u){s.push(n.Jh.bh(o,e.Is,a).next((function(){return n.Jh.ph(o,e.Ts,a)})));var c=e.resumeToken;if(c.rt()>0){var l=u.we(c,r).Ie(o.Oh);i=i.Ae(a,l),t.$u(u,l,e)&&s.push(n.Jh.Ih(o,l))}}}));var u=qt(),c=Kt();if(e.cs.forEach((function(t,e){c=c.add(t)})),s.push(a.getEntries(o,c).next((function(t){e.cs.forEach((function(i,c){var l=t.get(i);c instanceof bt&&c.version.isEqual(_.min())?(a.Mn(i,r),u=u.Ae(i,c)):null==l||c.version.S(l.version)>0||0===c.version.S(l.version)&&l.hasPendingWrites?(a.Nn(c,r),u=u.Ae(i,c)):ve("LocalStore","Ignoring outdated watch update for ",i,". Current version:",l.version," Watch version:",c.version),e._s.has(i)&&s.push(n.persistence.hh.Ko(o,i))}))}))),!r.isEqual(_.min())){var l=n.Jh._h(o).next((function(t){return n.Jh.dh(o,o.Oh,r)}));s.push(l)}return Pe.vn(s).next((function(){return a.apply(o)})).next((function(){return n.yu.Jn(o,u)}))})).then((function(t){return n.Pu=i,t}))},t.$u=function(t,e,n){return be(e.resumeToken.rt()>0),0===t.resumeToken.rt()||e.Ee.D()-t.Ee.D()>=this.Ou||n.Ts.size+n.Es.size+n.Is.size>0},t.prototype.Lu=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a,s,u,c,l=this;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(e){return Pe.forEach(t,(function(t){return Pe.forEach(t.hr,(function(n){return l.persistence.hh.yh(e,t.targetId,n)})).next((function(){return Pe.forEach(t.or,(function(n){return l.persistence.hh.vh(e,t.targetId,n)}))}))}))}))];case 1:return i.sent(),[3,3];case 2:if(!Un(e=i.sent()))throw e;return ve("LocalStore","Failed to update sequence numbers: "+e),[3,3];case 3:for(n=0,r=t;n<r.length;n++)o=r[n],a=o.targetId,o.fromCache||(s=this.Pu.get(a),u=s.Ee,c=s.Re(u),this.Pu=this.Pu.Ae(a,c));return[2]}}))}))},t.prototype.Bu=function(t){var e=this;return this.persistence.runTransaction("Get next mutation batch","readonly",(function(n){return void 0===t&&(t=-1),e.Wn.Zo(n,t)}))},t.prototype.qu=function(t){var e=this;return this.persistence.runTransaction("read document","readonly",(function(n){return e.yu.Kn(n,t)}))},t.prototype.Uu=function(t){var e=this;return this.persistence.runTransaction("Allocate target","readwrite",(function(n){var r;return e.Jh.gh(n,t).next((function(i){return i?(r=i,Pe.resolve(r)):e.Jh.oh(n).next((function(i){return r=new At(t,i,0,n.Oh),e.Jh.fh(n,r).next((function(){return r}))}))}))})).then((function(n){var r=e.Pu.get(n.targetId);return(null===r||n.Ee.S(r.Ee)>0)&&(e.Pu=e.Pu.Ae(n.targetId,n),e.Vu.set(t,n.targetId)),n}))},t.prototype.gh=function(t,e){var n=this.Vu.get(e);return void 0!==n?Pe.resolve(this.Pu.get(n)):this.Jh.gh(t,e)},t.prototype.Qu=function(t,e){var n=this,r=this.Pu.get(t),i=e?"readwrite":"readwrite-primary";return this.persistence.runTransaction("Release target",i,(function(t){return e?Pe.resolve():n.persistence.hh.removeTarget(t,r)})).then((function(){n.Pu=n.Pu.remove(t),n.Vu.delete(r.target)}))},t.prototype.Wu=function(t,e){var n=this,r=_.min(),i=Kt();return this.persistence.runTransaction("Execute query","readonly",(function(o){return n.gh(o,t.ee()).next((function(t){if(t)return r=t.lastLimboFreeSnapshotVersion,n.Jh.Sh(o,t.targetId).next((function(t){i=t}))})).next((function(){return n.mu.Zn(o,t,e?r:_.min(),e?i:Kt())})).next((function(t){return{documents:t,ju:i}}))}))},t.prototype.ku=function(t,e,n){var r=this,i=e.batch,o=i.keys(),a=Pe.resolve();return o.forEach((function(r){a=a.next((function(){return n.xn(t,r)})).next((function(t){var o=t,a=e.Rn.get(r);
2be(null!==a),(!o||o.version.S(a)<0)&&(o=i.at(r,o,e))&&n.Nn(o,e.wn)}))})),a.next((function(){return r.Wn.ia(t,i)}))},t.prototype.Tu=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.Ru(n,e.Pu)}))},t}();tr.Ou=3e8;var er=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).persistence=e,i.Wn=e.Do(r),i.pu=e.No(),i.Jh=e.Fo(),i}return i.__extends(e,t),e.prototype.start=function(){return this.Ku()},e.prototype.Gu=function(t){var e=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",(function(n){return e.Wn.Xo(n,t).next((function(t){return t?e.yu.Yn(n,t):Pe.resolve(null)}))}))},e.prototype.zu=function(t){this.Wn.na(t)},e.prototype.uo=function(t){this.persistence.uo(t)},e.prototype.So=function(){return this.persistence.So()},e.prototype.Hu=function(t){var e=this,n=this.Pu.get(t);return n?Promise.resolve(n.target):this.persistence.runTransaction("Get target data","readonly",(function(n){return e.Jh.si(n,t).next((function(t){return t?t.target:null}))}))},e.prototype.Kr=function(){var t=this;return this.persistence.runTransaction("Get new document changes","readonly",(function(e){return t.pu.Kr(e,t.gu)})).then((function(e){var n=e.Gr,r=e.readTime;return t.gu=r,n}))},e.prototype.Ku=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e=this;return i.__generator(this,(function(n){switch(n.label){case 0:return t=this,[4,this.persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return e.pu.Hr(t)}))];case 1:return t.gu=n.sent(),[2]}}))}))},e}(tr);function nr(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){if(t.code!==f.FAILED_PRECONDITION||t.message!==Oe)throw t;return ve("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}var rr=function(){function t(){this.Yu=new jt(ir.Ju),this.Xu=new jt(ir.Zu)}return t.prototype.B=function(){return this.Yu.B()},t.prototype.yh=function(t,e){var n=new ir(t,e);this.Yu=this.Yu.add(n),this.Xu=this.Xu.add(n)},t.prototype.tc=function(t,e){var n=this;t.forEach((function(t){return n.yh(t,e)}))},t.prototype.vh=function(t,e){this.ec(new ir(t,e))},t.prototype.sc=function(t,e){var n=this;t.forEach((function(t){return n.vh(t,e)}))},t.prototype.ic=function(t){var e=this,n=S.EMPTY,r=new ir(n,t),i=new ir(n,t+1),o=[];return this.Xu.Ke([r,i],(function(t){e.ec(t),o.push(t.key)})),o},t.prototype.nc=function(){var t=this;this.Yu.forEach((function(e){return t.ec(e)}))},t.prototype.ec=function(t){this.Yu=this.Yu.delete(t),this.Xu=this.Xu.delete(t)},t.prototype.rc=function(t){var e=S.EMPTY,n=new ir(e,t),r=new ir(e,t+1),i=Kt();return this.Xu.Ke([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.Ch=function(t){var e=new ir(t,0),n=this.Yu.ze(e);return null!==n&&t.isEqual(n.key)},t}(),ir=function(){function t(t,e){this.key=t,this.hc=e}return t.Ju=function(t,e){return S.N(t.key,e.key)||Ee(t.hc,e.hc)},t.Zu=function(t,e){return Ee(t.hc,e.hc)||S.N(t.key,e.key)},t}();function or(t,e){if(0!==e.length)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() does not support arguments, but was called with "+Tr(e.length,"argument")+".")}function ar(t,e,n){if(e.length!==n)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires "+Tr(n,"argument")+", but was called with "+Tr(e.length,"argument")+".")}function sr(t,e,n){if(e.length<n)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires at least "+Tr(n,"argument")+", but was called with "+Tr(e.length,"argument")+".")}function ur(t,e,n,r){if(e.length<n||e.length>r)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+Tr(e.length,"argument")+".")}function cr(t,e,n,r){vr(t,e,Er(n)+" argument",r)}function lr(t,e,n,r){void 0!==r&&cr(t,e,n,r)}function hr(t,e,n,r){vr(t,e,n+" option",r)}function fr(t,e,n,r){void 0!==r&&hr(t,e,n,r)}function pr(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){for(var o=[],a=0,s=i;a<s.length;a++){var u=s[a];if(u===r)return;o.push(gr(u))}var c=gr(r);throw new p(f.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+t+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(t,0,n,r,i)}function dr(t,e,n,r){if(!e.some((function(t){return t===r})))throw new p(f.INVALID_ARGUMENT,"Invalid value "+gr(r)+" provided to function "+t+"() for its "+Er(n)+" argument. Acceptable values: "+e.join(", "));return r}function vr(t,e,n,r){if(!("object"===e?yr(r):"non-empty string"===e?"string"==typeof r&&""!==r:typeof r===e)){var i=gr(r);throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function yr(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function gr(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":me()}function mr(t,e,n){if(void 0===n)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires a valid "+Er(e)+" argument, but it was undefined.")}function br(t,e,n){k(e,(function(e,r){if(n.indexOf(e)<0)throw new p(f.INVALID_ARGUMENT,"Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))}))}function _r(t,e,n,r){var i=gr(r);return new p(f.INVALID_ARGUMENT,"Function "+t+"() requires its "+Er(n)+" argument to be a "+e+", but it was: "+i)}function wr(t,e,n){if(n<=0)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires its "+Er(e)+" argument to be a positive number, but it was: "+n+".")}function Er(t){switch(t){case 1:return"first";
2case 2:return"second";case 3:return"third";default:return t+"th"}}function Tr(t,e){return t+" "+e+(1===t?"":"s")}function Ir(){if("undefined"==typeof Uint8Array)throw new p(f.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function Sr(){if(!fe.nt().oc)throw new p(f.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var Cr=function(){function t(t){Sr(),this.ac=t}return t.fromBase64String=function(e){ar("Blob.fromBase64String",arguments,1),cr("Blob.fromBase64String","string",1,e),Sr();try{return new t(x.fromBase64String(e))}catch(e){throw new p(f.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+e)}},t.fromUint8Array=function(e){if(ar("Blob.fromUint8Array",arguments,1),Ir(),!(e instanceof Uint8Array))throw _r("Blob.fromUint8Array","Uint8Array",1,e);return new t(x.fromUint8Array(e))},t.prototype.toBase64=function(){return ar("Blob.toBase64",arguments,0),Sr(),this.ac.toBase64()},t.prototype.toUint8Array=function(){return ar("Blob.toUint8Array",arguments,0),Ir(),this.ac.toUint8Array()},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this.ac.isEqual(t.ac)},t}(),kr=function(t){!function(t,e,n,r){if(!(e instanceof Array)||e.length<1)throw new p(f.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+Tr(1,"element")+".")}(0,t);for(var e=0;e<t.length;++e)if(cr("FieldPath","string",e,t[e]),0===t[e].length)throw new p(f.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.uc=new I(t)},Nr=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.call(this,e)||this}return i.__extends(e,t),e.documentId=function(){return e.cc},e.prototype.isEqual=function(t){if(!(t instanceof e))throw _r("isEqual","FieldPath",1,t);return this.uc.isEqual(t.uc)},e}(kr);Nr.cc=new Nr(I.J().j());var xr=new RegExp("[~\\*/\\[\\]]"),Pr=function(){this._c=this},Ar=function(t){function e(e){var n=this;return(n=t.call(this)||this).lc=e,n}return i.__extends(e,t),e.prototype.dc=function(t){if(2!==t.fc)throw 1===t.fc?t.Tc(this.lc+"() can only appear at the top level of your update data"):t.Tc(this.lc+"() cannot be used with set() unless you pass {merge:true}");return t.Vt.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(Pr),Or=function(t){function e(e){var n=this;return(n=t.call(this)||this).lc=e,n}return i.__extends(e,t),e.prototype.dc=function(t){return new rt(t.path,$.instance)},e.prototype.isEqual=function(t){return t instanceof e},e}(Pr),Rr=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).lc=e,r.Ec=n,r}return i.__extends(e,t),e.prototype.dc=function(t){var e=new zr({fc:3,methodName:this.lc,Ic:!0},t.ii,t.serializer,t.ignoreUndefinedProperties),n=this.Ec.map((function(t){return Gr(t,e)})),r=new J(n);return new rt(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(Pr),Dr=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).lc=e,r.Ec=n,r}return i.__extends(e,t),e.prototype.dc=function(t){var e=new zr({fc:3,methodName:this.lc,Ic:!0},t.ii,t.serializer,t.ignoreUndefinedProperties),n=this.Ec.map((function(t){return Gr(t,e)})),r=new Z(n);return new rt(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(Pr),Lr=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).lc=e,r.wc=n,r}return i.__extends(e,t),e.prototype.dc=function(t){var e=new zr({fc:3,methodName:this.lc},t.ii,t.serializer,t.ignoreUndefinedProperties),n=Gr(this.wc,e),r=new tt(t.serializer,n);return new rt(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(Pr),Mr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.delete=function(){return or("FieldValue.delete",arguments),new Fr(new Ar("FieldValue.delete"))},e.serverTimestamp=function(){return or("FieldValue.serverTimestamp",arguments),new Fr(new Or("FieldValue.serverTimestamp"))},e.arrayUnion=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];
2return sr("FieldValue.arrayUnion",arguments,1),new Fr(new Rr("FieldValue.arrayUnion",t))},e.arrayRemove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return sr("FieldValue.arrayRemove",arguments,1),new Fr(new Dr("FieldValue.arrayRemove",t))},e.increment=function(t){return cr("FieldValue.increment","number",1,t),ar("FieldValue.increment",arguments,1),new Fr(new Lr("FieldValue.increment",t))},e}(Pr),Fr=function(t){function e(e){var n=this;return(n=t.call(this)||this)._c=e,n.lc=e.lc,n}return i.__extends(e,t),e.prototype.dc=function(t){return this._c.dc(t)},e.prototype.isEqual=function(t){return t instanceof e&&this._c.isEqual(t._c)},e}(Mr),jr=function(){function t(t,e){if(ar("GeoPoint",arguments,2),cr("GeoPoint","number",1,t),cr("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new p(f.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new p(f.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this.Rc=t,this.Ac=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this.Rc},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this.Ac},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){return this.Rc===t.Rc&&this.Ac===t.Ac},t.prototype.p=function(t){return Ee(this.Rc,t.Rc)||Ee(this.Ac,t.Ac)},t}(),Ur=/^__.*__$/,Vr=function(t,e,n){this.mc=t,this.Pc=e,this.Vc=n},qr=function(){function t(t,e,n){this.data=t,this.Vt=e,this.fieldTransforms=n}return t.prototype.gc=function(t,e){var n=[];return null!==this.Vt?n.push(new ut(t,this.data,this.Vt,e)):n.push(new st(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new ct(t,this.fieldTransforms)),n},t}(),Br=function(){function t(t,e,n){this.data=t,this.Vt=e,this.fieldTransforms=n}return t.prototype.gc=function(t,e){var n=[new ut(t,this.data,this.Vt,e)];return this.fieldTransforms.length>0&&n.push(new ct(t,this.fieldTransforms)),n},t}();function Wr(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw me()}}var zr=function(){function t(t,e,n,r,i,o){this.settings=t,this.ii=e,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.pc(),this.fieldTransforms=i||[],this.Vt=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fc",{get:function(){return this.settings.fc},enumerable:!0,configurable:!0}),t.prototype.yc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.ii,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.Vt)},t.prototype.bc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.yc({path:n,Ic:!1});return r.vc(t),r},t.prototype.Sc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.yc({path:n,Ic:!1});return r.pc(),r},t.prototype.Dc=function(t){return this.yc({path:void 0,Ic:!0})},t.prototype.Tc=function(t){var e=!this.path||this.path.B()?"":" (found in field "+this.path.toString()+")";return new p(f.INVALID_ARGUMENT,"Function "+this.settings.methodName+"() called with invalid data. "+t+e)},t.prototype.contains=function(t){return void 0!==this.Vt.find((function(e){return t.q(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.q(e.field)}))},t.prototype.pc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.vc(this.path.get(t))},t.prototype.vc=function(t){if(0===t.length)throw this.Tc("Document fields must not be empty");if(Wr(this.fc)&&Ur.test(t))throw this.Tc('Document fields cannot begin and end with "__"')},t}(),Hr=function(){function t(t,e,n){this.ii=t,this.ignoreUndefinedProperties=e,this.serializer=n||fe.nt().Cc(t)}return t.prototype.Fc=function(t,e,n){void 0===n&&(n={});var r=this.Nc(n.merge||n.mergeFields?2:0,t);Yr("Data must be an object, but it was:",r,e);var i,o,a=Kr(e,r);if(n.merge)i=new nt(r.Vt),o=r.fieldTransforms;else if(n.mergeFields){for(var s=[],u=0,c=n.mergeFields;u<c.length;u++){var l=c[u],h=void 0;if(l instanceof kr)h=l.uc;else{if("string"!=typeof l)throw me();h=$r(t,l)}if(!r.contains(h))throw new p(f.INVALID_ARGUMENT,"Field '"+h+"' is specified in your field mask but missing from your input data.");Jr(s,h)||s.push(h)}i=new nt(s),o=r.fieldTransforms.filter((function(t){return i.dt(t.field)}))}else i=null,o=r.fieldTransforms;return new qr(new ft(a),i,o)},t.prototype.kc=function(t,e){var n=this.Nc(1,t);Yr("Data must be an object, but it was:",n,e);var r=[],i=new pt;k(e,(function(e,o){var a=$r(t,e),s=n.Sc(a);if(o instanceof Pr&&o._c instanceof Ar)r.push(a);else{var u=Gr(o,s);null!=u&&(r.push(a),i.set(a,u))}}));var o=new nt(r);return new Br(i.yt(),o,n.fieldTransforms)},t.prototype.Mc=function(t,e,n,r){var i=this.Nc(1,t),o=[Xr(t,e)],a=[n];if(r.length%2!=0)throw new p(f.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var s=0;s<r.length;s+=2)o.push(Xr(t,r[s])),a.push(r[s+1]);for(var u=[],c=new pt,l=o.length-1;l>=0;--l)if(!Jr(u,o[l])){var h=o[l],d=a[l],v=i.Sc(h);if(d instanceof Pr&&d._c instanceof Ar)u.push(h);else{var y=Gr(d,v);
2null!=y&&(u.push(h),c.set(h,y))}}var g=new nt(u);return new Br(c.yt(),g,i.fieldTransforms)},t.prototype.Nc=function(t,e){return new zr({fc:t,methodName:e,path:I.G,Ic:!1},this.ii,this.serializer,this.ignoreUndefinedProperties)},t.prototype.xc=function(t,e,n){return void 0===n&&(n=!1),Gr(e,this.Nc(n?4:3,t))},t}();function Gr(t,e){if(Qr(t))return Yr("Unsupported field value:",e,t),Kr(t,e);if(t instanceof Pr)return function(t,e){if(!Wr(e.fc))throw e.Tc(t.lc+"() can only be used with update() and set()");if(!e.path)throw e.Tc(t.lc+"() is not currently supported inside arrays");var n=t.dc(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(e.path&&e.Vt.push(e.path),t instanceof Array){if(e.settings.Ic&&4!==e.fc)throw e.Tc("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=Gr(o[i],e.Dc(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===t)return{nullValue:"NULL_VALUE"};if("number"==typeof t)return e.serializer.ai(t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=b.fromDate(t);return{timestampValue:e.serializer.C(n)}}if(t instanceof b){var r=new b(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:e.serializer.C(r)}}if(t instanceof jr)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Cr)return{bytesValue:e.serializer.ui(t)};if(t instanceof Vr){var i=e.ii,o=t.mc;if(!o.isEqual(i))throw e.Tc("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:e.serializer._i(t.Pc.path,t.mc)}}if(void 0===t&&e.ignoreUndefinedProperties)return null;throw e.Tc("Unsupported field value: "+gr(t))}(t,e)}function Kr(t,e){var n={};return N(t)?e.path&&e.path.length>0&&e.Vt.push(e.path):k(t,(function(t,r){var i=Gr(r,e.bc(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Qr(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof b||t instanceof jr||t instanceof Cr||t instanceof Vr||t instanceof Pr)}function Yr(t,e,n){if(!Qr(n)||!yr(n)){var r=gr(n);throw"an object"===r?e.Tc(t+" a custom object"):e.Tc(t+" "+r)}}function Xr(t,e){if(e instanceof kr)return e.uc;if("string"==typeof e)return $r(t,e);throw new p(f.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. Field path arguments must be of type string or FieldPath.")}function $r(t,e){try{return function(t){if(t.search(xr)>=0)throw new p(f.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(Nr.bind.apply(Nr,i.__spreadArrays([void 0],t.split("."))))}catch(i){throw new p(f.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e).uc}catch(e){var n=(r=e)instanceof Error?r.message:r.toString();throw new p(f.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. "+n)}var r}function Jr(t,e){return t.some((function(t){return t.isEqual(e)}))}var Zr=function(){function t(t,e,n,r,i,o){this.Tr=t,this.$c=n,this.Oc=r,this.Lc=i,this.listener=o,this.state=0,this.Bc=0,this.qc=null,this.stream=null,this.Na=new je(t,e)}return t.prototype.Uc=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.Qc=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.Wc()},t.prototype.stop=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Uc()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2))}))},t.prototype.jc=function(){this.state=0,this.Na.reset()},t.prototype.Kc=function(){var t=this;this.Qc()&&null===this.qc&&(this.qc=this.Tr.yr(this.$c,6e4,(function(){return t.Gc()})))},t.prototype.zc=function(t){this.Hc(),this.stream.send(t)},t.prototype.Gc=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.Qc()?[2,this.close(0)]:[2]}))}))},t.prototype.Hc=function(){this.qc&&(this.qc.cancel(),this.qc=null)},t.prototype.close=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.Hc(),this.Na.cancel(),this.Bc++,3!==t?this.Na.reset():e&&e.code===f.RESOURCE_EXHAUSTED?(ye(e.toString()),ye("Using maximum backoff delay to prevent overloading the backend."),this.Na.Vr()):e&&e.code===f.UNAUTHENTICATED&&this.Lc._(),null!==this.stream&&(this.Yc(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Jc(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.Yc=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.Xc(this.Bc),n=this.Bc;this.Lc.getToken().then((function(e){t.Bc===n&&t.Zc(e)}),(function(n){e((function(){var e=new p(f.UNKNOWN,"Fetching auth token failed: "+n.message);return t.t_(e)}))}))},t.prototype.Zc=function(t){var e=this,n=this.Xc(this.Bc);this.stream=this.e_(t),this.stream.s_((function(){n((function(){return e.state=2,e.listener.s_()}))})),this.stream.Jc((function(t){n((function(){return e.t_(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.Wc=function(){var t=this;this.state=4,this.Na.gr((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.t_=function(t){return ve("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.Xc=function(t){var e=this;return function(n){e.Tr.co((function(){return e.Bc===t?n():(ve("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),ti=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).serializer=i,a}return i.__extends(e,t),e.prototype.e_=function(t){return this.Oc.i_("Listen",t)},e.prototype.onMessage=function(t){this.Na.reset();var e=this.serializer.pi(t),n=this.serializer.bi(t);return this.listener.n_(e,n)},e.prototype.r_=function(t){var e={};e.database=this.serializer.wi,e.addTarget=this.serializer.ee(t);var n=this.serializer.zi(t);n&&(e.labels=n),this.zc(e)},e.prototype.h_=function(t){var e={};e.database=this.serializer.wi,e.removeTarget=t,this.zc(e)},e}(Zr),ei=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).serializer=i,a.o_=!1,a.lastStreamToken=x.ht,a}return i.__extends(e,t),Object.defineProperty(e.prototype,"a_",{get:function(){return this.o_},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.o_=!1,this.lastStreamToken=x.ht,t.prototype.start.call(this)},e.prototype.Yc=function(){this.o_&&this.u_([])},e.prototype.e_=function(t){return this.Oc.i_("Write",t)},e.prototype.onMessage=function(t){if(be(!!t.streamToken),this.lastStreamToken=this.serializer.ci(t.streamToken),this.o_){this.Na.reset();var e=this.serializer.$i(t.writeResults,t.commitTime),n=this.serializer.fromVersion(t.commitTime);return this.listener.c_(n,e)}return be(!t.writeResults||0===t.writeResults.length),this.o_=!0,this.listener.__()},e.prototype.l_=function(){var t={};t.database=this.serializer.wi,this.zc(t)},e.prototype.u_=function(t){var e=this,n={streamToken:this.serializer.ui(this.lastStreamToken),writes:t.map((function(t){return e.serializer.vi(t)}))};this.zc(n)},e}(Zr),ni=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Oc=e,i.credentials=n,i.serializer=r,i.f_=!1,i}return i.__extends(e,t),e.prototype.T_=function(){if(this.f_)throw new p(f.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.E_=function(t,e){var n=this;return this.T_(),this.credentials.getToken().then((function(r){return n.Oc.E_(t,e,r)})).catch((function(t){throw t.code===f.UNAUTHENTICATED&&n.credentials._(),t}))},e.prototype.I_=function(t,e){var n=this;return this.T_(),this.credentials.getToken().then((function(r){return n.Oc.I_(t,e,r)})).catch((function(t){throw t.code===f.UNAUTHENTICATED&&n.credentials._(),t}))},e}((function(){this.d_=void 0})),ri=function(){function t(t){this.w_=t,this.R_=new Map,this.mutations=[],this.A_=!1,this.m_=null,this.P_=new Set}return t.prototype.V_=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(this.g_(),this.mutations.length>0)throw new p(f.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:return n=_e(t),r={database:n.seri
2alizer.wi,documents:e.map((function(t){return n.serializer.fi(t)}))},[4,n.I_("BatchGetDocuments",r)];case 1:return o=i.sent(),a=new Map,o.forEach((function(t){var e=n.serializer.gi(t);a.set(e.key.toString(),e)})),s=[],[2,(e.forEach((function(t){var e=a.get(t.toString());be(!!e),s.push(e)})),s)]}}))}))}(this.w_,t)];case 1:return[2,((e=r.sent()).forEach((function(t){t instanceof bt||t instanceof mt?n.p_(t):me()})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.gc(t,this.Rt(t))),this.P_.add(t)},t.prototype.update=function(t,e){try{this.write(e.gc(t,this.y_(t)))}catch(t){this.m_=t}this.P_.add(t)},t.prototype.delete=function(t){this.write([new lt(t,this.Rt(t))]),this.P_.add(t)},t.prototype.commit=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e=this;return i.__generator(this,(function(n){switch(n.label){case 0:if(this.g_(),this.m_)throw this.m_;return t=this.R_,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=new S(E.K(n));e.mutations.push(new ht(r,e.Rt(r)))})),[4,function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r;return i.__generator(this,(function(i){switch(i.label){case 0:return n=_e(t),r={database:n.seri
2alizer.wi,writes:e.map((function(t){return n.serializer.vi(t)}))},[4,n.E_("Commit",r)];case 1:return i.sent(),[2]}}))}))}(this.w_,this.mutations)];case 1:return n.sent(),this.A_=!0,[2]}}))}))},t.prototype.p_=function(t){var e;if(t instanceof mt)e=t.version;else{if(!(t instanceof bt))throw me();e=_.min()}var n=this.R_.get(t.key.toString());if(n){if(!e.isEqual(n))throw new p(f.ABORTED,"Document version changed between two reads.")}else this.R_.set(t.key.toString(),e)},t.prototype.Rt=function(t){var e=this.R_.get(t.toString());return!this.P_.has(t)&&e?ot.updateTime(e):ot.ft()},t.prototype.y_=function(t){var e=this.R_.get(t.toString());if(!this.P_.has(t)&&e){if(e.isEqual(_.min()))throw new p(f.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return ot.updateTime(e)}return ot.exists(!0)},t.prototype.write=function(t){this.g_(),this.mutations=this.mutations.concat(t)},t.prototype.g_=function(){},t}(),ii=function(){function t(t,e){this.Ra=t,this.b_=e,this.state="Unknown",this.v_=0,this.S_=null,this.D_=!0}return t.prototype.C_=function(){var t=this;0===this.v_&&(this.F_("Unknown"),this.S_=this.Ra.yr("online_state_timeout",1e4,(function(){return t.S_=null,t.N_("Backend didn't respond within 10 seconds."),t.F_("Offline"),Promise.resolve()})))},t.prototype.k_=function(t){"Online"===this.state?this.F_("Unknown"):(this.v_++,this.v_>=1&&(this.M_(),this.N_("Connection failed 1 times. Most recent error: "+t.toString()),this.F_("Offline")))},t.prototype.set=function(t){this.M_(),this.v_=0,"Online"===t&&(this.D_=!1),this.F_(t)},t.prototype.F_=function(t){t!==this.state&&(this.state=t,this.b_(t))},t.prototype.N_=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.D_?(ye(e),this.D_=!1):ve("OnlineStateTracker",e)},t.prototype.M_=function(){null!==this.S_&&(this.S_.cancel(),this.S_=null)},t}(),oi=function(){function t(t,e,n,r,o){var a=this;this.x_=t,this.w_=e,this.Ra=n,this.O_=[],this.L_=new Map,this.B_=null,this.networkEnabled=!1,this.isPrimary=!1,this.q_=!1,this.U_=o,this.U_.Q_((function(t){n.co((function(){return i.__awaiter(a,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.W_()?(ve("RemoteStore","Restarting streams for network reachability change."),[4,this.j_()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2))}))}))})),this.K_=new ii(n,r),this.G_=function(t,e,n){var r=_e(t);return new ti(e,r.Oc,r.credentials,r.serializer,n)}(this.w_,n,{s_:this.z_.bind(this),Jc:this.H_.bind(this),n_:this.Y_.bind(this)}),this.J_=function(t,e,n){var r=_e(t);return new ei(e,r.Oc,r.credentials,r.serializer,n)}(this.w_,n,{s_:this.X_.bind(this),Jc:this.Z_.bind(this),__:this.tl.bind(this),c_:this.c_.bind(this)})}return t.prototype.start=function(){return this.enableNetwork()},t.prototype.enableNetwork=function(){return this.networkEnabled=!0,this.el()},t.prototype.el=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.W_()?(this.sl()?this.il():this.K_.set("Unknown"),[4,this.nl()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.disableNetwork=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.networkEnabled=!1,[4,this.rl()];case 1:return t.sent(),this.K_.set("Offline"),[2]}}))}))},t.prototype.rl=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,this.J_.stop()];case 1:return t.sent(),[4,this.G_.stop()];case 2:return t.sent(),this.O_.length>0&&(ve("RemoteStore","Stopping write stream with "+this.O_.length+" pending writes"),this.O_=[]),this.hl(),[2]}}))}))},t.prototype.Vo=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return ve("RemoteStore","RemoteStore shutting down."),this.networkEnabled=!1,[4,this.rl()];case 1:return t.sent(),this.U_.Vo(),this.K_.set("Unknown"),[2]}}))}))},t.prototype.listen=function(t){this.L_.has(t.targetId)||(this.L_.set(t.targetId,t),this.sl()?this.il():this.G_.Qc()&&this.ol(t))},t.prototype.al=function(t){this.L_.delete(t),this.G_.Qc()&&this.ul(t),0===this.L_.size&&(this.G_.Qc()?this.G_.Kc():this.W_()&&this.K_.set("Unknown"))},t.prototype.si=function(t){return this.L_.get(t)||null},t.prototype.ei=function(t){return this.cl.ei(t)},t.prototype.ol=function(t){this.B_.Ns(t.targetId),this.G_.r_(t)},t.prototype.ul=function(t){this.B_.Ns(t),this.G_.h_(t)},t.prototype.il=function(){this.B_=new oe(this),this.G_.start(),this.K_.C_()},t.prototype.sl=function(){return this.W_()&&!this.G_.Uc()&&this.L_.size>0},t.prototype.W_=function(){return!this.q_&&this.isPrimary&&this.networkEnabled},t.prototype.hl=function(){this.B_=null},t.prototype.z_=function(){return i.__awaiter(this,void 0,void 0,(function(){var t=this;return i.__generator(this,(function(e){return this.L_.forEach((function(e,n){t.ol(e)})),[2]}))}))},t.prototype.H_=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.hl(),this.sl()?(this.K_.k_(t),this.il()):this.K_.set("Unknown"),[2]}))}))},t.prototype.Y_=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:if(this.K_.set("Online"),!(t instanceof re&&2===t.state&&t.cause))return[3,6];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,this._l(t)];case 2:return i.sent(),[3,5];case 3:return n=i.sent(),ve("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),[4,this.ll(n)];case 4:return i.sent(),[3,5];case 5:return[3,13];case 6:if(t instanceof ee?this.B_.qs(t):t instanceof ne?this.B_.Hs(t):this.B_.Ws(t),e.isEqual(_.min()))return[3,13];i.label=7;case 7:return i.trys.push([7,11,,13]),[4,this.x_._h()];case 8:return r=i.sent(),e.S(r)>=0?[4,this.dl(e)]:[3,10];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return ve("RemoteStore","Failed to raise snapshot:",o=i.sent()),[4,this.ll(o)];case 12:return i.sent(),[3,13];case 13:return[2]}}
2))}))},t.prototype.ll=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(!Un(t))throw t;return this.q_=!0,[4,this.rl()];case 1:return r.sent(),this.K_.set("Offline"),e||(e=function(){return n.x_._h()}),this.Ra.lo((function(){return i.__awaiter(n,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return ve("RemoteStore","Retrying IndexedDB access"),[4,e()];case 1:return t.sent(),this.q_=!1,[4,this.el()];case 2:return t.sent(),[2]}}))}))})),[2]}}))}))},t.prototype.fl=function(t){var e=this;return t().catch((function(n){return e.ll(n,t)}))},t.prototype.dl=function(t){var e=this,n=this.B_.Xs(t);return n.as.forEach((function(n,r){if(n.resumeToken.rt()>0){var i=e.L_.get(r);i&&e.L_.set(r,i.we(n.resumeToken,t))}})),n.us.forEach((function(t){var n=e.L_.get(t);if(n){e.L_.set(t,n.we(x.ht,n.Ee)),e.ul(t);var r=new At(n.target,t,1,n.sequenceNumber);e.ol(r)}})),this.cl.xu(n)},t.prototype._l=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:e=t.cause,n=0,r=t.targetIds,i.label=1;case 1:return n<r.length?(o=r[n],this.L_.has(o)?[4,this.cl.Tl(o,e)]:[3,3]):[3,5];case 2:i.sent(),this.L_.delete(o),this.B_.removeTarget(o),i.label=3;case 3:i.label=4;case 4:return n++,[3,1];case 5:return[2]}}
2))}))},t.prototype.nl=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n;return i.__generator(this,(function(r){switch(r.label){case 0:t=this.O_.length>0?this.O_[this.O_.length-1].batchId:-1,r.label=1;case 1:if(!this.El())return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,this.x_.Bu(t)];case 3:return null===(e=r.sent())?(0===this.O_.length&&this.J_.Kc(),[3,7]):(t=e.batchId,this.Il(e),[3,6]);case 4:return n=r.sent(),[4,this.ll(n)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return this.wl()&&this.Rl(),[2]}}))}))},t.prototype.El=function(){return this.W_()&&this.O_.length<10},t.prototype.Al=function(){return this.O_.length},t.prototype.Il=function(t){this.O_.push(t),this.J_.Qc()&&this.J_.a_&&this.J_.u_(t.mutations)},t.prototype.wl=function(){return this.W_()&&!this.J_.Uc()&&this.O_.length>0},t.prototype.Rl=function(){this.J_.start()},t.prototype.X_=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.J_.l_(),[2]}))}))},t.prototype.tl=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n;return i.__generator(this,(function(r){for(t=0,e=this.O_;t<e.length;t++)n=e[t],this.J_.u_(n.mutations);return[2]}))}))},t.prototype.c_=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this.O_.shift(),r=xe.from(n,t,e),[4,this.fl((function(){return o.cl.ml(r)}))];case 1:return i.sent(),[4,this.nl()];case 2:return i.sent(),[2]}}))}))},t.prototype.Z_=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return t&&this.J_.a_?[4,this.Pl(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.wl()&&this.Rl(),[2]}}))}))},t.prototype.Pl=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return Rt(n=t.code)&&n!==f.ABORTED?(e=this.O_.shift(),this.J_.jc(),[4,this.fl((function(){return r.cl.Vl(e.batchId,t)}))]):[3,3];case 1:return i.sent(),[4,this.nl()];case 2:i.sent(),i.label=3;case 3:return[2]}}
2))}))},t.prototype.gl=function(){return new ri(this.w_)},t.prototype.j_=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.networkEnabled=!1,[4,this.rl()];case 1:return t.sent(),this.K_.set("Unknown"),[4,this.enableNetwork()];case 2:return t.sent(),[2]}}))}))},t.prototype.pl=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.W_()?(ve("RemoteStore","RemoteStore restarting streams for new credential"),[4,this.j_()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.yl=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.isPrimary=t,t&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return e.sent(),[3,5];case 2:return t?[3,4]:[4,this.rl()];case 3:e.sent(),this.K_.set("Unknown"),e.label=4;case 4:e.label=5;case 5:return[2]}}))}))},t}();function ai(t,e){return"firestore_clients_"+t+"_"+e}function si(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.t()&&(r+="_"+e.uid),r}function ui(t,e){return"firestore_targets_"+t+"_"+e}var ci=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.bl=function(e,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),a=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(a=new p(i.error.code,i.error.message)),o?new t(e,n,i.state,a):(ye("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.vl=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}(),li=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.bl=function(e,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new p(r.error.code,r.error.message)),i?new t(e,r.state,o):(ye("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.vl=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}(),hi=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.bl=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Yt(),a=0;i&&a<r.activeTargetIds.length;++a)i=O(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(ye("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),fi=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.bl=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):(ye("SharedClientState","Failed to parse online state: "+e),null)},t}(),pi=function(){function t(){this.activeTargetIds=Yt()}return t.prototype.Sl=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Dl=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.vl=function(){var t={activeTargetIds:this.activeTargetIds.W(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),di=function(){function t(e,n,r,i,o){if(this.Tr=e,this.platform=n,this.persistenceKey=r,this.Cl=i,this.cl=null,this.b_=null,this.ur=null,this.Fl=this.Nl.bind(this),this.kl=new Lt(Ee),this.ho=!1,this.Ml=[],!t.zh(this.platform))throw new p(f.UNIMPLEMENTED,"LocalStorage is not available on this platform.");var a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage,this.currentUser=o,this.xl=ai(this.persistenceKey,this.Cl),this.$l=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.kl=this.kl.Ae(this.Cl,new pi),this.Ol=new RegExp("^firestore_clients_"+a+"_([^_]*)$"),this.Ll=new RegExp("^firestore_mutations_"+a+"_(\\d+)(?:_(.*))?$"),this.Bl=new RegExp("^firestore_targets_"+a+"_(\\d+)$"),this.ql=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.platform.window.addEventListener("storage",this.Fl)}
2return t.zh=function(t){return!(!t.window||null==t.window.localStorage)},t.prototype.start=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n,r,o,a,s,u,c,l,h,f=this;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.cl.So()];case 1:for(t=i.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.Cl&&(o=this.getItem(ai(this.persistenceKey,r)))&&(a=hi.bl(r,o))&&(this.kl=this.kl.Ae(a.clientId,a));for(this.Ul(),(s=this.storage.getItem(this.ql))&&(u=this.Ql(s))&&this.Wl(u),c=0,l=this.Ml;c<l.length;c++)h=l[c],this.Nl(h);return this.Ml=[],this.platform.window.addEventListener("unload",(function(){return f.Vo()})),this.ho=!0,[2]}}))}))},t.prototype.lr=function(t){this.setItem(this.$l,JSON.stringify(t))},t.prototype.jl=function(){return this.Kl(this.kl)},t.prototype.Gl=function(t){var e=!1;return this.kl.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.zl=function(t){this.Hl(t,"pending")},t.prototype.Yl=function(t,e,n){this.Hl(t,e,n),this.Jl(t)},t.prototype.Xl=function(t){var e="not-current";if(this.Gl(t)){var n=this.storage.getItem(ui(this.persistenceKey,t));if(n){var r=li.bl(t,n);r&&(e=r.state)}}return this.Zl.Sl(t),this.Ul(),e},t.prototype.td=function(t){this.Zl.Dl(t),this.Ul()},t.prototype.ed=function(t){return this.Zl.activeTargetIds.has(t)},t.prototype.sd=function(t){this.removeItem(ui(this.persistenceKey,t))},t.prototype.nd=function(t,e,n){this.rd(t,e,n)},t.prototype.vu=function(t,e,n){var r=this;e.forEach((function(t){r.Jl(t)})),this.currentUser=t,n.forEach((function(t){r.zl(t)}))},t.prototype.hd=function(t){this.od(t)},t.prototype.Vo=function(){this.ho&&(this.platform.window.removeEventListener("storage",this.Fl),this.removeItem(this.xl),this.ho=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return ve("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){ve("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){ve("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.Nl=function(t){var e=this;if(t.storageArea===this.storage){if(ve("SharedClientState","EVENT",t.key,t.newValue),t.key===this.xl)return void ye("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Tr.lo((function(){return i.__awaiter(e,void 0,void 0,(function(){var e,n,r,o,a,s;return i.__generator(this,(function(i){if(this.ho){if(null!==t.key)if(this.Ol.test(t.key)){if(null==t.newValue)return e=this.ad(t.key),[2,this.ud(e,null)];if(n=this._d(t.key,t.newValue))return[2,this.ud(n.clientId,n)]}else if(this.Ll.test(t.key)){if(null!==t.newValue&&(r=this.ld(t.key,t.newValue)))return[2,this.dd(r)]}else if(this.Bl.test(t.key)){if(null!==t.newValue&&(o=this.fd(t.key,t.newValue)))return[2,this.Td(o)]}else if(t.key===this.ql){if(null!==t.newValue&&(a=this.Ql(t.newValue)))return[2,this.Wl(a)]}else t.key===this.$l&&(s=function(t){var e=Me.dr;if(null!=t)try{var n=JSON.parse(t);be("number"==typeof n),e=n}catch(t){ye("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(t.newValue))!==Me.dr&&this.ur(s)}else this.Ml.push(t);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Zl",{get:function(){return this.kl.get(this.Cl)},enumerable:!0,configurable:!0}),t.prototype.Ul=function(){this.setItem(this.xl,this.Zl.vl())},t.prototype.Hl=function(t,e,n){var r=new ci(this.currentUser,t,e,n),i=si(this.persistenceKey,this.currentUser,t);this.setItem(i,r.vl())},t.prototype.Jl=function(t){var e=si(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.od=function(t){var e={clientId:this.Cl,onlineState:t};this.storage.setItem(this.ql,JSON.stringify(e))},t.prototype.rd=function(t,e,n){var r=ui(this.persistenceKey,t),i=new li(t,e,n);this.setItem(r,i.vl())},t.prototype.ad=function(t){var e=this.Ol.exec(t);return e?e[1]:null},t.prototype._d=function(t,e){var n=this.ad(t);return hi.bl(n,e)},t.prototype.ld=function(t,e){var n=this.Ll.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return ci.bl(new h(i),r,e)},t.prototype.fd=function(t,e){var n=this.Bl.exec(t),r=Number(n[1]);return li.bl(r,e)},t.prototype.Ql=function(t){return fi.bl(t)},t.prototype.dd=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this.cl.Ed(t.batchId,t.state,t.error)]:(ve("SharedCl
2ientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.Td=function(t){return this.cl.Id(t.targetId,t.state,t.error)},t.prototype.ud=function(t,e){var n=this,r=e?this.kl.Ae(t,e):this.kl.remove(t),i=this.Kl(this.kl),o=this.Kl(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.cl.wd(a,s).then((function(){n.kl=r}))},t.prototype.Wl=function(t){this.kl.get(t.clientId)&&this.b_(t.onlineState)},t.prototype.Kl=function(t){var e=Yt();return t.forEach((function(t,n){e=e.He(n.activeTargetIds)})),e},t}(),vi=function(){function t(){this.Rd=new pi,this.Ad={},this.cl=null,this.b_=null,this.ur=null}return t.prototype.zl=function(t){},t.prototype.Yl=function(t,e,n){},t.prototype.Xl=function(t){return this.Rd.Sl(t),this.Ad[t]||"not-current"},t.prototype.nd=function(t,e,n){this.Ad[t]=e},t.prototype.td=function(t){this.Rd.Dl(t)},t.prototype.ed=function(t){return this.Rd.activeTargetIds.has(t)},t.prototype.sd=function(t){delete this.Ad[t]},t.prototype.jl=function(){return this.Rd.activeTargetIds},t.prototype.Gl=function(t){return this.Rd.activeTargetIds.has(t)},t.prototype.start=function(){return this.Rd=new pi,Promise.resolve()},t.prototype.vu=function(t,e,n){},t.prototype.hd=function(t){},t.prototype.Vo=function(){},t.prototype.lr=function(t){},t}(),yi=function(t){this.key=t},gi=function(t){this.key=t},mi=function(){function t(t,e){this.query=t,this.md=e,this.Pd=null,this.fs=!1,this.Vd=Kt(),this.ns=Kt(),this.gd=new Xt(t.se.bind(t))}return Object.defineProperty(t.prototype,"pd",{get:function(){return this.md},enumerable:!0,configurable:!0}),t.prototype.yd=function(t,e){var n=this,r=e?e.bd:new $t,i=e?e.gd:this.gd,o=e?e.ns:this.ns,a=i,s=!1,u=this.query.oe()&&i.size===this.query.limit?i.last():null,c=this.query.ae()&&i.size===this.query.limit?i.first():null;if(t.pe((function(t,e){var l=i.get(t),h=e instanceof mt?e:null;h&&(h=n.query.matches(h)?h:null);var f=!!l&&n.ns.has(l.key),p=!!h&&(h.At||n.ns.has(h.key)&&h.hasCommittedMutations),d=!1;l&&h?l.data().isEqual(h.data())?f!==p&&(r.track({type:3,doc:h}),d=!0):n.vd(l,h)||(r.track({type:2,doc:h}),d=!0,(u&&n.query.se(h,u)>0||c&&n.query.se(h,c)<0)&&(s=!0)):!l&&h?(r.track({type:0,doc:h}),d=!0):l&&!h&&(r.track({type:1,doc:l}),d=!0,(u||c)&&(s=!0)),d&&(h?(a=a.add(h),o=p?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),this.query.oe()||this.query.ae())for(;a.size>this.query.limit;){var l=this.query.oe()?a.last():a.first();a=a.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{gd:a,bd:r,Sd:s,ns:o}},t.prototype.vd=function(t,e){return t.At&&e.hasCommittedMutations&&!e.At},t.prototype.Ln=function(t,e,n){var r=this,i=this.gd;this.gd=t.gd,this.ns=t.ns;var o=t.bd.es();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 me()}};return n(t)-n(e)}(t.type,e.type)||r.query.se(t.doc,e.doc)})),this.Dd(n);var a=e?this.Cd():[],s=0===this.Vd.size&&this.fs?1:0,u=s!==this.Pd;return this.Pd=s,0!==o.length||u?{snapshot:new Jt(this.query,t.gd,i,o,t.ns,0===s,u,!1),Fd:a}:{Fd:a}},t.prototype.Nd=function(t){return this.fs&&"Offline"===t?(this.fs=!1,this.Ln({gd:this.gd,bd:new $t,ns:this.ns,Sd:!1},!1)):{Fd:[]}},t.prototype.kd=function(t){return!this.md.has(t)&&!!this.gd.has(t)&&!this.gd.get(t).At},t.prototype.Dd=function(t){var e=this;t&&(t.Ts.forEach((function(t){return e.md=e.md.add(t)})),t.Es.forEach((function(t){})),t.Is.forEach((function(t){return e.md=e.md.delete(t)})),this.fs=t.fs)},t.prototype.Cd=function(){var t=this;if(!this.fs)return[];var e=this.Vd;this.Vd=Kt(),this.gd.forEach((function(e){t.kd(e.key)&&(t.Vd=t.Vd.add(e.key))}));var n=[];return e.forEach((function(e){t.Vd.has(e)||n.push(new gi(e))})),this.Vd.forEach((function(t){e.has(t)||n.push(new yi(t))})),n},t.prototype.Md=function(t){this.md=t.ju,this.Vd=Kt();var e=this.yd(t.documents);return this.Ln(e,!0)},t.prototype.xd=function(){return Jt.os(this.query,this.gd,this.ns,0===this.Pd)},t}(),bi=function(){function t(t,e,n,r){this.Ra=t,this.w_=e,this.updateFunction=n,this.Pa=r,this.$d=5,this.Na=new je(this.Ra,"transaction_retry")}return t.prototype.Od=function(){this.Ld()},t.prototype.Ld=function(){var t=this;this.Na.gr((function(){return i.__awaiter(t,void 0,void 0,(function(){var t,e,n=this;return i.__generator(this,(function(r){return t=new ri(this.w_),(e=this.Bd(t))&&e.then((function(e){n.Ra.co((function(){return t.commit().then((function(){n.Pa.resolve(e)})).catch((function(t){n.qd(t)}))}))})).catch((function(t){n.qd(t)})),[2]}))}
2))}))},t.prototype.Bd=function(t){try{var e=this.updateFunction(t);return!P(e)&&e.catch&&e.then?e:(this.Pa.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.Pa.reject(t),null}},t.prototype.qd=function(t){var e=this;this.$d>0&&this.Ud(t)?(this.$d-=1,this.Ra.co((function(){return e.Ld(),Promise.resolve()}))):this.Pa.reject(t)},t.prototype.Ud=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!Rt(e)}return!1},t}(),_i=function(t,e,n){this.query=t,this.targetId=e,this.view=n},wi=function(t){this.key=t,this.Qd=!1},Ei=function(){function t(t,e,n,r,i,o){this.x_=t,this.Wd=e,this.w_=n,this.jd=r,this.currentUser=i,this.Kd=o,this.Gd=null,this.zd=new ke((function(t){return t.canonicalId()})),this.Hd=new Map,this.Yd=[],this.Jd=new Lt(S.N),this.Xd=new Map,this.Zd=new rr,this.tf={},this.ef=new Map,this.sf=Je.rh(),this.onlineState="Unknown"}return Object.defineProperty(t.prototype,"if",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.subscribe=function(t){this.Gd=t},t.prototype.listen=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nf("listen()"),(r=this.zd.get(t))?(e=r.targetId,this.jd.Xl(e),n=r.view.xd(),[3,4]):[3,1];case 1:return[4,this.x_.Uu(t.ee())];case 2:return o=i.sent(),a=this.jd.Xl(o.targetId),e=o.targetId,[4,this.rf(t,e,"current"===a)];case 3:n=i.sent(),this.if&&this.Wd.listen(o),i.label=4;case 4:return[2,n]}}))}))},t.prototype.rf=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,u,c;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.x_.Wu(t,!0)];case 1:return r=i.sent(),o=new mi(t,r.ju),a=o.yd(r.documents),s=te.ds(e,n&&"Offline"!==this.onlineState),u=o.Ln(a,this.if,s),this.hf(e,u.Fd),c=new _i(t,e,o),[2,(this.zd.set(t,c),this.Hd.has(e)?this.Hd.get(e).push(t):this.Hd.set(e,[t]),u.snapshot)]}}))}))},t.prototype.al=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nf("unlisten()"),e=this.zd.get(t),(n=this.Hd.get(e.targetId)).length>1?[2,(this.Hd.set(e.targetId,n.filter((function(e){return!e.isEqual(t)}))),void this.zd.delete(t))]:this.if?(this.jd.td(e.targetId),this.jd.Gl(e.targetId)?[3,2]:[4,this.x_.Qu(e.targetId,!1).then((function(){r.jd.sd(e.targetId),r.Wd.al(e.targetId),r.af(e.targetId)})).catch(nr)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return this.af(e.targetId),[4,this.x_.Qu(e.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}
2))}))},t.prototype.write=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.nf("write()"),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this.x_.Fu(t)];case 2:return n=i.sent(),this.jd.zl(n.batchId),this.uf(n.batchId,e),[4,this.cf(n.Dn)];case 3:return i.sent(),[4,this.Wd.nl()];case 4:return i.sent(),[3,6];case 5:return r=i.sent(),o=Kn(r,"Failed to persist write"),e.reject(o),[3,6];case 6:return[2]}}))}))},t.prototype.runTransaction=function(t,e,n){new bi(t,this.w_,e,n).Od()},t.prototype.xu=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:this.nf("applyRemoteEvent()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.x_.xu(t)];case 2:return e=r.sent(),t.as.forEach((function(t,e){var r=n.Xd.get(e);r&&(be(t.Ts.size+t.Es.size+t.Is.size<=1),t.Ts.size>0?r.Qd=!0:t.Es.size>0?be(r.Qd):t.Is.size>0&&(be(r.Qd),r.Qd=!1))})),[4,this.cf(e,t)];case 3:return r.sent(),[3,6];case 4:return[4,nr(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}
2))}))},t.prototype.Nd=function(t,e){this.nf("applyOnlineStateChange()");var n=[];this.zd.forEach((function(e,r){var i=r.view.Nd(t);i.snapshot&&n.push(i.snapshot)})),this.Gd._f(t),this.Gd.n_(n),this.onlineState=t},t.prototype.Tl=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,u=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nf("rejectListens()"),this.jd.nd(t,"rejected",e),n=this.Xd.get(t),(r=n&&n.key)?(o=(o=new Lt(S.N)).Ae(r,new bt(r,_.min())),a=Kt().add(r),s=new Zt(_.min(),new Map,new jt(Ee),o,a),[4,this.xu(s)]):[3,2];case 1:return i.sent(),this.Jd=this.Jd.remove(r),this.Xd.delete(t),this.lf(),[3,4];case 2:return[4,this.x_.Qu(t,!1).then((function(){return u.af(t,e)})).catch(nr)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},t.prototype.ml=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nf("applySuccessfulWrite()"),e=t.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.x_.Nu(t)];case 2:return n=r.sent(),this.df(e,null),this.ff(e),this.jd.Yl(e,"acknowledged"),[4,this.cf(n)];case 3:return r.sent(),[3,6];case 4:return[4,nr(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}
2))}))},t.prototype.Vl=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nf("rejectFailedWrite()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.x_.Mu(t)];case 2:return n=r.sent(),this.df(t,e),this.ff(t),this.jd.Yl(t,"rejected",e),[4,this.cf(n)];case 3:return r.sent(),[3,6];case 4:return[4,nr(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},t.prototype.Tf=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.Wd.W_()||ve("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,this.x_.ta()];case 2:return-1===(e=i.sent())?[2,void t.resolve()]:((n=this.ef.get(e)||[]).push(t),this.ef.set(e,n),[3,4]);case 3:return r=i.sent(),o=Kn(r,"Initialization of waitForPendingWrites() operation failed"),t.reject(o),[3,4];case 4:return[2]}}
2))}))},t.prototype.ff=function(t){(this.ef.get(t)||[]).forEach((function(t){t.resolve()})),this.ef.delete(t)},t.prototype.Ef=function(t){this.ef.forEach((function(e){e.forEach((function(e){e.reject(new p(f.CANCELLED,t))}))})),this.ef.clear()},t.prototype.uf=function(t,e){var n=this.tf[this.currentUser.s()];n||(n=new Lt(Ee)),n=n.Ae(t,e),this.tf[this.currentUser.s()]=n},t.prototype.df=function(t,e){var n=this.tf[this.currentUser.s()];if(n){var r=n.get(t);r&&(e?r.reject(e):r.resolve(),n=n.remove(t)),this.tf[this.currentUser.s()]=n}},t.prototype.af=function(t,e){var n=this;void 0===e&&(e=null),this.jd.td(t);for(var r=0,i=this.Hd.get(t);r<i.length;r++){var o=i[r];this.zd.delete(o),e&&this.Gd.If(o,e)}this.Hd.delete(t),this.if&&this.Zd.ic(t).forEach((function(t){n.Zd.Ch(t)||n.wf(t)}))},t.prototype.wf=function(t){var e=this.Jd.get(t);null!==e&&(this.Wd.al(e),this.Jd=this.Jd.remove(t),this.Xd.delete(e),this.lf())},t.prototype.hf=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n];i instanceof yi?(this.Zd.yh(i.key,t),this.Rf(i)):i instanceof gi?(ve("SyncEngine","Document no longer in limbo: "+i.key),this.Zd.vh(i.key,t),this.Zd.Ch(i.key)||this.wf(i.key)):me()}},t.prototype.Rf=function(t){var e=t.key;this.Jd.get(e)||(ve("SyncEngine","New document in limbo: "+e),this.Yd.push(e),this.lf())},t.prototype.lf=function(){for(;this.Yd.length>0&&this.Jd.size<this.Kd;){var t=this.Yd.shift(),e=this.sf.next();this.Xd.set(e,new wi(t)),this.Jd=this.Jd.Ae(t,e),this.Wd.listen(new At(Et.Wt(t.path).ee(),e,2,Me.dr))}},t.prototype.Af=function(){return this.Jd},t.prototype.mf=function(){return this.Yd},t.prototype.cf=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a=this;return i.__generator(this,(function(i){switch(i.label){case 0:return n=[],r=[],o=[],this.zd.forEach((function(i,s){o.push(Promise.resolve().then((function(){var e=s.view.yd(t);return e.Sd?a.x_.Wu(s.query,!1).then((function(t){var n=t.documents;return s.view.yd(n,e)})):e})).then((function(t){var i=e&&e.as.get(s.targetId),o=s.view.Ln(t,a.if,i);if(a.hf(s.targetId,o.Fd),o.snapshot){a.if&&a.jd.nd(s.targetId,o.snapshot.fromCache?"not-current":"current"),n.push(o.snapshot);var u=Le.ar(s.targetId,o.snapshot);r.push(u)}})))})),[4,Promise.all(o)];case 1:return i.sent(),this.Gd.n_(n),[4,this.x_.Lu(r)];case 2:return i.sent(),[2]}}))}))},t.prototype.nf=function(t){},t.prototype.pl=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e;return i.__generator(this,(function(n){switch(n.label){case 0:return this.currentUser.isEqual(t)?[3,3]:[4,this.x_.vu(t)];case 1:return e=n.sent(),this.currentUser=t,this.Ef("'waitForPendingWrites' promise is rejected due to a user change."),this.jd.vu(t,e.Du,e.Cu),[4,this.cf(e.Su)];case 2:n.sent(),n.label=3;case 3:return[4,this.Wd.pl()];case 4:return n.sent(),[2]}}))}))},t.prototype.enableNetwork=function(){return this.Wd.enableNetwork()},t.prototype.disableNetwork=function(){return this.Wd.disableNetwork()},t.prototype.ei=function(t){var e=this.Xd.get(t);if(e&&e.Qd)return Kt().add(e.key);var n=Kt(),r=this.Hd.get(t);if(!r)return n;for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.zd.get(a);n=n.He(s.view.pd)}return n},t}(),Ti=function(t){function e(e,n,r,i,o,a){var s=this;return(s=t.call(this,e,n,r,i,o,a)||this).x_=e,s.Pf=void 0,s}return i.__extends(e,t),Object.defineProperty(e.prototype,"if",{get:function(){return!0===this.Pf},enumerable:!0,configurable:!0}),e.prototype.enableNetwork=function(){return this.x_.uo(!0),t.prototype.enableNetwork.call(this)},e.prototype.disableNetwork=function(){return this.x_.uo(!1),t.prototype.disableNetwork.call(this)},e.prototype.Vf=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,this.x_.Wu(t.query,!0)];case 1:return e=r.sent(),n=t.view.Md(e),[2,(this.Pf&&this.hf(t.targetId,n.Fd),n)]}}))}))},e.prototype.Nd=function(e,n){this.if&&0===n&&(t.prototype.Nd.call(this,e,n),this.jd.hd(e)),this.if||1!==n||t.prototype.Nd.call(this,e,n)},e.prototype.Ed=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nf("applyBatchState()"),[4,this.x_.Gu(t)];case 1:return null===(r=i.sent())?[3,6]:"pending"!==e?[3,3]:[4,this.Wd.nl()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===e||"rejected"===e?(this.df(t,n||null),this.x_.zu(t)):me(),i.label=4;case 4:return[4,this.cf(r)];case 5:return i.sent(),[3,7];case 6:ve("SyncEngine","Cannot apply mutation batch with id: "+t),i.label=7;case 7:return[2]}}
2))}))},e.prototype.yl=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a,s,u,c=this;return i.__generator(this,(function(i){switch(i.label){case 0:return!0!==t||!0===this.Pf?[3,3]:(e=this.jd.jl(),[4,this.gf(e.W(),!0)]);case 1:return n=i.sent(),this.Pf=!0,[4,this.Wd.yl(!0)];case 2:for(i.sent(),r=0,o=n;r<o.length;r++)a=o[r],this.Wd.listen(a);return[3,7];case 3:return!1!==t||!1===this.Pf?[3,7]:(s=[],u=Promise.resolve(),this.Hd.forEach((function(t,e){c.jd.ed(e)?s.push(e):u=u.then((function(){return c.af(e),c.x_.Qu(e,!0)})),c.Wd.al(e)})),[4,u]);case 4:return i.sent(),[4,this.gf(s,!1)];case 5:return i.sent(),this.pf(),this.Pf=!1,[4,this.Wd.yl(!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))},e.prototype.pf=function(){var t=this;this.Xd.forEach((function(e,n){t.Wd.al(n)})),this.Zd.nc(),this.Xd=new Map,this.Jd=new Lt(S.N)},e.prototype.gf=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a,s,u,c,l,h,f,p,d;return i.__generator(this,(function(i){switch(i.label){case 0:e=[],n=[],r=0,o=t,i.label=1;case 1:return r<o.length?(a=o[r],s=void 0,(u=this.Hd.get(a))&&0!==u.length?[4,this.x_.Uu(u[0].ee())]:[3,7]):[3,13];case 2:s=i.sent(),c=0,l=u,i.label=3;case 3:return c<l.length?(h=l[c],f=this.zd.get(h),[4,this.Vf(f)]):[3,6];case 4:(p=i.sent()).snapshot&&n.push(p.snapshot),i.label=5;case 5:return c++,[3,3];case 6:return[3,11];case 7:return[4,this.x_.Hu(a)];case 8:return d=i.sent(),[4,this.x_.Uu(d)];case 9:return s=i.sent(),[4,this.rf(this.yf(d),a,!1)];case 10:i.sent(),i.label=11;case 11:e.push(s),i.label=12;case 12:return r++,[3,1];case 13:return[2,(this.Gd.n_(n),e)]}}))}))},e.prototype.yf=function(t){return new Et(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)},e.prototype.So=function(){return this.x_.So()},e.prototype.Id=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o;return i.__generator(this,(function(i){switch(i.label){case 0:return this.Pf?(ve("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!this.Hd.has(t))return[3,8];switch(e){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,this.x_.Kr()];case 3:return r=i.sent(),o=Zt.ls(t,"current"===e),[4,this.cf(r,o)];case 4:return i.sent(),[3,8];case 5:return[4,this.x_.Qu(t,!0)];case 6:return i.sent(),this.af(t,n),[3,8];case 7:me(),i.label=8;case 8:return[2]}}
2))}))},e.prototype.wd=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,l,h,f,p=this;return i.__generator(this,(function(d){switch(d.label){case 0:if(!this.Pf)return[3,10];n=0,r=t,d.label=1;case 1:return n<r.length?(o=r[n],this.Hd.has(o)?(ve("SyncEngine","Adding an already active target "+o),[3,5]):[4,this.x_.Hu(o)]):[3,6];case 2:return a=d.sent(),[4,this.x_.Uu(a)];case 3:return s=d.sent(),[4,this.rf(this.yf(a),s.targetId,!1)];case 4:d.sent(),this.Wd.listen(s),d.label=5;case 5:return n++,[3,1];case 6:u=function(t){return i.__generator(this,(function(e){switch(e.label){case 0:return c.Hd.has(t)?[4,c.x_.Qu(t,!1).then((function(){p.Wd.al(t),p.af(t)})).catch(nr)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},c=this,l=0,h=e,d.label=7;case 7:return l<h.length?(f=h[l],[5,u(f)]):[3,10];case 8:d.sent(),d.label=9;case 9:return l++,[3,7];case 10:return[2]}}))}))},e}(Ei),Ii=function(){this.bf=void 0,this.vf=[]},Si=function(){function t(t){this.cl=t,this.Sf=new ke((function(t){return t.canonicalId()})),this.onlineState="Unknown",this.Df=new Set,this.cl.subscribe(this)}return t.prototype.listen=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:if(e=t.query,n=!1,(r=this.Sf.get(e))||(n=!0,r=new Ii),!n)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),o=r,[4,this.cl.listen(e)];case 2:return o.bf=i.sent(),[3,4];case 3:return a=i.sent(),s=Kn(a,"Initialization of query '"+t.query+"' failed"),[2,void t.onError(s)];case 4:return this.Sf.set(e,r),r.vf.push(t),t.Nd(this.onlineState),r.bf&&t.Cf(r.bf)&&this.Ff(),[2]}}))}))},t.prototype.al=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o;return i.__generator(this,(function(i){return e=t.query,n=!1,(r=this.Sf.get(e))&&(o=r.vf.indexOf(t))>=0&&(r.vf.splice(o,1),n=0===r.vf.length),n?[2,(this.Sf.delete(e),this.cl.al(e))]:[2]}))}))},t.prototype.n_=function(t){for(var e=!1,n=0,r=t;n<r.length;n++){var i=r[n],o=i.query,a=this.Sf.get(o);if(a){for(var s=0,u=a.vf;s<u.length;s++)u[s].Cf(i)&&(e=!0);a.bf=i}}e&&this.Ff()},t.prototype.If=function(t,e){var n=this.Sf.get(t);if(n)for(var r=0,i=n.vf;r<i.length;r++)i[r].onError(e);this.Sf.delete(t)},t.prototype._f=function(t){this.onlineState=t;var e=!1;this.Sf.forEach((function(n,r){for(var i=0,o=r.vf;i<o.length;i++)o[i].Nd(t)&&(e=!0)})),e&&this.Ff()},t.prototype.Nf=function(t){this.Df.add(t),t.next()},t.prototype.kf=function(t){this.Df.delete(t)},t.prototype.Ff=function(){this.Df.forEach((function(t){t.next()}))},t}(),Ci=function(){function t(t,e,n){this.query=t,this.Mf=e,this.xf=!1,this.$f=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Cf=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 Jt(t.query,t.docs,t.ss,e,t.ns,t.fromCache,t.rs,!0)}var o=!1;return this.xf?this.Of(t)&&(this.Mf.next(t),o=!0):this.Lf(t,this.onlineState)&&(this.Bf(t),o=!0),this.$f=t,o},t.prototype.onError=function(t){this.Mf.error(t)},t.prototype.Nd=function(t){this.onlineState=t;var e=!1;return this.$f&&!this.xf&&this.Lf(this.$f,t)&&(this.Bf(this.$f),e=!0),e},t.prototype.Lf=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.qf&&n||t.docs.B()&&"Offline"!==e)},t.prototype.Of=function(t){if(t.docChanges.length>0)return!0;var e=this.$f&&this.$f.hasPendingWrites!==t.hasPendingWrites;return!(!t.rs&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.Bf=function(t){t=Jt.os(t.query,t.docs,t.ns,t.fromCache),this.xf=!0,this.Mf.next(t)},t}(),ki=function(){function t(){}return t.prototype.bu=function(t){this.Uf=t},t.prototype.Zn=function(t,e,n,r){var i=this;return e.te()||n.isEqual(_.min())?this.Qf(t,e):this.Uf.Yn(t,r).next((function(o){var s=i.Wf(e,o);return(e.oe()||e.ae())&&i.Sd(e.Bt,s,r,n)?i.Qf(t,e):(de()<=a.LogLevel.DEBUG&&ve("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),e.toString()),i.Uf.Zn(t,e,n).next((function(t){return s.forEach((function(e){t=t.Ae(e.key,e)})),t})))}))},t.prototype.Wf=function(t,e){var n=new jt((function(e,n){return t.se(e,n)}));return e.forEach((function(e,r){r instanceof mt&&t.matches(r)&&(n=n.add(r))})),n},t.prototype.Sd=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.S(r)>0)},t.prototype.Qf=function(t,e){return de()<=a.LogLevel.DEBUG&&ve("IndexFreeQueryEngine","Using full collection scan to execute query:",e.toString()),this.Uf.Zn(t,e,_.min())},t}(),Ni=function(){function t(t,e){this.jn=t,this.hh=e,this.Wn=[],this.jf=1,this.Kf=new jt(ir.Ju)}return t.prototype.Ho=function(t){return Pe.resolve(0===this.Wn.length)},t.prototype.Yo=function(t,e,n,r){var i=this.jf;this.jf++,this.Wn.length>0&&this.Wn[this.Wn.length-1];var o=new Ne(i,e,n,r);this.Wn.push(o);for(var a=0,s=r;a<s.length;a++){var u=s[a];this.Kf=this.Kf.add(new ir(u.key,i)),this.jn.Dr(t,u.key.path.$())}return Pe.resolve(o)},t.prototype.Jo=function(t,e){return Pe.resolve(this.Gf(e))},t.prototype.Zo=function(t,e){var n=e+1,r=this.zf(n),i=r<0?0:r;return Pe.resolve(this.Wn.length>i?this.Wn[i]:null)},t.prototype.ta=function(){return Pe.resolve(0===this.Wn.length?-1:this.jf-1)},t.prototype.ea=function(t){return Pe.resolve(this.Wn.slice())},t.prototype.Gn=function(t,e){var n=this,r=new ir(e,0),i=new ir(e,Number.POSITIVE_INFINITY),o=[];return this.Kf.Ke([r,i],(function(t){var e=n.Gf(t.hc);o.push(e)})),Pe.resolve(o)},t.prototype.Xn=function(t,e){var n=this,r=new jt(Ee);return e.forEach((function(t){var e=new ir(t,0),i=new ir(t,Number.POSITIVE_INFINITY);n.Kf.Ke([e,i],(function(t){r=r.add(t.hc)}))})),Pe.resolve(this.Hf(r))},t.prototype.nr=function(t,e){var n=e.path,r=n.length+1,i=n;S.et(i)||(i=i.child(""));var o=new ir(new S(i),0),a=new jt(Ee);return this.Kf.Ge((function(t){var e=t.key.path;return!!n.q(e)&&(e.length===r&&(a=a.add(t.hc)),!0)}),o),Pe.resolve(this.Hf(a))},t.prototype.Hf=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.Gf(t);null!==r&&n.push(r)})),n},t.prototype.ia=function(t,e){var n=this;be(0===this.Yf(e.batchId,"removed")),this.Wn.shift();var r=this.Kf;return Pe.forEach(e.mutations,(function(i){var o=new ir(i.key,e.batchId);return r=r.delete(o),n.hh.Uo(t,i.key)})).next((function(){n.Kf=r}))},t.prototype.na=function(t){},t.prototype.Ch=function(t,e){var n=new ir(e,0),r=this.Kf.ze(n);return Pe.resolve(e.isEqual(r&&r.key))},t.prototype.ra=function(t){return this.Wn.length,Pe.resolve()},t.prototype.Yf=function(t,e){return this.zf(t)},t.prototype.zf=function(t){return 0===this.Wn.length?0:t-this.Wn[0].batchId},t.prototype.Gf=function(t){var e=this.zf(t);return e<0||e>=this.Wn.length?null:this.Wn[e]},t}(),xi=function(){function t(t,e){this.jn=t,this.Jf=e,this.docs=new Lt(S.N),this.size=0}return t.prototype.Nn=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,a=this.Jf(e);return this.docs=this.docs.Ae(r,{$r:e,size:a,readTime:n}),this.size+=a-o,this.jn.Dr(t,r.path.$())},t.prototype.Mn=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.xn=function(t,e){var n=this.docs.get(e);return Pe.resolve(n?n.$r:null)},t.prototype.getEntries=function(t,e){var n=this,r=Bt();return e.forEach((function(t){var e=n.docs.get(t);r=r.Ae(t,e?e.$r:null)})),Pe.resolve(r)},t.prototype.Zn=function(t,e,n){for(var r=zt(),i=new S(e.path.child("")),o=this.docs.ve(i);o.ke();){var a=o.Ne(),s=a.key,u=a.value,c=u.$r,l=u.readTime;if(!e.path.q(s.path))break;l.S(n)<=0||c instanceof mt&&e.matches(c)&&(r=r.Ae(c.key,c))}return Pe.resolve(r)},t.prototype.Xf=function(t,e){return Pe.forEach(this.docs,(function(t){return e(t)}))},t.prototype.Yr=function(e){return new t.Jr(this)},t.prototype.Zr=function(t){return Pe.resolve(this.size)},t}();xi.Jr=function(t){function e(e){var n=this;return(n=t.call(this)||this).th=e,n}return i.__extends(e,t),e.prototype.Ln=function(t){var e=this,n=[];return this.Dn.forEach((function(r,i){i?n.push(e.th.Nn(t,i,e.readTime)):e.th.Mn(r)})),Pe.vn(n)},e.prototype.$n=function(t,e){return this.th.xn(t,e)},e.prototype.On=function(t,e){return this.th.getEntries(t,e)},e}(Ae);var Pi=function(){function t(t){this.persistence=t,this.Zf=new ke((function(t){return t.canonicalId()})),this.lastRemoteSnapshotVersion=_.min(),this.highestTargetId=0,this.tT=0,this.eT=new rr,this.targetCount=0,this.sT=Je.nh()}return t.prototype.js=function(t,e){return this.Zf.forEach((function(t,n){return e(n)})),Pe.resolve()},t.prototype._h=function(t){return Pe.resolve(this.lastRemoteSnapshotVersion)},t.prototype.lh=function(t){return Pe.resolve(this.tT)},t.prototype.oh=function(t){return this.highestTargetId=this.sT.next(),Pe.resolve(this.highestTargetId)},t.prototype.dh=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.tT&&(this.tT=e),Pe.resolve()},t.prototype.Th=function(t){this.Zf.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.sT=new Je(e),this.highestTargetId=e),t.sequenceNumber>this.tT&&(this.tT=t.sequenceNumber)},t.prototype.fh=function(t,e){return this.Th(e),this.targetCount+=1,Pe.resolve()},t.prototype.Ih=function(t,e){return this.Th(e),Pe.resolve()},t.prototype.wh=function(t,e){return this.Zf.delete(e.target),this.eT.ic(e.targetId),this.targetCount-=1,Pe.resolve()},t.prototype.Ah=function(t,e,n){var r=this,i=0,o=[];return this.Zf.forEach((function(a,s){s.sequenceNumber<=e&&null===n.get(s.targetId)&&(r.Zf.delete(a),o.push(r.Rh(t,s.targetId)),i++)})),Pe.vn(o).next((function(){return i}))},t.prototype.Vh=function(t){return Pe.resolve(this.targetCount)},t.prototype.gh=function(t,e){var n=this.Zf.get(e)||null;return Pe.resolve(n)},t.prototype.ph=function(t,e,n){return this.eT.tc(e,n),Pe.resolve()},t.prototype.bh=function(t,e,n){this.eT.sc(e,n);var r=this.persistence.hh,i=[];return r&&e.forEach((function(e){i.push(r.Uo(t,e))})),Pe.vn(i)},t.prototype.Rh=function(t,e){return this.eT.ic(e),Pe.resolve()},t.prototype.Sh=function(t,e){var n=this.eT.rc(e);return Pe.resolve(n)},t.prototype.Ch=function(t,e){return Pe.resolve(this.eT.Ch(e))},t}(),Ai=function(){function t(t){var e=this;this.iT={},this.qh=new Me(0),this.Uh=!1,this.Uh=!0,this.hh=t(this),this.Jh=new Pi(this),this.jn=new We,this.Qn=new xi(this.jn,(function(t){return e.hh.nT(t)}))}return t.prototype.start=function(){return Promise.resolve()},t.prototype.Vo=function(){return this.Uh=!1,Promise.resolve()},Object.defineProperty(t.prototype,"ho",{get:function(){return this.Uh},enumerable:!0,configurable:!0}),t.prototype.oo=function(){},t.prototype.ko=function(){return this.jn},t.prototype.Do=function(t){var e=this.iT[t.s()];return e||(e=new Ni(this.jn,this.hh),this.iT[t.s()]=e),e},t.prototype.Fo=function(){return this.Jh},t.prototype.No=function(){return this.Qn},t.prototype.runTransaction=function(t,e,n){var r=this;ve("MemoryPersistence","Starting transaction:",t);var i=new Oi(this.qh.next());return this.hh.rT(),n(i).next((function(t){return r.hh.hT(i).next((function(){return t}))})).yn().then((function(t){return i.Un(),t}))},t.prototype.oT=function(t,e){return Pe.Sn(Object.values(this.iT).map((function(n){return function(){return n.Ch(t,e)}})))},t}(),Oi=function(t){function e(e){var n=this;return(n=t.call(this)||this).Oh=e,n}return i.__extends(e,t),e}(Re),Ri=function(){function t(t){this.persistence=t,this.aT=new rr,this.uT=null}return t.cT=function(e){return new t(e)},Object.defineProperty(t.prototype,"_T",{get:function(){if(this.uT)return this.uT;throw me()},enumerable:!0,configurable:!0}),t.prototype.yh=function(t,e,n){return this.aT.yh(n,e),this._T.delete(n),Pe.resolve()},t.prototype.vh=function(t,e,n){return this.aT.vh(n,e),this._T.add(n),Pe.resolve()},t.prototype.Uo=function(t,e){return this._T.add(e),Pe.resolve()},t.prototype.removeTarget=function(t,e){var n=this;
2this.aT.ic(e.targetId).forEach((function(t){return n._T.add(t)}));var r=this.persistence.Fo();return r.Sh(t,e.targetId).next((function(t){t.forEach((function(t){return n._T.add(t)}))})).next((function(){return r.wh(t,e)}))},t.prototype.rT=function(){this.uT=new Set},t.prototype.hT=function(t){var e=this,n=this.persistence.No().Yr();return Pe.forEach(this._T,(function(r){return e.lT(t,r).next((function(t){t||n.Mn(r)}))})).next((function(){return e.uT=null,n.apply(t)}))},t.prototype.Ko=function(t,e){var n=this;return this.lT(t,e).next((function(t){t?n._T.delete(e):n._T.add(e)}))},t.prototype.nT=function(t){return 0},t.prototype.lT=function(t,e){var n=this;return Pe.Sn([function(){return Pe.resolve(n.aT.Ch(e))},function(){return n.persistence.Fo().Ch(t,e)},function(){return n.persistence.oT(t,e)}])},t}(),Di="You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.",Li=function(){function t(){}return t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(n){switch(n.label){case 0:return this.jd=this.dT(t),this.persistence=this.fT(t),[4,this.persistence.start()];case 1:return n.sent(),this.TT=this.ET(t),this.x_=this.IT(t),this.Wd=this.wT(t),this.cl=this.RT(t),this.AT=this.mT(t),this.jd.b_=function(t){return e.cl.Nd(t,1)},this.Wd.cl=this.cl,[4,this.x_.start()];case 2:return n.sent(),[4,this.jd.start()];case 3:return n.sent(),[4,this.Wd.start()];case 4:return n.sent(),[4,this.Wd.yl(this.cl.if)];case 5:return n.sent(),[2]}}))}))},t.prototype.mT=function(t){return new Si(this.cl)},t.prototype.ET=function(t){return null},t.prototype.IT=function(t){return new tr(this.persistence,new ki,t.PT)},t.prototype.fT=function(t){if(t.gT.VT)throw new p(f.FAILED_PRECONDITION,Di);return new Ai(Ri.cT)},t.prototype.wT=function(t){var e=this;return new oi(this.x_,t.w_,t.Ra,(function(t){return e.cl.Nd(t,0)}),t.platform.pT())},t.prototype.dT=function(t){return new vi},t.prototype.RT=function(t){return new Ei(this.x_,this.Wd,t.w_,this.jd,t.PT,t.Kd)},t.prototype.clearPersistence=function(t){throw new p(f.FAILED_PRECONDITION,Di)},t}(),Mi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return r.sent(),[4,this.persistence.ro((function(t){return i.__awaiter(n,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return[4,this.cl.yl(t)];case 1:return e.sent(),this.TT&&(t&&!this.TT.ho?this.TT.start(this.x_):t||this.TT.stop()),[2]}}))}))}))];case 2:return r.sent(),[2]}}))}))},e.prototype.IT=function(t){return new er(this.persistence,new ki,t.PT)},e.prototype.RT=function(t){var e=new Ti(this.x_,this.Wd,t.w_,this.jd,t.PT,t.Kd);return this.jd instanceof di&&(this.jd.cl=e),e},e.prototype.ET=function(t){var e=this.persistence.hh.$o;return new Jn(e,t.Ra)},e.prototype.fT=function(t){var e=sn.xo(t.yT),n=t.platform.Cc(t.yT.ii);return new sn(t.gT.synchronizeTabs,e,t.clientId,t.platform,$n.nu(t.gT.cacheSizeBytes),t.Ra,n,this.jd,t.gT.Bh)},e.prototype.dT=function(t){if(t.gT.VT&&t.gT.synchronizeTabs){if(!di.zh(t.platform))throw new p(f.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var e=sn.xo(t.yT);return new di(t.Ra,t.platform,e,t.clientId,t.PT)}return new vi},e.prototype.clearPersistence=function(t){var e=sn.xo(t);return sn.clearPersistence(e)},e}(Li),Fi=function(){function t(t,e,n,r){this.platform=t,this.yT=e,this.credentials=n,this.Ra=r,this.clientId=we.cn()}return t.prototype.start=function(t,e){var n=this;this.T_();var r=new Fe,i=new Fe,o=!1;return this.credentials.l((function(a){if(!o)return o=!0,ve("FirestoreClient","Initializing. user=",a.uid),n.bT(t,e,a,i).then(r.resolve,r.reject);n.Ra.lo((function(){return n.pl(a)}))})),this.Ra.co((function(){return r.promise})),i.promise},t.prototype.enableNetwork=function(){var t=this;return this.T_(),this.Ra.enqueue((function(){return t.cl.enableNetwork()}))},t.prototype.bT=function(t,e,n,r){return i.__awaiter(this,void 0,void 0,(function(){var o,a,s,u,c=this;return i.__generator(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),[4,this.platform.vT(this.yT)];case 1:return o=l.sent(),a=this.platform.Cc(this.yT.ii),s=function(t,e,n){return new ni(t,e,n)}(o,this.credentials,a),[4,t.initialize({Ra:this.Ra,yT:this.yT,platform:this.platform,w_:s,clientId:this.clientId,PT:n,Kd:100,gT:e})];case 2:return l.sent(),this.persistence=t.persistence,this.jd=t.jd,this.x_=t.x_,this.Wd=t.Wd,this.cl=t.cl,this.TT=t.TT,this.ST=t.AT,this.persistence.oo((function(){return i.__awaiter(c,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,this.terminate()];case 1:return t.sent(),[2]}}))}))})),r.resolve(),[3,4];case 3:if(u=l.sent(),r.reject(u),!this.DT(u))throw u;return[2,(console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+u),this.bT(new Li,{VT:!1},n,r))];case 4:return[2]}}
2))}))},t.prototype.DT=function(t){return"FirebaseError"===t.name?t.code===f.FAILED_PRECONDITION||t.code===f.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code},t.prototype.T_=function(){if(this.Ra.Ma)throw new p(f.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.pl=function(t){return this.Ra.Ua(),ve("FirestoreClient","Credential Changed. Current user: "+t.uid),this.cl.pl(t)},t.prototype.disableNetwork=function(){var t=this;return this.T_(),this.Ra.enqueue((function(){return t.cl.disableNetwork()}))},t.prototype.terminate=function(){var t=this;return this.Ra.Ba((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.TT&&this.TT.stop(),[4,this.Wd.Vo()];case 1:return t.sent(),[4,this.jd.Vo()];case 2:return t.sent(),[4,this.persistence.Vo()];case 3:return t.sent(),this.credentials.T(),[2]}}))}))}))},t.prototype.waitForPendingWrites=function(){var t=this;this.T_();var e=new Fe;
2return this.Ra.co((function(){return t.cl.Tf(e)})),e.promise},t.prototype.listen=function(t,e,n){var r=this;this.T_();var i=new Ci(t,e,n);return this.Ra.co((function(){return r.ST.listen(i)})),i},t.prototype.al=function(t){var e=this;this.CT||this.Ra.co((function(){return e.ST.al(t)}))},t.prototype.FT=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return this.T_(),e=new Fe,[4,this.Ra.enqueue((function(){return i.__awaiter(n,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.x_.qu(t)];case 1:return(n=i.sent())instanceof mt?e.resolve(n):n instanceof bt?e.resolve(null):e.reject(new p(f.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return r=i.sent(),o=Kn(r,"Failed to get document '"+t+" from cache"),e.reject(o),[3,3];case 3:return[2]}}
2))}))}))];case 1:return[2,(r.sent(),e.promise)]}}))}))},t.prototype.NT=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return this.T_(),e=new Fe,[4,this.Ra.enqueue((function(){return i.__awaiter(n,void 0,void 0,(function(){var n,r,o,a,s,u;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.x_.Wu(t,!0)];case 1:return n=i.sent(),r=new mi(t,n.ju),o=r.yd(n.documents),a=r.Ln(o,!1),e.resolve(a.snapshot),[3,3];case 2:return s=i.sent(),u=Kn(s,"Failed to execute query '"+t+" against cache"),e.reject(u),[3,3];case 3:return[2]}}))}))}))];case 1:return[2,(r.sent(),e.promise)]}}))}))},t.prototype.write=function(t){var e=this;this.T_();var n=new Fe;return this.Ra.co((function(){return e.cl.write(t,n)})),n.promise},t.prototype.ii=function(){return this.yT.ii},t.prototype.Nf=function(t){var e=this;this.T_(),this.Ra.co((function(){return e.ST.Nf(t),Promise.resolve()}))},t.prototype.kf=function(t){var e=this;this.CT||this.Ra.co((function(){return e.ST.kf(t),Promise.resolve()}))},Object.defineProperty(t.prototype,"CT",{get:function(){return this.Ra.Ma},enumerable:!0,configurable:!0}),t.prototype.transaction=function(t){var e=this;this.T_();var n=new Fe;
2return this.Ra.co((function(){return e.cl.runTransaction(e.Ra,t,n),Promise.resolve()})),n.promise},t}(),ji=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.kT(this.observer.next,t)},t.prototype.error=function(t){this.kT(this.observer.error,t)},t.prototype.MT=function(){this.muted=!0},t.prototype.kT=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}();function Ui(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)}var Vi=function(){function t(t,e,n,r){this.ii=t,this.timestampsInSnapshots=e,this.xT=n,this.$T=r}return t.prototype.OT=function(t){switch(M(t)){case 0:return null;case 1:return t.booleanValue;case 2:return W(t.integerValue||t.doubleValue);case 3:return this.LT(t.timestampValue);case 4:return this.BT(t);case 5:return t.stringValue;case 6:return new Cr(z(t.bytesValue));case 7:return this.qT(t.referenceValue);case 8:return this.UT(t.geoPointValue);case 9:return this.QT(t.arrayValue);case 10:return this.WT(t.mapValue);default:throw me()}},t.prototype.WT=function(t){var e=this,n={};return k(t.fields||{},(function(t,r){n[t]=e.OT(r)})),n},t.prototype.UT=function(t){return new jr(W(t.latitude),W(t.longitude))},t.prototype.QT=function(t){var e=this;return(t.values||[]).map((function(t){return e.OT(t)}))},t.prototype.BT=function(t){switch(this.xT){case"previous":var e=function t(e){var n=e.mapValue.fields.__previous_value__;return R(n)?t(n):n}(t);return null==e?null:this.OT(e);case"estimate":return this.LT(D(t));default:return null}},t.prototype.LT=function(t){var e=B(t),n=new b(e.seconds,e.nanos);return this.timestampsInSnapshots?n:n.toDate()},t.prototype.qT=function(t){var e=E.K(t);be(he(e));var n=new Ce(e.get(1),e.get(3)),r=new S(e.M(5));return n.isEqual(this.ii)||ye("Document "+r+" contains a document reference within a different database ("+n.projectId+"/"+n.database+") which is not supported. It will be treated as a reference in the current database ("+this.ii.projectId+"/"+this.ii.database+") instead."),this.$T(r)},t}(),qi=$n.ou,Bi=function(){function t(t){var e,n,r,i;if(void 0===t.host){if(void 0!==t.ssl)throw new p(f.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else hr("settings","non-empty string","host",t.host),this.host=t.host,fr("settings","boolean","ssl",t.ssl),this.ssl=null===(e=t.ssl)||void 0===e||e;if(br("settings",t,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling","ignoreUndefinedProperties"]),fr("settings","object","credentials",t.credentials),this.credentials=t.credentials,fr("settings","boolean","timestampsInSnapshots",t.timestampsInSnapshots),fr("settings","boolean","ignoreUndefinedProperties",t.ignoreUndefinedProperties),!0===t.timestampsInSnapshots?ye("The setting 'timestampsInSnapshots: true' is no longer required and should be removed."):!1===t.timestampsInSnapshots&&ye("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),this.timestampsInSnapshots=null===(n=t.timestampsInSnapshots)||void 0===n||n,this.ignoreUndefinedProperties=null!==(r=t.ignoreUndefinedProperties)&&void 0!==r&&r,fr("settings","number","cacheSizeBytes",t.cacheSizeBytes),void 0===t.cacheSizeBytes)this.cacheSizeBytes=$n.uu;else{if(t.cacheSizeBytes!==qi&&t.cacheSizeBytes<$n.au)throw new p(f.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+$n.au);this.cacheSizeBytes=t.cacheSizeBytes}fr("settings","boolean","experimentalForceLongPolling",t.experimentalForceLongPolling),this.forceLongPolling=null!==(i=t.experimentalForceLongPolling)&&void 0!==i&&i}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.timestampsInSnapshots===t.timestampsInSnapshots&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.forceLongPolling===t.forceLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),Wi=function(){function t(e,n,r){var o=this;if(void 0===r&&(r=new Li),this.jT=null,this.KT=new Gn,this.INTERNAL={delete:function(){return i.__awaiter(o,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.GT(),[4,this.zT.terminate()];case 1:return t.sent(),[2]}}))}))}}
2,"object"==typeof e.options){var a=e;this.jT=a,this.mc=t.HT(a),this.YT=a.name,this.JT=new y(n)}else{var s=e;if(!s.projectId)throw new p(f.INVALID_ARGUMENT,"Must provide projectId");this.mc=new Ce(s.projectId,s.database),this.YT="[DEFAULT]",this.JT=new v}this.XT=r,this.ZT=new Bi({})}return Object.defineProperty(t.prototype,"tE",{get:function(){return this.eE||(this.eE=new Hr(this.mc,this.ZT.ignoreUndefinedProperties)),this.eE},enumerable:!0,configurable:!0}),t.prototype.settings=function(t){ar("Firestore.settings",arguments,1),cr("Firestore.settings","object",1,t);var e=new Bi(t);if(this.zT&&!this.ZT.isEqual(e))throw new p(f.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this.ZT=e,void 0!==e.credentials&&(this.JT=function(t){if(!t)return new v;switch(t.type){case"gapi":var e=t.sE;return be(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new m(e,t.V||"0");case"provider":return t.sE;default:throw new p(f.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype.enableNetwork=function(){return this.GT(),this.zT.enableNetwork()},t.prototype.disableNetwork=function(){return this.GT(),this.zT.disableNetwork()},t.prototype.enablePersistence=function(t){var e,n;if(this.zT)throw new p(f.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");var r=!1,i=!1;if(t&&(void 0!==t.experimentalTabSynchronization&&ye("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),r=null!==(n=null!==(e=t.synchronizeTabs)&&void 0!==e?e:t.experimentalTabSynchronization)&&void 0!==n&&n,i=!!t.experimentalForceOwningTab&&t.experimentalForceOwningTab,r&&i))throw new p(f.INVALID_ARGUMENT,"The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'.");return this.iE(this.XT,{VT:!0,cacheSizeBytes:this.ZT.cacheSizeBytes,synchronizeTabs:r,Bh:i})},t.prototype.clearPersistence=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e=this;return i.__generator(this,(function(n){if(void 0!==this.zT&&!this.zT.CT)throw new p(f.FAILED_PRECONDITION,"Persistence cannot be cleared after this Firestore instance is initialized.");return t=new Fe,[2,(this.KT.xa((function(){return i.__awaiter(e,void 0,void 0,(function(){var e,n;return i.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=this.nE(),[4,this.XT.clearPersistence(e)];case 1:return r.sent(),t.resolve(),[3,3];case 2:return n=r.sent(),t.reject(n),[3,3];case 3:return[2]}}
2))}))})),t.promise)]}))}))},t.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.INTERNAL.delete()},Object.defineProperty(t.prototype,"rE",{get:function(){return this.GT(),this.zT.CT},enumerable:!0,configurable:!0}),t.prototype.waitForPendingWrites=function(){return this.GT(),this.zT.waitForPendingWrites()},t.prototype.onSnapshotsInSync=function(t){if(this.GT(),Ui(t))return this.hE(t);cr("Firestore.onSnapshotsInSync","function",1,t);var e={next:t};return this.hE(e)},t.prototype.hE=function(t){var e=this,n=new ji({next:function(){t.next&&t.next()},error:function(t){throw me()}});return this.zT.Nf(n),function(){n.MT(),e.zT.kf(n)}},t.prototype.GT=function(){return this.zT||this.iE(new Li,{VT:!1}),this.zT},t.prototype.nE=function(){return new Se(this.mc,this.YT,this.ZT.host,this.ZT.ssl,this.ZT.forceLongPolling)},t.prototype.iE=function(t,e){var n=this.nE();return this.zT=new Fi(fe.nt(),n,this.JT,this.KT),this.zT.start(t,e)},t.HT=function(t){if(e=t.options,!Object.prototype.hasOwnProperty.call(e,"projectId"))throw new p(f.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var e,n=t.options.projectId;if(!n||"string"!=typeof n)throw new p(f.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new Ce(n)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.jT)throw new p(f.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.jT},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){return ar("Firestore.collection",arguments,1),cr("Firestore.collection","non-empty string",1,t),this.GT(),new Ji(E.K(t),this,null)},t.prototype.doc=function(t){return ar("Firestore.doc",arguments,1),cr("Firestore.doc","non-empty string",1,t),this.GT(),Gi.oE(E.K(t),this,null)},t.prototype.collectionGroup=function(t){if(ar("Firestore.collectionGroup",arguments,1),cr("Firestore.collectionGroup","non-empty string",1,t),t.indexOf("/")>=0)throw new p(f.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.GT(),new Xi(new Et(E.G,t),this,null)},t.prototype.runTransaction=function(t){var e=this;return ar("Firestore.runTransaction",arguments,1),cr("Firestore.runTransaction","function",1,t),this.GT().transaction((function(n){return t(new zi(e,n))}))},t.prototype.batch=function(){return this.GT(),new Hi(this)},Object.defineProperty(t,"logLevel",{get:function(){switch(de()){case a.LogLevel.DEBUG:return"debug";case a.LogLevel.ERROR:return"error";case a.LogLevel.SILENT:return"silent";case a.LogLevel.WARN:return"warn";case a.LogLevel.INFO:return"info";case a.LogLevel.VERBOSE:return"verbose";default:return"error"}},enumerable:!0,configurable:!0}),t.setLogLevel=function(t){var e;ar("Firestore.setLogLevel",arguments,1),dr("setLogLevel",["debug","error","silent","warn","info","verbose"],1,t),e=t,pe.setLogLevel(e)},t.prototype.aE=function(){return this.ZT.timestampsInSnapshots},t}(),zi=function(){function t(t,e){this.uE=t,this.cE=e}return t.prototype.get=function(t){var e=this;ar("Transaction.get",arguments,1);var n=no("Transaction.get",t,this.uE);return this.cE.V_([n.Pc]).then((function(t){if(!t||1!==t.length)return me();var r=t[0];if(r instanceof bt)return new Qi(e.uE,n.Pc,null,!1,!1,n.Vc);if(r instanceof mt)return new Qi(e.uE,n.Pc,r,!1,!1,n.Vc);throw me()}))},t.prototype.set=function(t,e,n){ur("Transaction.set",arguments,2,3);var r=no("Transaction.set",t,this.uE);n=Zi("Transaction.set",n);var i=io(r.Vc,e,"Transaction.set"),o=i[0],a=i[1],s=this.uE.tE.Fc(a,o,n);return this.cE.set(r.Pc,s),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return"string"==typeof e||e instanceof Nr?(sr("Transaction.update",arguments,3),r=no("Transaction.update",t,this.uE),i=this.uE.tE.Mc("Transaction.update",e,n,o)):(ar("Transaction.update",arguments,2),r=no("Transaction.update",t,this.uE),i=this.uE.tE.kc("Transaction.update",e)),this.cE.update(r.Pc,i),this},t.prototype.delete=function(t){ar("Transaction.delete",arguments,1
2);var e=no("Transaction.delete",t,this.uE);return this.cE.delete(e.Pc),this},t}(),Hi=function(){function t(t){this.uE=t,this._E=[],this.lE=!1}return t.prototype.set=function(t,e,n){ur("WriteBatch.set",arguments,2,3),this.dE();var r=no("WriteBatch.set",t,this.uE);n=Zi("WriteBatch.set",n);var i=io(r.Vc,e,"WriteBatch.set"),o=i[0],a=i[1],s=this.uE.tE.Fc(a,o,n);return this._E=this._E.concat(s.gc(r.Pc,ot.ft())),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return this.dE(),"string"==typeof e||e instanceof Nr?(sr("WriteBatch.update",arguments,3),r=no("WriteBatch.update",t,this.uE),i=this.uE.tE.Mc("WriteBatch.update",e,n,o)):(ar("WriteBatch.update",arguments,2),r=no("WriteBatch.update",t,this.uE),i=this.uE.tE.kc("WriteBatch.update",e)),this._E=this._E.concat(i.gc(r.Pc,ot.exists(!0))),this},t.prototype.delete=function(t){ar("WriteBatch.delete",arguments,1),this.dE();var e=no("WriteBatch.delete",t,this.uE);return this._E=this._E.concat(new lt(e.Pc,ot.ft())),this},t.prototype.commit=function(){return this.dE(),this.lE=!0,this._E.length>0?this.uE.GT().write(this._E):Promise.resolve()},t.prototype.dE=function(){if(this.lE)throw new p(f.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(),Gi=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n.mc,e,r)||this).Pc=e,i.firestore=n,i.Vc=r,i.zT=i.firestore.GT(),i}return i.__extends(e,t),e.oE=function(t,n,r){if(t.length%2!=0)throw new p(f.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.j()+" has "+t.length);return new e(new S(t),n,r)},Object.defineProperty(e.prototype,"id",{get:function(){return this.Pc.path.L()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Ji(this.Pc.path.$(),this.firestore,this.Vc)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.Pc.path.j()},enumerable:!0,configurable:!0}),e.prototype.collection=function(t){if(ar("DocumentReference.collection",arguments,1),cr("DocumentReference.collection","non-empty string",1,t),!t)throw new p(f.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var e=E.K(t);return new Ji(this.Pc.path.child(e),this.firestore,null)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw _r("isEqual","DocumentReference",1,t);return this.firestore===t.firestore&&this.Pc.isEqual(t.Pc)&&this.Vc===t.Vc},e.prototype.set=function(t,e){ur("DocumentReference.set",arguments,1,2),e=Zi("DocumentReference.set",e);var n=io(this.Vc,t,"DocumentReference.set"),r=n[0],i=n[1],o=this.firestore.tE.Fc(i,r,e);return this.zT.write(o.gc(this.Pc,ot.ft()))},e.prototype.update=function(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof t||t instanceof Nr?(sr("DocumentReference.update",arguments,2),n=this.firestore.tE.Mc("DocumentReference.update",t,e,r)):(ar("DocumentReference.update",arguments,1),n=this.firestore.tE.kc("DocumentReference.update",t)),this.zT.write(n.gc(this.Pc,ot.exists(!0)))},e.prototype.delete=function(){return ar("DocumentReference.delete",arguments,0),this.zT.write([new lt(this.Pc,ot.ft())])},e.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];ur("DocumentReference.onSnapshot",arguments,1,4);var n,r={includeMetadataChanges:!1},i=0;"object"!=typeof t[i]||Ui(t[i])||(br("DocumentReference.onSnapshot",r=t[i],["includeMetadataChanges"]),fr("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++);var o={includeMetadataChanges:r.includeMetadataChanges};return Ui(t[i])?n=t[i]:(cr("DocumentReference.onSnapshot","function",i,t[i]),lr("DocumentReference.onSnapshot","function",i+1,t[i+1]),lr("DocumentReference.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.fE(o,n)},e.prototype.fE=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new ji({next:function(t){if(e.next){var r=t.docs.get(n.Pc);
2e.next(new Qi(n.firestore,n.Pc,r,t.fromCache,t.hasPendingWrites,n.Vc))}},error:r}),o=this.zT.listen(Et.Wt(this.Pc.path),i,t);return function(){i.MT(),n.zT.al(o)}},e.prototype.get=function(t){var e=this;return ur("DocumentReference.get",arguments,0,1),eo("DocumentReference.get",t),new Promise((function(n,r){t&&"cache"===t.source?e.firestore.GT().FT(e.Pc).then((function(t){n(new Qi(e.firestore,e.Pc,t,!0,t instanceof mt&&t.At,e.Vc))}),r):e.TE(n,r,t)}))},e.prototype.TE=function(t,e,n){var r=this.fE({includeMetadataChanges:!0,qf:!0},{next:function(i){r(),!i.exists&&i.metadata.fromCache?e(new p(f.UNAVAILABLE,"Failed to get document because the client is offline.")):i.exists&&i.metadata.fromCache&&n&&"server"===n.source?e(new p(f.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):t(i)},error:e})},e.prototype.withConverter=function(t){return new e(this.Pc,this.firestore,t)},e}(Vr),Ki=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}(),Qi=function(){function t(t,e,n,r,i,o){this.uE=t,this.Pc=e,this.EE=n,this.IE=r,this.wE=i,this.Vc=o}return t.prototype.data=function(t){var e=this;if(ur("DocumentSnapshot.data",arguments,0,1),t=to("DocumentSnapshot.data",t),this.EE){if(this.Vc){var n=new Yi(this.uE,this.Pc,this.EE,this.IE,this.wE,null);return this.Vc.fromFirestore(n,t)}return new Vi(this.uE.mc,this.uE.aE(),t.serverTimestamps||"none",(function(t){return new Gi(t,e.uE,null)})).OT(this.EE.xt())}},t.prototype.get=function(t,e){var n=this;if(ur("DocumentSnapshot.get",arguments,1,2),e=to("DocumentSnapshot.get",e),this.EE){var r=this.EE.data().field(Xr("DocumentSnapshot.get",t));if(null!==r)return new Vi(this.uE.mc,this.uE.aE(),e.serverTimestamps||"none",(function(t){return new Gi(t,n.uE,n.Vc)})).OT(r)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.Pc.path.L()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Gi(this.Pc,this.uE,this.Vc)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this.EE},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new Ki(this.wE,this.IE)},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw _r("isEqual","DocumentSnapshot",1,e);return this.uE===e.uE&&this.IE===e.IE&&this.Pc.isEqual(e.Pc)&&(null===this.EE?null===e.EE:this.EE.isEqual(e.EE))&&this.Vc===e.Vc},t}(),Yi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.data=function(e){return t.prototype.data.call(this,e)},e}(Qi),Xi=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n.mc,n.tE,e)||this).RE=e,i.firestore=n,i.Vc=r,i}return i.__extends(e,t),e.prototype.where=function(t,n,r){ar("Query.where",arguments,3),mr("Query.where",3,r);var i=dr("Query.where",["<","<=","==",">=",">","array-contains","in","array-contains-any"],2,n),o=Xr("Query.where",t),a=this.AE(o,i,r);return new e(this.RE.Gt(a),this.firestore,this.Vc)},e.prototype.orderBy=function(t,n){var r;if(ur("Query.orderBy",arguments,1,2),lr("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new p(f.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Xr("Query.orderBy",t),o=this.gE(i,r);return new e(this.RE.zt(o),this.firestore,this.Vc)},e.prototype.limit=function(t){return ar("Query.limit",arguments,1),cr("Query.limit","number",1,t),wr("Query.limit",1,t),new e(this.RE.Ht(t),this.firestore,this.Vc)},e.prototype.limitToLast=function(t){return ar("Query.limitToLast",arguments,1),cr("Query.limitToLast","number",1,t),wr("Query.limitToLast",1,t),new e(this.RE.Yt(t),this.firestore,this.Vc)},e.prototype.startAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];
2sr("Query.startAt",arguments,1);var i=this.DE("Query.startAt",t,n,!0);return new e(this.RE.Jt(i),this.firestore,this.Vc)},e.prototype.startAfter=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];sr("Query.startAfter",arguments,1);var i=this.DE("Query.startAfter",t,n,!1);return new e(this.RE.Jt(i),this.firestore,this.Vc)},e.prototype.endBefore=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];sr("Query.endBefore",arguments,1);var i=this.DE("Query.endBefore",t,n,!0);return new e(this.RE.Xt(i),this.firestore,this.Vc)},e.prototype.endAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];sr("Query.endAt",arguments,1);var i=this.DE("Query.endAt",t,n,!1);return new e(this.RE.Xt(i),this.firestore,this.Vc)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw _r("isEqual","Query",1,t);return this.firestore===t.firestore&&this.RE.isEqual(t.RE)&&this.Vc===t.Vc},e.prototype.withConverter=function(t){return new e(this.RE,this.firestore,t)},e.prototype.DE=function(t,e,n,r){if(mr(t,1,e),e instanceof Qi)return ar(t,i.__spreadArrays([e],n),1),this.yE(t,e.EE,r);var o=[e].concat(n);return this.bE(t,o,r)},e.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];ur("Query.onSnapshot",arguments,1,4);var n,r={},i=0;return"object"!=typeof t[i]||Ui(t[i])||(br("Query.onSnapshot",r=t[i],["includeMetadataChanges"]),fr("Query.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++),Ui(t[i])?n=t[i]:(cr("Query.onSnapshot","function",i,t[i]),lr("Query.onSnapshot","function",i+1,t[i+1]),lr("Query.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.vE(this.RE),this.fE(r,n)},e.prototype.fE=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new ji({next:function(t){e.next&&e.next(new $i(n.firestore,n.RE,t,n.Vc))},error:r}),o=this.firestore.GT(),a=o.listen(this.RE,i,t);return function(){i.MT(),o.al(a)}},e.prototype.get=function(t){var e=this;return ur("Query.get",arguments,0,1),eo("Query.get",t),this.vE(this.RE),new Promise((function(n,r){t&&"cache"===t.source?e.firestore.GT().NT(e.RE).then((function(t){n(new $i(e.firestore,e.RE,t,e.Vc))}),r):e.TE(n,r,t)}))},e.prototype.TE=function(t,e,n){var r=this.fE({includeMetadataChanges:!0,qf:!0},{next:function(i){r(),i.metadata.fromCache&&n&&"server"===n.source?e(new p(f.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):t(i)},error:e})},e}(function(){function t(t,e,n){this.mc=t,this.tE=e,this.RE=n}return t.prototype.AE=function(t,e,n){var r;if(t.Y()){if("array-contains"===e||"array-contains-any"===e)throw new p(f.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+e+"' queries on FieldPath.documentId().");if("in"===e){this.mE(n,e);for(var i=[],o=0,a=n;o<a.length;o++){var s=a[o];i.push(this.PE(s))}r={arrayValue:{values:i}}}else r=this.PE(n)}else"in"!==e&&"array-contains-any"!==e||this.mE(n,e),r=this.tE.xc("Query.where",n,"in"===e);var u=Tt.create(t,e,r);return this.VE(u),u},t.prototype.gE=function(t,e){if(null!==this.RE.startAt)throw new p(f.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this.RE.endAt)throw new p(f.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var n=new Pt(t,e);return this.pE(n),n},t.prototype.yE=function(t,e,n){if(!e)throw new p(f.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+t+"().");for(var r=[],i=0,o=this.RE.orderBy;i<o.length;i++){var a=o[i];if(a.field.Y())r.push(H(this.mc,e.key));else{var s=e.field(a.field);if(R(s))throw new p(f.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+a.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===s){var u=a.field.j();throw new p(f.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}r.push(s)}}return new xt(r,n)},t.prototype.bE=function(t,e,n){var r=this.RE.Lt;if(e.length>r.length)throw new p(f.INVALID_ARGUMENT,"Too many arguments provided to "+t+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var i=[],o=0;o<e.length;o++){var a=e[o];if(r[o].field.Y()){if("string"!=typeof a)throw new p(f.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+t+"(), but got a "+typeof a);if(!this.RE._e()&&-1!==a.indexOf("/"))throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+t+"() must be a plain document ID, but '"+a+"' contains a slash.");var s=this.RE.path.child(E.K(a));if(!S.et(s))throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+t+"() must result in a valid document path, but '"+s+"' is not because it c
2ontains an odd number of segments.");var u=new S(s);i.push(H(this.mc,u))}else{var c=this.tE.xc(t,a);i.push(c)}}return new xt(i,n)},t.prototype.vE=function(t){if(t.ae()&&0===t.Lt.length)throw new p(f.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")},t.prototype.PE=function(t){if("string"==typeof t){if(""===t)throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!this.RE._e()&&-1!==t.indexOf("/"))throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+t+"' contains a '/' character.");var e=this.RE.path.child(E.K(t));if(!S.et(e))throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+e+"' is not because it has an odd number of segments ("+e.length+").");return H(this.mc,new S(e))}if(t instanceof Vr)return H(this.mc,t.Pc);throw new p(f.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+gr(t)+".")},t.prototype.mE=function(t,e){if(!Array.isArray(t)||0===t.length)throw new p(f.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new p(f.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.");if(t.indexOf(null)>=0)throw new p(f.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters cannot contain 'null' in the value array.");if(t.filter((function(t){return Number.isNaN(t)})).length>0)throw new p(f.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters cannot contain 'NaN' in the value array.")},t.prototype.VE=function(t){if(t instanceof Tt){var e=["array-contains","array-contains-any"],n=["in","array-contains-any"],r=e.indexOf(t.op)>=0,i=n.indexOf(t.op)>=0;if(t.ue()){var o=this.RE.jt();if(null!==o&&!o.isEqual(t.field))throw new p(f.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+o.toString()+"' and '"+t.field.toString()+"'");var a=this.RE.Kt();null!==a&&this.SE(t.field,a)}else if(i||r){var s=null;if(i&&(s=this.RE.ce(n)),null===s&&r&&(s=this.RE.ce(e)),null!=s)throw s===t.op?new p(f.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new p(f.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+s.toString()+"' filters.")}}},t.prototype.pE=function(t){if(null===this.RE.Kt()){var e=this.RE.jt();null!==e&&this.SE(e,t.field)}},t.prototype.SE=function(t,e){if(!e.isEqual(t))throw new p(f.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+e.toString()+"' instead.")},t}()),$i=function(){function t(t,e,n,r){this.uE=t,this.CE=e,this.FE=n,this.Vc=r,this.NE=null,this.kE=null,this.metadata=new Ki(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this.FE.docs.B()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.FE.docs.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;ur("QuerySnapshot.forEach",arguments,1,2),cr("QuerySnapshot.forEach","function",1,t),this.FE.docs.forEach((function(r){t.call(e,n.ME(r))}))},Object.defineProperty(t.prototype,"query",{get:function(){return new Xi(this.CE,this.uE,this.Vc)},enumerable:!0,configurable:!0}),t.prototype.docChanges=function(t){t&&(br("QuerySnapshot.docChanges",t,["includeMetadataChanges"]),fr("QuerySnapsh
2ot.docChanges","boolean","includeMetadataChanges",t.includeMetadataChanges));var e=!(!t||!t.includeMetadataChanges);if(e&&this.FE.hs)throw new p(f.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.NE&&this.kE===e||(this.NE=function(t,e,n,r){if(n.ss.B()){var i=0;return n.docChanges.map((function(e){var o=new Yi(t,e.doc.key,e.doc,n.fromCache,n.ns.has(e.doc.key),r);return e.doc,{type:"added",doc:o,oldIndex:-1,newIndex:i++}}))}var o=n.ss;return n.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var i=new Yi(t,e.doc.key,e.doc,n.fromCache,n.ns.has(e.doc.key),r),a=-1,s=-1;return 0!==e.type&&(a=o.indexOf(e.doc.key),o=o.delete(e.doc.key)),1!==e.type&&(s=(o=o.add(e.doc)).indexOf(e.doc.key)),{type:ro(e.type),doc:i,oldIndex:a,newIndex:s}}))}(this.uE,e,this.FE,this.Vc),this.kE=e),this.NE},t.prototype.isEqual=function(e){if(!(e instanceof t))throw _r("isEqual","QuerySnapshot",1,e);return this.uE===e.uE&&this.CE.isEqual(e.CE)&&this.FE.isEqual(e.FE)&&this.Vc===e.Vc},t.prototype.ME=function(t){return new Yi(this.uE,t.key,t,this.metadata.fromCache,this.FE.ns.has(t.key),this.Vc)},t}(),Ji=function(t){function e(e,n,r){var i=this;if((i=t.call(this,Et.Wt(e),n,r)||this).xE=e,e.length%2!=1)throw new p(f.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e.j()+" has "+e.length);return i}return i.__extends(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.RE.path.L()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.RE.path.$();return t.B()?null:new Gi(new S(t),this.firestore,null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.RE.path.j()},enumerable:!0,configurable:!0}),e.prototype.doc=function(t){ur("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=we.cn()),cr("CollectionReference.doc","non-empty string",1,t);var e=E.K(t);return Gi.oE(this.RE.path.child(e),this.firestore,this.Vc)},e.prototype.add=function(t){ar("CollectionReference.add",arguments,1),cr("CollectionReference.add","object",1,this.Vc?this.Vc.toFirestore(t):t);var e=this.doc();return e.set(t).then((function(){return e}))},e.prototype.withConverter=function(t){return new e(this.xE,this.firestore,t)},e}(Xi);function Zi(t,e){if(void 0===e)return{merge:!1};if(br(t,e,["merge","mergeFields"]),fr(t,"boolean","merge",e.merge),function(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){if(!(r instanceof Array))throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires its "+e+" option to be an array, but it was: "+gr(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new p(f.INVALID_ARGUMENT,"Function "+t+"() requires all "+e+" elements to be a string or a FieldPath, but the value at index "+o+" was: "+gr(r[o]))}(t,"mergeFields",0,r,(function(t){return"string"==typeof t||t instanceof Nr}))}(t,0,0,e.mergeFields),void 0!==e.mergeFields&&void 0!==e.merge)throw new p(f.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function to(t,e){return void 0===e?{}:(br(t,e,["serverTimestamps"]),pr(t,0,"serverTimestamps",e.serverTimestamps,["estimate","previous","none"]),e)}function eo(t,e){lr(t,"object",1,e),e&&(br(t,e,["source"]),pr(t,0,"source",e.source,["default","server","cache"]))}function no(t,e,n){if(e instanceof Vr){if(e.firestore!==n)throw new p(f.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}throw _r(t,"DocumentReference",1,e)}function ro(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return me()}}function io(t,e,n){var r;return t?(r=t.toFirestore(e),n="toFirestore() in "+n):r=e,[r,n]}function oo(t,e){function n(){var t="This constructor is private.";throw e&&(t+=" ",t+=e),new p(f.INVALID_ARGUMENT,t)}return n.prototype=t.prototype,Object.assign(n,t),n}var ao=oo(Wi,"Use firebase.firestore() instead."),so=oo(zi,"Use firebase.firestore().runTransaction() instead."),uo=oo(Hi,"Use firebase.firestore().batch() instead."),co=oo(Gi,"Use firebase.firestore().doc() instead."),lo=oo(Qi),ho=oo(Yi),fo=oo(Xi),po=oo($i),vo=oo(Ji,"Use firebase.firestore().collection() instead."),yo=oo(Mr,"Use FieldValue.<field>() instead."),go=oo(Cr,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),mo={Firestore:ao,GeoPoint:jr,Timestamp:b,Blob:go,Transaction:so,WriteBatch:uo,DocumentReference:co,DocumentSnapshot:lo,Query:fo,QueryDocumentSnapshot:ho,QuerySnapsh
2ot:po,CollectionReference:vo,FieldPath:Nr,FieldValue:yo,setLogLevel:Wi.setLogLevel,CACHE_SIZE_UNLIMITED:qi},bo=function(){function t(){}return t.prototype.Q_=function(t){},t.prototype.Vo=function(){},t}(),_o=function(){function t(){var t=this;this.$E=function(){return t.OE()},this.LE=function(){return t.BE()},this.qE=[],this.UE()}return t.prototype.Q_=function(t){this.qE.push(t)},t.prototype.Vo=function(){window.removeEventListener("online",this.$E),window.removeEventListener("offline",this.LE)},t.prototype.UE=function(){window.addEventListener("online",this.$E),window.addEventListener("offline",this.LE)},t.prototype.OE=function(){ve("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.qE;t<e.length;t++)(0,e[t])(0)},t.prototype.BE=function(){ve("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.qE;t<e.length;t++)(0,e[t])(1)},t.zh=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),wo=function(){function t(t){this.QE=t.QE,this.WE=t.WE}return t.prototype.s_=function(t){this.jE=t},t.prototype.Jc=function(t){this.KE=t},t.prototype.onMessage=function(t){this.GE=t},t.prototype.close=function(){this.WE()},t.prototype.send=function(t){this.QE(t)},t.prototype.zE=function(){this.jE()},t.prototype.HE=function(t){this.KE(t)},t.prototype.YE=function(t){this.GE(t)},t}(),Eo={BatchGetDocuments:"batchGet",Commit:"commit"},To="gl-js/ fire/"+l,Io=function(){function t(t){this.ii=t.ii;var e=t.ssl?"https":"http";this.JE=e+"://"+t.host,this.forceLongPolling=t.forceLongPolling}return t.prototype.XE=function(t,e){if(e)for(var n in e.o)e.o.hasOwnProperty(n)&&(t[n]=e.o[n]);t["X-Goog-Api-Client"]=To},t.prototype.E_=function(t,e,n){var r=this,i=this.ZE(t);return new Promise((function(o,a){var s=new c.XhrIo;s.listenOnce(c.EventType.COMPLETE,(function(){try{switch(s.getLastErrorCode()){case c.ErrorCode.NO_ERROR:var e=s.getResponseJson();ve("Connection","XHR received:",JSON.stringify(e)),o(e);break;case c.ErrorCode.TIMEOUT:ve("Connection",'RPC "'+t+'" timed out'),a(new p(f.DEADLINE_EXCEEDED,"Request time out"));break;case c.ErrorCode.HTTP_ERROR:var n=s.getStatus();if(ve("Connection",'RPC "'+t+'" failed with status:',n,"response text:",s.getResponseText()),n>0){var r=s.getResponseJson().error;if(r&&r.status&&r.message){var i=function(t){var e=t.toLowerCase().replace("_","-");return Object.values(f).indexOf(e)>=0?e:f.UNKNOWN}(r.status);a(new p(i,r.message))}else a(new p(f.UNKNOWN,"Server responded with status "+s.getStatus()))}else ve("Connection",'RPC "'+t+'" failed'),a(new p(f.UNAVAILABLE,"Connection failed."));break;default:me()}}finally{ve("Connection",'RPC "'+t+'" completed.')}}));var u=Object.assign({},e);delete u.database;var l=JSON.stringify(u);ve("Connection","XHR sending: ",i+" "+l);var h={"Content-Type":"text/plain"};r.XE(h,n),s.send(i,"POST",l,h,15)}))},t.prototype.I_=function(t,e,n){return this.E_(t,e,n)},t.prototype.i_=function(t,e){var n=[this.JE,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=c.createWebChannelTransport(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.ii.projectId+"/databases/"+this.ii.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling};this.XE(o.initMessageHeaders,e),s.isMobileCordova()||s.isReactNative()||s.isElectron()||s.isIE()||s.isUWP()||s.isBrowserExtension()||(o.httpHeadersOverwriteParam="$httpHeaders");var u=n.join("");ve("Connection","Creating WebChannel: "+u+" "+o);var h=r.createWebChannel(u,o),d=!1,v=!1,y=new wo({QE:function(t){v?ve("Connection","Not sending because WebChannel is closed:",t):(d||(ve("Connection","Opening WebChannel transport."),h.open(),d=!0),ve("Connection","WebChannel sending:",t),h.send(t))},WE:function(){return h.close()}}),g=function(t,e){h.listen(t,(function(t){try{e(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return g(c.WebChannel.EventType.OPEN,(function(){v||ve("Connection","WebChannel transport opened.")})),g(c.WebChannel.EventType.CLOSE,(function(){v||(v=!0,ve("Connection","WebChannel transport closed"),y.HE())}
2)),g(c.WebChannel.EventType.ERROR,(function(t){v||(v=!0,function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(pe.logLevel<=a.LogLevel.WARN){var r=e.map(ge);pe.warn.apply(pe,i.__spreadArrays(["Firestore ("+l+"): "+t],r))}}("Connection","WebChannel transport errored:",t),y.HE(new p(f.UNAVAILABLE,"The operation could not be completed")))})),g(c.WebChannel.EventType.MESSAGE,(function(t){var e;if(!v){var n=t.data[0];be(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){ve("Connection","WebChannel received error:",i);var o=i.status,a=function(t){var e=vt[t];if(void 0!==e)return Dt(e)}(o),s=i.message;void 0===a&&(a=f.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),v=!0,y.HE(new p(a,s)),h.close()}else ve("Connection","WebChannel received:",n),y.YE(n)}})),setTimeout((function(){y.zE()}),0),y},t.prototype.ZE=function(t){var e=Eo[t];return this.JE+"/v1/projects/"+this.ii.projectId+"/databases/"+this.ii.database+"/documents:"+e},t}();function So(t){!function(t,e){t.INTERNAL.registerComponent(new u.Component("firestore",(function(t){return function(t,e){return new Wi(t,e,new Mi)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},mo)))}(t),t.registerVersion("@firebase/firestore","1.15.4")}fe.an(new(function(){function t(){this.oc="undefined"!=typeof atob}return Object.defineProperty(t.prototype,"document",{get:function(){return"undefined"!=typeof document?document:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return"undefined"!=typeof window?window:null},enumerable:!0,configurable:!0}),t.prototype.vT=function(t){return Promise.resolve(new Io(t))},t.prototype.pT=function(){return _o.zh()?new _o:new bo},t.prototype.Cc=function(t){return new le(t,{hi:!0})},t.prototype.un=function(t){return JSON.stringify(t)},t.prototype.atob=function(t){return atob(t)},t.prototype.btoa=function(t){return btoa(t)},t.prototype._n=function(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n},t}())),So(o),e.__PRIVATE_registerFirestore=So},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";n.r(e),function(t){function r(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.")}n.d(e,"ErrorCode",(function(){return Xn})),n.d(e,"EventType",(function(){return $n})),n.d(e,"WebChannel",(function(){return Jn})),n.d(e,"XhrIo",(function(){return Zn})),n.d(e,"createWebChannelTransport",(function(){return Yn}));var i,o="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},a=a||{},s=o||self;function u(){}function c(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function l(t){var e=c(t);return"array"==e||"object"==e&&"number"==typeof t.length}function h(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var f="closure_uid_"+(1e9*Math.random()>>>0),p=0;function d(t,e,n){return t.call.apply(t.bind,arguments)}function v(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 y(t,e,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?d:v).apply(null,arguments)}
2function g(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 m=Date.now||function(){return+new Date};function b(t,e){function n(){}n.prototype=e.prototype,t.M=e.prototype,t.prototype=new n,t.prototype.constructor=t}function _(){this.j=this.j,this.i=this.i}_.prototype.j=!1,_.prototype.da=function(){if(!this.j&&(this.j=!0,this.C(),0))(function(t){Object.prototype.hasOwnProperty.call(t,f)&&t[f]||(t[f]=++p)})(this)},_.prototype.C=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var w=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},E=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 T(t){return Array.prototype.concat.apply([],arguments)}function I(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 S(t){return/^[\s\xa0]*$/.test(t)}var C,k=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function N(t,e){return-1!=t.indexOf(e)}function x(t,e){return t<e?-1:t>e?1:0}t:{var P=s.navigator;if(P){var A=P.userAgent;if(A){C=A;break t}}C=""}function O(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function R(t){var e={};for(var n in t)e[n]=t[n];return e}var D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function L(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<D.length;o++)n=D[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function M(t){return M[" "](t),t}M[" "]=u;var F,j=N(C,"Opera"),U=N(C,"Trident")||N(C,"MSIE"),V=N(C,"Edge"),q=V||U,B=N(C,"Gecko")&&!(N(C.toLowerCase(),"webkit")&&!N(C,"Edge"))&&!(N(C,"Trident")||N(C,"MSIE"))&&!N(C,"Edge"),W=N(C.toLowerCase(),"webkit")&&!N(C,"Edge");function z(){var t=s.document;return t?t.documentMode:void 0}t:{var H="",G=function(){var t=C;return B?/rv:([^\);]+)(\)|;)/.exec(t):V?/Edge\/([\d\.]+)/.exec(t):U?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):W?/WebKit\/(\S+)/.exec(t):j?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(G&&(H=G?G[1]:""),U){var K=z();if(null!=K&&K>parseFloat(H)){F=String(K);break t}}F=H}var Q,Y={};function X(t){return function(t,e){var n=Y;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,(function(){for(var e=0,n=k(String(F)).split("."),r=k(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=x(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||x(0==a[2].length,0==s[2].length)||x(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}if(s.document&&U){var $=z();Q=$||(parseInt(F,10)||void 0)}else Q=void 0;var J=Q,Z=!U||9<=Number(J),tt=U&&!X("9"),et=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{s.addEventListener("test",u,e),s.removeEventListener("test",u,e)}catch(n){}return t}();function nt(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function rt(t,e){if(nt.call(this,t?t.type:""),this.relatedTarget=this.a=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.c=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.a=e,e=t.relatedTarget){if(B){t:{try{M(e.nodeName);var i=!0;break t}catch(o){}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:it[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}nt.prototype.b=function(){this.defaultPrevented=!0},b(rt,nt);var it={2:"touch",3:"pen",4:"mouse"};rt.prototype.b=function(){rt.M.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,tt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var ot="closure_listenable_"+(1e6*Math.random()|0),at=0;function st(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.aa=i,this.key=++at,this.V=this.X=!1}function ut(t){t.V=!0,t.listener=null,t.proxy=null,t.src=null,t.aa=null}function ct(t){this.src=t,this.a={},this.b=0}function lt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=w(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ut(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function ht(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.V&&o.listener==e&&o.capture==!!n&&o.aa==r)return i}return-1}ct.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=ht(t,e,r,i);return-1<a?(e=t[a],n||(e.X=!1)):((e=new st(e,this.src,o,!!r,i)).X=n,t.pu
2sh(e)),e};var ft="closure_lm_"+(1e6*Math.random()|0),pt={};function dt(t,e,n,r,i){if(r&&r.once)return function t(e,n,r,i,o){if(Array.isArray(n)){for(var a=0;a<n.length;a++)t(e,n[a],r,i,o);return null}return r=Et(r),e&&e[ot]?e.sa(n,r,h(i)?!!i.capture:!!i,o):vt(e,n,r,!0,i,o)}(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)dt(t,e[o],n,r,i);return null}return n=Et(n),t&&t[ot]?t.ra(e,n,h(r)?!!r.capture:!!r,i):vt(t,e,n,!1,r,i)}function vt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=h(i)?!!i.capture:!!i;if(a&&!Z)return null;var s=_t(t);if(s||(t[ft]=s=new ct(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=bt,e=Z?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)et||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(gt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function yt(t){if("number"!==typeof t&&t&&!t.V){var e=t.src;if(e&&e[ot])lt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(gt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=_t(e))?(lt(n,t),0==n.b&&(n.src=null,e[ft]=null)):ut(t)}}}function gt(t){return t in pt?pt[t]:pt[t]="on"+t}function mt(t,e){var n=t.listener,r=t.aa||t.src;return t.X&&yt(t),n.call(r,e)}function bt(t,e){if(t.V)return!0;if(!Z){if(!e)t:{e=["window","event"];for(var n=s,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}return mt(t,e=new rt(e,this))}return mt(t,new rt(e,this))}function _t(t){return(t=t[ft])instanceof ct?t:null}var wt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Et(t){return"function"==c(t)?t:(t[wt]||(t[wt]=function(e){return t.handleEvent(e)}),t[wt])}function Tt(){_.call(this),this.c=new ct(this),this.J=this,this.A=null}function It(t,e,n,r){if(!(e=t.c.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.V&&a.capture==n){var s=a.listener,u=a.aa||a.src;a.X&<(t.c,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}b(Tt,_),Tt.prototype[ot]=!0,(i=Tt.prototype).addEventListener=function(t,e,n,r){dt(this,t,e,n,r)},i.removeEventListener=function(t,e,n,r){!function t(e,n,r,i,o){if(Array.isArray(n))for(var a=0;a<n.length;a++)t(e,n[a],r,i,o);else i=h(i)?!!i.capture:!!i,r=Et(r),e&&e[ot]?(e=e.c,(n=String(n).toString())in e.a&&(-1<(r=ht(a=e.a[n],r,i,o))&&(ut(a[r]),Array.prototype.splice.call(a,r,1),0==a.length&&(delete e.a[n],e.b--)))):e&&(e=_t(e))&&(n=e.a[n.toString()],e=-1,n&&(e=ht(n,r,i,o)),(r=-1<e?n[e]:null)&&yt(r))}(this,t,e,n,r)},i.dispatchEvent=function(t){var e,n=this.A;if(n)for(e=[];n;n=n.A)e.push(n);n=this.J;var r=t.type||t;if("string"===typeof t)t=new nt(t,n);else if(t instanceof nt)t.target=t.target||n;else{var i=t;L(t=new nt(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.a=e[o];i=It(a,r,!0,t)&&i}if(i=It(a=t.a=n,r,!0,t)&&i,i=It(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=It(a=t.a=e[o],r,!1,t)&&i;return i},i.C=function(){if(Tt.M.C.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)ut(n[r]);delete e.a[t],e.b--}}this.A=null},i.ra=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},i.sa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var St=s.JSON.stringify;function Ct(){this.b=this.a=null}var kt,Nt=new(function(){function t(t,e,n){this.f=n,this.c=t,this.g=e,this.b=0,this.a=null}return t.prototype.get=function(){var t;return 0<this.b?(this.b--,t=this.a,this.a=t.next,t.next=null):t=this.c(),t},t}())((function(){return new Pt}),(function(t){t.reset()}),100);function xt(){var t=Dt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function Pt(){this.next=this.b=this.a=null}function At(t){s.setTimeout((function(){throw t}),0)}function Ot(t,e){kt||function(){var t=s.Promise.resolve(void 0);kt=function(){t.then(Lt)}}(),Rt||(kt(),Rt=!0),Dt.add(t,e)}Ct.prototype.add=function(t,e){var n=Nt.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},Pt.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},Pt.prototype.reset=function(){this.next=this.b=this.a=null};var Rt=!1,Dt=new Ct;function Lt(){for(var t;t=xt();
2){try{t.a.call(t.b)}catch(n){At(n)}var e=Nt;e.g(t),e.b<e.f&&(e.b++,t.next=e.a,e.a=t)}Rt=!1}function Mt(t,e){Tt.call(this),this.b=t||1,this.a=e||s,this.f=y(this.Ua,this),this.g=m()}function Ft(t){t.Z=!1,t.L&&(t.a.clearTimeout(t.L),t.L=null)}function jt(t,e,n){if("function"==c(t))n&&(t=y(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=y(t.handleEvent,t)}return 2147483647<Number(e)?-1:s.setTimeout(t,e||0)}function Ut(t,e,n){_.call(this),this.f=null!=n?y(t,n):t,this.c=e,this.b=y(this.Pa,this),this.a=[]}function Vt(t){t.T=jt(t.b,t.c),t.f.apply(null,t.a)}function qt(t){_.call(this),this.b=t,this.a={}}b(Mt,Tt),(i=Mt.prototype).Z=!1,i.L=null,i.Ua=function(){if(this.Z){var t=m()-this.g;0<t&&t<.8*this.b?this.L=this.a.setTimeout(this.f,this.b-t):(this.L&&(this.a.clearTimeout(this.L),this.L=null),this.dispatchEvent("tick"),this.Z&&(Ft(this),this.start()))}},i.start=function(){this.Z=!0,this.L||(this.L=this.a.setTimeout(this.f,this.b),this.g=m())},i.C=function(){Mt.M.C.call(this),Ft(this),delete this.a},b(Ut,_),(i=Ut.prototype).ba=!1,i.T=null,i.Ia=function(t){this.a=arguments,this.T?this.ba=!0:Vt(this)},i.C=function(){Ut.M.C.call(this),this.T&&(s.clearTimeout(this.T),this.T=null,this.ba=!1,this.a=[])},i.Pa=function(){this.T=null,this.ba&&(this.ba=!1,Vt(this))},b(qt,_);var Bt=[];function Wt(t,e,n,r){Array.isArray(n)||(n&&(Bt[0]=n.toString()),n=Bt);for(var i=0;i<n.length;i++){var o=dt(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function zt(t){O(t.a,(function(t,e){this.a.hasOwnProperty(e)&&yt(t)}),t),t.a={}}function Ht(){}qt.prototype.C=function(){qt.M.C.call(this),zt(this)},qt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Gt=null;function Kt(){return Gt=Gt||new Tt}function Qt(t){nt.call(this,"serverreachability",t)}function Yt(t){var e=Kt();e.dispatchEvent(new Qt(e,t))}function Xt(t){nt.call(this,"statevent",t)}function $t(t){var e=Kt();e.dispatchEvent(new Xt(e,t))}function Jt(t){nt.call(this,"timingevent",t)}function Zt(t,e){if("function"!=c(t))throw Error("Fn must not be null and must be a function");return s.setTimeout((function(){t()}),e)}b(Qt,nt),b(Xt,nt),b(Jt,nt);var te={NO_ERROR:0,Va:1,bb:2,ab:3,Ya:4,$a:5,cb:6,za:7,TIMEOUT:8,gb:9},ee={Xa:"complete",kb:"success",Aa:"error",za:"abort",ib:"ready",jb:"readystatechange",TIMEOUT:"timeout",eb:"incrementaldata",hb:"progress",Za:"downloadprogress",lb:"uploadprogress"};function ne(){}function re(t){var e;return(e=t.a)||(e=t.a={}),e}function ie(){}ne.prototype.a=null;var oe,ae={OPEN:"a",Wa:"b",Aa:"c",fb:"d"};function se(){nt.call(this,"d")}function ue(){nt.call(this,"c")}function ce(){}function le(t,e,n){this.g=t,this.W=e,this.U=n||1,this.G=new qt(this),this.N=he,t=q?125:void 0,this.O=new Mt(t),this.m=null,this.b=!1,this.j=this.A=this.f=this.B=this.s=this.P=this.h=null,this.i=[],this.a=null,this.w=0,this.c=this.v=null,this.H=-1,this.l=!1,this.J=0,this.D=null,this.o=this.R=this.F=!1}b(se,nt),b(ue,nt),b(ce,ne),oe=new ce;var he=45e3,fe={},pe={};function de(t,e,n){t.B=1,t.f=Me(Pe(e)),t.j=n,t.F=!0,ve(t,null)}function ve(t,e){t.s=m(),me(t),t.A=Pe(t.f);var n=t.A,r=t.U;Array.isArray(r)||(r=[String(r)]),Ye(n.b,"t",r),t.w=0,t.a=qn(t.g,t.g.w?e:null),0<t.J&&(t.D=new Ut(y(t.ya,t,t.a),t.J)),Wt(t.G,t.a,"readystatechange",t.Sa),e=t.m?R(t.m):{},t.j?(t.v||(t.v="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.a.$(t.A,t.v,t.j,e)):(t.v="GET",t.a.$(t.A,t.v,null,e)),Yt(1)}function ye(t,e,n){for(var r=!0;!t.l&&t.w<n.length;){var i=ge(t,n);if(i==pe){4==e&&(t.c=4,$t(14),r=!1);break}if(i==fe){t.c=4,$t(15),r=!1;break}Te(t,i)}4==e&&0==n.length&&(t.c=1,$t(16),r=!1),t.b=t.b&&r,r||(Ee(t),we(t))}function ge(t,e){var n=t.w,r=e.indexOf("\n",n);return-1==r?pe:(n=Number(e.substring(n,r)),isNaN(n)?fe:(r+=1)+n>e.length?pe:(e=e.substr(r,n),t.w=r+n,e))}function me(t){t.P=m()+t.N,be(t,t.N)}function be(t,e){if(null!=t.h)throw Error("WatchDog timer not null");t.h=Zt(y(t.Qa,t),e)}function _e(t){t.h&&(s.clearTimeout(t.h),t.h=null)}function we(t){0==t.g.u||t.l||Mn(t.g,t)}function Ee(t){_e(t);var e=t.D;e&&"function"==typeof e.da&&e.da(),t.D=null,Ft(t.O),zt(t.G),t.a&&(e=t.a,t.a=null,e.abort(),e.da())}function Te(t,e){try{var n=t.g;if(0!=n.u&&(n.a==t||nn(n.b,t)))if(n.A=t.H,!t.o&&nn(n.b,t)&&3==n.u){try{var r=n.ja.a.parse(e)}catch(v){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.i){if(n.a){if(!(n.a.s+3e3<t.s))break t;Ln(n),n.a.cancel(),n.a=null}Dn(n),$t(18)}}else n.ia=i[1],0<n.ia-n.G&&37500>i[2]&&n.U&&0==n.m&&!n.l&&(n.l=Zt(y(n.Na,n),6e3));if(1>=en(n.b)&&n.O){try{n.O()}catch(v){}n.O=void 0}}else jn(n,11)}else if((t.o||n.a==t)&&Ln(n),!S(e))for(e=r=n.ja.a.parse(e),r=0;r<e.length;r++)if(i=e[r],n.G=i[0],i=i[1],2==n.u)if("c"==i[0]){n.B=i[1],n.R=i[2];var o=i[3];null!=o&&(n.oa=o);var a=i[5];null!=a&&"number"===typeof a&&0<a&&(n.D=1.5*a);var s=n,u=t.a;if(u){var c=u.a?u.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(c){var l=s.b;!l.a&&(N(c,"spdy")||N(c,"quic")||N(c,"h2"))&&(l.f=l.g,l.a=new Set,l.b&&(rn(l,l.b),l.b=null))}if(s.s){var h=u.a?u.a.getResponseHeader("X-HTTP-Session-Id"):null;h&&(s.ha=h,Le(s.v,s.s,h))}}n.u=3,n.c&&n.c.na();var f=t;if((s=n).ea=Vn(s,s.w?s.R:null,s.P),f.o){on(s.b,f);var p=f,d=s.D;d&&p.setTimeout(d),p.h&&(_e(p),me(p)),s.a=f}else Rn(s);0<n.f.length&&xn(n)}else"stop"!=i[0]&&"close"!=i[0]||jn(n,7);else 3==n.u&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?jn(n,7):Cn(n):"noop"!=i[0]&&n.c&&n.c.ma(i),n.m=0);Yt(4)}catch(v){}}function Ie(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(l(t)||"string"===typeof t)E(t,e,void 0);else{if(t.K&&"function"==typeof t.K)var n=t.K();else if(t.I&&"function"==typeof t.I)n=void 0;else if(l(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.I&&"function"==typeof t.I)return t.I();if("string"===typeof t)return t.split("");
vendor: 5,615 bytes, line 2
2if(l(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 Se(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 Se)for(n=t.K(),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 Ce(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];ke(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;)ke(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(i=le.prototype).setTimeout=function(t){this.N=t},i.Sa=function(t){t=t.target;var e=this.D;e&&3==En(t)?e.Ia():this.ya(t)},i.ya=function(t){try{if(t==this.a)t:{var e=En(this.a),n=this.a.qa(),r=this.a.S();if(!(3>e||3==e&&!q&&!this.a.Y())){this.l||4!=e||7==n||Yt(8==n||0>=r?3:2),_e(this);var i=this.a.S();this.H=i;var o=this.a.Y();if(this.b=200==i){if(this.R&&!this.o){e:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(a)){var u=a;break e}}u=null}if(!u){this.b=!1,this.c=3,$t(12),Ee(this),we(this);break t}this.o=!0,Te(this,u)}this.F?(ye(this,e,o),q&&this.b&&3==e&&(Wt(this.G,this.O,"tick",this.Ra),this.O.start())):Te(this,o),4==e&&Ee(this),this.b&&!this.l&&(4==e?Mn(this.g,this):(this.b=!1,me(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.c=3,$t(12)):(this.c=0,$t(13)),Ee(this),we(this)}}}catch(c){}},i.Ra=function(){if(this.a){var t=En(this.a),e=this.a.Y();this.w<e.length&&(_e(this),ye(this,t,e),this.b&&4!=t&&me(this))}},i.cancel=function(){this.l=!0,Ee(this)},i.Qa=function(){this.h=null;var t=m();0<=t-this.P?(2!=this.B&&(Yt(3),$t(17)),Ee(this),this.c=2,we(this)):be(this,this.P-t)},(i=Se.prototype).I=function(){Ce(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},i.K=function(){return Ce(this),this.a.concat()},i.get=function(t,e){return ke(this.b,t)?this.b[t]:e},i.set=function(t,e){ke(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},i.forEach=function(t,e){for(var n=this.K(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Ne=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function xe(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof xe){this.a=void 0!==e?e:t.a,Ae(this,t.f),this.j=t.j,Oe(this,t.c),Re(this,t.h),this.g=t.g,e=t.b;var n=new He;n.c=e.c,e.a&&(n.a=new Se(e.a),n.b=e.b),De(this,n),this.i=t.i}else t&&(n=String(t).match(Ne))?(this.a=!!e,Ae(this,n[1]||"",!0),this.j=Fe(n[2]||""),Oe(this,n[3]||"",!0),Re(this,n[4]),this.g=Fe(n[5]||"",!0),De(this,n[6]||"",!0),this.i=Fe(n[7]||"")):(this.a=!!e,this.b=new He(null,this.a))}function Pe(t){return new xe(t)}function Ae(t,e,n){t.f=n?Fe(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Oe(t,e,n){t.c=n?Fe(e,!0):e}function Re(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.h=e}else t.h=null}function De(t,e,n){e instanceof He?(t.b=e,function(t,e){e&&!t.f&&(Ge(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(Ke(this,e),Ye(this,n,t))}),t)),t.f=e}(t.b,t.a)):(n||(e=je(e,We)),t.b=new He(e,t.a))}function Le(t,e,n){t.b.set(e,n)}function Me(t){return Le(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^m()).toString(36)),t}function Fe(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function je(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,Ue),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ue(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}xe.prototype.toString=function(){var t=[],e=this.f;e&&t.push(je(e,Ve,!0),":");var n=this.c;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(je(e,Ve,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(je(n,"/"==n.charAt(0)?Be:qe,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",je(n,ze)),t.join("")};var Ve=/[#\/\?@]/g,qe=/[#\?:]/g,Be=/[#\?]/g,We=/[#\?@]/g,ze=/#/g;function He(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Ge(t){t.a||(t.a=new Se,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 Ke(t,e){Ge(t),e=Xe(t,e),ke(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,ke((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ce(t)))}function Qe(t,e){return Ge(t),e=Xe(t,e),ke(t.a.b,e)}function Ye(t,e,n){Ke(t,e),0<n.length&&(t.c=null,t.a.set(Xe(t,e),I(n)),t.b+=n.length)}function Xe(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function $e(t,e){this.b=t,this.a=e}function Je(t){this.g=t||Ze,s.PerformanceNavigationTiming?t=0<(t=s.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(s.ca&&s.ca.ua&&s.ca.ua()&&s.ca.ua().mb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(i=He.prototype).add=function(t,e){Ge(this),this.c=null,t=Xe(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this}
2,i.forEach=function(t,e){Ge(this),this.a.forEach((function(n,r){E(n,(function(n){t.call(e,n,r,this)}),this)}),this)},i.K=function(){Ge(this);for(var t=this.a.I(),e=this.a.K(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},i.I=function(t){Ge(this);var e=[];if("string"===typeof t)Qe(this,t)&&(e=T(e,this.a.get(Xe(this,t))));else{t=this.a.I();for(var n=0;n<t.length;n++)e=T(e,t[n])}return e},i.set=function(t,e){return Ge(this),this.c=null,Qe(this,t=Xe(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},i.get=function(t,e){return t&&0<(t=this.I(t)).length?String(t[0]):e},i.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.K(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.I(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 Ze=10;function tn(t){return!!t.b||!!t.a&&t.a.size>=t.f}function en(t){return t.b?1:t.a?t.a.size:0}function nn(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function rn(t,e){t.a?t.a.add(e):t.b=e}function on(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function an(t){var e,n;if(null!=t.b)return t.c.concat(t.b.i);if(null!=t.a&&0!==t.a.size){var i=t.c;try{for(var o=r(t.a.values()),a=o.next();!a.done;a=o.next()){var s=a.value;i=i.concat(s.i)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}return I(t.c)}function sn(){}function un(){this.a=new sn}function cn(t,e,n){var r=n||"";try{Ie(t,(function(t,n){var i=t;h(t)&&(i=St(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function ln(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}Je.prototype.cancel=function(){var t,e;if(this.c=an(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=r(this.a.values()),i=n.next();!i.done;i=n.next()){i.value.cancel()}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},sn.prototype.stringify=function(t){return s.JSON.stringify(t,void 0)},sn.prototype.parse=function(t){return s.JSON.parse(t,void 0)};var hn=s.JSON.parse;function fn(t){Tt.call(this),this.headers=new Se,this.G=t||null,this.b=!1,this.s=this.a=null,this.D="",this.h=0,this.f="",this.g=this.w=this.l=this.v=!1,this.o=0,this.m=null,this.H=pn,this.B=this.F=!1}b(fn,Tt);var pn="",dn=/^https?$/i,vn=["POST","PUT"];function yn(t){return"content-type"==t.toLowerCase()}function gn(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,mn(t),_n(t)}function mn(t){t.v||(t.v=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function bn(t){if(t.b&&"undefined"!=typeof a&&(!t.s[1]||4!=En(t)||2!=t.S()))if(t.l&&4==En(t))jt(t.va,0,t);else if(t.dispatchEvent("readystatechange"),4==En(t)){t.b=!1;try{var e,n=t.S();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.D).match(Ne)[1]||null;if(!o&&s.self&&s.self.location){var u=s.self.location.protocol;o=u.substr(0,u.length-1)}i=!dn.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{t.h=6;try{var c=2<En(t)?t.a.statusText:""}catch(l){c=""}t.f=c+" ["+t.S()+"]",mn(t)}}finally{_n(t)}}}function _n(t,e){if(t.a){wn(t);var n=t.a,r=t.s[0]?u:null;t.a=null,t.s=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){}}}function wn(t){t.a&&t.B&&(t.a.ontimeout=null),t.m&&(s.clearTimeout(t.m),t.m=null)}function En(t){return t.a?t.a.readyState:0}function Tn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return O(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"===typeof t?null!=n&&encodeURIComponent(String(n)):Le(t,e,n))}function In(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Sn(t){this.f=[],this.R=this.ea=this.v=this.P=this.a=this.ha=this.s=this.N=this.h=this.F=this.j=null,this.Fa=this.H=0,this.Ca=In("failFast",!1,t),this.U=this.l=this.i=this.g=this.c=null,this.W=!0,this.A=this.ia=this.G=-1,this.J=this.m=this.o=0,this.Ba=In("baseRetryDelayMs",5e3,t),this.Ga=In("retryDelaySeedMs",1e4,t),this.Da=In("forwardChannelMaxRetries",2,t),this.ga=In("forwardChannelRequestTimeoutMs",2e4,t),this.Ea=t&&t.nb||void 0,this.D=void 0,this.w=t&&t.supportsCrossDomainXhr||!1,this.B="",this.b=new Je(t&&t.concurrentRequestLimit),this.ja=new un,this.fa=t&&t.fastHandshake||!1,t&&t.forceLongPolling&&(this.W=!1),this.O=void 0}function Cn(t){if(kn(t),3==t.u){var e=t.H++,n=Pe(t.v);Le(n,"SID",t.B),Le(n,"RID",e),Le(n,"TYPE","terminate"),An(t,n),(e=new le(t,e,void 0)).B=2,e.f=Me(Pe(n)),n=!1,s.navigator&&s.navigator.sendBeacon&&(n=s.navigator.sendBeacon(e.f.toString(),"")),!n&&s.Image&&((new Image).src=e.f,n=!0),n||(e.a=qn(e.g,null),e.a.$(e.f)),e.s=m(),me(e)}Un(t)}function kn(t){t.a&&(t.a.cancel(),t.a=null),t.i&&(s.clearTimeout(t.i),t.i=null),Ln(t),t.b.cancel(),t.g&&("number"===typeof t.g&&s.clearTimeout(t.g),t.g=null)}function Nn(t,e){t.f.push(new $e(t.Fa++,e)),3==t.u&&xn(t)}function xn(t){tn(t.b)||t.g||(t.g=!0,Ot(t.xa,t),t.o=0)}function Pn(t,e){var n;n=e?e.W:t.H++;var r=Pe(t.v);Le(r,"SID",t.B),Le(r,"RID",n),Le(r,"AID",t.G),An(t,r),t.h&&t.j&&Tn(r,t.h,t.j),n=new le(t,n,t.o+1),null===t.h&&(n.m=t.j),e&&(t.f=e.i.concat(t.f)),e=On(t,n,1e3),n.setTimeout(
2Math.round(.5*t.ga)+Math.round(.5*t.ga*Math.random())),rn(t.b,n),de(n,r,e)}function An(t,e){t.c&&Ie({},(function(t,n){Le(e,n,t)}))}function On(t,e,n){n=Math.min(t.f.length,n);var r=t.c?y(t.c.Ha,t.c,t):null;t:for(var i=t.f,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].b,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,u=0;u<n;u++){var c=i[u].b,l=i[u].a;if(0>(c-=o))o=Math.max(0,i[u].b-100),s=!1;else try{cn(l,a,"req"+c+"_")}catch(h){r&&r(l)}}if(s){r=a.join("&");break t}}return t=t.f.splice(0,n),e.i=t,r}function Rn(t){t.a||t.i||(t.J=1,Ot(t.wa,t),t.m=0)}function Dn(t){return!(t.a||t.i||3<=t.m)&&(t.J++,t.i=Zt(y(t.wa,t),Fn(t,t.m)),t.m++,!0)}function Ln(t){null!=t.l&&(s.clearTimeout(t.l),t.l=null)}function Mn(t,e){var n=null;if(t.a==e){Ln(t),t.a=null;var r=2}else{if(!nn(t.b,e))return;n=e.i,on(t.b,e),r=1}if(t.A=e.H,0!=t.u)if(e.b)if(1==r){n=e.j?e.j.length:0,e=m()-e.s;var i=t.o;(r=Kt()).dispatchEvent(new Jt(r,n,e,i)),xn(t)}else Rn(t);else if(3==(i=e.c)||0==i&&0<t.A||!(1==r&&function(t,e){return!(en(t.b)>=t.b.f-(t.g?1:0))&&(t.g?(t.f=e.i.concat(t.f),!0):!(1==t.u||2==t.u||t.o>=(t.Ca?0:t.Da))&&(t.g=Zt(y(t.xa,t,e),Fn(t,t.o)),t.o++,!0))}(t,e)||2==r&&Dn(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:jn(t,5);break;case 4:jn(t,10);break;case 3:jn(t,6);break;default:jn(t,2)}}function Fn(t,e){var n=t.Ba+Math.floor(Math.random()*t.Ga);return t.c||(n*=2),n*e}function jn(t,e){if(2==e){var n=null;t.c&&(n=null);var r=y(t.Ta,t);n||(n=new xe("//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||Ae(n,"https"),Me(n)),function(t,e){var n=new Ht;if(s.Image){var r=new Image;r.onload=g(ln,n,r,"TestLoadImage: loaded",!0,e),r.onerror=g(ln,n,r,"TestLoadImage: error",!1,e),r.onabort=g(ln,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=g(ln,n,r,"TestLoadImage: timeout",!1,e),s.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else $t(2);t.u=0,t.c&&t.c.la(e),Un(t),kn(t)}function Un(t){t.u=0,t.A=-1,t.c&&(0==an(t.b).length&&0==t.f.length||(t.b.c.length=0,I(t.f),t.f.length=0),t.c.ka())}function Vn(t,e,n){var r=function(t){return t instanceof xe?Pe(t):new xe(t,void 0)}(n);if(""!=r.c)e&&Oe(r,e+"."+r.c),Re(r,r.h);else{var i=s.location;r=function(t,e,n,r){var i=new xe(null,void 0);return t&&Ae(i,t),e&&Oe(i,e),n&&Re(i,n),r&&(i.g=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.N&&O(t.N,(function(t,e){Le(r,e,t)})),e=t.s,n=t.ha,e&&n&&Le(r,e,n),Le(r,"VER",t.oa),An(t,r),r}function qn(t,e){if(e&&!t.w)throw Error("Can't create secondary domain capable XhrIo object.");return(e=new fn(t.Ea)).F=t.w,e}function Bn(){}function Wn(){if(U&&!(10<=Number(J)))throw Error("Environmental error: no available transport.")}function zn(t,e){Tt.call(this),this.a=new Sn(e),this.l=t,this.b=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.j=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.pa&&(t?t["X-WebChannel-Client-Profile"]=e.pa:t={"X-WebChannel-Client-Profile":e.pa}),this.a.F=t,(t=e&&e.httpHeadersOverwriteParam)&&!S(t)&&(this.a.h=t),this.h=e&&e.supportsCrossDomainXhr||!1,this.g=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!S(e)&&(this.a.s=e,null!==(t=this.b)&&e in t&&(e in(t=this.b)&&delete t[e])),this.f=new Kn(this)}function Hn(t){se.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function Gn(){ue.call(this),this.status=1}function Kn(t){this.a=t}(i=fn.prototype).$=function(t,e,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+t);e=e?e.toUpperCase():"GET",this.D=t,this.f="",this.h=0,this.v=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.G?re(this.G):re(oe),this.a.onreadystatechange=y(this.va,this);try{this.w=!0,this.a.open(e,String(t),!0),this.w=!1}catch(o){return void gn(this,o)}t=n||"";var i=new Se(this.headers);r&&Ie(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=yn,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.K()),n=s.FormData&&t instanceof s.FormData,!(0<=w(vn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;
2charset=utf-8"),i.forEach((function(t,e){this.a.setRequestHeader(e,t)}),this),this.H&&(this.a.responseType=this.H),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{wn(this),0<this.o&&((this.B=function(t){return U&&X(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.ta,this)):this.m=jt(this.ta,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){gn(this,o)}},i.ta=function(){"undefined"!=typeof a&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},i.abort=function(t){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=t||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),_n(this))},i.C=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),_n(this,!0)),fn.M.C.call(this)},i.va=function(){this.j||(this.w||this.l||this.g?bn(this):this.Oa())},i.Oa=function(){bn(this)},i.S=function(){try{return 2<En(this)?this.a.status:-1}catch(t){return-1}},i.Y=function(){try{return this.a?this.a.responseText:""}catch(t){return""}},i.Ja=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),hn(e)}},i.qa=function(){return this.h},i.Ma=function(){return"string"===typeof this.f?this.f:String(this.f)},(i=Sn.prototype).oa=8,i.u=1,i.xa=function(t){if(this.g)if(this.g=null,1==this.u){if(!t){this.H=Math.floor(1e5*Math.random());var e,n=new le(this,t=this.H++,void 0),r=this.j;if(this.F&&(r?L(r=R(r),this.F):r=this.F),null===this.h&&(n.m=r),this.fa)t:{for(var i=e=0;i<this.f.length;i++){var o=this.f[i];if(void 0===(o="__data__"in o.a&&"string"===typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(e+=o)){e=i;break t}if(4096===e||i===this.f.length-1){e=i+1;break t}}e=1e3}else e=1e3;e=On(this,n,e),Le(i=Pe(this.v),"RID",t),Le(i,"CVER",22),this.s&&Le(i,"X-HTTP-Session-Id",this.s),An(this,i),this.h&&r&&Tn(i,this.h,r),rn(this.b,n),this.fa?(Le(i,"$req",e),Le(i,"SID","null"),n.R=!0,de(n,i,null)):de(n,i,e),this.u=2}}else 3==this.u&&(t?Pn(this,t):0==this.f.length||tn(this.b)||Pn(this))},i.wa=function(){this.i=null,this.a=new le(this,"rpc",this.J),null===this.h&&(this.a.m=this.j),this.a.J=0;var t=Pe(this.ea);Le(t,"RID","rpc"),Le(t,"SID",this.B),Le(t,"CI",this.U?"0":"1"),Le(t,"AID",this.G),An(this,t),Le(t,"TYPE","xmlhttp"),this.h&&this.j&&Tn(t,this.h,this.j),this.D&&this.a.setTimeout(this.D);var e=this.a,n=this.R;e.B=1,e.f=Me(Pe(t)),e.j=null,e.F=!0,ve(e,n)},i.Na=function(){null!=this.l&&(this.l=null,this.a.cancel(),this.a=null,Dn(this),$t(19))},i.Ta=function(t){$t(t?2:1)},(i=Bn.prototype).na=function(){},i.ma=function(){},i.la=function(){},i.ka=function(){},i.Ha=function(){},Wn.prototype.a=function(t,e){return new zn(t,e)},b(zn,Tt),(i=zn.prototype).addEventListener=function(t,e,n,r){zn.M.addEventListener.call(this,t,e,n,r)},i.removeEventListener=function(t,e,n,r){zn.M.removeEventListener.call(this,t,e,n,r)},i.Ka=function(){this.a.c=this.f,this.h&&(this.a.w=!0);var t=this.a,e=this.l,n=this.b||void 0;$t(0),t.P=e,t.N=n||{},t.U=t.W,t.v=Vn(t,null,t.P),xn(t)},i.close=function(){Cn(this.a)},i.La=function(t){if("string"===typeof t){var e={};e.__data__=t,Nn(this.a,e)}else this.g?((e={}).__data__=St(t),Nn(this.a,e)):Nn(this.a,t)},i.C=function(){this.a.c=null,delete this.f,Cn(this.a),delete this.a,zn.M.C.call(this)},b(Hn,se),b(Gn,ue),b(Kn,Bn),Kn.prototype.na=function(){this.a.dispatchEvent("a")},Kn.prototype.ma=function(t){this.a.dispatchEvent(new Hn(t))},Kn.prototype.la=function(t){this.a.dispatchEvent(new Gn(t))},Kn.prototype.ka=function(){this.a.dispatchEvent("b")},Wn.prototype.createWebChannel=Wn.prototype.a,zn.prototype.send=zn.prototype.La,zn.prototype.open=zn.prototype.Ka,zn.prototype.close=zn.prototype.close,te.NO_ERROR=0,te.TIMEOUT=8,te.HTTP_ERROR=6,ee.COMPLETE="complete",ie.EventType=ae,ae.OPEN="a",ae.CLOSE="b",ae.ERROR="c",ae.MESSAGE="d",Tt.prototype.listen=Tt.prototype.ra,fn.prototype.listenOnce=fn.prototype.sa,fn.prototype.getLastError=fn.prototype.Ma,fn.prototype.getLastErrorCode=fn.prototype.qa,fn.prototype.getStatus=fn.prototype.S,fn.prototype.getResponseJson=fn.prototype.Ja,fn.prototype.getResponseText=fn.prototype.Y,fn.prototype.send=fn.prototype.$;var Qn={createWebChannelTransport:function(){return new Wn},ErrorCode:te,EventType:ee,WebChannel:ie,XhrIo:fn},Yn=Qn.createWebChannelTransport,Xn=Qn.ErrorCode,$n=Qn.EventType,Jn=Qn.WebChannel,Zn=Qn.XhrIo;e.default=Qn}.call(this,n(18))},function(t,e,n){"use strict";var r,i=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,o=n(60),a=n(5),s={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
2ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},u=function(t){function e(n,r,i){var o=t.call(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o.code=n,o.details=i,o}return o.__extends(e,t),e}(Error);var c=function(){function t(t,e){var n=this;this.auth=null,this.messaging=null,this.auth=t.getImmediate({optional:!0}),this.messaging=e.getImmediate({optional:!0}),this.auth||t.get().then((function(t){return n.auth=t}),(function(){})),this.messaging||e.get().then((function(t){return n.messaging=t}),(function(){}))}return t.prototype.getAuthToken=function(){return o.__awaiter(this,void 0,void 0,(function(){var t;return o.__generator(this,(function(e){switch(e.label){case 0:if(!this.auth)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return(t=e.sent())?[2,t.accessToken]:[2,void 0];case 3:return e.sent(),[2,void 0];case 4:return[2]}}))}))},t.prototype.getInstanceIdToken=function(){return o.__awaiter(this,void 0,void 0,(function(){return o.__generator(this,(function(t){if(!this.messaging||!("Notification"in self)||"granted"!==Notification.permission)return[2,void 0];try{return[2,this.messaging.getToken()]}catch(e){return[2,void 0]}return[2]}))}))},t.prototype.getContext=function(){return o.__awaiter(this,void 0,void 0,(function(){var t,e;return o.__generator(this,(function(n){switch(n.label){case 0:return[4,this.getAuthToken()];case 1:return t=n.sent(),[4,this.getInstanceIdToken()];case 2:return e=n.sent(),[2,{authToken:t,instanceIdToken:e}]}}))}))},t}();function l(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}var h=function(){function t(){}return t.prototype.encode=function(t){var e=this;if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(Array.isArray(t))return t.map((function(t){return e.encode(t)}));if("function"===typeof t||"object"===typeof t)return l(t,(function(t){return e.encode(t)}));throw new Error("Data cannot be encoded in JSON: "+t)},t.prototype.decode=function(t){var e=this;if(null==t)return t;if(t["@type"])switch(t["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":var n=Number(t.value);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+t);return n;default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((function(t){return e.decode(t)})):"function"===typeof t||"object"===typeof t?l(t,(function(t){return e.decode(t)})):t},t}();var f=function(){function t(t,e,n,r){var i=this;void 0===r&&(r="us-central1"),this.app_=t,this.region_=r,this.serializer=new h,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return i.deleteService()}},this.contextProvider=new c(e,n),this.cancelAllRequests=new Promise((function(t){i.deleteService=function(){return t()}}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!0,configurable:!0}),t.prototype._url=function(t){var e=this.app_.options.projectId,n=this.region_;return null!==this.emulatorOrigin?this.emulatorOrigin+"/"+e+"/"+n+"/"+t:"https://"+n+"-"+e+".cloudfunctions.net/"+t},t.prototype.useFunctionsEmulator=function(t){this.emulatorOrigin=t},t.prototype.httpsCallable=function(t,e){var n=this;return function(r){return n.call(t,r,e||{})}},t.prototype.postJSON=function(t,e,n){return o.__awaiter(this,void 0,void 0,(function(){var r,i;return o.__generator(this,(function(o){switch(o.label){case 0:n.append("Content-Type","application/json"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch(t,{method:"POST",body:JSON.stringify(e),headers:n})];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),[2,{status:0,json:null}];case 4:i=null,o.label=5;case 5:return o.trys.push([5,7,,8]),[4,r.json()];case 6:return i=o.sent(),[3,8];case 7:return o.sent(),[3,8];case 8:return[2,{status:r.status,json:i}]}}))}))},t.prototype.call=function(t,e,n){return o.__awaiter(this,void 0,void 0,(function(){var r,i,a,c,l,h,f,p;return o.__generator(this,(function(o){switch(o.label){case 0:return r=this._url(t),e=this.serializer.encode(e),i={data:e},a=new Headers,[4,this.contextProvider.getContext()];case 1:return(c=o.sent()).authToken&&a.append("Authorization","Bearer "+c.authToken),c.instanceIdToken&&a.append("Firebase-Instance-ID-Token",c.instanceIdToken),l=n.timeout||7e4,[4,Promise.race([this.postJSON(r,i,a),(d=l,new Promise((function(t,e){setTimeout((function(){e(new u("deadline-exceeded","deadline-exceeded"))}),d)}))),this.cancelAllRequests])];case 2:if(!(h=o.sent()))throw new u("cancelled","Firebase Functions instance was deleted.");
2if(f=function(t,e,n){var r=function(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(t),i=r,o=void 0;try{var a=e&&e.error;if(a){var c=a.status;if("string"===typeof c){if(!s[c])return new u("internal","internal");r=s[c],i=c}var l=a.message;"string"===typeof l&&(i=l),void 0!==(o=a.details)&&(o=n.decode(o))}}catch(h){}return"ok"===r?null:new u(r,i,o)}(h.status,h.json,this.serializer))throw f;if(!h.json)throw new u("internal","Response is not valid JSON object.");if("undefined"===typeof(p=h.json.data)&&(p=h.json.result),"undefined"===typeof p)throw new u("internal","Response is missing data field.");return[2,{data:this.serializer.decode(p)}]}var d}))}))},t}();function p(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("messaging");return new f(n,r,i,e)}!function(t){var e={Functions:f};t.INTERNAL.registerComponent(new a.Component("functions",p,"PUBLIC").setServiceProps(e).setMultipleInstances(!0))}(i),i.registerVersion("@firebase/functions","0.4.46")},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";
2Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r;n(19);var o,a,s,u,c=n(62),l=n(8),h=n(13),f=n(5),p=((o={})["trace started"]="Trace {$traceName} was started before.",o["trace stopped"]="Trace {$traceName} is not running.",o["no window"]="Window is not available.",o["no app id"]="App id is not available.",o["no project id"]="Project id is not available.",o["no api key"]="Api key is not available.",o["invalid cc log"]="Attempted to queue invalid cc event",o["FB not default"]="Performance can only start when Firebase app instance is the default one.",o["RC response not ok"]="RC response is not ok",o["invalid attribute name"]="Attribute name {$attributeName} is invalid.",o["invalid attribute value"]="Attribute value {$attributeValue} is invalid.",o["invalid custom metric name"]="Custom metric name {$customMetricName} is invalid",o["invalid String merger input"]="Input for String merger is invalid, contact support team to resolve.",o),d=new l.ErrorFactory("performance","Performance",p),v=function(){function t(t){if(this.window=t,!t)throw d.create("no window");this.performance=t.performance,this.PerformanceObserver=t.PerformanceObserver,this.windowLocation=t.location,this.navigator=t.navigator,this.document=t.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=t.localStorage),t.perfMetrics&&t.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=t.perfMetrics.onFirstInputDelay)}return t.prototype.getUrl=function(){return this.windowLocation.href.split("?")[0]},t.prototype.mark=function(t){this.performance&&this.performance.mark&&this.performance.mark(t)},t.prototype.measure=function(t,e,n){this.performance&&this.performance.measure&&this.performance.measure(t,e,n)},t.prototype.getEntriesByType=function(t){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(t):[]},t.prototype.getEntriesByName=function(t){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(t):[]},t.prototype.getTimeOrigin=function(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)},t.prototype.requiredApisAvailable=function(){return!!(fetch&&Promise&&this.navigator&&this.navigator.cookieEnabled)},t.prototype.setupObserver=function(t,e){this.PerformanceObserver&&new this.PerformanceObserver((function(t){for(var n=0,r=t.getEntries();n<r.length;n++){var i=r[n];e(i)}})).observe({entryTypes:[t]})},t.getInstance=function(){return void 0===a&&(a=new t(s)),a},t}();function y(t,e){var n=t.length-e.length;if(n<0||n>1)throw d.create("invalid String merger input");for(var r=[],i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")}var g,m,b=function(){function t(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=y("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=y("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}return t.prototype.getAppId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!t)throw d.create("no app id");return t},t.prototype.getProjectId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!t)throw d.create("no project id");return t},t.prototype.getApiKey=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!t)throw d.create("no api key");return t},t.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},t.getInstance=function(){return void 0===u&&(u=new t),u},t}();function _(){return g}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VISIBLE=1]="VISIBLE",t[t.HIDDEN=2]="HIDDEN"}(m||(m={}));var w=["firebase_","google_","ga_"],E=new RegExp("^[a-zA-Z]\\w*$");function T(){var t=v.getInstance().navigator;
2return"serviceWorker"in t?t.serviceWorker.controller?2:3:1}function I(){switch(v.getInstance().document.visibilityState){case"visible":return m.VISIBLE;case"hidden":return m.HIDDEN;default:return m.UNKNOWN}}function S(){var t=v.getInstance().navigator.connection;switch(t&&t.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}var C=new h.Logger("Performance");C.logLevel=h.LogLevel.INFO;var k=!0;function N(t){var e=function(){var t=v.getInstance().localStorage;if(!t)return;var e=t.getItem("@firebase/performance/configexpire");if(!e||(n=e,!(Number(n)>Date.now())))return;var n;var r=t.getItem("@firebase/performance/config");if(!r)return;try{return JSON.parse(r)}catch(o){return}}();return e?(x(e),Promise.resolve()):function(t){return function(){var t=b.getInstance().installationsService.getToken();return t.then((function(t){})),t}().then((function(e){var n="https://firebaseremoteconfig.googleapis.com/v1/projects/"+b.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+b.getInstance().getApiKey(),r=new Request(n,{method:"POST",headers:{Authorization:"FIREBASE_INSTALLATIONS_AUTH "+e},body:JSON.stringify({app_instance_id:t,app_instance_id_token:e,app_id:b.getInstance().getAppId(),app_version:"0.3.7",sdk_version:"0.0.1"})});return fetch(r).then((function(t){if(t.ok)return t.json();throw d.create("RC response not ok")}))})).catch((function(){C.info("Could not fetch config, will use default configs")}))}(t).then(x).then((function(t){return function(t){var e=v.getInstance().localStorage;if(!t||!e)return;e.setItem("@firebase/performance/config",JSON.stringify(t)),e.setItem("@firebase/performance/configexpire",String(Date.now()+60*b.getInstance().configTimeToLive*60*1e3))}(t)}),(function(){}))}function x(t){if(!t)return t;var e=b.getInstance(),n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=k,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=P(e.tracesSamplingRate),e.logNetworkAfterSampling=P(e.networkRequestsSamplingRate),t}function P(t){return Math.random()<=t}var A,O=1;function R(){return O=2,A=A||function(){var t=v.getInstance().document;return new Promise((function(e){t&&"complete"!==t.readyState?t.addEventListener("readystatechange",(function n(){"complete"===t.readyState&&(t.removeEventListener("readystatechange",n),e())})):e()}))}().then((function(){return function(){var t=b.getInstance().installationsService.getId();return t.then((function(t){g=t})),t}()})).then((function(t){return N(t)})).then((function(){return D()}),(function(){return D()}))}function D(){O=3}var L,M=3,F=[],j=!1;function U(t){setTimeout((function(){if(0!==M)return F.length?void function(){var t=c.__spreadArrays(F);F=[];var e=t.map((function(t){return{source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)}}));(function(t,e){return function(t){var e=b.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}(t).then((function(t){return t.ok||C.info("Call to Firebase backend failed."),t.json()})).then((function(t){var n=Number(t.nextRequestWaitMillis),r=1e4;isNaN(n)||(r=Math.max(n,r));var i=t.logResponseDetails;Array.isArray(i)&&i.length>0&&"RETRY_REQUEST_LATER"===i[0].responseAction&&(F=c.__spreadArrays(e,F),C.info("Retry transport request later.")),M=3,U(r)}))})({request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:b.getInstance().logSource,log_event:e},t).catch((function(){F=c.__spreadArrays(t,F),M--,C.info("Tries left: "+M+"."),U(1e4)}))}():U(1e4)}),t)}function V(t){if(!t.eventTime||!t.message)throw d.create("invalid cc log");F=c.__spreadArrays(F,[t])}function q(t,e){L||(L=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(void 0,e);V({message:r,eventTime:Date.now()})}}(z)),L(t,e)}function B(t){var e=b.getInstance();!e.instrumentationEnabled&&t.isAuto||(e.dataCollectionEnabled||t.isAuto)&&v.getInstance().requiredApisAvailable()&&(t.isAuto&&I()!==m.VISIBLE||e.loggingEnabled&&e.logTraceAfterSampling&&(3===O?W(t):R().then((function(){return W(t)}),(function(){return W(t)}))))}function W(t){_()&&setTimeout((function(){return q(t,1)}),0)}function z(t,e){return 0===e?function(t){var e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:H(),network_request_metric:e};return JSON.stringify(n)}(t):function(t){var e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};0!==Object.keys(t.counters).length&&(e.counters=t.counters);var n=t.getAttributes();0!==Object.keys(n).length&&(e.custom_attributes=n);var r={application_info:H(),trace_metric:e};return JSON.stringify(r)}(t)}function H(){return{google_app_id:b.getInstance().getAppId(),app_instance_id:_(),web_app_info:{sdk_version:"0.3.7",page_url:v.getInstance().getUrl(),service_worker_status:T(),visibility_state:I(),effective_connection_type:S()},application_process_state:0}}var G=["_fp","_fcp","_fid"];var K=function(){function t(t,e,n){void 0===e&&(e=!1),this.name=t,this.isAuto=e,this.state=1,this.customAttributes={},this.counters={},this.api=v.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark="FB-PERF-TRACE-START-"+this.randomId+"-"+this.name,this.traceStopMark="FB-PERF-TRACE-STOP-"+this.randomId+"-"+this.name,this.traceMeasure=n||"FB-PERF-TRACE-MEASURE-"+this.randomId+"-"+this.name,n&&this.calculateTraceMetrics())}return t.prototype.start=function(){if(1!==this.state)throw d.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2},t.prototype.stop=function(){if(2!==this.state)throw d.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),B(this)},t.prototype.record=function(t,e,n){if(this.durationUs=Math.floor(1e3*e),this.startTimeUs=Math.floor(1e3*t),n&&n.attributes&&(this.customAttributes=c.__assign({},n.attributes)),n&&n.metrics)for(var r=0,i=Object.keys(n.metrics);r<i.length;r++){var o=i[r];isNaN(Number(n.metrics[o]))||(this.counters[o]=Number(Math.floor(n.metrics[o])))}B(this)},t.prototype.incrementMetric=function(t,e){void 0===e&&(e=1),void 0===this.counters[t]&&this.putMetric(t,0),this.counters[t]+=e},t.prototype.putMetric=function(t,e){if(!function(t,e){return!(0===t.length||t.length>100)&&(e&&e.startsWith("_wt_")&&G.indexOf(t)>-1||!t.startsWith("_"))}(t,this.name))throw d.create("invalid custom metric name",{customMetricName:t});this.counters[t]=e},t.prototype.getMetric=function(t){return this.counters[t]||0},t.prototype.putAttribute=function(t,e){var n=function(t){return!(0===t.length||t.length>40)&&(!w.some((function(e){return t.startsWith(e)}))&&!!t.match(E))}(t),r=function(t){return 0!==t.length&&t.length<=100}(e);if(n&&r)this.customAttributes[t]=e;else{if(!n)throw d.create("invalid attribute name",{attributeName:t});if(!r)throw d.create("invalid attribute value",{attributeValue:e})}},t.prototype.getAttribute=function(t){return this.customAttributes[t]},t.prototype.removeAttribute=function(t){void 0!==this.customAttributes[t]&&delete this.customAttributes[t]},t.prototype.getAttributes=function(){return c.__assign({},this.customAttributes)},t.prototype.setStartTime=function(t){this.startTimeUs=t},t.prototype.setDuration=function(t){this.durationUs=t},t.prototype.calculateTraceMetrics=function(){var t=this.api.getEntriesByName(this.traceMeasure),e=t&&t[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))},t.createOobTrace=function(e,n,r){var i=v.getInstance().getUrl();if(i){var o=new t("_wt_"+i,!0),a=Math.floor(1e3*v.getInstance().getTimeOrigin());o.setStartTime(a),e&&e[0]&&(o.setDuration(Math.floor(1e3*e[0].duration)),o.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),o.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),o.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));if(n){var s=n.find((function(t){return"first-paint"===t.name}));s&&s.startTime&&o.putMetric("_fp",Math.floor(1e3*s.startTime));var u=n.find((function(t){return"first-contentful-paint"===t.name}));u&&u.startTime&&o.putMetric("_fcp",Math.floor(1e3*u.startTime)),r&&o.putMetric("_fid",Math.floor(1e3*r))}B(o)}},t.createUserTimingTrace=function(e){B(new t(e,!1,e))},t}();function Q(t){var e=t;if(e&&void 0!==e.responseStart){var n=v.getInstance().getTimeOrigin(),r=Math.floor(1e3*(e.startTime+n)),i=e.responseStart?Math.floor(1e3*(e.responseStart-e.startTime)):void 0,o=Math.floor(1e3*(e.responseEnd-e.startTime));!function(t){var e=b.getInstance();if(e.instrumentationEnabled){var n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0];n!==r&&n!==i&&e.loggingEnabled&&e.logNetworkAfterSampling&&setTimeout((function(){return q(t,0)}),0)}}({url:e.name&&e.name.split("?")[0],responsePayloadBytes:e.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:o})}}
2function Y(){_()&&(setTimeout((function(){return function(){var t=v.getInstance(),e=t.getEntriesByType("navigation"),n=t.getEntriesByType("paint");if(t.onFirstInputDelay){var r=setTimeout((function(){K.createOobTrace(e,n),r=void 0}),5e3);t.onFirstInputDelay((function(t){r&&(clearTimeout(r),K.createOobTrace(e,n,t))}))}else K.createOobTrace(e,n)}()}),0),setTimeout((function(){return function(){for(var t=v.getInstance(),e=t.getEntriesByType("resource"),n=0,r=e;n<r.length;n++){Q(r[n])}t.setupObserver("resource",Q)}()}),0),setTimeout((function(){return function(){for(var t=v.getInstance(),e=t.getEntriesByType("measure"),n=0,r=e;n<r.length;n++){X(r[n])}t.setupObserver("measure",X)}()}),0))}function X(t){var e=t.name;"FB-PERF-TRACE-MEASURE"!==e.substring(0,"FB-PERF-TRACE-MEASURE".length)&&K.createUserTimingTrace(e)}var $=function(){function t(t){this.app=t,v.getInstance().requiredApisAvailable()?(j||(U(5500),j=!0),R().then(Y,Y)):C.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.")}return t.prototype.trace=function(t){return new K(t)},Object.defineProperty(t.prototype,"instrumentationEnabled",{get:function(){return b.getInstance().instrumentationEnabled},set:function(t){b.getInstance().instrumentationEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataCollectionEnabled",{get:function(){return b.getInstance().dataCollectionEnabled},set:function(t){b.getInstance().dataCollectionEnabled=t},enumerable:!0,configurable:!0}),t}();function J(t){var e=function(t,e){if("[DEFAULT]"!==t.name)throw d.create("FB not default");if("undefined"===typeof window)throw d.create("no window");return function(t){s=t}(window),b.getInstance().firebaseAppInstance=t,b.getInstance().installationsService=e,new $(t)};t.INTERNAL.registerComponent(new f.Component("performance",(function(t){var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations").getImmediate();return e(n,r)}),"PUBLIC")),t.registerVersion("@firebase/performance","0.3.7")}J(i),e.registerPerformance=J},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";
2Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r;n(19);var o,a=n(64),s=n(8),u=n(13),c=n(5),l=function(){function t(t,e,n,r){this.client=t,this.storage=e,this.storageCache=n,this.logger=r}return t.prototype.isCachedDataFresh=function(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var n=Date.now()-e,r=n<=t;return this.logger.debug("Config fetch cache check. Cache age millis: "+n+". Cache max age millis (minimumFetchIntervalMillis setting): "+t+". Is cache hit: "+r+"."),r},t.prototype.fetch=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r,i,o;return a.__generator(this,(function(a){switch(a.label){case 0:return[4,Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()])];case 1:return e=a.sent(),n=e[0],(r=e[1])&&this.isCachedDataFresh(t.cacheMaxAgeMillis,n)?[2,r]:(t.eTag=r&&r.eTag,[4,this.client.fetch(t)]);case 2:return i=a.sent(),o=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())],200===i.status&&o.push(this.storage.setLastSuccessfulFetchResponse(i)),[4,Promise.all(o)];case 3:return a.sent(),[2,i]}}))}))},t}(),h=((o={})["registration-window"]="Undefined window object. This SDK only supports usage in a browser environment.",o["registration-project-id"]="Undefined project identifier. Check Firebase app initialization.",o["registration-api-key"]="Undefined API key. Check Firebase app initialization.",o["registration-app-id"]="Undefined app identifier. Check Firebase app initialization.",o["storage-open"]="Error thrown when opening storage. Original error: {$originalErrorMessage}.",o["storage-get"]="Error thrown when reading from storage. Original error: {$originalErrorMessage}.",o["storage-set"]="Error thrown when writing to storage. Original error: {$originalErrorMessage}.",o["storage-delete"]="Error thrown when deleting from storage. Original error: {$originalErrorMessage}.",o["fetch-client-network"]="Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.",o["fetch-timeout"]='The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',o["fetch-throttle"]='The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',o["fetch-client-parse"]="Fetch client could not parse response. Original error: {$originalErrorMessage}.",o["fetch-status"]="Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.",o),f=new s.ErrorFactory("remoteconfig","Remote Config",h);var p=function(){function t(t,e,n,r,i,o){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=n,this.projectId=r,this.apiKey=i,this.appId=o}return t.prototype.fetch=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r,i,o,s,u,c,l,h,p,d,v,y,g,m,b,_,w;return a.__generator(this,(function(a){switch(a.label){case 0:return[4,Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()])];case 1:e=a.sent(),n=e[0],r=e[1],i=window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com",o=i+"/v1/projects/"+this.projectId+"/namespaces/"+this.namespace+":fetch?key="+this.apiKey,s={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":t.eTag||"*"},u={sdk_version:this.sdkVersion,app_instance_id:n,app_instance_id_token:r,app_id:this.appId,language_code:(void 0===E&&(E=navigator),E.languages&&E.languages[0]||E.language)},c={method:"POST",headers:s,body:JSON.stringify(u)},l=fetch(o,c),h=new Promise((function(e,n){t.signal.addEventListener((function(){var t=new Error("The operation was aborted.");t.name="AbortError",n(t)}))})),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,Promise.race([l,h])];case 3:return a.sent(),[4,l];case 4:return p=a.sent(),[3,6];case 5:throw d=a.sent(),v="fetch-client-network","AbortError"===d.name&&(v="fetch-timeout"),f.create(v,{originalErrorMessage:d.message});case 6:if(y=p.status,g=p.headers.get("ETag")||void 0,200!==p.status)return[3,11];_=void 0,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,p.json()];case 8:return _=a.sent(),[3,10];case 9:throw w=a.sent(),f.create("fetch-client-parse",{originalErrorMessage:w.message});case 10:m=_.entries,b=_.state,a.label=11;case 11:if("INSTANCE_STATE_UNSPECIFIED"===b?y=500:"NO_CHANGE"===b?y=304:"NO_TEMPLATE"!==b&&"EMPTY_CONFIG"!==b||(m={}),304!==y&&200!==y)throw f.create("fetch-status",{httpStatus:y});return[2,{status:y,eTag:g,config:m}]}var E}))}))},t}(),d=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)}
2,t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}(),v=["1","true","t","yes","y","on"],y=function(){function t(t,e){void 0===e&&(e=""),this._source=t,this._value=e}return t.prototype.asString=function(){return this._value},t.prototype.asBoolean=function(){return"static"!==this._source&&v.indexOf(this._value.toLowerCase())>=0},t.prototype.asNumber=function(){if("static"===this._source)return 0;var t=Number(this._value);return isNaN(t)&&(t=0),t},t.prototype.getSource=function(){return this._source},t}(),g=function(){function t(t,e,n,r,i){this.app=t,this._client=e,this._storageCache=n,this._storage=r,this._logger=i,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:6e4,minimumFetchIntervalMillis:432e5},this.defaultConfig={}}return t.prototype.setLogLevel=function(t){switch(t){case"debug":this._logger.logLevel=u.LogLevel.DEBUG;break;case"silent":this._logger.logLevel=u.LogLevel.SILENT;break;default:this._logger.logLevel=u.LogLevel.ERROR}},Object.defineProperty(t.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!0,configurable:!0}),t.prototype.activate=function(){return a.__awaiter(this,void 0,void 0,(function(){var t,e,n;return a.__generator(this,(function(r){switch(r.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return t=r.sent(),e=t[0],n=t[1],e&&e.config&&e.eTag&&e.eTag!==n?[4,Promise.all([this._storageCache.setActiveConfig(e.config),this._storage.setActiveConfigEtag(e.eTag)])]:[2,!1];case 2:return r.sent(),[2,!0]}}))}))},t.prototype.ensureInitialized=function(){var t=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then((function(){t._isInitializationComplete=!0}))),this._initializePromise},t.prototype.fetch=function(){return a.__awaiter(this,void 0,void 0,(function(){var t,e,n,r=this;return a.__generator(this,(function(i){switch(i.label){case 0:t=new d,setTimeout((function(){return a.__awaiter(r,void 0,void 0,(function(){return a.__generator(this,(function(e){return t.abort(),[2]}))}))}),this.settings.fetchTimeoutMillis),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,this._client.fetch({cacheMaxAgeMillis:this.settings.minimumFetchIntervalMillis,signal:t})];case 2:return i.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return i.sent(),[3,6];case 4:return e=i.sent(),u="fetch-throttle",n=(o=e)instanceof s.FirebaseError&&-1!==o.code.indexOf(u)?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(n)];case 5:throw i.sent(),e;case 6:return[2]}var o,u}))}))},t.prototype.fetchAndActivate=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return[4,this.fetch()];case 1:return t.sent(),[2,this.activate()]}}))}))},t.prototype.getAll=function(){var t=this;return function(t,e){void 0===t&&(t={});void 0===e&&(e={});return Object.keys(a.__assign(a.__assign({},t),e))}(this._storageCache.getActiveConfig(),this.defaultConfig).reduce((function(e,n){return e[n]=t.getValue(n),e}),{})},t.prototype.getBoolean=function(t){return this.getValue(t).asBoolean()},t.prototype.getNumber=function(t){return this.getValue(t).asNumber()},t.prototype.getString=function(t){return this.getValue(t).asString()},t.prototype.getValue=function(t){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+t+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var e=this._storageCache.getActiveConfig();return e&&void 0!==e[t]?new y("remote",e[t]):this.defaultConfig&&void 0!==this.defaultConfig[t]?new y("default",String(this.defaultConfig[t])):(this._logger.debug('Returning static value for key "'+t+'". Define a default or remote value if this is unintentional.'),new y("static"))},t}();function m(t,e){var n=t.target.error||void 0;return f.create(e,{originalErrorMessage:n&&n.message})}var b=function(){function t(t,e,n,r){void 0===r&&(r=new Promise((function(t,e){var n=indexedDB.open("firebase_remote_config",1);n.onerror=function(t){e(m(t,"storage-open"))},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;switch(t.oldVersion){case 0:e.createObjectStore("app_namespace_store",{keyPath:"compositeKey"})}}}))),this.appId=t,this.appName=e,this.namespace=n,this.openDbPromise=r}return t.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},t.prototype.setLastFetchStatus=function(t){return this.set("last_fetch_status",t)},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.set("last_successful_fetch_timestamp_millis",t)},t.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},t.prototype.setLastSuccessfulFetchResponse=function(t){return this.set("last_successful_fetch_response",t)},t.prototype.getActiveConfig=function(){return this.get("active_config")},t.prototype.setActiveConfig=function(t){return this.set("active_config",t)},t.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},t.prototype.setActiveConfigEtag=function(t){return this.set("active_config_etag",t)},t.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},t.prototype.setThrottleMetadata=function(t){return this.set("throttle_metadata",t)},t.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},t.prototype.get=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n=this;return a.__generator(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction(["app_namespace_store"],"readonly").objectStore("app_namespace_store"),a=n.createCompositeKey(t);try{var s=o.get(a);s.onerror=function(t){i(m(t,"storage-get"))},s.onsuccess=function(t){var e=t.target.result;r(e?e.value:void 0)}}catch(u){i(f.create("storage-get",{originalErrorMessage:u&&u.message}))}}))]}}))}))},t.prototype.set=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){var n,r=this;return a.__generator(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return n=i.sent(),[2,new Promise((function(i,o){var a=n.transaction(["app_namespace_store"],"readwrite").objectStore("app_namespace_store"),s=r.createCompositeKey(t);try{var u=a.put({compositeKey:s,value:e});u.onerror=function(t){o(m(t,"storage-set"))},u.onsuccess=function(){i()}}catch(c){o(f.create("storage-set",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.delete=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n=this;return a.__generator(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction(["app_namespace_store"],"readwrite").objectStore("app_namespace_store"),a=n.createCompositeKey(t);try{var s=o.delete(a);s.onerror=function(t){i(m(t,"storage-delete"))},s.onsuccess=function(){r()}}catch(u){i(f.create("storage-delete",{originalErrorMessage:u&&u.message}))}}))]}}))}))},t.prototype.createCompositeKey=function(t){return[this.appId,this.appName,this.namespace,t].join()},t}(),_=function(){function t(t){this.storage=t}return t.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},t.prototype.getActiveConfig=function(){return this.activeConfig},t.prototype.loadFromStorage=function(){return a.__awaiter(this,void 0,void 0,(function(){var t,e,n,r,i,o;return a.__generator(this,(function(a){switch(a.label){case 0:return t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),n=this.storage.getActiveConfig(),[4,t];case 1:return(r=a.sent())&&(this.lastFetchStatus=r),[4,e];case 2:return(i=a.sent())&&(this.lastSuccessfulFetchTimestampMillis=i),[4,n];case 3:return(o=a.sent())&&(this.activeConfig=o),[2]}}))}))},t.prototype.setLastFetchStatus=function(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)},t.prototype.setActiveConfig=function(t){return this.activeConfig=t,this.storage.setActiveConfig(t)},t}();function w(t){var e=1e3*Math.pow(2,t),n=Math.round(.5*e*(Math.random()-.5)*2);return Math.min(144e5,e+n)}function E(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(f.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}var T=function(){function t(t,e){this.client=t,this.storage=e}return t.prototype.fetch=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e;return a.__generator(this,(function(n){switch(n.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return e=n.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(t,e)]}}))}))},t.prototype.attemptFetch=function(t,e){var n=e.throttleEndTimeMillis,r=e.backoffCount;return a.__awaiter(this,void 0,void 0,(function(){var e,i,o;return a.__generator(this,(function(a){switch(a.label){case 0:return[4,E(t.signal,n)];case 1:a.sent(),a.label=2;case 2:return a.trys.push([2,5,,7]),[4,this.client.fetch(t)];case 3:return e=a.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return a.sent(),[2,e];case 5:if(!function(t){if(!(t instanceof s.FirebaseError))return!1;var e=Number(t.httpStatus);return 429===e||500===e||503===e||504===e}(i=a.sent()))throw i;return o={throttleEndTimeMillis:Date.now()+w(r),backoffCount:r+1},[4,this.storage.setThrottleMetadata(o)];case 6:return a.sent(),[2,this.attemptFetch(t,o)];case 7:return[2]}}
2))}))},t}(),I="@firebase/remote-config";function S(t){t.INTERNAL.registerComponent(new c.Component("remoteConfig",(function(e,n){var r=e.getProvider("app").getImmediate(),i=e.getProvider("installations").getImmediate();if("undefined"===typeof window)throw f.create("registration-window");var o=r.options,a=o.projectId,s=o.apiKey,c=o.appId;if(!a)throw f.create("registration-project-id");if(!s)throw f.create("registration-api-key");if(!c)throw f.create("registration-app-id");n=n||"firebase";var h=new b(c,r.name,n),d=new _(h),v=new u.Logger(I);v.logLevel=u.LogLevel.ERROR;var y=new p(i,t.SDK_VERSION,n,a,s,c),m=new T(y,h),w=new l(m,h,d,v),E=new g(r,w,d,h,v);return E.ensureInitialized(),E}),"PUBLIC").setMultipleInstances(!0)),t.registerVersion(I,"0.1.23")}S(i),e.registerRemoteConfig=S},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w}
2)),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return T})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return C}));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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){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){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}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 h(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(s){o=[6,s],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 f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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 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(s){i={error:s}}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(){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}function m(t){return this instanceof m?(this.v=t,this):new m(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function I(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function C(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n,r){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return I()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}t.wrap=s;var c={};function l(){}function h(){}function f(){}var p={};p[i]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(T([])));v&&v!==e&&n.call(v,i)&&(p=v);var y=f.prototype=l.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"===typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&
vendor: 4,560 bytes, line 2
2(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,c;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(t){if(t){var e=t[i];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=y.constructor=f,f.constructor=h,f[a]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[o]=function(){return this},t.AsyncIterator=m,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new m(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),y[a]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},,,function(t,e,n){"use strict";var r=n(7),i=n(29),o=n(69),a=n(35);function s(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n}var u=s(n(32));u.Axios=o,u.create=function(t){return s(a(u.defaults,t))}
vendor: 6,310 bytes, line 2
2,u.Cancel=n(36),u.CancelToken=n(82),u.isCancel=n(31),u.all=function(t){return Promise.all(t)},u.spread=n(83),t.exports=u,t.exports.default=u},function(t,e,n){"use strict";var r=n(7),i=n(30),o=n(70),a=n(71),s=n(35);function u(t){this.defaults=t,this.interceptors={request:new o,response:new o}}u.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[a,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},u.prototype.getUri=function(t){return t=s(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){u.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}})),r.forEach(["post","put","patch"],(function(t){u.prototype[t]=function(e,n,i){return this.request(r.merge(i||{},{method:t,url:e,data:n}))}})),t.exports=u},function(t,e,n){"use strict";var r=n(7);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(7),i=n(72),o=n(31),a=n(32);function s(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return s(t),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return s(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(s(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(7);t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},function(t,e,n){"use strict";var r=n(7);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";var r=n(34);t.exports=function(t,e,n){var i=n.config.validateStatus;!i||i(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var r=n(77),i=n(78);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(7),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,a={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(a[e]&&i.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},function(t,e,n){"use strict";var r=n(7);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(7);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(36);function i(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r=n(85);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i}
2;return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function E(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case h:case f:case a:case u:case s:case d:return t;default:switch(t=t&&t.$$typeof){case l:case p:case g:case y:case c:return t;default:return e}}case o:return e}}}function T(t){return E(t)===f}e.AsyncMode=h,e.ConcurrentMode=f,e.ContextConsumer=l,e.ContextProvider=c,e.Element=i,e.ForwardRef=p,e.Fragment=a,e.Lazy=g,e.Memo=y,e.Portal=o,e.Profiler=u,e.StrictMode=s,e.Suspense=d,e.isAsyncMode=function(t){return T(t)||E(t)===h},e.isConcurrentMode=T,e.isContextConsumer=function(t){return E(t)===l},e.isContextProvider=function(t){return E(t)===c},e.isElement=function(t){return"object"===typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return E(t)===p},e.isFragment=function(t){return E(t)===a},e.isLazy=function(t){return E(t)===g},e.isMemo=function(t){return E(t)===y},e.isPortal=function(t){return E(t)===o},e.isProfiler=function(t){return E(t)===u},e.isStrictMode=function(t){return E(t)===s},e.isSuspense=function(t){return E(t)===d},e.isValidElementType=function(t){return"string"===typeof t||"function"===typeof t||t===a||t===f||t===u||t===s||t===d||t===v||"object"===typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===y||t.$$typeof===c||t.$$typeof===l||t.$$typeof===p||t.$$typeof===b||t.$$typeof===_||t.$$typeof===w||t.$$typeof===m)},e.typeOf=E},,,function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=(n(19),n(5));var a=function(){return(a=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 s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 u(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(s){o=[6,s],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 c(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 l(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(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}var h,f=n(8),p=n(12),d=((h={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',h["only-available-in-window"]="This method is available in a Window context.",h["only-available-in-sw"]="This method is available in a service worker context.",h["permission-default"]="The notification permission was not granted and dismissed instead.",h["permission-blocked"]="The notification permission was not granted and blocked instead.",h["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",h["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",h["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$errorInfo}",h["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",h["token-unsubscribe-failed"]="A problem occured while unsubscribing the user from FCM: {$errorInfo}",h["token-update-failed"]="A problem occured while updating the user from FCM: {$errorInfo}",h["token-update-no-token"]="FCM returned no token when updating the user to push.",h["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",h["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",h["invalid-bg-handler"]="The input to setBackgroun
2dMessageHandler() must be a function.",h["invalid-vapid-key"]="The public VAPID key must be a string.",h["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",h),v=new f.ErrorFactory("messaging","Messaging",d);function y(t){return v.create("missing-app-config-values",{valueName:t})}function g(t){var e=new Uint8Array(t);return btoa(String.fromCharCode.apply(String,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}(e))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function m(t){for(var e=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}function b(t){return s(this,void 0,void 0,(function(){var e,n,r=this;return u(this,(function(i){switch(i.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(e=i.sent(),!e.map((function(t){return t.name})).includes("fcm_token_details_db"))return[2,null];i.label=2;case 2:return n=null,[4,Object(p.openDb)("fcm_token_details_db",5,(function(e){return s(r,void 0,void 0,(function(){var r,i,o,a;return u(this,(function(s){switch(s.label){case 0:return e.oldVersion<2?[2]:e.objectStoreNames.contains("fcm_token_object_Store")?[4,(r=e.transaction.objectStore("fcm_token_object_Store")).index("fcmSenderId").get(t)]:[2];case 1:return i=s.sent(),[4,r.clear()];case 2:if(s.sent(),!i)return[2];if(2===e.oldVersion){if(!(o=i).auth||!o.p256dh||!o.endpoint)return[2];n={token:o.fcmToken,createTime:null!==(a=o.createTime)&&void 0!==a?a:Date.now(),subscriptionOptions:{auth:o.auth,p256dh:o.p256dh,endpoint:o.endpoint,swScope:o.swScope,vapidKey:"string"===typeof o.vapidKey?o.vapidKey:g(o.vapidKey)}}}else(3===e.oldVersion||4===e.oldVersion)&&(n={token:(o=i).fcmToken,createTime:o.createTime,subscriptionOptions:{auth:g(o.auth),p256dh:g(o.p256dh),endpoint:o.endpoint,swScope:o.swScope,vapidKey:g(o.vapidKey)}});return[2]}}))}))}))];case 3:return i.sent().close(),[4,Object(p.deleteDb)("fcm_token_details_db")];case 4:return i.sent(),[4,Object(p.deleteDb)("fcm_vapid_details_db")];case 5:return i.sent(),[4,Object(p.deleteDb)("undefined")];case 6:return i.sent(),[2,_(n)?n:null]}}))}))}function _(t){if(!t||!t.subscriptionOptions)return!1;var e=t.subscriptionOptions;return"number"===typeof t.createTime&&t.createTime>0&&"string"===typeof t.token&&t.token.length>0&&"string"===typeof e.auth&&e.auth.length>0&&"string"===typeof e.p256dh&&e.p256dh.length>0&&"string"===typeof e.endpoint&&e.endpoint.length>0&&"string"===typeof e.swScope&&e.swScope.length>0&&"string"===typeof e.vapidKey&&e.vapidKey.length>0}var w="firebase-messaging-store",E=null;function T(){return E||(E=Object(p.openDb)("firebase-messaging-database",1,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(w)}}))),E}function I(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return e=k(t),[4,T()];case 1:return[4,i.sent().transaction(w).objectStore(w).get(e)];case 2:return(n=i.sent())?[2,n]:[3,3];case 3:return[4,b(t.appConfig.senderId)];case 4:return(r=i.sent())?[4,S(t,r)]:[3,6];case 5:return i.sent(),[2,r];case 6:return[2]}}
2))}))}function S(t,e){return s(this,void 0,void 0,(function(){var n,r,i;return u(this,(function(o){switch(o.label){case 0:return n=k(t),[4,T()];case 1:return r=o.sent(),[4,(i=r.transaction(w,"readwrite")).objectStore(w).put(e,n)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2,e]}}))}))}function C(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return e=k(t),[4,T()];case 1:return n=i.sent(),[4,(r=n.transaction(w,"readwrite")).objectStore(w).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function k(t){return t.appConfig.appId}var N="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4";function x(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a,s;return u(this,(function(u){switch(u.label){case 0:return[4,R(t)];case 1:n=u.sent(),r=D(e),i={method:"POST",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(O(t.appConfig),i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),v.create("token-subscribe-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,v.create("token-subscribe-failed",{errorInfo:s});if(!o.token)throw v.create("token-subscribe-no-token");return[2,o.token]}}))}))}function P(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a,s;return u(this,(function(u){switch(u.label){case 0:return[4,R(t)];case 1:n=u.sent(),r=D(e.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(O(t.appConfig)+"/"+e.token,i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),v.create("token-update-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,v.create("token-update-failed",{errorInfo:s});if(!o.token)throw v.create("token-update-no-token");return[2,o.token]}}))}))}function A(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a;return u(this,(function(s){switch(s.label){case 0:return[4,R(t)];case 1:n=s.sent(),r={method:"DELETE",headers:n},s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(O(t.appConfig)+"/"+e,r)];case 3:return[4,s.sent().json()];case 4:if((i=s.sent()).error)throw o=i.error.message,v.create("token-unsubscribe-failed",{errorInfo:o});return[3,6];case 5:throw a=s.sent(),v.create("token-unsubscribe-failed",{errorInfo:a});case 6:return[2]}}
2))}))}function O(t){return"https://fcmregistrations.googleapis.com/v1/projects/"+t.projectId+"/registrations"}function R(t){var e=t.appConfig,n=t.installations;return s(this,void 0,void 0,(function(){var t;return u(this,(function(r){switch(r.label){case 0:return[4,n.getToken()];case 1:return t=r.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":"FIS "+t})]}}))}))}function D(t){var e=t.p256dh,n=t.auth,r=t.endpoint,i=t.vapidKey,o={web:{endpoint:r,auth:n,p256dh:e}};return i!==N&&(o.web.applicationPubKey=i),o}var L;function M(t,e,n){return s(this,void 0,void 0,(function(){var r,i,o,a;return u(this,(function(s){switch(s.label){case 0:if("granted"!==Notification.permission)throw v.create("permission-blocked");return[4,V(e,n)];case 1:return r=s.sent(),[4,I(t)];case 2:return i=s.sent(),o={vapidKey:n,swScope:e.scope,endpoint:r.endpoint,auth:g(r.getKey("auth")),p256dh:g(r.getKey("p256dh"))},i?[3,3]:[2,U(t,o)];case 3:if(function(t,e){var n=e.vapidKey===t.vapidKey,r=e.endpoint===t.endpoint,i=e.auth===t.auth,o=e.p256dh===t.p256dh;return n&&r&&i&&o}(i.subscriptionOptions,o))return[3,8];s.label=4;case 4:return s.trys.push([4,6,,7]),[4,A(t,i.token)];case 5:return s.sent(),[3,7];case 6:return a=s.sent(),console.warn(a),[3,7];case 7:return[2,U(t,o)];case 8:return Date.now()>=i.createTime+6048e5?[2,j({token:i.token,createTime:Date.now(),subscriptionOptions:o},t,e)]:[2,i.token];case 9:return[2]}}
2))}))}function F(t,e){return s(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,I(t)];case 1:return(n=i.sent())?[4,A(t,n.token)]:[3,4];case 2:return i.sent(),[4,C(t)];case 3:i.sent(),i.label=4;case 4:return[4,e.pushManager.getSubscription()];case 5:return(r=i.sent())?[2,r.unsubscribe()]:[2,!0]}}))}))}function j(t,e,n){return s(this,void 0,void 0,(function(){var r,i,o;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,5]),[4,P(e,t)];case 1:return r=s.sent(),i=a({token:r,createTime:Date.now()},t),[4,S(e,i)];case 2:return s.sent(),[2,r];case 3:return o=s.sent(),[4,F(e,n)];case 4:throw s.sent(),o;case 5:return[2]}}))}))}function U(t,e){return s(this,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return[4,x(t,e)];case 1:return n=i.sent(),r={token:n,createTime:Date.now(),subscriptionOptions:e},[4,S(t,r)];case 2:return i.sent(),[2,r.token]}}))}))}function V(t,e){return s(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return[4,t.pushManager.getSubscription()];case 1:return(n=r.sent())?[2,n]:[2,t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:m(e)})]}}))}))}function q(t){return"object"===typeof t&&!!t&&"google.c.a.c_id"in t}!function(t){t.PUSH_RECEIVED="push-received",t.NOTIFICATION_CLICKED="notification-clicked"}(L||(L={}));var B=function(){function t(t){var e=this;this.firebaseDependencies=t,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",(function(t){return e.messageEventListener(t)}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!0,configurable:!0}),t.prototype.getToken=function(){return s(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return this.vapidKey||(this.vapidKey=N),[4,this.getServiceWorkerRegistration()];case 1:return t=e.sent(),"default"!==Notification.permission?[3,3]:[4,Notification.requestPermission()];case 2:e.sent(),e.label=3;case 3:if("granted"!==Notification.permission)throw v.create("permission-blocked");return[2,M(this.firebaseDependencies,t,this.vapidKey)]}}))}))},t.prototype.deleteToken=function(){return s(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return t=e.sent(),[2,F(this.firebaseDependencies,t)]}}))}))},t.prototype.requestPermission=function(){return s(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(t=e.sent()))return[2];throw"denied"===t?v.create("permission-blocked"):v.create("permission-default")}}))}))},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw v.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw v.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(t){if(!(t instanceof ServiceWorkerRegistration))throw v.create("invalid-sw-registration");if(this.swRegistration)throw v.create("use-sw-after-get-token");this.swRegistration=t},t.prototype.onMessage=function(t){var e=this;return this.onMessageCallback="function"===typeof t?t:t.next,function(){e.onMessageCallback=null}},t.prototype.setBackgroundMessageHandler=function(){throw v.create("only-available-in-sw")},t.prototype.onTokenRefresh=function(){return function(){}},t.prototype.getServiceWorkerRegistration=function(){return s(this,void 0,void 0,(function(){var t,e;return u(this,(function(n){switch(n.label){case 0:if(this.swRegistration)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),t=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 2:return t.swRegistration=n.sent(),this.swRegistration.update().catch((function(){})),[3,4];case 3:throw e=n.sent(),v.create("failed-service-worker-registration",{browserErrorMessage:e.message});case 4:return[2,this.swRegistration]}}))}))},t.prototype.messageEventListener=function(t){var e;return s(this,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(a){switch(a.label){case 0:return(null===(e=t.data)||void 0===e?void 0:e.firebaseMessaging)?(n=t.data.firebaseMessaging,r=n.type,i=n.payload,this.onMessageCallback&&r===L.PUSH_RECEIVED&&this.onMessageCallback(i),q(o=i.data)&&"1"===o["google.c.a.e"]?[4,this.logEvent(r,o)]:[3,2]):[2];case 1:a.sent(),a.label=2;case 2:return[2]}}
2))}))},t.prototype.logEvent=function(t,e){return s(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return n=function(t){switch(t){case L.NOTIFICATION_CLICKED:return"notification_open";case L.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return r.sent().logEvent(n,{message_id:e["google.c.a.c_id"],message_name:e["google.c.a.c_l"],message_time:e["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}}))}))},t}();var W=function(){function t(t){var e=this;this.firebaseDependencies=t,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",(function(t){t.waitUntil(e.onPush(t))})),self.addEventListener("pushsubscriptionchange",(function(t){t.waitUntil(e.onSubChange(t))})),self.addEventListener("notificationclick",(function(t){t.waitUntil(e.onNotificationClick(t))}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!0,configurable:!0}),t.prototype.setBackgroundMessageHandler=function(t){if(!t||"function"!==typeof t)throw v.create("invalid-bg-handler");this.bgMessageHandler=t},t.prototype.getToken=function(){var t,e;return s(this,void 0,void 0,(function(){var n;return u(this,(function(r){switch(r.label){case 0:return this.vapidKey?[3,2]:[4,I(this.firebaseDependencies)];case 1:n=r.sent(),this.vapidKey=null!==(e=null===(t=null===n||void 0===n?void 0:n.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==e?e:N,r.label=2;case 2:return[2,M(this.firebaseDependencies,self.registration,this.vapidKey)]}}))}))},t.prototype.deleteToken=function(){return F(this.firebaseDependencies,self.registration)},t.prototype.requestPermission=function(){throw v.create("only-available-in-window")},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw v.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw v.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(){throw v.create("only-available-in-window")},t.prototype.onMessage=function(){throw v.create("only-available-in-window")},t.prototype.onTokenRefresh=function(){throw v.create("only-available-in-window")},t.prototype.onPush=function(t){return s(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return(e=function(t){var e=t.data;if(!e)return null;try{return e.json()}catch(n){return null}}(t))?[4,G()]:[2];case 1:return function(t){return t.some((function(t){return"visible"===t.visibilityState&&!t.url.startsWith("chrome-extension://")}))}(n=i.sent())?[2,H(n,e)]:(r=function(t){var e;if(!t||"object"!==typeof t.notification)return;var n=a({},t.notification);return n.data=a(a({},t.notification.data),((e={}).FCM_MSG=t,e)),n}(e))?[4,Q(r)]:[3,3];case 2:return i.sent(),[3,5];case 3:return this.bgMessageHandler?[4,this.bgMessageHandler(e)]:[3,5];case 4:i.sent(),i.label=5;case 5:return[2]}}
2))}))},t.prototype.onSubChange=function(t){var e,n;return s(this,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:return t.newSubscription?[3,2]:[4,F(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,I(this.firebaseDependencies)];case 3:return r=i.sent(),[4,F(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,M(this.firebaseDependencies,self.registration,null!==(n=null===(e=null===r||void 0===r?void 0:r.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==n?n:N)];case 5:return i.sent(),[2]}}))}))},t.prototype.onNotificationClick=function(t){var e,n;return s(this,void 0,void 0,(function(){var r,i,o,a;return u(this,(function(s){switch(s.label){case 0:return(r=null===(n=null===(e=t.notification)||void 0===e?void 0:e.data)||void 0===n?void 0:n.FCM_MSG)?t.action?[2]:(t.stopImmediatePropagation(),t.notification.close(),(i=function(t){var e,n,r,i=null!==(n=null===(e=t.fcmOptions)||void 0===e?void 0:e.link)&&void 0!==n?n:null===(r=t.notification)||void 0===r?void 0:r.click_action;if(i)return i;return q(t.data)?self.location.origin:null}(r))?[4,z(i)]:[2]):[2];case 1:return(o=s.sent())?[3,4]:[4,self.clients.openWindow(i)];case 2:return o=s.sent(),[4,(u=3e3,new Promise((function(t){setTimeout(t,u)})))];case 3:return s.sent(),[3,6];case 4:return[4,o.focus()];case 5:o=s.sent(),s.label=6;case 6:return o?(a=K(L.NOTIFICATION_CLICKED,r),[2,o.postMessage(a)]):[2]}var u}))}))},t}();function z(t){return s(this,void 0,void 0,(function(){var e,n,r,i,o,a,s;return u(this,(function(u){switch(u.label){case 0:return e=new URL(t,self.location.href),[4,G()];case 1:n=u.sent();try{for(r=c(n),i=r.next();!i.done;i=r.next())if(o=i.value,new URL(o.url,self.location.href).host===e.host)return[2,o]}catch(l){a={error:l}}finally{try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}return[2,null]}}))}))}function H(t,e){var n,r,i=K(L.PUSH_RECEIVED,e);try{for(var o=c(t),a=o.next();!a.done;a=o.next()){a.value.postMessage(i)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function G(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function K(t,e){return{firebaseMessaging:{type:t,payload:e}}}function Q(t){var e,n=null!==(e=t.title)&&void 0!==e?e:"",r=t.actions,i=Notification.maxActions;return r&&i&&r.length>i&&console.warn("This browser only supports "+i+" actions. The remaining actions will not be displayed."),self.registration.showNotification(n,t)}var Y={isSupported:X};function X(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}i.a.INTERNAL.registerComponent(new o.Component("messaging",(function(t){var e=t.getProvider("app").getImmediate(),n={app:e,appConfig:function(t){var e,n;if(!t||!t.options)throw y("App Configuration Object");if(!t.name)throw y("App Name");var r=t.options;try{for(var i=c(["projectId","apiKey","appId","messagingSenderId"]),o=i.next();!o.done;o=i.next()){var a=o.value;if(!r[a])throw y(a)}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{appName:t.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(e),installations:t.getProvider("installations").getImmediate(),analyticsProvider:t.getProvider("analytics-internal")};if(!X())throw v.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new W(n):new B(n)}),"PUBLIC").setServiceProps(Y))},function(t,e,n){"use strict";n.r(e),n.d(e,"registerStorage",(function(){return ye}));var r=n(1),i=n.n(r);
2function o(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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 a(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(s){o=[6,s],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 s(){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 u=n(5),c=function(){function t(t,e){this.code_=N(t),this.message_="Firebase Storage: "+e,this.serverResponse_=null,this.name_="FirebaseError"}return t.prototype.codeProp=function(){return this.code},t.prototype.codeEquals=function(t){return N(t)===this.codeProp()},t.prototype.serverResponseProp=function(){return this.serverResponse_},t.prototype.setServerResponseProp=function(t){this.serverResponse_=t},Object.defineProperty(t.prototype,"name",{get:function(){return this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"code",{get:function(){return this.code_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.message_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.serverResponse_},enumerable:!0,configurable:!0}),t}(),l="unknown",h="object-not-found",f="quota-exceeded",p="unauthenticated",d="unauthorized",v="retry-limit-exceeded",y="canceled",g="invalid-url",m="invalid-default-bucket",b="cannot-slice-blob",_="server-file-wrong-size",w="no-download-url",E="invalid-argument",T="invalid-argument-count",I="app-deleted",S="invalid-root-operation",C="invalid-format",k="internal-error";function N(t){return"storage/"+t}function x(){return new c(l,"An unknown error occurred, please check the error payload for server response.")}function P(){return new c(y,"User canceled the upload/download.")}function A(){return new c(b,"Cannot slice blob for upload. Please retry the upload.")}function O(){return new c(w,"The given file does not have any download URLs.")}function R(t,e,n){return new c(E,"Invalid argument in `"+e+"` at index "+t+": "+n)}function D(){return new c(I,"The Firebase app was deleted.")}function L(t,e){return new c(C,"String does not match format '"+t+"': "+e)}function M(t){throw new c(k,"Internal error: "+t)}var F={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};function j(t){switch(t){case F.RAW:case F.BASE64:case F.BASE64URL:case F.DATA_URL:return;default:throw"Expected one of the event types: ["+F.RAW+", "+F.BASE64+", "+F.BASE64URL+", "+F.DATA_URL+"]."}}var U=function(t,e){this.data=t,this.contentType=e||null};function V(t,e){switch(t){case F.RAW:return new U(q(e));case F.BASE64:case F.BASE64URL:return new U(B(t,e));case F.DATA_URL:return new U(function(t){var e=new W(t);return e.base64?B(F.BASE64,e.rest):function(t){var e;try{e=decodeURIComponent(t)}catch(n){throw L(F.DATA_URL,"Malformed data URL.")}return q(e)}(e.rest)}(e),new W(e).contentType)}throw x()}function q(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296===(64512&r))if(n<t.length-1&&56320===(64512&t.charCodeAt(n+1)))r=65536|(1023&r)<<10|1023&t.charCodeAt(++n),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r);else e.push(239,191,189);else 56320===(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function B(t,e){switch(t){case F.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r)throw L(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break;case F.BASE64URL:var i=-1!==e.indexOf("+"),o=-1!==e.indexOf("/");if(i||o)throw L(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}var a;try{a=atob(e)}catch(c){throw L(t,"Invalid character found")}for(var s=new Uint8Array(a.length),u=0;u<a.length;
2u++)s[u]=a.charCodeAt(u);return s}var W=function(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw L(F.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=(r=n,i=";base64",r.length>=i.length&&r.substring(r.length-i.length)===i),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=t.substring(t.indexOf(",")+1);var r,i};var z,H={STATE_CHANGED:"state_changed"},G="running",K="pausing",Q="paused",Y="success",X="canceling",$="canceled",J="error",Z={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function tt(t){switch(t){case G:case K:case X:return Z.RUNNING;case Q:return Z.PAUSED;case Y:return Z.SUCCESS;case $:return Z.CANCELED;case J:default:return Z.ERROR}}function et(t){return null!=t}function nt(t){return void 0!==t}function rt(t){return"function"===typeof t}function it(t){return"object"===typeof t}function ot(t){return it(t)&&null!==t}function at(t){return"string"===typeof t||t instanceof String}function st(t){return ut(t)&&Number.isInteger(t)}function ut(t){return"number"===typeof t||t instanceof Number}function ct(t){return lt()&&t instanceof Blob}function lt(){return"undefined"!==typeof Blob}!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(z||(z={}));var ht=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=z.NO_ERROR,this.sendPromise_=new Promise((function(e){t.xhr_.addEventListener("abort",(function(){t.errorCode_=z.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(){t.errorCode_=z.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(){e(t)}))}))}return t.prototype.send=function(t,e,n,r){if(this.sent_)throw M("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(e,t,!0),et(r))for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return et(n)?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw M("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw M("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw M("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){et(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){et(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",t)},t}(),ft=function(){function t(){}return t.prototype.createXhrIo=function(){return new ht},t}();function pt(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function dt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=pt();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(lt())return new Blob(t);throw Error("This browser doesn't seem to support creating Blobs")}var vt=function(){function t(t,e){var n=0,r="";ct(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(ct(this.data_)){var r=function(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}(this.data_,e,n);return null===r?null:new t(r)}return new t(new Uint8Array(this.data_.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(lt()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(dt.apply(null,r))}var i=e.map((function(t){return at(t)?V(F.RAW,t).data:t.data_})),o=0;
2i.forEach((function(t){o+=t.byteLength}));var a=new Uint8Array(o),s=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)a[s++]=t[e]})),new t(a,!0)},t.prototype.uploadData=function(){return this.data_},t}(),yt=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!0,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(r){return new t(e,"")}if(""===n.path)return n;throw new c(m,"Invalid default bucket '"+e+"'.")},t.makeFromUrl=function(e){var n=null;var r=new RegExp("^gs://([A-Za-z0-9.\\-_]+)(/(.*))?$","i");function i(t){t.path_=decodeURIComponent(t.path)}for(var o="firebasestorage.googleapis.com".replace(/[.]/g,"\\."),a=[{regex:r,indices:{bucket:1,path:3},postModify:function(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}},{regex:new RegExp("^https?://"+o+"/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-_]+)/o(/([^?#]*).*)?$","i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp("^https?://(?:storage.googleapis.com|storage.cloud.google.com)/([A-Za-z0-9.\\-_]+)/([^?#]*)","i"),indices:{bucket:1,path:2},postModify:i}],s=0;s<a.length;s++){var u=a[s],l=u.regex.exec(e);if(l){var h=l[u.indices.bucket],f=l[u.indices.path];f||(f=""),n=new t(h,f),u.postModify(n);break}}if(null==n)throw function(t){return new c(g,"Invalid URL '"+t+"'.")}(e);return n},t}();function gt(t){var e,n;try{e=JSON.parse(t)}catch(r){return null}return it(n=e)&&!Array.isArray(n)?e:null}function mt(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}function bt(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function _t(t){return"https://firebasestorage.googleapis.com/v0"+t}function wt(t){var e=encodeURIComponent,n="?";for(var r in t){if(t.hasOwnProperty(r))n=n+(e(r)+"="+e(t[r]))+"&"}return n=n.slice(0,-1)}function Et(t,e){return e}var Tt=function(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||Et},It=null;function St(){if(It)return It;var t=[];t.push(new Tt("bucket")),t.push(new Tt("generation")),t.push(new Tt("metageneration")),t.push(new Tt("name","fullPath",!0));var e=new Tt("name");e.xform=function(t,e){return function(t){return!at(t)||t.length<2?t:bt(t)}(e)},t.push(e);var n=new Tt("size");return n.xform=function(t,e){return et(e)?Number(e):e},t.push(n),t.push(new Tt("timeCreated")),t.push(new Tt("updated")),t.push(new Tt("md5Hash",null,!0)),t.push(new Tt("cacheControl",null,!0)),t.push(new Tt("contentDisposition",null,!0)),t.push(new Tt("contentEncoding",null,!0)),t.push(new Tt("contentLanguage",null,!0)),t.push(new Tt("contentType",null,!0)),t.push(new Tt("metadata","customMetadata",!0)),It=t}function Ct(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var a=n[o];r[a.local]=a.xform(r,e[a.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){var n=t.bucket,r=t.fullPath,i=new yt(n,r);return e.makeStorageReference(i)}})}(r,t),r}function kt(t,e,n){var r=gt(e);return null===r?null:Ct(t,r,n)}function Nt(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}function xt(t){if(!it(t)||!t)throw"Expected Metadata object.";for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if("customMetadata"===e){if(!it(n))throw"Expected object for 'customMetadata' mapping."}else if(ot(n))throw"Mapping for '"+e+"' cannot be an object."}}function Pt(t,e,n){var r=gt(n);return null===r?null:function(t,e,n){var r={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n.prefixes)for(var i=0,o=n.prefixes;i<o.length;i++){var a=o[i].replace(/\/$/,""),s=t.makeStorageReference(new yt(e,a));r.prefixes.push(s)}if(n.items)for(var u=0,c=n.items;u<c.length;u++){var l=c[u];s=t.makeStorageReference(new yt(e,l.name));r.items.push(s)}return r}(t,e,r)}function At(t){if(!it(t)||!t)throw"Expected ListOptions object.";for(var e in t)if("maxResults"===e){if(!st(t.maxResults)||t.maxResults<=0)throw"Expected maxResults to be a positive number.";if(t.maxResults>1e3)throw"Expected maxResults to be less than or equal to 1000."}else{if("pageToken"!==e)throw"Unknown option: "+e;if(t.pageToken&&!at(t.pageToken))throw"Expected pageToken to be string."}}var Ot=function(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParam
2s={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]};function Rt(t){if(!t)throw x()}function Dt(t,e){return function(n,r){var i=kt(t,r,e);return Rt(null!==i),i}}function Lt(t,e){return function(n,r){var i=kt(t,r,e);return Rt(null!==i),function(t,e){var n=gt(e);if(null===n)return null;if(!at(n.downloadTokens))return null;var r=n.downloadTokens;if(0===r.length)return null;var i=encodeURIComponent;return r.split(",").map((function(e){var n=t.bucket,r=t.fullPath;return _t("/b/"+i(n)+"/o/"+i(r))+wt({alt:"media",token:e})}))[0]}(i,r)}}function Mt(t){return function(e,n){var r,i,o;return 401===e.getStatus()?r=new c(p,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(o=t.bucket,r=new c(f,"Quota for bucket '"+o+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(i=t.path,r=new c(d,"User does not have permission to access '"+i+"'.")):r=n,r.setServerResponseProp(n.serverResponseProp()),r}}function Ft(t){var e=Mt(t);return function(n,r){var i,o=e(n,r);return 404===n.getStatus()&&(i=t.path,o=new c(h,"Object '"+i+"' does not exist.")),o.setServerResponseProp(r.serverResponseProp()),o}}function jt(t,e,n){var r=_t(e.fullServerUrl()),i=t.maxOperationRetryTime(),o=new Ot(r,"GET",Dt(t,n),i);return o.errorHandler=Ft(e),o}function Ut(t,e,n,r,i){var o={};e.isRoot?o.prefix="":o.prefix=e.path+"/",n&&n.length>0&&(o.delimiter=n),r&&(o.pageToken=r),i&&(o.maxResults=i);var a=_t(e.bucketOnlyServerUrl()),s=t.maxOperationRetryTime(),u=new Ot(a,"GET",function(t,e){return function(n,r){var i=Pt(t,e,r);return Rt(null!==i),i}}(t,e.bucket),s);return u.urlParams=o,u.errorHandler=Mt(e),u}function Vt(t,e,n){var r=_t(e.fullServerUrl()),i=t.maxOperationRetryTime(),o=new Ot(r,"GET",Lt(t,n),i);return o.errorHandler=Ft(e),o}function qt(t,e,n,r){var i=_t(e.fullServerUrl()),o=Nt(n,r),a=t.maxOperationRetryTime(),s=new Ot(i,"PATCH",Dt(t,r),a);return s.headers={"Content-Type":"application/json; charset=utf-8"},s.body=o,s.errorHandler=Ft(e),s}function Bt(t,e){var n=_t(e.fullServerUrl()),r=t.maxOperationRetryTime();var i=new Ot(n,"DELETE",(function(t,e){}),r);return i.successCodes=[200,204],i.errorHandler=Ft(e),i}function Wt(t,e,n){var r=Object.assign({},n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=function(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}(null,e)),r}var zt=function(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null};function Ht(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(r){Rt(!1)}return Rt(!!n&&-1!==(e||["active"]).indexOf(n)),n}function Gt(t,e,n,r,i,o,a,s){var u=new zt(0,0);if(a?(u.current=a.current,u.total=a.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw new c(_,"Server recorded incorrect upload file size, please retry the upload.");var l=u.total-u.current,h=l;i>0&&(h=Math.min(h,i));var f=u.current,p=f+h,d={"X-Goog-Upload-Command":h===l?"upload, finalize":"upload","X-Goog-Upload-Offset":u.current},v=r.slice(f,p);if(null===v)throw A();var y=e.maxUploadRetryTime(),g=new Ot(n,"POST",(function(t,n){var i,a=Ht(t,["active","final"]),s=u.current+h,c=r.size();return i="final"===a?Dt(e,o)(t,n):null,new zt(s,c,"final"===a,i)}),y);return g.headers=d,g.body=v.uploadData(),g.progressCallback=s||null,g.errorHandler=Mt(t),g}var Kt=function(t,e,n){if(rt(t)||et(e)||et(n))this.next=t,this.error=e||null,this.complete=n||null;else{var r=t;this.next=r.next||null,this.error=r.error||null,this.complete=r.complete||null}},Qt=function(t,e,n,r,i,o){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=i,this.ref=o};function Yt(t,e,n){for(var r=e.length,i=e.length,o=0;o<e.length;o++)if(e[o].optional){r=o;break}if(!(r<=n.length&&n.length<=i))throw function(t,e,n,r){var i,o;return t===e?(i=t,o=1===t?"argument":"arguments"):(i="between "+t+" and "+e,o="arguments"),new c(T,"Invalid argument count in `"+n+"`: Expected "+i+" "+o+", received "+r+".")}(r,i,t,n.length);for(o=0;o<n.length;o++)try{e[o].validator(n[o])}catch(a){throw a instanceof Error?R(o,t,a.message):R(o,t,a)}}var Xt=function(t,e){var n=this;this.validator=function(e){n.optional&&!nt(e)||t(e)},this.optional=!!e};function $t(t,e){function n(t){if(!at(t))throw"Expected string."}var r,i,o;return t?(i=n,o=t,r=function(t){i(t),o(t)}):r=n,new Xt(r,e)}function Jt(){return new Xt((function(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||lt()&&t instanceof Blob))throw"Expected Blob or File."}))}function Zt(t){return new Xt(xt,t)}function te(t){return new Xt(At,t)}function ee(){return new Xt((function(t){if(!(ut(t)&&t>=0))throw"Expected a number 0 or greater."}))}function ne(t,e){return new Xt((function(e){if(!(null===e||et(e)&&e instanceof Object))throw"Expected an Object.";void 0!==t&&null!==t&&t(e)}),e)}function re(t){return new Xt((function(t){if(!(null===t||rt(t)))throw"Expected a Function."}),t)}function ie(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Promise.resolve().then((function(){return t.apply(void 0,e)}))}}var oe=function(){function t(t,e,n,r,i,o){var a=this;void 0===o&&(o=null),this.transferred_=0,this.needToFetchStatus_=!1,this.needToFetchMetadata_=!1,this.observers_=[],this.error_=null,this.uploadUrl_=null,this.request_=null,this.chunkMultiplier_=1,this.resolve_=null,this.reject_=null,this.ref_=t,this.authWrapper_=e,this.location_=n,this.blob_=i,this.metadata_=o,this.mappings_=r,this.resumable_=this.shouldDoResumable_(this.blob_),this.state_=G,this.errorHandler_=function(t){a.request_=null,a.chunkMultiplier_=1,t.codeEquals(y)?(a.needToFetchStatus_=!0,a.completeTransitions_()):(a.error_=t,a.transition_(J))},this.metadataErrorHandler_=function(t){a.request_=null,t.codeEquals(y)?a.completeTransitions_():(a.error_=t,a.transition_(J))},this.promise_=new Promise((function(t,e){a.resolve_=t,a.reject_=e,a.start_()}
2)),this.promise_.then(null,(function(){}))}return t.prototype.makeProgressCallback_=function(){var t=this,e=this.transferred_;return function(n){return t.updateProgress_(e+n)}},t.prototype.shouldDoResumable_=function(t){return t.size()>262144},t.prototype.start_=function(){this.state_===G&&null===this.request_&&(this.resumable_?null===this.uploadUrl_?this.createResumable_():this.needToFetchStatus_?this.fetchStatus_():this.needToFetchMetadata_?this.fetchMetadata_():this.continueUpload_():this.oneShotUpload_())},t.prototype.resolveToken_=function(t){var e=this;this.authWrapper_.getAuthToken().then((function(n){switch(e.state_){case G:t(n);break;case X:e.transition_($);break;case K:e.transition_(Q)}}))},t.prototype.createResumable_=function(){var t=this;this.resolveToken_((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a=Wt(e,r,i),s={name:a.fullPath},u=_t(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=Nt(a,n),h=t.maxUploadRetryTime(),f=new Ot(u,"POST",(function(t){var e;Ht(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(n){Rt(!1)}return Rt(at(e)),e}),h);return f.urlParams=s,f.headers=c,f.body=l,f.errorHandler=Mt(e),f}(t.authWrapper_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.uploadUrl_=e,t.needToFetchStatus_=!1,t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.fetchStatus_=function(){var t=this,e=this.uploadUrl_;this.resolveToken_((function(n){var r=function(t,e,n,r){var i=t.maxUploadRetryTime(),o=new Ot(n,"POST",(function(t){var e=Ht(t,["active","final"]),n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(o){Rt(!1)}n||Rt(!1);var i=Number(n);return Rt(!isNaN(i)),new zt(i,r.size(),"final"===e)}),i);return o.headers={"X-Goog-Upload-Command":"query"},o.errorHandler=Mt(e),o}(t.authWrapper_,t.location_,e,t.blob_),i=t.authWrapper_.makeRequest(r,n);t.request_=i,i.getPromise().then((function(e){e=e,t.request_=null,t.updateProgress_(e.current),t.needToFetchStatus_=!1,e.finalized&&(t.needToFetchMetadata_=!0),t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.continueUpload_=function(){var t=this,e=262144*this.chunkMultiplier_,n=new zt(this.transferred_,this.blob_.size()),r=this.uploadUrl_;this.resolveToken_((function(i){var o;try{o=Gt(t.location_,t.authWrapper_,r,t.blob_,e,t.mappings_,n,t.makeProgressCallback_())}catch(s){return t.error_=s,void t.transition_(J)}var a=t.authWrapper_.makeRequest(o,i);t.request_=a,a.getPromise().then((function(e){t.increaseMultiplier_(),t.request_=null,t.updateProgress_(e.current),e.finalized?(t.metadata_=e.metadata,t.transition_(Y)):t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.increaseMultiplier_=function(){262144*this.chunkMultiplier_<33554432&&(this.chunkMultiplier_*=2)},t.prototype.fetchMetadata_=function(){var t=this;this.resolveToken_((function(e){var n=jt(t.authWrapper_,t.location_,t.mappings_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.transition_(Y)}),t.metadataErrorHandler_)}))},t.prototype.oneShotUpload_=function(){var t=this;this.resolveToken_((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},s=function(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();a["Content-Type"]="multipart/related; boundary="+s;var u=Wt(e,r,i),c="--"+s+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Nt(u,n)+"\r\n--"+s+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",l="\r\n--"+s+"--",h=vt.getBlob(c,r,l);if(null===h)throw A();var f={name:u.fullPath},p=_t(o),d=t.maxUploadRetryTime(),v=new Ot(p,"POST",Dt(t,n),d);return v.urlParams=f,v.headers=a,v.body=h.uploadData(),v.errorHandler=Mt(e),v}(t.authWrapper_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.updateProgress_(t.blob_.size()),t.transition_(Y)}),t.errorHandler_)}))},t.prototype.updateProgress_=function(t){var e=this.transferred_;this.transferred_=t,this.transferred_!==e&&this.notifyObservers_()},t.prototype.transition_=function(t){if(this.state_!==t)switch(t){case X:case K:this.state_=t,null!==this.request_&&this.request_.cancel();break;case G:var e=this.state_===Q;this.state_=t,e&&(this.notifyObservers_(),this.start_());break;case Q:this.state_=t,this.notifyObservers_();break;case $:this.error_=P(),this.state_=t,this.notifyObservers_();break;case J:case Y:this.state_=t,this.notifyObservers_()}},t.prototype.completeTransitions_=function(){switch(this.state_){case K:this.transition_(Q);break;case X:this.transition_($);break;case G:this.start_()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=tt(this.state_);return new Qt(this.transferred_,this.blob_.size(),t,this.metadata_,this,this.ref_)},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e,n,r){function i(){if(t!==H.STATE_CHANGED)throw"Expected one of the event types: ["+H.STATE_CHANGED+"]."}var o="Expected a function or an Object with one of `next`, `error`, `complete` properties.",a=re(!0).validator,s=ne(null,!0).validator;function u(t){try{return void a(t)}catch(e){}try{if(s(t),!(nt(t.next)||nt(t.error)||nt(t.complete)))throw"";return}catch(e){throw o}}var c=[$t(i),ne(u,!0),re(!0),re(!0)];Yt("on",c,arguments);var l=this;function h(t){return function(e,n,i){null!==t&&Yt("on",t,arguments);var o=new Kt(e,n,r);return l.addObserver_(o),function(){l.removeObserver_(o)}}}function f(t){if(null===t)throw o;u(t)}var p=[ne(f),re(!0),re(!0)],d=!(nt(e)||nt(n)||nt(r));return d?h(p):h(null)(e,n,r)},t.prototype.then=function(t,e){return this.promise_.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype.addObserver_=function(t){this.observers_.push(t),this.notifyObserver_(t)},t.prototype.removeObserver_=function(t){var e=this.observers_.indexOf(t);-1!==e&&this.observers_.splice(e,1)},t.prototype.notifyObservers_=function(){var t=this;
2this.finishPromise_(),this.observers_.slice().forEach((function(e){t.notifyObserver_(e)}))},t.prototype.finishPromise_=function(){if(null!==this.resolve_){var t=!0;switch(tt(this.state_)){case Z.SUCCESS:ie(this.resolve_.bind(null,this.snapshot))();break;case Z.CANCELED:case Z.ERROR:ie(this.reject_.bind(null,this.error_))();break;default:t=!1}t&&(this.resolve_=null,this.reject_=null)}},t.prototype.notifyObserver_=function(t){switch(tt(this.state_)){case Z.RUNNING:case Z.PAUSED:t.next&&ie(t.next.bind(t,this.snapshot))();break;case Z.SUCCESS:t.complete&&ie(t.complete.bind(t))();break;case Z.CANCELED:case Z.ERROR:t.error&&ie(t.error.bind(t,this.error_))();break;default:t.error&&ie(t.error.bind(t,this.error_))()}},t.prototype.resume=function(){Yt("resume",[],arguments);var t=this.state_===Q||this.state_===K;return t&&this.transition_(G),t},t.prototype.pause=function(){Yt("pause",[],arguments);var t=this.state_===G;return t&&this.transition_(K),t},t.prototype.cancel=function(){Yt("cancel",[],arguments);var t=this.state_===G||this.state_===K;return t&&this.transition_(X),t},t}(),ae=function(){function t(t,e){this.authWrapper=t,this.location=e instanceof yt?e:yt.makeFromUrl(e)}return t.prototype.toString=function(){return Yt("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},t.prototype.newRef=function(e,n){return new t(e,n)},t.prototype.mappings=function(){return St()},t.prototype.child=function(t){Yt("child",[$t()],arguments);var e=mt(this.location.path,t),n=new yt(this.location.bucket,e);return this.newRef(this.authWrapper,n)},Object.defineProperty(t.prototype,"parent",{get:function(){var t=function(t){if(0===t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this.location.path);if(null===t)return null;var e=new yt(this.location.bucket,t);return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){var t=new yt(this.location.bucket,"");return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return bt(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),t.prototype.put=function(t,e){return void 0===e&&(e=null),Yt("put",[Jt(),Zt(!0)],arguments),this.throwIfRoot_("put"),new oe(this,this.authWrapper,this.location,this.mappings(),new vt(t),e)},t.prototype.putString=function(t,e,n){void 0===e&&(e=F.RAW),Yt("putString",[$t(),$t(j,!0),Zt(!0)],arguments),this.throwIfRoot_("putString");var r=V(e,t),i=Object.assign({},n);return!et(i.contentType)&&et(r.contentType)&&(i.contentType=r.contentType),new oe(this,this.authWrapper,this.location,this.mappings(),new vt(r.data,!0),i)},t.prototype.delete=function(){var t=this;return Yt("delete",[],arguments),this.throwIfRoot_("delete"),this.authWrapper.getAuthToken().then((function(e){var n=Bt(t.authWrapper,t.location);return t.authWrapper.makeRequest(n,e).getPromise()}))},t.prototype.listAll=function(){Yt("listAll",[],arguments);var t={prefixes:[],items:[]};return this.listAllHelper(t).then((function(){return t}))},t.prototype.listAllHelper=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return n={pageToken:e},[4,this.list(n)];case 1:return r=a.sent(),(i=t.prefixes).push.apply(i,r.prefixes),(o=t.
2items).push.apply(o,r.items),null==r.nextPageToken?[3,3]:[4,this.listAllHelper(t,r.nextPageToken)];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},t.prototype.list=function(t){Yt("list",[te(!0)],arguments);var e=this;return this.authWrapper.getAuthToken().then((function(n){var r=t||{},i=Ut(e.authWrapper,e.location,"/",r.pageToken,r.maxResults);return e.authWrapper.makeRequest(i,n).getPromise()}))},t.prototype.getMetadata=function(){var t=this;return Yt("getMetadata",[],arguments),this.throwIfRoot_("getMetadata"),this.authWrapper.getAuthToken().then((function(e){var n=jt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()}))},t.prototype.updateMetadata=function(t){var e=this;return Yt("updateMetadata",[Zt()],arguments),this.throwIfRoot_("updateMetadata"),this.authWrapper.getAuthToken().then((function(n){var r=qt(e.authWrapper,e.location,t,e.mappings());return e.authWrapper.makeRequest(r,n).getPromise()}))},t.prototype.getDownloadURL=function(){var t=this;return Yt("getDownloadURL",[],arguments),this.throwIfRoot_("getDownloadURL"),this.authWrapper.getAuthToken().then((function(e){var n=Vt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise().then((function(t){if(null===t)throw O();return t}))}))},t.prototype.throwIfRoot_=function(t){if(""===this.location.path)throw function(t){return new c(S,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(t)},t}(),se=function(){function t(t){this.promise_=Promise.reject(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){},t}(),ue=function(){function t(){this.map=new Map,this.id=-9007199254740991}return t.prototype.addRequest=function(t){var e=this,n=this.id;this.id++,this.map.set(n,t),t.getPromise().then((function(){return e.map.delete(n)}),(function(){return e.map.delete(n)}))},t.prototype.clear=function(){this.map.forEach((function(t){t&&t.cancel(!0)})),this.map.clear()},t}(),ce=function(){function t(e,n,r,i,o,a){var s;if(this.bucket_=null,this.appId_=null,this.deleted_=!1,this.app_=e,null!==this.app_){var u=this.app_.options;et(u)&&(this.bucket_=t.extractBucket_(u),this.appId_=null!==(s=u.appId)&&void 0!==s?s:null)}this.authProvider_=n,this.storageRefMaker_=r,this.requestMaker_=i,this.pool_=a,this.service_=o,this.maxOperationRetryTime_=12e4,this.maxUploadRetryTime_=6e5,this.requestMap_=new ue}return t.extractBucket_=function(t){var e=t.storageBucket||null;return null==e?null:yt.makeFromBucketSpec(e).bucket},t.prototype.getAuthToken=function(){var t=this.authProvider_.getImmediate({optional:!0});return t?t.getToken().then((function(t){return null!==t?t.accessToken:null}),(function(){return null})):Promise.resolve(null)},t.prototype.bucket=function(){if(this.deleted_)throw D();return this.bucket_},t.prototype.service=function(){return this.service_},t.prototype.makeStorageReference=function(t){return this.storageRefMaker_(this,t)},t.prototype.makeRequest=function(t,e){if(this.deleted_)return new se(D());var n=this.requestMaker_(t,this.appId_,e,this.pool_);return this.requestMap_.addRequest(n),n},t.prototype.deleteApp=function(){this.deleted_=!0,this.app_=null,this.requestMap_.clear()},t.prototype.maxUploadRetryTime=function(){return this.maxUploadRetryTime_},t.prototype.setMaxUploadRetryTime=function(t){this.maxUploadRetryTime_=t},t.prototype.maxOperationRetryTime=function(){return this.maxOperationRetryTime_},t.prototype.setMaxOperationRetryTime=function(t){this.maxOperationRetryTime_=t},t}();var le=function(){function t(t,e,n,r,i,o,a,s,u,c,l){var h=this;this.pendingXhr_=null,this.backoffId_=null,this.resolve_=null,this.reject_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=a,this.errorCallback_=s,this.progressCallback_=c,this.timeout_=u,this.pool_=l,this.promise_=new Promise((function(t,e){h.resolve_=t,h.reject_=e,h.start_()}))}return t.prototype.start_=function(){var t=this;function e(e,n){var r,i=t.resolve_,o=t.reject_,a=n.xhr;if(n.wasSuccessCode)try{var s=t.callback_(a,a.getResponseText());nt(s)?i(s):i()}catch(u){o(u)}else null!==a?((r=x()).setServerResponseProp(a.getResponseText()),t.errorCallback_?o(t.errorCallback_(a,r)):o(r)):n.canceled?o(r=t.appDelete_?D():P()):o(r=new c(v,"Max retry time for operation exceeded, please try again."))}this.canceled_?e(0,new he(!1,null,!0)):this.backoffId_=function(t,e,n){var r=1,i=null,o=!1,a=0;function u(){return 2===a}var c=!1;function l(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];
2c||(c=!0,e.apply(null,t))}function h(e){i=setTimeout((function(){i=null,t(f,u())}),e)}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)l.call.apply(l,s([null,t],e));else{var i,f=u()||o;if(f)l.call.apply(l,s([null,t],e));else r<64&&(r*=2),1===a?(a=2,i=0):i=1e3*(r+Math.random()),h(i)}}var p=!1;function d(t){p||(p=!0,c||(null!==i?(t||(a=2),clearTimeout(i),h(0)):t||(a=1)))}return h(0),setTimeout((function(){o=!0,d(!0)}),n),d}((function(e,n){if(n)e(!1,new he(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null;var r=(n=n).getErrorCode()===z.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var a=-1!==t.successCodes_.indexOf(o);e(!0,new he(a,n))}else{var s=n.getErrorCode()===z.ABORT;e(!1,new he(!1,null,s))}}))}function i(e){var n=e.loaded,r=e.lengthComputable?e.total:-1;null!==t.progressCallback_&&t.progressCallback_(n,r)}}),e,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=-1!==[408,429].indexOf(t),r=-1!==this.additionalRetryCodes_.indexOf(t);return e||n||r},t}(),he=function(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n};function fe(t,e,n,r){var o=wt(t.urlParams),a=t.url+o,s=Object.assign({},t.headers);return function(t,e){e&&(t["X-Firebase-GMPID"]=e)}(s,e),function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(s,n),function(t){var e="undefined"!==typeof i.a?i.a.SDK_VERSION:"AppManager";t["X-Firebase-Storage-Version"]="webjs/"+e}(s),new le(a,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)}var pe=function(){function t(t,e,n,r){if(this.bucket_=null,this.authWrapper_=new ce(t,e,(function(t,e){return new ae(t,e)}),fe,this,n),this.app_=t,null!=r)this.bucket_=yt.makeFromBucketSpec(r);else{var i=this.authWrapper_.bucket();null!=i&&(this.bucket_=new yt(i,""))}this.internals_=new de(this)}return t.prototype.ref=function(t){function e(t){if("string"!==typeof t)throw"Path is not a string.";if(/^[A-Za-z]+:\/\//.test(t))throw"Expected child path but got a URL, use refFromURL instead."}if(Yt("ref",[$t(e,!0)],arguments),null==this.bucket_)throw new Error("No Storage Bucket defined in Firebase Options.");var n=new ae(this.authWrapper_,this.bucket_);return null!=t?n.child(t):n},t.prototype.refFromURL=function(t){function e(t){if("string"!==typeof t)throw"Path is not a string.";if(!/^[A-Za-z]+:\/\//.test(t))throw"Expected full URL but got a child path, use ref instead.";try{yt.makeFromUrl(t)}catch(e){throw"Expected valid full URL but got an invalid one."}}return Yt("refFromURL",[$t(e,!1)],arguments),new ae(this.authWrapper_,t)},Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this.authWrapper_.maxUploadRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxUploadRetryTime=function(t){Yt("setMaxUploadRetryTime",[ee()],arguments),this.authWrapper_.setMaxUploadRetryTime(t)},t.prototype.setMaxOperationRetryTime=function(t){Yt("setMaxOperationRetryTime",[ee()],arguments),this.authWrapper_.setMaxOperationRetryTime(t)},Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"INTERNAL",{get:function(){return this.internals_},enumerable:!0,configurable:!0}),t}(),de=function(){function t(t){this.service_=t}return t.prototype.delete=function(){return this.service_.authWrapper_.deleteApp(),Promise.resolve()},t}();function ve(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return new pe(n,r,new ft,e)}function ye(t){var e={TaskState:Z,TaskEvent:H,StringFormat:F,Storage:pe,Reference:ae};t.INTERNAL.registerComponent(new u.Component("storage",ve,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion("@firebase/storage","0.3.36")}ye(i.a)},function(t,e,n){"use strict";n.r(e),n.d(e,"factory",(function(){return N})),n.d(e,"getGlobalVars",(function(){return C})),n.d(e,"registerAnalytics",(function(){return x})),n.d(e,"resetGlobalVars",(function(){return S})),n.d(e,"settings",(function(){return k}));var r=n(1),i=n.n(r);n(19);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)};
2function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}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(s){o=[6,s],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])}}}var u,c,l=n(13),h=n(8),f=n(5),p="https://www.googletagmanager.com/gtag/js";!function(t){t.EVENT="event",t.SET="set",t.CONFIG="config"}(u||(u={})),function(t){t.ADD_SHIPPING_INFO="add_shipping_info",t.ADD_PAYMENT_INFO="add_payment_info",t.ADD_TO_CART="add_to_cart",t.ADD_TO_WISHLIST="add_to_wishlist",t.BEGIN_CHECKOUT="begin_checkout",t.CHECKOUT_PROGRESS="checkout_progress",t.EXCEPTION="exception",t.GENERATE_LEAD="generate_lead",t.LOGIN="login",t.PAGE_VIEW="page_view",t.PURCHASE="purchase",t.REFUND="refund",t.REMOVE_FROM_CART="remove_from_cart",t.SCREEN_VIEW="screen_view",t.SEARCH="search",t.SELECT_CONTENT="select_content",t.SELECT_ITEM="select_item",t.SELECT_PROMOTION="select_promotion",t.SET_CHECKOUT_OPTION="set_checkout_option",t.SHARE="share",t.SIGN_UP="sign_up",t.TIMING_COMPLETE="timing_complete",t.VIEW_CART="view_cart",t.VIEW_ITEM="view_item",t.VIEW_ITEM_LIST="view_item_list",t.VIEW_PROMOTION="view_promotion",t.VIEW_SEARCH_RESULTS="view_search_results"}(c||(c={}));var d,v=new l.Logger("@firebase/analytics");function y(t,e,n){var r=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];window[e].push(arguments)};return window[n]&&"function"===typeof window[n]&&(r=window[n]),window[n]=function(t,e){return function(n,r,i){if(n===u.EVENT){var o=[];if(i&&i.send_to){var a=i.send_to;Array.isArray(a)||(a=[a]);for(var s=0,c=a;s<c.length;s++){var l=c[s],h=e[l];if(!h){o=[];break}o.push(h)}}if(0===o.length)for(var f=0,p=Object.values(e);f<p.length;f++){var d=p[f];o.push(d)}Promise.all(o).then((function(){return t(u.EVENT,r,i||{})})).catch((function(t){return v.error(t)}))}else if(n===u.CONFIG){(e[r]||Promise.resolve()).then((function(){t(u.CONFIG,r,i)})).catch((function(t){return v.error(t)}))}else t(u.SET,r)}}(r,t),{gtagCore:r,wrappedGtag:window[n]}}var g,m,b=((d={})["no-ga-id"]='"measurementId" field is empty in Firebase config. Firebase Analytics requires this field to contain a valid measurement ID.',d["already-exists"]="A Firebase Analytics instance with the measurement ID ${id} already exists. Only one Firebase Analytics instance can be created for each measurement ID.",d["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",d["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate",d),_=new h.ErrorFactory("analytics","Analytics",b),w={},E="dataLayer",T="gtag",I=!1;function S(t,e){void 0===t&&(t=!1),void 0===e&&(e={}),I=t,w=e,E="dataLayer",T="gtag"}function C(){return{initializedIdPromisesMap:w}}function k(t){if(I)throw _.create("already-initialized");t.dataLayerName&&(E=t.dataLayerName),t.gtagName&&(T=t.gtagName)}function N(t,e){var n=t.options.measurementId;if(!n)throw _.create("no-ga-id");if(null!=w[n])throw _.create("already-exists",{id:n});if(!I){(function(){for(var t=window.document.getElementsByTagName("script"),e=0,n=Object.values(t);e<n.length;e++){var r=n[e];if(r.src&&r.src.includes(p))return r}return null})()||function(t){var e=document.createElement("script");e.src=p+"?l="+t,e.async=!0,document.head.appendChild(e)}(E),function(t){var e=[];Array.isArray(window[t])?e=window[t]:window[t]=e}(E);var r=y(w,E,T),i=r.wrappedGtag,c=r.gtagCore;m=i,g=c,I=!0}return w[n]=function(t,e,n){return a(this,void 0,void 0,(function(){var r,i;return s(this,(function(o){switch(o.label){case 0:return[4,e.getId()];case 1:return r=o.sent(),n("js",new Date),n(u.CONFIG,t.options.measurementId,((i={}).firebase_id=r,i.origin="firebase",i.update=!0,i)),[2]}}))}))}(t,e,g),{app:t,logEvent:function(t,e,r){return function(t,e,n,r,i){var a=r||{};i&&i.global||(a=o(o({},r),{send_to:e})),t(u.EVENT,n,a||{})}(m,n,t,e,r)},setCurrentScreen:function(t,e){return function(t,e,n,r){r&&r.global?t(u.SET,{screen_name:n}):t(u.CONFIG,e,{update:!0,screen_name:n})}(m,n,t,e)}
2,setUserId:function(t,e){return function(t,e,n,r){r&&r.global?t(u.SET,{user_id:n}):t(u.CONFIG,e,{update:!0,user_id:n})}(m,n,t,e)},setUserProperties:function(t,e){return function(t,e,n,r){if(r&&r.global){for(var i={},o=0,a=Object.keys(n);o<a.length;o++){var s=a[o];i["user_properties."+s]=n[s]}t(u.SET,i)}else t(u.CONFIG,e,{update:!0,user_properties:n})}(m,n,t,e)},setAnalyticsCollectionEnabled:function(t){return function(t,e){window["ga-disable-"+t]=!e}(n,t)}}}function x(t){t.INTERNAL.registerComponent(new f.Component("analytics",(function(t){return N(t.getProvider("app").getImmediate(),t.getProvider("installations").getImmediate())}),"PUBLIC").setServiceProps({settings:k,EventName:c})),t.INTERNAL.registerComponent(new f.Component("analytics-internal",(function(t){try{return{logEvent:t.getProvider("analytics").getImmediate().logEvent}}catch(e){throw _.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),t.registerVersion("@firebase/analytics","0.3.7")}x(i.a)}]]); 3//# sourceMappingURL=2.c273dff2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.