· 7 years ago · Feb 27, 2018, 03:24 PM
1/*!
2 * @license Firebase v4.9.1
3 * Build: rev-631e1ad
4 * Terms: https://firebase.google.com/terms/
5 */
6var firebase=function(){var e=void 0===e?self:e;return function(t){function r(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var n=e.webpackJsonpFirebase;e.webpackJsonpFirebase=function(e,o,a){for(var c,s,u,f=0,l=[];f<e.length;f++)s=e[f],i[s]&&l.push(i[s][0]),i[s]=0;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(t[c]=o[c]);for(n&&n(e,o,a);l.length;)l.shift()();if(a)for(f=0;f<a.length;f++)u=r(r.s=a[f]);return u};var o={},i={5:0};return r.e=function(e){function t(){c.onerror=c.onload=null,clearTimeout(s);var t=i[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),i[e]=void 0)}var n=i[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var o=new Promise(function(t,r){n=i[e]=[t,r]});n[2]=o;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,r.nc&&c.setAttribute("nonce",r.nc),c.src=r.p+""+e+".js";var s=setTimeout(t,12e4);return c.onerror=c.onload=t,a.appendChild(c),o},r.m=t,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.oe=function(e){throw console.error(e),e},r(r.s=57)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(28);t.assert=n.assert,t.assertionError=n.assertionError;var o=r(29);t.base64=o.base64,t.base64Decode=o.base64Decode,t.base64Encode=o.base64Encode;var i=r(20);t.CONSTANTS=i.CONSTANTS;var a=r(65);t.deepCopy=a.deepCopy,t.deepExtend=a.deepExtend,t.patchProperty=a.patchProperty;var c=r(66);t.Deferred=c.Deferred;var s=r(67);t.getUA=s.getUA,t.isMobileCordova=s.isMobileCordova,t.isNodeSdk=s.isNodeSdk,t.isReactNative=s.isReactNative;var u=r(68);t.ErrorFactory=u.ErrorFactory,t.FirebaseError=u.FirebaseError,t.patchCapture=u.patchCapture;var f=r(30);t.jsonEval=f.jsonEval,t.stringify=f.stringify;var l=r(69);t.decode=l.decode,t.isAdmin=l.isAdmin,t.issuedAtTime=l.issuedAtTime,t.isValidFormat=l.isValidFormat,t.isValidTimestamp=l.isValidTimestamp;var h=r(31);t.clone=h.clone,t.contains=h.contains,t.every=h.every,t.extend=h.extend,t.findKey=h.findKey,t.findValue=h.findValue,t.forEach=h.forEach,t.getAnyKey=h.getAnyKey,t.getCount=h.getCount,t.getValues=h.getValues,t.isEmpty=h.isEmpty,t.isNonNullObject=h.isNonNullObject,t.map=h.map,t.safeGet=h.safeGet;var p=r(70);t.querystring=p.querystring,t.querystringDecode=p.querystringDecode;var d=r(71);t.Sha1=d.Sha1;var v=r(73);t.async=v.async,t.createSubscribe=v.createSubscribe;var y=r(74);t.errorPrefix=y.errorPrefix,t.validateArgCount=y.validateArgCount,t.validateCallback=y.validateCallback,t.validateContextObject=y.validateContextObject,t.validateNamespace=y.validateNamespace;var b=r(75);t.stringLength=b.stringLength,t.stringToByteArray=b.stringToByteArray},,,,,,function(e,t,r){"use strict";function n(){function e(e){h(d[e],"delete"),delete d[e]}function t(e){return e=e||c,a(d,e)||o("no-app",{name:e}),d[e]}function r(e,t){void 0===t?t=c:"string"==typeof t&&""!==t||o("bad-app-name",{name:t+""}),a(d,t)&&o("duplicate-app",{name:t});var r=new u(e,t,b);return d[t]=r,h(r,"create"),r}function s(){return Object.keys(d).map(function(e){return d[e]})}function f(e,r,n,a,c){v[e]&&o("duplicate-service",{name:e}),v[e]=r,a&&(y[e]=a,s().forEach(function(e){a("create",e)}));var f=function(r){return void 0===r&&(r=t()),"function"!=typeof r[e]&&o("invalid-app-argument",{name:e}),r[e]()};return void 0!==n&&Object(i.deepExtend)(f,n),b[e]=f,u.prototype[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.t.bind(this,e).apply(this,c?t:[])},f}function l(e){Object(i.deepExtend)(b,e)}function h(e,t){Object.keys(v).forEach(function(r){var n=p(e,r);null!==n&&y[n]&&y[n](t,e)})}function p(e,t){if("serverAuth"===t)return null;var r=t;return e.options,r}var d={},v={},y={},b={__esModule:!0,initializeApp:r,app:t,apps:null,Promise:Promise,SDK_VERSION:"4.9.1",INTERNAL:{registerService:f,createFirebaseNamespace:n,extendNamespace:l,createSubscribe:i.createSubscribe,ErrorFactory:i.ErrorFactory,removeApp:e,factories:v,useAsService:p,Promise:Promise,deepExtend:i.deepExtend}};return Object(i.patchProperty)(b,"default",b),Object.defineProperty(b,"apps",{get:s}),Object(i.patchProperty)(t,"App",u),b}function o(e,t){throw l.create(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c="[DEFAULT]",s=[],u=function(){function e(e,t,r){this.r=r,this.a=!1,this.u={},this.f=t,this.h=Object(i.deepCopy)(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){s.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){s=s.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"name",{get:function(){return this.v(),this.f},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.v(),this.h},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.v(),t()}).then(function(){e.r.INTERNAL.removeApp(e.f);var t=[];return Object.keys(e.u).forEach(function(r){Object.keys(e.u[r]).forEach(function(n){t.push(e.u[r][n])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.a=!0,e.u={}})},e.prototype.t=function(e,t){if(void 0===t&&(t=c),this.v(),this.u[e]||(this.u[e]={}),!this.u[e][t]){var r=t!==c?t:void 0,n=this.r.INTERNAL.factories[e](this,this.extendApp.bind(this),r);this.u[e][t]=n}return this.u[e][t]},e.prototype.extendApp=function(e){var t=this;Object(i.deepExtend)(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(s.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),s=[])},e.prototype.v=function(){this.a&&o("app-deleted",{name:this.f})},e}();u.prototype.name&&u.prototype.options||u.prototype.delete||console.log("dc");var f={"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."},l=new i.ErrorFactory("app","Firebase",f);r.d(t,"firebase",function(){return h});var h=n();t.default=h},,,,,,function(t,r){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof e&&(n=e)}t.exports=n},,,,,,,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"}},,,,,,,function(e,t){function r(){throw Error("setTimeout has not been defined")}function n(){throw Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&c())}function c(){if(!v){var e=o(a);v=!0;for(var t=d.length;t;){for(p=d,d=[];++y<t;)p&&p[y].run();y=-1,t=d.length}p=null,v=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function u(){}var f,l,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(e){l=n}}();var p,d=[],v=!1,y=-1;h.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new s(e,t)),1!==d.length||v||o(c)},s.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(e){return[]},h.binding=function(e){throw Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(20);t.assert=function(e,r){if(!e)throw t.assertionError(r)},t.assertionError=function(e){return Error("Firebase Database ("+n.CONSTANTS.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t},o=function(e){for(var t=[],r=0,n=0;r<e.length;){var o=e[r++];if(o<128)t[n++]=String.fromCharCode(o);else if(o>191&&o<224){var i=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){var i=e[r++],a=e[r++],c=e[r++],s=((7&o)<<18|(63&i)<<12|(63&a)<<6|63&c)-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{var i=e[r++],a=e[r++];t[n++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}}return t.join("")};t.base64={y:null,b:null,_:null,g: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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.A();for(var r=t?this._:this.y,n=[],o=0;o<e.length;o+=3){var i=e[o],a=o+1<e.length,c=a?e[o+1]:0,s=o+2<e.length,u=s?e[o+2]:0,f=i>>2,l=(3&i)<<4|c>>4,h=(15&c)<<2|u>>6,p=63&u;s||(p=64,a||(h=64)),n.push(r[f],r[l],r[h],r[p])}return n.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(n(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):o(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.A();for(var r=t?this.g:this.b,n=[],o=0;o<e.length;){var i=r[e.charAt(o++)],a=o<e.length,c=a?r[e.charAt(o)]:0;++o;var s=o<e.length,u=s?r[e.charAt(o)]:64;++o;var f=o<e.length,l=f?r[e.charAt(o)]:64;if(++o,null==i||null==c||null==u||null==l)throw Error();var h=i<<2|c>>4;if(n.push(h),64!=u){var p=c<<4&240|u>>2;if(n.push(p),64!=l){var d=u<<6&192|l;n.push(d)}}}return n},A:function(){if(!this.y){this.y={},this.b={},this._={},this.g={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.y[e]=this.ENCODED_VALS.charAt(e),this.b[this.y[e]]=e,this._[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.g[this._[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.b[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.g[this.ENCODED_VALS.charAt(e)]=e)}}},t.base64Encode=function(e){var r=n(e);return t.base64.encodeByteArray(r,!0)},t.base64Decode=function(e){try{return t.base64.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}},function(e,t,r){"use strict";function n(e){return JSON.parse(e)}function o(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.jsonEval=n,t.stringify=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.forEach=function(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])},t.extend=function(e,r){return t.forEach(r,function(t,r){e[t]=r}),e},t.clone=function(e){return t.extend({},e)},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.getCount=function(e){var t=0;for(var r in e)t++;return t},t.map=function(e,t,r){var n={};for(var o in e)n[o]=t.call(r,e[o],o,e);return n},t.findKey=function(e,t,r){for(var n in e)if(t.call(r,e[n],n,e))return n},t.findValue=function(e,r,n){var o=t.findKey(e,r,n);return o&&e[o]},t.getAnyKey=function(e){for(var t in e)return t},t.getValues=function(e){var t=[],r=0;for(var n in e)t[r++]=e[n];return t},t.every=function(e,t){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&!t(r,e[r]))return!1;return!0}},,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){r(58),e.exports=r(6).default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(59),o=(r.n(n),r(63)),i=(r.n(o),r(64));r.n(i)},function(t,r,n){(function(t){var r=function(){if(void 0!==t)return t;if(void 0!==e)return e;if("undefined"!=typeof self)return self;throw Error("unable to locate global object")}();"undefined"==typeof Promise&&(r.Promise=Promise=n(60))}).call(r,n(12))},function(e,t,r){(function(t){!function(r){function n(){}function o(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this.O=[],l(e,this)}function a(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e.O.push(t);e._handled=!0,i.T(function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null===r)return void(1===e._state?c:s)(t.promise,e._value);var n;try{n=r(e._value)}catch(e){return void s(t.promise,e)}c(t.promise,n)})}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof i)return e._state=3,e._value=t,void u(e);if("function"==typeof r)return void l(o(r,t),e)}e._state=1,e._value=t,u(e)}catch(t){s(e,t)}}function s(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e.O.length&&i.T(function(){e._handled||i.j(e._value)});for(var t=0,r=e.O.length;t<r;t++)a(e,e.O[t]);e.O=null}function f(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function l(e,t){var r=!1;try{e(function(e){r||(r=!0,c(t,e))},function(e){r||(r=!0,s(t,e))})}catch(e){if(r)return;r=!0,s(t,e)}}var h=setTimeout;i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var r=new this.constructor(n);return a(this,new f(e,t,r)),r},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,r){function n(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(e){n(i,e)},r)}t[i]=a,0==--o&&e(t)}catch(e){r(e)}}if(0===t.length)return e([]);for(var o=t.length,i=0;i<t.length;i++)n(i,t[i])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,r){r(e)})},i.race=function(e){return new i(function(t,r){for(var n=0,o=e.length;n<o;n++)e[n].then(t,r)})},i.T="function"==typeof t&&function(e){t(e)}||function(e){h(e,0)},i.j=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i.S=function(e){i.T=e},i.C=function(e){i.j=e},void 0!==e&&e.exports?e.exports=i:r.Promise||(r.Promise=i)}(this)}).call(t,r(61).setImmediate)},function(t,r,n){function o(e,t){this.N=e,this._clearFn=t}var i=Function.prototype.apply;r.setTimeout=function(){return new o(i.call(setTimeout,e,arguments),clearTimeout)},r.setInterval=function(){return new o(i.call(setInterval,e,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(e,this.N)},r.enroll=function(e,t){clearTimeout(e.w),e.P=t},r.unenroll=function(e){clearTimeout(e.w),e.P=-1},r.k=r.active=function(e){clearTimeout(e.w);var t=e.P;t>=0&&(e.w=setTimeout(function(){e.M&&e.M()},t))},n(62),r.setImmediate=setImmediate,r.clearImmediate=clearImmediate},function(e,t,r){(function(e,t){!function(e,r){"use strict";function n(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return u[s]=n,c(s),s++}function o(e){delete u[e]}function i(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}function a(e){if(f)setTimeout(a,0,e);else{var t=u[e];if(t){f=!0;try{i(t)}finally{o(e),f=!1}}}}if(!e.setImmediate){var c,s=1,u={},f=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?function(){c=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?function(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&a(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),c=function(r){e.postMessage(t+r,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},c=function(t){e.port2.postMessage(t)}}():l&&"onreadystatechange"in l.createElement("script")?function(){var e=l.documentElement;c=function(t){var r=l.createElement("script");r.onreadystatechange=function(){a(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}():function(){c=function(e){setTimeout(a,0,e)}}(),h.setImmediate=n,h.clearImmediate=o}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,r(12),r(27))},function(e,t){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}}})},function(e,t){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return o;o++}return-1}})},function(e,t,r){"use strict";function n(e){return o(void 0,e)}function o(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:var r=t;return new Date(r.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=o(e[n],t[n]));return e}function i(e,t,r){e[t]=r}Object.defineProperty(t,"__esModule",{value:!0}),t.deepCopy=n,t.deepExtend=o,t.patchProperty=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})}return e.prototype.wrapCallback=function(e){var t=this;return function(r,n){r?t.reject(r):t.resolve(n),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(r):e(r,n))}},e}();t.Deferred=n},function(t,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=n(20);r.getUA=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},r.isMobileCordova=function(){return void 0!==e&&!!(e.cordova||e.phonegap||e.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(r.getUA())},r.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},r.isNodeSdk=function(){return!0===o.CONSTANTS.NODE_CLIENT||!0===o.CONSTANTS.NODE_ADMIN}},function(e,t,r){"use strict";function n(e){var t=i;return i=e,t}Object.defineProperty(t,"__esModule",{value:!0});var o="FirebaseError",i=Error.captureStackTrace;t.patchCapture=n;var a=function(){function e(e,t){if(this.code=e,this.message=t,i)i(this,c.prototype.create);else{var r=Error.apply(this,arguments);this.name=o,Object.defineProperty(this,"stack",{get:function(){return r.stack}})}}return e}();t.FirebaseError=a,a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a.prototype.name=o;var c=function(){function e(e,t,r){this.service=e,this.serviceName=t,this.errors=r,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var r,n=this.errors[e],o=this.service+"/"+e;r=void 0===n?"Error":n.replace(this.pattern,function(e,r){var n=t[r];return void 0!==n?""+n:"<"+r+"?>"}),r=this.serviceName+": "+r+" ("+o+").";var i=new a(o,r);for(var c in t)t.hasOwnProperty(c)&&"_"!==c.slice(-1)&&(i[c]=t[c]);return i},e}();t.ErrorFactory=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(29),o=r(30);t.decode=function(e){var t={},r={},i={},a="";try{var c=e.split(".");t=o.jsonEval(n.base64Decode(c[0])||""),r=o.jsonEval(n.base64Decode(c[1])||""),a=c[2],i=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:i,signature:a}},t.isValidTimestamp=function(e){var r,n,o=t.decode(e).claims,i=Math.floor((new Date).getTime()/1e3);return"object"==typeof o&&(o.hasOwnProperty("nbf")?r=o.nbf:o.hasOwnProperty("iat")&&(r=o.iat),n=o.hasOwnProperty("exp")?o.exp:r+86400),i&&r&&n&&i>=r&&i<=n},t.issuedAtTime=function(e){var r=t.decode(e).claims;return"object"==typeof r&&r.hasOwnProperty("iat")?r.iat:null},t.isValidFormat=function(e){var r=t.decode(e),n=r.claims;return!!r.signature&&!!n&&"object"==typeof n&&n.hasOwnProperty("iat")},t.isAdmin=function(e){var r=t.decode(e).claims;return"object"==typeof r&&!0===r.admin}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31);t.querystring=function(e){var t=[];return n.forEach(e,function(e,r){Array.isArray(r)?r.forEach(function(r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var r=e.split("=");t[r[0]]=r[1]}}),t}},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=r(72),i=function(e){function t(){var t=e.call(this)||this;t.D=[],t.x=[],t.F=[],t.I=[],t.L=0,t.R=0,t.blockSize=64,t.I[0]=128;for(var r=1;r<t.blockSize;++r)t.I[r]=0;return t.reset(),t}return n(t,e),t.prototype.reset=function(){this.D[0]=1732584193,this.D[1]=4023233417,this.D[2]=2562383102,this.D[3]=271733878,this.D[4]=3285377520,this.L=0,this.R=0},t.prototype.V=function(e,t){t||(t=0);var r=this.F;if("string"==typeof e)for(var n=0;n<16;n++)r[n]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(var n=0;n<16;n++)r[n]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(var n=16;n<80;n++){var o=r[n-3]^r[n-8]^r[n-14]^r[n-16];r[n]=4294967295&(o<<1|o>>>31)}for(var i,a,c=this.D[0],s=this.D[1],u=this.D[2],f=this.D[3],l=this.D[4],n=0;n<80;n++){n<40?n<20?(i=f^s&(u^f),a=1518500249):(i=s^u^f,a=1859775393):n<60?(i=s&u|f&(s|u),a=2400959708):(i=s^u^f,a=3395469782);var o=(c<<5|c>>>27)+i+l+a+r[n]&4294967295;l=f,f=u,u=4294967295&(s<<30|s>>>2),s=c,c=o}this.D[0]=this.D[0]+c&4294967295,this.D[1]=this.D[1]+s&4294967295,this.D[2]=this.D[2]+u&4294967295,this.D[3]=this.D[3]+f&4294967295,this.D[4]=this.D[4]+l&4294967295},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var r=t-this.blockSize,n=0,o=this.x,i=this.L;n<t;){if(0==i)for(;n<=r;)this.V(e,n),n+=this.blockSize;if("string"==typeof e){for(;n<t;)if(o[i]=e.charCodeAt(n),++i,++n,i==this.blockSize){this.V(o),i=0;break}}else for(;n<t;)if(o[i]=e[n],++i,++n,i==this.blockSize){this.V(o),i=0;break}}this.L=i,this.R+=t}},t.prototype.digest=function(){var e=[],t=8*this.R;this.L<56?this.update(this.I,56-this.L):this.update(this.I,this.blockSize-(this.L-56));for(var r=this.blockSize-1;r>=56;r--)this.x[r]=255&t,t/=256;this.V(this.x);for(var n=0,r=0;r<5;r++)for(var o=24;o>=0;o-=8)e[n]=this.D[r]>>o&255,++n;return e},t}(o.Hash);t.Sha1=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.blockSize=-1}return e}();t.Hash=n},function(e,t,r){"use strict";function n(e,t){var r=new c(e,t);return r.subscribe.bind(r)}function o(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];Promise.resolve(!0).then(function(){e.apply(void 0,r)}).catch(function(e){t&&t(e)})}}function i(e,t){if("object"!=typeof e||null===e)return!1;for(var r=0,n=t;r<n.length;r++){var o=n[r];if(o in e&&"function"==typeof e[o])return!0}return!1}function a(){}Object.defineProperty(t,"__esModule",{value:!0}),t.createSubscribe=n;var c=function(){function e(e,t){var r=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(r)}).catch(function(e){r.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,r){var n,o=this;if(void 0===e&&void 0===t&&void 0===r)throw Error("Missing Observer.");n=i(e,["next","error","complete"])?e:{next:e,error:t,complete:r},void 0===n.next&&(n.next=a),void 0===n.error&&(n.error=a),void 0===n.complete&&(n.complete=a);var c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?n.error(o.finalError):n.complete()}catch(e){}}),this.observers.push(n),c},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var r=this;this.task.then(function(){if(void 0!==r.observers&&void 0!==r.observers[e])try{t(r.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();t.async=o},function(e,t,r){"use strict";function n(e,t,r){var n="";switch(t){case 1:n=r?"first":"First";break;case 2:n=r?"second":"Second";break;case 3:n=r?"third":"Third";break;case 4:n=r?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var o=e+" failed: ";return o+=n+" argument "}function o(e,t,r,o){if((!o||r)&&"string"!=typeof r)throw Error(n(e,t,o)+"must be a valid firebase namespace.")}function i(e,t,r,o){if((!o||r)&&"function"!=typeof r)throw Error(n(e,t,o)+"must be a valid function.")}function a(e,t,r,o){if((!o||r)&&("object"!=typeof r||null===r))throw Error(n(e,t,o)+"must be a valid context object.")}Object.defineProperty(t,"__esModule",{value:!0}),t.validateArgCount=function(e,t,r,n){var o;if(n<t?o="at least "+t:n>r&&(o=0===r?"none":"no more than "+r),o){var i=e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+o+".";throw Error(i)}},t.errorPrefix=n,t.validateNamespace=o,t.validateCallback=i,t.validateContextObject=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(28);t.stringToByteArray=function(e){for(var t=[],r=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=55296&&i<=56319){var a=i-55296;o++,n.assert(o<e.length,"Surrogate pair missing trail surrogate."),i=65536+(a<<10)+(e.charCodeAt(o)-56320)}i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):i<65536?(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return t},t.stringLength=function(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,r++):t+=3}return t}}])}().default;
7
8/*!
9 * @license Firebase v4.9.1
10 * Build: rev-631e1ad
11 * Terms: https://firebase.google.com/terms/
12 */
13try {
14 webpackJsonpFirebase([4], {76:function(va, Wb, Xb) {
15 Xb(77);
16 }, 77:function(va, Wb, Xb) {
17 (function(va) {
18 (function() {
19 function x(a) {
20 return "string" == typeof a;
21 }
22 function va(a) {
23 return "boolean" == typeof a;
24 }
25 function Y() {
26 }
27 function Oa(a) {
28 var b = typeof a;
29 if ("object" == b) {
30 if (!a) {
31 return "null";
32 }
33 if (a instanceof Array) {
34 return "array";
35 }
36 if (a instanceof Object) {
37 return b;
38 }
39 var c = Object.prototype.toString.call(a);
40 if ("[object Window]" == c) {
41 return "object";
42 }
43 if ("[object Array]" == c || "number" == typeof a.length && void 0 !== a.splice && void 0 !== a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
44 return "array";
45 }
46 if ("[object Function]" == c || void 0 !== a.call && void 0 !== a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
47 return "function";
48 }
49 } else {
50 if ("function" == b && void 0 === a.call) {
51 return "object";
52 }
53 }
54 return b;
55 }
56 function Wb(a) {
57 return null === a;
58 }
59 function la(a) {
60 return "array" == Oa(a);
61 }
62 function nb(a) {
63 var b = Oa(a);
64 return "array" == b || "object" == b && "number" == typeof a.length;
65 }
66 function G(a) {
67 return "function" == Oa(a);
68 }
69 function O(a) {
70 var b = typeof a;
71 return "object" == b && null != a || "function" == b;
72 }
73 function xi(a, b, c) {
74 return a.call.apply(a.bind, arguments);
75 }
76 function yi(a, b, c) {
77 if (!a) {
78 throw Error();
79 }
80 if (2 < arguments.length) {
81 var d = Array.prototype.slice.call(arguments, 2);
82 return function() {
83 var c = Array.prototype.slice.call(arguments);
84 return Array.prototype.unshift.apply(c, d), a.apply(b, c);
85 };
86 }
87 return function() {
88 return a.apply(b, arguments);
89 };
90 }
91 function n(a, b, c) {
92 return n = Function.prototype.bind && -1 != ("" + Function.prototype.bind).indexOf("native code") ? xi : yi, n.apply(null, arguments);
93 }
94 function Yb(a, b) {
95 var c = Array.prototype.slice.call(arguments, 1);
96 return function() {
97 var b = c.slice();
98 return b.push.apply(b, arguments), a.apply(this, b);
99 };
100 }
101 function u(a, b) {
102 function c() {
103 }
104 c.prototype = b.prototype;
105 a.ib = b.prototype;
106 a.prototype = new c;
107 a.prototype.constructor = a;
108 a.Rc = function(a, c, g) {
109 for (var d = Array(arguments.length - 2), e = 2; e < arguments.length; e++) {
110 d[e - 2] = arguments[e];
111 }
112 return b.prototype[c].apply(a, d);
113 };
114 }
115 function L(a) {
116 if (Error.captureStackTrace) {
117 Error.captureStackTrace(this, L);
118 } else {
119 var b = Error().stack;
120 b && (this.stack = b);
121 }
122 a && (this.message = a + "");
123 }
124 function Tc(a, b) {
125 for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1); e.length && 1 < c.length;) {
126 d += c.shift() + e.shift();
127 }
128 return d + c.join("%s");
129 }
130 function Uc(a) {
131 return zi.test(a) ? (-1 != a.indexOf("&") && (a = a.replace(Ai, "&")), -1 != a.indexOf("<") && (a = a.replace(Bi, "<")), -1 != a.indexOf(">") && (a = a.replace(Ci, ">")), -1 != a.indexOf('"') && (a = a.replace(Di, """)), -1 != a.indexOf("'") && (a = a.replace(Ei, "'")), -1 != a.indexOf("\x00") && (a = a.replace(Fi, "�")), a) : a;
132 }
133 function w(a, b) {
134 return -1 != a.indexOf(b);
135 }
136 function Vc(a, b) {
137 return a < b ? -1 : a > b ? 1 : 0;
138 }
139 function Wc(a, b) {
140 b.unshift(a);
141 L.call(this, Tc.apply(null, b));
142 b.shift();
143 }
144 function ob(a, b) {
145 throw new Wc("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1));
146 }
147 function Gi(a, b) {
148 var c = a.length, d = x(a) ? a.split("") : a;
149 for (--c; 0 <= c; --c) {
150 c in d && b.call(void 0, d[c], c, a);
151 }
152 }
153 function Hi(a) {
154 a: {
155 for (var b = Ii, c = a.length, d = x(a) ? a.split("") : a, e = 0; e < c; e++) {
156 if (e in d && b.call(void 0, d[e], e, a)) {
157 b = e;
158 break a;
159 }
160 }
161 b = -1;
162 }
163 return 0 > b ? null : x(a) ? a.charAt(b) : a[b];
164 }
165 function wa(a, b) {
166 return 0 <= We(a, b);
167 }
168 function $b(a, b) {
169 b = We(a, b);
170 var c;
171 return (c = 0 <= b) && Array.prototype.splice.call(a, b, 1), c;
172 }
173 function Z(a, b) {
174 var c = 0;
175 Gi(a, function(d, e) {
176 b.call(void 0, d, e, a) && 1 == Array.prototype.splice.call(a, e, 1).length && c++;
177 });
178 }
179 function Xc(a) {
180 return Array.prototype.concat.apply([], arguments);
181 }
182 function xa(a) {
183 var b = a.length;
184 if (0 < b) {
185 for (var c = Array(b), d = 0; d < b; d++) {
186 c[d] = a[d];
187 }
188 return c;
189 }
190 return [];
191 }
192 function C(a) {
193 return w(pb, a);
194 }
195 function Xe(a, b) {
196 for (var c in a) {
197 b.call(void 0, a[c], c, a);
198 }
199 }
200 function Ye(a) {
201 var b, c = [], d = 0;
202 for (b in a) {
203 c[d++] = a[b];
204 }
205 return c;
206 }
207 function Ze(a) {
208 var b, c = [], d = 0;
209 for (b in a) {
210 c[d++] = b;
211 }
212 return c;
213 }
214 function qb(a) {
215 for (var b in a) {
216 return !1;
217 }
218 return !0;
219 }
220 function rb(a) {
221 var b, c = {};
222 for (b in a) {
223 c[b] = a[b];
224 }
225 return c;
226 }
227 function ma(a, b) {
228 for (var c, d, e = 1; e < arguments.length; e++) {
229 d = arguments[e];
230 for (c in d) {
231 a[c] = d[c];
232 }
233 for (var g = 0; g < $e.length; g++) {
234 c = $e[g], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);
235 }
236 }
237 }
238 function Yc(a) {
239 return Yc[" "](a), a;
240 }
241 function Ji(a, b) {
242 var c = Ki;
243 return Object.prototype.hasOwnProperty.call(c, a) ? c[a] : c[a] = b(a);
244 }
245 function af() {
246 var a = l.document;
247 return a ? a.documentMode : void 0;
248 }
249 function bf(a) {
250 return Ji(a, function() {
251 for (var b = 0, c = cf(Zc + "").split("."), d = cf(a + "").split("."), e = Math.max(c.length, d.length), g = 0; 0 == b && g < e; g++) {
252 var h = c[g] || "", f = d[g] || "";
253 do {
254 if (h = /(\d*)(\D*)(.*)/.exec(h) || ["", "", "", ""], f = /(\d*)(\D*)(.*)/.exec(f) || ["", "", "", ""], 0 == h[0].length && 0 == f[0].length) {
255 break;
256 }
257 b = Vc(0 == h[1].length ? 0 : parseInt(h[1], 10), 0 == f[1].length ? 0 : parseInt(f[1], 10)) || Vc(0 == h[2].length, 0 == f[2].length) || Vc(h[2], f[2]);
258 h = h[3];
259 f = f[3];
260 } while (0 == b);
261 }
262 return 0 <= b;
263 });
264 }
265 function df(a) {
266 a.prototype.then = a.prototype.then;
267 a.prototype.$goog_Thenable = !0;
268 }
269 function ef(a) {
270 if (!a) {
271 return !1;
272 }
273 try {
274 return !!a.$goog_Thenable;
275 } catch (b) {
276 return !1;
277 }
278 }
279 function $c(a, b, c) {
280 this.f = c;
281 this.c = a;
282 this.g = b;
283 this.b = 0;
284 this.a = null;
285 }
286 function ff(a, b) {
287 a.g(b);
288 a.b < a.f && (a.b++, b.next = a.a, a.a = b);
289 }
290 function Li() {
291 var a = gf, b = null;
292 return a.a && (b = a.a, a.a = a.a.next, a.a || (a.b = null), b.next = null), b;
293 }
294 function ad() {
295 this.next = this.b = this.a = null;
296 }
297 function hf(a) {
298 l.setTimeout(function() {
299 throw a;
300 }, 0);
301 }
302 function Mi() {
303 var a = l.MessageChannel;
304 if (void 0 === a && "undefined" != typeof window && window.postMessage && window.addEventListener && !C("Presto") && (a = function() {
305 var a = document.createElement("IFRAME");
306 a.style.display = "none";
307 a.src = "";
308 document.documentElement.appendChild(a);
309 var b = a.contentWindow;
310 a = b.document;
311 a.open();
312 a.write("");
313 a.close();
314 var c = "callImmediate" + Math.random(), d = "file:" == b.location.protocol ? "*" : b.location.protocol + "//" + b.location.host;
315 a = n(function(a) {
316 "*" != d && a.origin != d || a.data != c || this.port1.onmessage();
317 }, this);
318 b.addEventListener("message", a, !1);
319 this.port1 = {};
320 this.port2 = {postMessage:function() {
321 b.postMessage(c, d);
322 }};
323 }), void 0 !== a && !C("Trident") && !C("MSIE")) {
324 var b = new a, c = {}, d = c;
325 return b.port1.onmessage = function() {
326 if (void 0 !== c.next) {
327 c = c.next;
328 var a = c.pb;
329 c.pb = null;
330 a();
331 }
332 }, function(a) {
333 d.next = {pb:a};
334 d = d.next;
335 b.port2.postMessage(0);
336 };
337 }
338 return "undefined" != typeof document && "onreadystatechange" in document.createElement("SCRIPT") ? function(a) {
339 var b = document.createElement("SCRIPT");
340 b.onreadystatechange = function() {
341 b.onreadystatechange = null;
342 b.parentNode.removeChild(b);
343 b = null;
344 a();
345 a = null;
346 };
347 document.documentElement.appendChild(b);
348 } : function(a) {
349 l.setTimeout(a, 0);
350 };
351 }
352 function tb(a, b) {
353 ac || Ni();
354 bd || (ac(), bd = !0);
355 var c = gf, d = jf.get();
356 d.set(a, b);
357 c.b ? c.b.next = d : c.a = d;
358 c.b = d;
359 }
360 function Ni() {
361 if (-1 != (l.Promise + "").indexOf("[native code]")) {
362 var a = l.Promise.resolve(void 0);
363 ac = function() {
364 a.then(kf);
365 };
366 } else {
367 ac = function() {
368 var a = kf;
369 !G(l.setImmediate) || l.Window && l.Window.prototype && !C("Edge") && l.Window.prototype.setImmediate == l.setImmediate ? (cd || (cd = Mi()), cd(a)) : l.setImmediate(a);
370 };
371 }
372 }
373 function kf() {
374 for (var a; a = Li();) {
375 try {
376 a.a.call(a.b);
377 } catch (b) {
378 hf(b);
379 }
380 ff(jf, a);
381 }
382 bd = !1;
383 }
384 function t(a, b) {
385 if (this.a = ya, this.i = void 0, this.f = this.b = this.c = null, this.g = this.h = !1, a != Y) {
386 try {
387 var c = this;
388 a.call(b, function(a) {
389 za(c, ub, a);
390 }, function(a) {
391 if (!(a instanceof Pa)) {
392 try {
393 if (a instanceof Error) {
394 throw a;
395 }
396 throw Error("Promise rejected.");
397 } catch (e) {
398 }
399 }
400 za(c, fa, a);
401 });
402 } catch (d) {
403 za(this, fa, d);
404 }
405 }
406 }
407 function lf() {
408 this.next = this.f = this.b = this.g = this.a = null;
409 this.c = !1;
410 }
411 function dd(a, b, c) {
412 var d = mf.get();
413 return d.g = a, d.b = b, d.f = c, d;
414 }
415 function p(a) {
416 if (a instanceof t) {
417 return a;
418 }
419 var b = new t(Y);
420 return za(b, ub, a), b;
421 }
422 function z(a) {
423 return new t(function(b, c) {
424 c(a);
425 });
426 }
427 function nf(a, b, c) {
428 of(a, b, c, null) || tb(Yb(b, a));
429 }
430 function Oi(a) {
431 return new t(function(b, c) {
432 var d = a.length, e = [];
433 if (d) {
434 for (var g, h = function(a, c) {
435 d--;
436 e[a] = c;
437 0 == d && b(e);
438 }, f = function(a) {
439 c(a);
440 }, k = 0; k < a.length; k++) {
441 g = a[k], nf(g, Yb(h, k), f);
442 }
443 } else {
444 b(e);
445 }
446 });
447 }
448 function Pi(a) {
449 return new t(function(b) {
450 var c = a.length, d = [];
451 if (c) {
452 for (var e, g = function(a, e, g) {
453 c--;
454 d[a] = e ? {Ub:!0, value:g} : {Ub:!1, reason:g};
455 0 == c && b(d);
456 }, h = 0; h < a.length; h++) {
457 e = a[h], nf(e, Yb(g, h, !0), Yb(g, h, !1));
458 }
459 } else {
460 b(d);
461 }
462 });
463 }
464 function Qa(a, b) {
465 return b = dd(b, b, void 0), b.c = !0, fd(a, b), a;
466 }
467 function pf(a, b) {
468 if (a.a == ya) {
469 if (a.c) {
470 var c = a.c;
471 if (c.b) {
472 for (var d = 0, e = null, g = null, h = c.b; h && (h.c || (d++, h.a == a && (e = h), !(e && 1 < d))); h = h.next) {
473 e || (g = h);
474 }
475 e && (c.a == ya && 1 == d ? pf(c, b) : (g ? (d = g, d.next == c.f && (c.f = d), d.next = d.next.next) : qf(c), rf(c, e, fa, b)));
476 }
477 a.c = null;
478 } else {
479 za(a, fa, b);
480 }
481 }
482 }
483 function fd(a, b) {
484 a.b || a.a != ub && a.a != fa || a.h || (a.h = !0, tb(a.Qb, a));
485 a.f ? a.f.next = b : a.b = b;
486 a.f = b;
487 }
488 function sf(a, b, c, d) {
489 var e = dd(null, null, null);
490 return e.a = new t(function(a, h) {
491 e.g = b ? function(c) {
492 try {
493 var e = b.call(d, c);
494 a(e);
495 } catch (ed) {
496 h(ed);
497 }
498 } : a;
499 e.b = c ? function(b) {
500 try {
501 var e = c.call(d, b);
502 void 0 === e && b instanceof Pa ? h(b) : a(e);
503 } catch (ed) {
504 h(ed);
505 }
506 } : h;
507 }), e.a.c = a, fd(a, e), e.a;
508 }
509 function za(a, b, c) {
510 a.a == ya && (a === c && (b = fa, c = new TypeError("Promise cannot resolve to itself")), a.a = 1, of(c, a.Ac, a.Bc, a) || (a.i = c, a.a = b, a.c = null, a.h || (a.h = !0, tb(a.Qb, a)), b != fa || c instanceof Pa || Qi(a, c)));
511 }
512 function of(a, b, c, d) {
513 if (a instanceof t) {
514 return fd(a, dd(b || Y, c || null, d)), !0;
515 }
516 if (ef(a)) {
517 return a.then(b, c, d), !0;
518 }
519 if (O(a)) {
520 try {
521 var e = a.then;
522 if (G(e)) {
523 return Ri(a, e, b, c, d), !0;
524 }
525 } catch (g) {
526 return c.call(d, g), !0;
527 }
528 }
529 return !1;
530 }
531 function Ri(a, b, c, d, e) {
532 function g(a) {
533 f || (f = !0, d.call(e, a));
534 }
535 function h(a) {
536 f || (f = !0, c.call(e, a));
537 }
538 var f = !1;
539 try {
540 b.call(a, h, g);
541 } catch (sb) {
542 g(sb);
543 }
544 }
545 function qf(a) {
546 var b = null;
547 return a.b && (b = a.b, a.b = b.next, b.next = null), a.b || (a.f = null), b;
548 }
549 function rf(a, b, c, d) {
550 if (c == fa && b.b && !b.c) {
551 for (; a && a.g; a = a.c) {
552 a.g = !1;
553 }
554 }
555 if (b.a) {
556 b.a.c = null, tf(b, c, d);
557 } else {
558 try {
559 b.c ? b.g.call(b.f) : tf(b, c, d);
560 } catch (e) {
561 uf.call(null, e);
562 }
563 }
564 ff(mf, b);
565 }
566 function tf(a, b, c) {
567 b == ub ? a.g.call(a.f, c) : a.b && a.b.call(a.f, c);
568 }
569 function Qi(a, b) {
570 a.g = !0;
571 tb(function() {
572 a.g && uf.call(null, b);
573 });
574 }
575 function Pa(a) {
576 L.call(this, a);
577 }
578 function Aa() {
579 this.a = "";
580 this.b = vf;
581 }
582 function wf(a) {
583 return a instanceof Aa && a.constructor === Aa && a.b === vf ? a.a : (ob("expected object of type Const, got '" + a + "'"), "type_error:Const");
584 }
585 function vb(a) {
586 var b = new Aa;
587 return b.a = a, b;
588 }
589 function Ra() {
590 this.a = "";
591 this.b = xf;
592 }
593 function yf(a) {
594 return a instanceof Ra && a.constructor === Ra && a.b === xf ? a.a : (ob("expected object of type TrustedResourceUrl, got '" + a + "' of type " + Oa(a)), "type_error:TrustedResourceUrl");
595 }
596 function gd(a, b) {
597 return a = Si(a, b), b = new Ra, b.a = a, b;
598 }
599 function Si(a, b) {
600 var c = wf(a);
601 if (!Ti.test(c)) {
602 throw Error("Invalid TrustedResourceUrl format: " + c);
603 }
604 return c.replace(Ui, function(a, e) {
605 if (!Object.prototype.hasOwnProperty.call(b, e)) {
606 throw Error('Found marker, "' + e + '", in format string, "' + c + '", but no valid label mapping found in args: ' + JSON.stringify(b));
607 }
608 return a = b[e], a instanceof Aa ? wf(a) : encodeURIComponent(a + "");
609 });
610 }
611 function aa() {
612 this.a = "";
613 this.b = zf;
614 }
615 function bc(a) {
616 return a instanceof aa && a.constructor === aa && a.b === zf ? a.a : (ob("expected object of type SafeUrl, got '" + a + "' of type " + Oa(a)), "type_error:SafeUrl");
617 }
618 function Af(a) {
619 return a instanceof aa ? a : (a = a.la ? a.ja() : a + "", Bf.test(a) || (a = "about:invalid#zClosurez"), hd(a));
620 }
621 function hd(a) {
622 var b = new aa;
623 return b.a = a, b;
624 }
625 function Sa() {
626 this.a = "";
627 this.b = Cf;
628 }
629 function cc(a) {
630 var b = new Sa;
631 return b.a = a, b;
632 }
633 function dc(a) {
634 var b = document;
635 return x(a) ? b.getElementById(a) : a;
636 }
637 function Df(a, b) {
638 Xe(b, function(b, d) {
639 b && b.la && (b = b.ja());
640 "style" == d ? a.style.cssText = b : "class" == d ? a.className = b : "for" == d ? a.htmlFor = b : Ef.hasOwnProperty(d) ? a.setAttribute(Ef[d], b) : 0 == d.lastIndexOf("aria-", 0) || 0 == d.lastIndexOf("data-", 0) ? a.setAttribute(d, b) : a[d] = b;
641 });
642 }
643 function Vi(a, b, c) {
644 var d = arguments, e = document, g = d[0] + "", h = d[1];
645 if (!Wi && h && (h.name || h.type)) {
646 if (g = ["<", g], h.name && g.push(' name="', Uc(h.name), '"'), h.type) {
647 g.push(' type="', Uc(h.type), '"');
648 var f = {};
649 ma(f, h);
650 delete f.type;
651 h = f;
652 }
653 g.push(">");
654 g = g.join("");
655 }
656 return g = e.createElement(g), h && (x(h) ? g.className = h : la(h) ? g.className = h.join(" ") : Df(g, h)), 2 < d.length && Xi(e, g, d), g;
657 }
658 function Xi(a, b, c) {
659 function d(c) {
660 c && b.appendChild(x(c) ? a.createTextNode(c) : c);
661 }
662 for (var e = 2; e < c.length; e++) {
663 var g = c[e];
664 !nb(g) || O(g) && 0 < g.nodeType ? d(g) : M(Yi(g) ? xa(g) : g, d);
665 }
666 }
667 function Yi(a) {
668 if (a && "number" == typeof a.length) {
669 if (O(a)) {
670 return "function" == typeof a.item || "string" == typeof a.item;
671 }
672 if (G(a)) {
673 return "function" == typeof a.item;
674 }
675 }
676 return !1;
677 }
678 function Ff(a) {
679 var b = [];
680 return id(new Zi, a, b), b.join("");
681 }
682 function Zi() {
683 }
684 function id(a, b, c) {
685 if (null == b) {
686 c.push("null");
687 } else {
688 if ("object" == typeof b) {
689 if (la(b)) {
690 var d = b;
691 b = d.length;
692 c.push("[");
693 for (var e = "", g = 0; g < b; g++) {
694 c.push(e), id(a, d[g], c), e = ",";
695 }
696 return void c.push("]");
697 }
698 if (!(b instanceof String || b instanceof Number || b instanceof Boolean)) {
699 c.push("{");
700 e = "";
701 for (d in b) {
702 Object.prototype.hasOwnProperty.call(b, d) && "function" != typeof(g = b[d]) && (c.push(e), Gf(d, c), c.push(":"), id(a, g, c), e = ",");
703 }
704 return void c.push("}");
705 }
706 b = b.valueOf();
707 }
708 switch(typeof b) {
709 case "string":
710 Gf(b, c);
711 break;
712 case "number":
713 c.push(isFinite(b) && !isNaN(b) ? b + "" : "null");
714 break;
715 case "boolean":
716 c.push(b + "");
717 break;
718 case "function":
719 c.push("null");
720 break;
721 default:
722 throw Error("Unknown type: " + typeof b);
723 }
724 }
725 }
726 function Gf(a, b) {
727 b.push('"', a.replace($i, function(a) {
728 var b = Hf[a];
729 return b || (b = "\\u" + (65536 | a.charCodeAt(0)).toString(16).substr(1), Hf[a] = b), b;
730 }), '"');
731 }
732 function ec() {
733 0 != If && (Jf[this[fc] || (this[fc] = ++Kf)] = this);
734 this.oa = this.oa;
735 this.Fa = this.Fa;
736 }
737 function Lf(a) {
738 a.oa || (a.oa = !0, a.ta(), 0 != If && (a = a[fc] || (a[fc] = ++Kf), delete Jf[a]));
739 }
740 function P(a, b) {
741 this.type = a;
742 this.b = this.target = b;
743 this.Bb = !0;
744 }
745 function Ba(a, b) {
746 if (P.call(this, a ? a.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, a) {
747 var c = this.type = a.type, d = a.changedTouches ? a.changedTouches[0] : null;
748 if (this.target = a.target || a.srcElement, this.b = b, b = a.relatedTarget) {
749 if (Mf) {
750 a: {
751 try {
752 Yc(b.nodeName);
753 c = !0;
754 break a;
755 } catch (e) {
756 }
757 c = !1;
758 }
759 c || (b = null);
760 }
761 } else {
762 "mouseover" == c ? b = a.fromElement : "mouseout" == c && (b = a.toElement);
763 }
764 this.relatedTarget = b;
765 null === d ? (this.clientX = void 0 !== a.clientX ? a.clientX : a.pageX, this.clientY = void 0 !== a.clientY ? a.clientY : a.pageY, this.screenX = a.screenX || 0, this.screenY = a.screenY || 0) : (this.clientX = void 0 !== d.clientX ? d.clientX : d.pageX, this.clientY = void 0 !== d.clientY ? d.clientY : d.pageY, this.screenX = d.screenX || 0, this.screenY = d.screenY || 0);
766 this.button = a.button;
767 this.key = a.key || "";
768 this.ctrlKey = a.ctrlKey;
769 this.altKey = a.altKey;
770 this.shiftKey = a.shiftKey;
771 this.metaKey = a.metaKey;
772 this.pointerId = a.pointerId || 0;
773 this.pointerType = x(a.pointerType) ? a.pointerType : aj[a.pointerType] || "";
774 this.a = a;
775 a.defaultPrevented && this.c();
776 }
777 }
778 function bj(a, b, c, d, e) {
779 this.listener = a;
780 this.a = null;
781 this.src = b;
782 this.type = c;
783 this.capture = !!d;
784 this.La = e;
785 this.key = ++cj;
786 this.ma = this.Ha = !1;
787 }
788 function gc(a) {
789 a.ma = !0;
790 a.listener = null;
791 a.a = null;
792 a.src = null;
793 a.La = null;
794 }
795 function jd(a) {
796 this.src = a;
797 this.a = {};
798 this.b = 0;
799 }
800 function kd(a, b, c, d, e, g) {
801 var h = "" + b;
802 (b = a.a[h]) || (b = a.a[h] = [], a.b++);
803 var f = ld(b, c, e, g);
804 return -1 < f ? (a = b[f], d || (a.Ha = !1)) : (a = new bj(c, a.src, h, !!e, g), a.Ha = d, b.push(a)), a;
805 }
806 function md(a, b) {
807 var c = b.type;
808 c in a.a && $b(a.a[c], b) && (gc(b), 0 == a.a[c].length && (delete a.a[c], a.b--));
809 }
810 function ld(a, b, c, d) {
811 for (var e = 0; e < a.length; ++e) {
812 var g = a[e];
813 if (!g.ma && g.listener == b && g.capture == !!c && g.La == d) {
814 return e;
815 }
816 }
817 return -1;
818 }
819 function na(a, b, c, d, e) {
820 if (d && d.once) {
821 nd(a, b, c, d, e);
822 } else {
823 if (la(b)) {
824 for (var g = 0; g < b.length; g++) {
825 na(a, b[g], c, d, e);
826 }
827 } else {
828 c = od(c), a && a[wb] ? Nf(a, b, c, O(d) ? !!d.capture : !!d, e) : Of(a, b, c, !1, d, e);
829 }
830 }
831 }
832 function Of(a, b, c, d, e, g) {
833 if (!b) {
834 throw Error("Invalid event type");
835 }
836 var h = O(e) ? !!e.capture : !!e, f = hc(a);
837 if (f || (a[pd] = f = new jd(a)), c = kd(f, b, c, d, h, g), !c.a) {
838 if (d = dj(), c.a = d, d.src = a, d.listener = c, a.addEventListener) {
839 ej || (e = h), void 0 === e && (e = !1), a.addEventListener("" + b, d, e);
840 } else {
841 if (!a.attachEvent) {
842 throw Error("addEventListener and attachEvent are unavailable.");
843 }
844 a.attachEvent(Pf("" + b), d);
845 }
846 Qf++;
847 }
848 }
849 function dj() {
850 var a = fj, b = Rf ? function(c) {
851 return a.call(b.src, b.listener, c);
852 } : function(c) {
853 if (!(c = a.call(b.src, b.listener, c))) {
854 return c;
855 }
856 };
857 return b;
858 }
859 function nd(a, b, c, d, e) {
860 if (la(b)) {
861 for (var g = 0; g < b.length; g++) {
862 nd(a, b[g], c, d, e);
863 }
864 } else {
865 c = od(c), a && a[wb] ? qd(a, b, c, O(d) ? !!d.capture : !!d, e) : Of(a, b, c, !0, d, e);
866 }
867 }
868 function R(a, b, c, d, e) {
869 if (la(b)) {
870 for (var g = 0; g < b.length; g++) {
871 R(a, b[g], c, d, e);
872 }
873 } else {
874 d = O(d) ? !!d.capture : !!d, c = od(c), a && a[wb] ? (a = a.u, (b += "") in a.a && (g = a.a[b], -1 < (c = ld(g, c, d, e)) && (gc(g[c]), Array.prototype.splice.call(g, c, 1), 0 == g.length && (delete a.a[b], a.b--)))) : a && (a = hc(a)) && (b = a.a["" + b], a = -1, b && (a = ld(b, c, d, e)), (c = -1 < a ? b[a] : null) && Sf(c));
875 }
876 }
877 function Sf(a) {
878 if ("number" != typeof a && a && !a.ma) {
879 var b = a.src;
880 if (b && b[wb]) {
881 md(b.u, a);
882 } else {
883 var c = a.type, d = a.a;
884 b.removeEventListener ? b.removeEventListener(c, d, a.capture) : b.detachEvent && b.detachEvent(Pf(c), d);
885 Qf--;
886 (c = hc(b)) ? (md(c, a), 0 == c.b && (c.src = null, b[pd] = null)) : gc(a);
887 }
888 }
889 }
890 function Pf(a) {
891 return a in rd ? rd[a] : rd[a] = "on" + a;
892 }
893 function Tf(a, b, c, d) {
894 var e = !0;
895 if ((a = hc(a)) && (b = a.a["" + b])) {
896 for (b = b.concat(), a = 0; a < b.length; a++) {
897 var g = b[a];
898 g && g.capture == c && !g.ma && (g = Uf(g, d), e = e && !1 !== g);
899 }
900 }
901 return e;
902 }
903 function Uf(a, b) {
904 var c = a.listener, d = a.La || a.src;
905 return a.Ha && Sf(a), c.call(d, b);
906 }
907 function fj(a, b) {
908 if (a.ma) {
909 return !0;
910 }
911 if (!Rf) {
912 if (!b) {
913 a: {
914 b = ["window", "event"];
915 for (var c = l, d = 0; d < b.length; d++) {
916 if (null == (c = c[b[d]])) {
917 b = null;
918 break a;
919 }
920 }
921 b = c;
922 }
923 }
924 if (d = b, b = new Ba(d, this), c = !0, !(0 > d.keyCode || void 0 != d.returnValue)) {
925 a: {
926 var e = !1;
927 if (0 == d.keyCode) {
928 try {
929 d.keyCode = -1;
930 break a;
931 } catch (h) {
932 e = !0;
933 }
934 }
935 (e || void 0 == d.returnValue) && (d.returnValue = !0);
936 }
937 d = [];
938 for (e = b.b; e; e = e.parentNode) {
939 d.push(e);
940 }
941 a = a.type;
942 for (e = d.length - 1; 0 <= e; e--) {
943 b.b = d[e];
944 var g = Tf(d[e], a, !0, b);
945 c = c && g;
946 }
947 for (e = 0; e < d.length; e++) {
948 b.b = d[e], g = Tf(d[e], a, !1, b), c = c && g;
949 }
950 }
951 return c;
952 }
953 return Uf(a, new Ba(b, this));
954 }
955 function hc(a) {
956 return a = a[pd], a instanceof jd ? a : null;
957 }
958 function od(a) {
959 return G(a) ? a : (a[sd] || (a[sd] = function(b) {
960 return a.handleEvent(b);
961 }), a[sd]);
962 }
963 function S() {
964 ec.call(this);
965 this.u = new jd(this);
966 this.Ib = this;
967 this.Ra = null;
968 }
969 function E(a, b) {
970 var c, d = a.Ra;
971 if (d) {
972 for (c = []; d; d = d.Ra) {
973 c.push(d);
974 }
975 }
976 if (a = a.Ib, d = b.type || b, x(b)) {
977 b = new P(b, a);
978 } else {
979 if (b instanceof P) {
980 b.target = b.target || a;
981 } else {
982 var e = b;
983 b = new P(d, a);
984 ma(b, e);
985 }
986 }
987 if (e = !0, c) {
988 for (var g = c.length - 1; 0 <= g; g--) {
989 var h = b.b = c[g];
990 e = ic(h, d, !0, b) && e;
991 }
992 }
993 if (h = b.b = a, e = ic(h, d, !0, b) && e, e = ic(h, d, !1, b) && e, c) {
994 for (g = 0; g < c.length; g++) {
995 h = b.b = c[g], e = ic(h, d, !1, b) && e;
996 }
997 }
998 }
999 function Nf(a, b, c, d, e) {
1000 kd(a.u, b + "", c, !1, d, e);
1001 }
1002 function qd(a, b, c, d, e) {
1003 kd(a.u, b + "", c, !0, d, e);
1004 }
1005 function ic(a, b, c, d) {
1006 if (!(b = a.u.a[b + ""])) {
1007 return !0;
1008 }
1009 b = b.concat();
1010 for (var e = !0, g = 0; g < b.length; ++g) {
1011 var h = b[g];
1012 if (h && !h.ma && h.capture == c) {
1013 var f = h.listener, k = h.La || h.src;
1014 h.Ha && md(a.u, h);
1015 e = !1 !== f.call(k, d) && e;
1016 }
1017 }
1018 return e && 0 != d.Bb;
1019 }
1020 function td(a, b, c) {
1021 if (G(a)) {
1022 c && (a = n(a, c));
1023 } else {
1024 if (!a || "function" != typeof a.handleEvent) {
1025 throw Error("Invalid listener argument");
1026 }
1027 a = n(a.handleEvent, a);
1028 }
1029 return 2147483647 < +b ? -1 : l.setTimeout(a, b || 0);
1030 }
1031 function Ca(a) {
1032 var b = null;
1033 return (new t(function(c, d) {
1034 -1 == (b = td(function() {
1035 c(void 0);
1036 }, a)) && d(Error("Failed to schedule timer."));
1037 })).s(function(a) {
1038 throw l.clearTimeout(b), a;
1039 });
1040 }
1041 function ud(a, b, c, d, e) {
1042 this.reset(a, b, c, d, e);
1043 }
1044 function vd(a) {
1045 this.f = a;
1046 this.b = this.c = this.a = null;
1047 }
1048 function jc(a, b) {
1049 this.name = a;
1050 this.value = b;
1051 }
1052 function Vf(a) {
1053 return a.c ? a.c : a.a ? Vf(a.a) : (ob("Root logger has no level set."), null);
1054 }
1055 function Wf(a) {
1056 kc || (kc = new vd(""), wd[""] = kc, kc.c = gj);
1057 var b;
1058 if (!(b = wd[a])) {
1059 b = new vd(a);
1060 var c = a.lastIndexOf("."), d = a.substr(c + 1);
1061 c = Wf(a.substr(0, c));
1062 c.b || (c.b = {});
1063 c.b[d] = b;
1064 b.a = c;
1065 wd[a] = b;
1066 }
1067 return b;
1068 }
1069 function Ta(a, b) {
1070 this.b = {};
1071 this.a = [];
1072 this.c = 0;
1073 var c = arguments.length;
1074 if (1 < c) {
1075 if (c % 2) {
1076 throw Error("Uneven number of arguments");
1077 }
1078 for (var d = 0; d < c; d += 2) {
1079 this.set(arguments[d], arguments[d + 1]);
1080 }
1081 } else {
1082 if (a) {
1083 a instanceof Ta ? (c = a.S(), d = a.P()) : (c = Ze(a), d = Ye(a));
1084 for (var e = 0; e < c.length; e++) {
1085 this.set(c[e], d[e]);
1086 }
1087 }
1088 }
1089 }
1090 function xd(a) {
1091 if (a.c != a.a.length) {
1092 for (var b = 0, c = 0; b < a.a.length;) {
1093 var d = a.a[b];
1094 Da(a.b, d) && (a.a[c++] = d);
1095 b++;
1096 }
1097 a.a.length = c;
1098 }
1099 if (a.c != a.a.length) {
1100 var e = {};
1101 for (c = b = 0; b < a.a.length;) {
1102 d = a.a[b], Da(e, d) || (a.a[c++] = d, e[d] = 1), b++;
1103 }
1104 a.a.length = c;
1105 }
1106 }
1107 function Da(a, b) {
1108 return Object.prototype.hasOwnProperty.call(a, b);
1109 }
1110 function Q(a, b) {
1111 a && a.log(hj, b, void 0);
1112 }
1113 function ij(a) {
1114 return yd(a, function(a) {
1115 return a = a.toString(16), 1 < a.length ? a : "0" + a;
1116 }).join("");
1117 }
1118 function jj(a) {
1119 var b = "";
1120 return kj(a, function(a) {
1121 b += String.fromCharCode(a);
1122 }), b;
1123 }
1124 function kj(a, b) {
1125 function c(b) {
1126 for (; d < a.length;) {
1127 var c = a.charAt(d++), e = lc[c];
1128 if (null != e) {
1129 return e;
1130 }
1131 if (!/^[\s\xa0]*$/.test(c)) {
1132 throw Error("Unknown base64 encoding at char: " + c);
1133 }
1134 }
1135 return b;
1136 }
1137 lj();
1138 for (var d = 0;;) {
1139 var e = c(-1), g = c(0), h = c(64), f = c(64);
1140 if (64 === f && -1 === e) {
1141 break;
1142 }
1143 b(e << 2 | g >> 4);
1144 64 != h && (b(g << 4 & 240 | h >> 2), 64 != f && b(h << 6 & 192 | f));
1145 }
1146 }
1147 function lj() {
1148 if (!mc) {
1149 mc = {};
1150 lc = {};
1151 for (var a = 0; 65 > a; a++) {
1152 mc[a] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a), lc[mc[a]] = a, 62 <= a && (lc["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)] = a);
1153 }
1154 }
1155 }
1156 function oa(a, b) {
1157 this.g = [];
1158 this.v = a;
1159 this.o = b || null;
1160 this.f = this.a = !1;
1161 this.c = void 0;
1162 this.u = this.w = this.i = !1;
1163 this.h = 0;
1164 this.b = null;
1165 this.l = 0;
1166 }
1167 function xb(a, b, c) {
1168 a.a = !0;
1169 a.c = c;
1170 a.f = !b;
1171 Xf(a);
1172 }
1173 function nc(a) {
1174 if (a.a) {
1175 if (!a.u) {
1176 throw new oc;
1177 }
1178 a.u = !1;
1179 }
1180 }
1181 function mj(a, b) {
1182 zd(a, null, b, void 0);
1183 }
1184 function zd(a, b, c, d) {
1185 a.g.push([b, c, d]);
1186 a.a && Xf(a);
1187 }
1188 function Yf(a) {
1189 return nj(a.g, function(a) {
1190 return G(a[1]);
1191 });
1192 }
1193 function Xf(a) {
1194 if (a.h && a.a && Yf(a)) {
1195 var b = a.h, c = pc[b];
1196 c && (l.clearTimeout(c.a), delete pc[b]);
1197 a.h = 0;
1198 }
1199 a.b && (a.b.l--, delete a.b);
1200 b = a.c;
1201 for (var d = c = !1; a.g.length && !a.i;) {
1202 var e = a.g.shift(), g = e[0], h = e[1];
1203 if (e = e[2], g = a.f ? h : g) {
1204 try {
1205 var f = g.call(e || a.o, b);
1206 void 0 !== f && (a.f = a.f && (f == b || f instanceof Error), a.c = b = f);
1207 (ef(b) || "function" == typeof l.Promise && b instanceof l.Promise) && (d = !0, a.i = !0);
1208 } catch (sb) {
1209 b = sb, a.f = !0, Yf(a) || (c = !0);
1210 }
1211 }
1212 }
1213 a.c = b;
1214 d && (f = n(a.m, a, !0), d = n(a.m, a, !1), b instanceof oa ? (zd(b, f, d), b.w = !0) : b.then(f, d));
1215 c && (b = new Zf(b), pc[b.a] = b, a.h = b.a);
1216 }
1217 function oc() {
1218 L.call(this);
1219 }
1220 function yb() {
1221 L.call(this);
1222 }
1223 function Zf(a) {
1224 this.a = l.setTimeout(n(this.c, this), 0);
1225 this.b = a;
1226 }
1227 function qc(a, b) {
1228 this.b = -1;
1229 this.b = $f;
1230 this.f = l.Uint8Array ? new Uint8Array(this.b) : Array(this.b);
1231 this.g = this.c = 0;
1232 this.a = [];
1233 this.i = a;
1234 this.h = b;
1235 this.l = l.Int32Array ? new Int32Array(64) : Array(64);
1236 Ad || (Ad = l.Int32Array ? new Int32Array(ag) : ag);
1237 this.reset();
1238 }
1239 function Bd(a) {
1240 for (var b = a.f, c = a.l, d = 0, e = 0; e < b.length;) {
1241 c[d++] = b[e] << 24 | b[e + 1] << 16 | b[e + 2] << 8 | b[e + 3], e = 4 * d;
1242 }
1243 for (b = 16; 64 > b; b++) {
1244 e = 0 | c[b - 15];
1245 d = 0 | c[b - 2];
1246 var g = (0 | c[b - 16]) + ((e >>> 7 | e << 25) ^ (e >>> 18 | e << 14) ^ e >>> 3) | 0, h = (0 | c[b - 7]) + ((d >>> 17 | d << 15) ^ (d >>> 19 | d << 13) ^ d >>> 10) | 0;
1247 c[b] = g + h | 0;
1248 }
1249 d = 0 | a.a[0];
1250 e = 0 | a.a[1];
1251 var f = 0 | a.a[2], k = 0 | a.a[3], l = 0 | a.a[4], m = 0 | a.a[5], n = 0 | a.a[6];
1252 g = 0 | a.a[7];
1253 for (b = 0; 64 > b; b++) {
1254 var p = ((d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10)) + (d & e ^ d & f ^ e & f) | 0;
1255 h = l & m ^ ~l & n;
1256 g = g + ((l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7)) | 0;
1257 h = h + (0 | Ad[b]) | 0;
1258 h = g + (h + (0 | c[b]) | 0) | 0;
1259 g = n;
1260 n = m;
1261 m = l;
1262 l = k + h | 0;
1263 k = f;
1264 f = e;
1265 e = d;
1266 d = h + p | 0;
1267 }
1268 a.a[0] = a.a[0] + d | 0;
1269 a.a[1] = a.a[1] + e | 0;
1270 a.a[2] = a.a[2] + f | 0;
1271 a.a[3] = a.a[3] + k | 0;
1272 a.a[4] = a.a[4] + l | 0;
1273 a.a[5] = a.a[5] + m | 0;
1274 a.a[6] = a.a[6] + n | 0;
1275 a.a[7] = a.a[7] + g | 0;
1276 }
1277 function Cd(a, b, c) {
1278 void 0 === c && (c = b.length);
1279 var d = 0, e = a.c;
1280 if (x(b)) {
1281 for (; d < c;) {
1282 a.f[e++] = b.charCodeAt(d++), e == a.b && (Bd(a), e = 0);
1283 }
1284 } else {
1285 if (!nb(b)) {
1286 throw Error("message must be string or array");
1287 }
1288 for (; d < c;) {
1289 var g = b[d++];
1290 if (!("number" == typeof g && 0 <= g && 255 >= g && g == (0 | g))) {
1291 throw Error("message must be a byte array");
1292 }
1293 a.f[e++] = g;
1294 e == a.b && (Bd(a), e = 0);
1295 }
1296 }
1297 a.c = e;
1298 a.g += c;
1299 }
1300 function bg() {
1301 qc.call(this, 8, oj);
1302 }
1303 function cg(a) {
1304 if (a.P && "function" == typeof a.P) {
1305 return a.P();
1306 }
1307 if (x(a)) {
1308 return a.split("");
1309 }
1310 if (nb(a)) {
1311 for (var b = [], c = a.length, d = 0; d < c; d++) {
1312 b.push(a[d]);
1313 }
1314 return b;
1315 }
1316 return Ye(a);
1317 }
1318 function dg(a) {
1319 if (a.S && "function" == typeof a.S) {
1320 return a.S();
1321 }
1322 if (!a.P || "function" != typeof a.P) {
1323 if (nb(a) || x(a)) {
1324 var b = [];
1325 a = a.length;
1326 for (var c = 0; c < a; c++) {
1327 b.push(c);
1328 }
1329 return b;
1330 }
1331 return Ze(a);
1332 }
1333 }
1334 function pj(a, b) {
1335 if (a.forEach && "function" == typeof a.forEach) {
1336 a.forEach(b, void 0);
1337 } else {
1338 if (nb(a) || x(a)) {
1339 M(a, b, void 0);
1340 } else {
1341 for (var c = dg(a), d = cg(a), e = d.length, g = 0; g < e; g++) {
1342 b.call(void 0, d[g], c && c[g], a);
1343 }
1344 }
1345 }
1346 }
1347 function qj(a, b) {
1348 if (a) {
1349 a = a.split("&");
1350 for (var c = 0; c < a.length; c++) {
1351 var d = a[c].indexOf("="), e = null;
1352 if (0 <= d) {
1353 var g = a[c].substring(0, d);
1354 e = a[c].substring(d + 1);
1355 } else {
1356 g = a[c];
1357 }
1358 b(g, e ? decodeURIComponent(e.replace(/\+/g, " ")) : "");
1359 }
1360 }
1361 }
1362 function Ua(a, b) {
1363 if (this.b = this.l = this.c = "", this.i = null, this.h = this.g = "", this.f = !1, a instanceof Ua) {
1364 this.f = void 0 !== b ? b : a.f;
1365 Dd(this, a.c);
1366 this.l = a.l;
1367 this.b = a.b;
1368 eg(this, a.i);
1369 this.g = a.g;
1370 b = a.a;
1371 var c = new Va;
1372 c.c = b.c;
1373 b.a && (c.a = new Ta(b.a), c.b = b.b);
1374 fg(this, c);
1375 this.h = a.h;
1376 } else {
1377 a && (c = (a + "").match(gg)) ? (this.f = !!b, Dd(this, c[1] || "", !0), this.l = zb(c[2] || ""), this.b = zb(c[3] || "", !0), eg(this, c[4]), this.g = zb(c[5] || "", !0), fg(this, c[6] || "", !0), this.h = zb(c[7] || "")) : (this.f = !!b, this.a = new Va(null, 0, this.f));
1378 }
1379 }
1380 function Dd(a, b, c) {
1381 a.c = c ? zb(b, !0) : b;
1382 a.c && (a.c = a.c.replace(/:$/, ""));
1383 }
1384 function eg(a, b) {
1385 if (b) {
1386 if (b = +b, isNaN(b) || 0 > b) {
1387 throw Error("Bad port number " + b);
1388 }
1389 a.i = b;
1390 } else {
1391 a.i = null;
1392 }
1393 }
1394 function fg(a, b, c) {
1395 b instanceof Va ? (a.a = b, rj(a.a, a.f)) : (c || (b = Ab(b, sj)), a.a = new Va(b, 0, a.f));
1396 }
1397 function A(a, b, c) {
1398 a.a.set(b, c);
1399 }
1400 function Wa(a, b) {
1401 return a.a.get(b);
1402 }
1403 function pa(a) {
1404 return a instanceof Ua ? new Ua(a) : new Ua(a, void 0);
1405 }
1406 function hg(a, b) {
1407 var c = new Ua(null, void 0);
1408 return Dd(c, "https"), a && (c.b = a), b && (c.g = b), c;
1409 }
1410 function zb(a, b) {
1411 return a ? b ? decodeURI(a.replace(/%25/g, "%2525")) : decodeURIComponent(a) : "";
1412 }
1413 function Ab(a, b, c) {
1414 return x(a) ? (a = encodeURI(a).replace(b, tj), c && (a = a.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), a) : null;
1415 }
1416 function tj(a) {
1417 return a = a.charCodeAt(0), "%" + (a >> 4 & 15).toString(16) + (15 & a).toString(16);
1418 }
1419 function Va(a, b, c) {
1420 this.b = this.a = null;
1421 this.c = a || null;
1422 this.f = !!c;
1423 }
1424 function qa(a) {
1425 a.a || (a.a = new Ta, a.b = 0, a.c && qj(a.c, function(b, c) {
1426 ig(a, decodeURIComponent(b.replace(/\+/g, " ")), c);
1427 }));
1428 }
1429 function jg(a) {
1430 var b = dg(a);
1431 if (void 0 === b) {
1432 throw Error("Keys are undefined");
1433 }
1434 var c = new Va(null, 0, void 0);
1435 a = cg(a);
1436 for (var d = 0; d < b.length; d++) {
1437 var e = b[d], g = a[d];
1438 la(g) ? kg(c, e, g) : ig(c, e, g);
1439 }
1440 return c;
1441 }
1442 function ig(a, b, c) {
1443 qa(a);
1444 a.c = null;
1445 b = Xa(a, b);
1446 var d = a.a.get(b);
1447 d || a.a.set(b, d = []);
1448 d.push(c);
1449 a.b += 1;
1450 }
1451 function ha(a, b) {
1452 qa(a);
1453 b = Xa(a, b);
1454 Da(a.a.b, b) && (a.c = null, a.b -= a.a.get(b).length, a = a.a, Da(a.b, b) && (delete a.b[b], a.c--, a.a.length > 2 * a.c && xd(a)));
1455 }
1456 function lg(a, b) {
1457 return qa(a), b = Xa(a, b), Da(a.a.b, b);
1458 }
1459 function kg(a, b, c) {
1460 ha(a, b);
1461 0 < c.length && (a.c = null, a.a.set(Xa(a, b), xa(c)), a.b += c.length);
1462 }
1463 function Xa(a, b) {
1464 return b += "", a.f && (b = b.toLowerCase()), b;
1465 }
1466 function rj(a, b) {
1467 b && !a.f && (qa(a), a.c = null, a.a.forEach(function(a, b) {
1468 var c = b.toLowerCase();
1469 b != c && (ha(this, b), kg(this, c, a));
1470 }, a));
1471 a.f = b;
1472 }
1473 function rc() {
1474 }
1475 function uj(a) {
1476 return a.c || (a.c = a.b());
1477 }
1478 function sc() {
1479 }
1480 function mg(a) {
1481 if (!a.f && "undefined" == typeof XMLHttpRequest && "undefined" != typeof ActiveXObject) {
1482 for (var b = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], c = 0; 4 > c; c++) {
1483 var d = b[c];
1484 try {
1485 return new ActiveXObject(d), a.f = d;
1486 } catch (e) {
1487 }
1488 }
1489 throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");
1490 }
1491 return a.f;
1492 }
1493 function Ea(a) {
1494 S.call(this);
1495 this.headers = new Ta;
1496 this.w = a || null;
1497 this.b = !1;
1498 this.v = this.a = null;
1499 this.g = this.I = this.i = "";
1500 this.c = this.G = this.h = this.A = !1;
1501 this.f = 0;
1502 this.m = null;
1503 this.l = ng;
1504 this.o = this.N = !1;
1505 }
1506 function vj(a, b, c, d, e) {
1507 if (a.a) {
1508 throw Error("[goog.net.XhrIo] Object is active with another request=" + a.i + "; newUri=" + b);
1509 }
1510 c = c ? c.toUpperCase() : "GET";
1511 a.i = b;
1512 a.g = "";
1513 a.I = c;
1514 a.A = !1;
1515 a.b = !0;
1516 a.a = a.w ? a.w.a() : og.a();
1517 a.v = uj(a.w ? a.w : og);
1518 a.a.onreadystatechange = n(a.Ab, a);
1519 try {
1520 Q(a.J, ia(a, "Opening Xhr")), a.G = !0, a.a.open(c, b + "", !0), a.G = !1;
1521 } catch (h) {
1522 return Q(a.J, ia(a, "Error opening Xhr: " + h.message)), void pg(a, h);
1523 }
1524 b = d || "";
1525 var g = new Ta(a.headers);
1526 e && pj(e, function(a, b) {
1527 g.set(b, a);
1528 });
1529 e = Hi(g.S());
1530 d = l.FormData && b instanceof l.FormData;
1531 !wa(wj, c) || e || d || g.set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
1532 g.forEach(function(a, b) {
1533 this.a.setRequestHeader(b, a);
1534 }, a);
1535 a.l && (a.a.responseType = a.l);
1536 "withCredentials" in a.a && a.a.withCredentials !== a.N && (a.a.withCredentials = a.N);
1537 try {
1538 qg(a), 0 < a.f && (a.o = xj(a.a), Q(a.J, ia(a, "Will abort after " + a.f + "ms if incomplete, xhr2 " + a.o)), a.o ? (a.a.timeout = a.f, a.a.ontimeout = n(a.Ea, a)) : a.m = td(a.Ea, a.f, a)), Q(a.J, ia(a, "Sending request")), a.h = !0, a.a.send(b), a.h = !1;
1539 } catch (h) {
1540 Q(a.J, ia(a, "Send error: " + h.message)), pg(a, h);
1541 }
1542 }
1543 function xj(a) {
1544 return T && bf(9) && "number" == typeof a.timeout && void 0 !== a.ontimeout;
1545 }
1546 function Ii(a) {
1547 return "content-type" == a.toLowerCase();
1548 }
1549 function pg(a, b) {
1550 a.b = !1;
1551 a.a && (a.c = !0, a.a.abort(), a.c = !1);
1552 a.g = b;
1553 rg(a);
1554 tc(a);
1555 }
1556 function rg(a) {
1557 a.A || (a.A = !0, E(a, "complete"), E(a, "error"));
1558 }
1559 function sg(a) {
1560 if (a.b && void 0 !== Ed) {
1561 if (a.v[1] && 4 == Bb(a) && 2 == uc(a)) {
1562 Q(a.J, ia(a, "Local request error detected and ignored"));
1563 } else {
1564 if (a.h && 4 == Bb(a)) {
1565 td(a.Ab, 0, a);
1566 } else {
1567 if (E(a, "readystatechange"), 4 == Bb(a)) {
1568 Q(a.J, ia(a, "Request complete"));
1569 a.b = !1;
1570 try {
1571 var b = uc(a);
1572 a: {
1573 switch(b) {
1574 case 200:
1575 case 201:
1576 case 202:
1577 case 204:
1578 case 206:
1579 case 304:
1580 case 1223:
1581 var c = !0;
1582 break a;
1583 default:
1584 c = !1;
1585 }
1586 }
1587 var d;
1588 if (!(d = c)) {
1589 var e;
1590 if (e = 0 === b) {
1591 var g = (a.i + "").match(gg)[1] || null;
1592 if (!g && l.self && l.self.location) {
1593 var h = l.self.location.protocol;
1594 g = h.substr(0, h.length - 1);
1595 }
1596 e = !yj.test(g ? g.toLowerCase() : "");
1597 }
1598 d = e;
1599 }
1600 if (d) {
1601 E(a, "complete"), E(a, "success");
1602 } else {
1603 try {
1604 var f = 2 < Bb(a) ? a.a.statusText : "";
1605 } catch (sb) {
1606 Q(a.J, "Can not get status: " + sb.message), f = "";
1607 }
1608 a.g = f + " [" + uc(a) + "]";
1609 rg(a);
1610 }
1611 } finally {
1612 tc(a);
1613 }
1614 }
1615 }
1616 }
1617 }
1618 }
1619 function tc(a, b) {
1620 if (a.a) {
1621 qg(a);
1622 var c = a.a, d = a.v[0] ? Y : null;
1623 a.a = null;
1624 a.v = null;
1625 b || E(a, "ready");
1626 try {
1627 c.onreadystatechange = d;
1628 } catch (e) {
1629 (a = a.J) && a.log(tg, "Problem encountered resetting onreadystatechange: " + e.message, void 0);
1630 }
1631 }
1632 }
1633 function qg(a) {
1634 a.a && a.o && (a.a.ontimeout = null);
1635 "number" == typeof a.m && (l.clearTimeout(a.m), a.m = null);
1636 }
1637 function Bb(a) {
1638 return a.a ? a.a.readyState : 0;
1639 }
1640 function uc(a) {
1641 try {
1642 return 2 < Bb(a) ? a.a.status : -1;
1643 } catch (b) {
1644 return -1;
1645 }
1646 }
1647 function zj(a) {
1648 try {
1649 return a.a ? a.a.responseText : "";
1650 } catch (b) {
1651 return Q(a.J, "Can not get responseText: " + b.message), "";
1652 }
1653 }
1654 function ia(a, b) {
1655 return b + " [" + a.I + " " + a.i + " " + uc(a) + "]";
1656 }
1657 function Fd(a) {
1658 var b = {}, c = b.document || document, d = yf(a), e = document.createElement("SCRIPT"), g = {Cb:e, Ea:void 0}, h = new oa(Aj, g), f = null, k = null != b.timeout ? b.timeout : 5E3;
1659 return 0 < k && (f = window.setTimeout(function() {
1660 vc(e, !0);
1661 var a = new Gd(Bj, "Timeout reached for loading script " + d);
1662 nc(h);
1663 xb(h, !1, a);
1664 }, k), g.Ea = f), e.onload = e.onreadystatechange = function() {
1665 e.readyState && "loaded" != e.readyState && "complete" != e.readyState || (vc(e, b.Sc || !1, f), h.A(null));
1666 }, e.onerror = function() {
1667 vc(e, !0, f);
1668 var a = new Gd(Cj, "Error while loading script " + d);
1669 nc(h);
1670 xb(h, !1, a);
1671 }, g = b.attributes || {}, ma(g, {type:"text/javascript", charset:"UTF-8"}), Df(e, g), e.src = yf(a), Dj(c).appendChild(e), h;
1672 }
1673 function Dj(a) {
1674 var b;
1675 return (b = (a || document).getElementsByTagName("HEAD")) && 0 != b.length ? b[0] : a.documentElement;
1676 }
1677 function Aj() {
1678 if (this && this.Cb) {
1679 var a = this.Cb;
1680 a && "SCRIPT" == a.tagName && vc(a, !0, this.Ea);
1681 }
1682 }
1683 function vc(a, b, c) {
1684 null != c && l.clearTimeout(c);
1685 a.onload = Y;
1686 a.onerror = Y;
1687 a.onreadystatechange = Y;
1688 b && window.setTimeout(function() {
1689 a && a.parentNode && a.parentNode.removeChild(a);
1690 }, 0);
1691 }
1692 function Gd(a, b) {
1693 var c = "Jsloader error (code #" + a + ")";
1694 b && (c += ": " + b);
1695 L.call(this, c);
1696 this.code = a;
1697 }
1698 function wc() {
1699 }
1700 function ug() {
1701 this.a = new XDomainRequest;
1702 this.readyState = 0;
1703 this.onreadystatechange = null;
1704 this.responseText = "";
1705 this.status = -1;
1706 this.statusText = this.responseXML = null;
1707 this.a.onload = n(this.Wb, this);
1708 this.a.onerror = n(this.xb, this);
1709 this.a.onprogress = n(this.Xb, this);
1710 this.a.ontimeout = n(this.Yb, this);
1711 }
1712 function Hd() {
1713 var a = F();
1714 return T && !!ra && 11 == ra || /Edge\/\d+/.test(a);
1715 }
1716 function xc() {
1717 return l.window && l.window.location.href || "";
1718 }
1719 function vg(a, b) {
1720 b = b || l.window;
1721 var c = "about:blank";
1722 a && (c = bc(Af(a)));
1723 b.location.href = c;
1724 }
1725 function wg(a, b) {
1726 var c, d = [];
1727 for (c in a) {
1728 if (c in b) {
1729 if (typeof a[c] != typeof b[c]) {
1730 d.push(c);
1731 } else {
1732 if (la(a[c])) {
1733 a: {
1734 var e = void 0;
1735 var g = a[c], h = b[c];
1736 for (e in g) {
1737 if (!(e in h) || g[e] !== h[e]) {
1738 e = !1;
1739 break a;
1740 }
1741 }
1742 for (e in h) {
1743 if (!(e in g)) {
1744 e = !1;
1745 break a;
1746 }
1747 }
1748 e = !0;
1749 }
1750 e || d.push(c);
1751 } else {
1752 "object" == typeof a[c] && null != a[c] && null != b[c] ? 0 < wg(a[c], b[c]).length && d.push(c) : a[c] !== b[c] && d.push(c);
1753 }
1754 }
1755 } else {
1756 d.push(c);
1757 }
1758 }
1759 for (c in b) {
1760 c in a || d.push(c);
1761 }
1762 return d;
1763 }
1764 function Ej() {
1765 var a = F();
1766 return !((a = Cb(a) != xg ? null : (a = a.match(/\sChrome\/(\d+)/i)) && 2 == a.length ? parseInt(a[1], 10) : null) && 30 > a || T && ra && !(9 < ra));
1767 }
1768 function yg(a) {
1769 return a = (a || F()).toLowerCase(), !!(a.match(/android/) || a.match(/webos/) || a.match(/iphone|ipad|ipod/) || a.match(/blackberry/) || a.match(/windows phone/) || a.match(/iemobile/));
1770 }
1771 function Fa(a) {
1772 a = a || l.window;
1773 try {
1774 a.close();
1775 } catch (b) {
1776 }
1777 }
1778 function zg(a, b, c) {
1779 var d = "" + Math.floor(1E9 * Math.random());
1780 b = b || 500;
1781 c = c || 600;
1782 var e = (window.screen.availHeight - c) / 2, g = (window.screen.availWidth - b) / 2;
1783 b = {width:b, height:c, top:0 < e ? e : 0, left:0 < g ? g : 0, location:!0, resizable:!0, statusbar:!0, toolbar:!1};
1784 c = F().toLowerCase();
1785 d && (b.target = d, w(c, "crios/") && (b.target = "_blank"));
1786 Cb(F()) == Id && (a = a || "http://localhost", b.scrollbars = !0);
1787 c = a || "";
1788 (d = b) || (d = {});
1789 a = window;
1790 b = c instanceof aa ? c : Af(void 0 !== c.href ? c.href : c + "");
1791 c = d.target || c.target;
1792 e = [];
1793 for (h in d) {
1794 switch(h) {
1795 case "width":
1796 case "height":
1797 case "top":
1798 case "left":
1799 e.push(h + "=" + d[h]);
1800 break;
1801 case "target":
1802 case "noreferrer":
1803 break;
1804 default:
1805 e.push(h + "=" + (d[h] ? 1 : 0));
1806 }
1807 }
1808 var h = e.join(",");
1809 if ((C("iPhone") && !C("iPod") && !C("iPad") || C("iPad") || C("iPod")) && a.navigator && a.navigator.standalone && c && "_self" != c ? (h = a.document.createElement("A"), b instanceof aa || b instanceof aa || (b = b.la ? b.ja() : b + "", Bf.test(b) || (b = "about:invalid#zClosurez"), b = hd(b)), h.href = bc(b), h.setAttribute("target", c), d.noreferrer && h.setAttribute("rel", "noreferrer"), d = document.createEvent("MouseEvent"), d.initMouseEvent("click", !0, !0, a, 1), h.dispatchEvent(d),
1810 h = {}) : d.noreferrer ? (h = a.open("", c, h), a = bc(b), h && (Fj && w(a, ";") && (a = "'" + a.replace(/'/g, "%27") + "'"), h.opener = null, vb("b/12014412, meta tag with sanitized URL"), a = '<META HTTP-EQUIV="refresh" content="0; url=' + Uc(a) + '">', a = cc(a), h.document.write(a instanceof Sa && a.constructor === Sa && a.b === Cf ? a.a : (ob("expected object of type SafeHtml, got '" + a + "' of type " + Oa(a)), "type_error:SafeHtml")), h.document.close())) : h = a.open(bc(b), c, h),
1811 h) {
1812 try {
1813 h.focus();
1814 } catch (Zb) {
1815 }
1816 }
1817 return h;
1818 }
1819 function Gj(a) {
1820 return new t(function(b) {
1821 function c() {
1822 Ca(2E3).then(function() {
1823 if (a && !a.closed) {
1824 return c();
1825 }
1826 b();
1827 });
1828 }
1829 return c();
1830 });
1831 }
1832 function Jd() {
1833 var a = null;
1834 return (new t(function(b) {
1835 "complete" == l.document.readyState ? b() : (a = function() {
1836 b();
1837 }, nd(window, "load", a));
1838 })).s(function(b) {
1839 throw R(window, "load", a), b;
1840 });
1841 }
1842 function Hj() {
1843 return Kd(void 0) ? Jd().then(function() {
1844 return new t(function(a, b) {
1845 var c = l.document, d = setTimeout(function() {
1846 b(Error("Cordova framework is not ready."));
1847 }, 1E3);
1848 c.addEventListener("deviceready", function() {
1849 clearTimeout(d);
1850 a();
1851 }, !1);
1852 });
1853 }) : z(Error("Cordova must run in an Android or iOS file scheme."));
1854 }
1855 function Kd(a) {
1856 return a = a || F(), !("file:" !== Db() || !a.toLowerCase().match(/iphone|ipad|ipod|android/));
1857 }
1858 function Ld() {
1859 var a = l.window;
1860 try {
1861 return !(!a || a == a.top);
1862 } catch (b) {
1863 return !1;
1864 }
1865 }
1866 function U() {
1867 return q.INTERNAL.hasOwnProperty("reactNative") ? "ReactNative" : q.INTERNAL.hasOwnProperty("node") ? "Node" : "Browser";
1868 }
1869 function Ag() {
1870 var a = U();
1871 return "ReactNative" === a || "Node" === a;
1872 }
1873 function Cb(a) {
1874 var b = a.toLowerCase();
1875 return w(b, "opera/") || w(b, "opr/") || w(b, "opios/") ? "Opera" : w(b, "iemobile") ? "IEMobile" : w(b, "msie") || w(b, "trident/") ? "IE" : w(b, "edge/") ? "Edge" : w(b, "firefox/") ? Id : w(b, "silk/") ? "Silk" : w(b, "blackberry") ? "Blackberry" : w(b, "webos") ? "Webos" : !w(b, "safari/") || w(b, "chrome/") || w(b, "crios/") || w(b, "android") ? !w(b, "chrome/") && !w(b, "crios/") || w(b, "edge/") ? w(b, "android") ? "Android" : (a = a.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/)) && 2 ==
1876 a.length ? a[1] : "Other" : xg : "Safari";
1877 }
1878 function Ya(a, b) {
1879 b = b || [];
1880 var c, d = [], e = {};
1881 for (c in Bg) {
1882 e[Bg[c]] = !0;
1883 }
1884 for (c = 0; c < b.length; c++) {
1885 void 0 !== e[b[c]] && (delete e[b[c]], d.push(b[c]));
1886 }
1887 return d.sort(), b = d, b.length || (b = ["FirebaseCore-web"]), d = U(), ("Browser" === d ? Cb(F()) : d) + "/JsCore/" + a + "/" + b.join(",");
1888 }
1889 function F() {
1890 return l.navigator && l.navigator.userAgent || "";
1891 }
1892 function y(a, b) {
1893 a = a.split(".");
1894 b = b || l;
1895 for (var c = 0; c < a.length && "object" == typeof b && null != b; c++) {
1896 b = b[a[c]];
1897 }
1898 return c != a.length && (b = void 0), b;
1899 }
1900 function Md() {
1901 try {
1902 var a = l.localStorage, b = Za();
1903 if (a) {
1904 return a.setItem(b, "1"), a.removeItem(b), !Hd() || !!l.indexedDB;
1905 }
1906 } catch (c) {
1907 }
1908 return !1;
1909 }
1910 function Ga() {
1911 return (yc() || "chrome-extension:" === Db() || Kd()) && !Ag() && Md();
1912 }
1913 function yc() {
1914 return "http:" === Db() || "https:" === Db();
1915 }
1916 function Db() {
1917 return l.location && l.location.protocol || null;
1918 }
1919 function Eb(a) {
1920 return a = a || F(), !yg(a) && Cb(a) != Id;
1921 }
1922 function Fb(a) {
1923 return void 0 === a ? null : Ff(a);
1924 }
1925 function Cg(a) {
1926 var b, c = {};
1927 for (b in a) {
1928 a.hasOwnProperty(b) && null !== a[b] && void 0 !== a[b] && (c[b] = a[b]);
1929 }
1930 return c;
1931 }
1932 function Gb(a) {
1933 if (null !== a) {
1934 return JSON.parse(a);
1935 }
1936 }
1937 function Za(a) {
1938 return a || "" + Math.floor(1E9 * Math.random());
1939 }
1940 function Dg(a) {
1941 return a = a || F(), "Safari" != Cb(a) && !a.toLowerCase().match(/iphone|ipad|ipod/);
1942 }
1943 function Eg() {
1944 var a = l.___jsl;
1945 if (a && a.H) {
1946 for (var b in a.H) {
1947 if (a.H[b].r = a.H[b].r || [], a.H[b].L = a.H[b].L || [], a.H[b].r = a.H[b].L.concat(), a.CP) {
1948 for (var c = 0; c < a.CP.length; c++) {
1949 a.CP[c] = null;
1950 }
1951 }
1952 }
1953 }
1954 }
1955 function Nd() {
1956 var a = l.navigator;
1957 return !a || "boolean" != typeof a.onLine || !yc() && "chrome-extension:" !== Db() && void 0 === a.connection || a.onLine;
1958 }
1959 function Ha(a, b, c, d) {
1960 if (a > b) {
1961 throw Error("Short delay should be less than long delay!");
1962 }
1963 this.c = a;
1964 this.b = b;
1965 a = c || F();
1966 d = d || U();
1967 this.a = yg(a) || "ReactNative" === d;
1968 }
1969 function Od() {
1970 var a = l.document;
1971 return !a || void 0 === a.visibilityState || "visible" == a.visibilityState;
1972 }
1973 function Ij() {
1974 var a = l.document, b = null;
1975 return Od() || !a ? p() : (new t(function(c) {
1976 b = function() {
1977 Od() && (a.removeEventListener("visibilitychange", b, !1), c());
1978 };
1979 a.addEventListener("visibilitychange", b, !1);
1980 })).s(function(c) {
1981 throw a.removeEventListener("visibilitychange", b, !1), c;
1982 });
1983 }
1984 function Fg(a) {
1985 try {
1986 var b = new Date(parseInt(a, 10));
1987 if (!isNaN(b.getTime()) && !/[^0-9]/.test(a)) {
1988 return b.toUTCString();
1989 }
1990 } catch (c) {
1991 }
1992 return null;
1993 }
1994 function r(a, b, c) {
1995 Gg ? Object.defineProperty(a, b, {configurable:!0, enumerable:!0, value:c}) : a[b] = c;
1996 }
1997 function ba(a, b) {
1998 if (b) {
1999 for (var c in b) {
2000 b.hasOwnProperty(c) && r(a, c, b[c]);
2001 }
2002 }
2003 }
2004 function ja(a) {
2005 var b = {};
2006 return ba(b, a), b;
2007 }
2008 function Jj(a) {
2009 var b, c = {};
2010 for (b in a) {
2011 a.hasOwnProperty(b) && (c[b] = a[b]);
2012 }
2013 return c;
2014 }
2015 function Kj(a, b) {
2016 if (!b || !b.length) {
2017 return !0;
2018 }
2019 if (!a) {
2020 return !1;
2021 }
2022 for (var c = 0; c < b.length; c++) {
2023 var d = a[b[c]];
2024 if (void 0 === d || null === d || "" === d) {
2025 return !1;
2026 }
2027 }
2028 return !0;
2029 }
2030 function Pd(a) {
2031 var b = a;
2032 if ("object" == typeof a && null != a) {
2033 b = "length" in a ? [] : {};
2034 for (var c in a) {
2035 r(b, c, Pd(a[c]));
2036 }
2037 }
2038 return b;
2039 }
2040 function Lj(a) {
2041 var b = {}, c = a[Mj], d = a[Nj];
2042 if (a = a[Oj], !c || !a) {
2043 throw Error("Invalid provider user info!");
2044 }
2045 b[Pj] = d || null;
2046 b[Qj] = c;
2047 r(this, Rj, a);
2048 r(this, Sj, Pd(b));
2049 }
2050 function k(a, b) {
2051 this.code = Hb + a;
2052 this.message = b || Tj[a] || "";
2053 }
2054 function Hg(a) {
2055 var b = a && a.code;
2056 return b ? new k(b.substring(Hb.length), a.message) : null;
2057 }
2058 function Ig(a) {
2059 var b = a[Uj];
2060 if (void 0 === b) {
2061 throw new k("missing-continue-uri");
2062 }
2063 if ("string" != typeof b || "string" == typeof b && !b.length) {
2064 throw new k("invalid-continue-uri");
2065 }
2066 this.h = b;
2067 this.c = this.a = null;
2068 this.g = !1;
2069 var c = a[Jg];
2070 if (c && "object" == typeof c) {
2071 b = c[Kg];
2072 var d = c[Lg];
2073 if (c = c[Mg], "string" == typeof b && b.length) {
2074 if (this.a = b, void 0 !== d && "boolean" != typeof d) {
2075 throw new k("argument-error", Lg + " property must be a boolean when specified.");
2076 }
2077 if (this.g = !!d, void 0 !== c && ("string" != typeof c || "string" == typeof c && !c.length)) {
2078 throw new k("argument-error", Mg + " property must be a non empty string when specified.");
2079 }
2080 this.c = c || null;
2081 } else {
2082 if (void 0 !== b) {
2083 throw new k("argument-error", Kg + " property must be a non empty string when specified.");
2084 }
2085 if (void 0 !== d || void 0 !== c) {
2086 throw new k("missing-android-pkg-name");
2087 }
2088 }
2089 } else {
2090 if (void 0 !== c) {
2091 throw new k("argument-error", Jg + " property must be a non null object when specified.");
2092 }
2093 }
2094 if (this.b = null, (b = a[Ng]) && "object" == typeof b) {
2095 if ("string" == typeof(b = b[Og]) && b.length) {
2096 this.b = b;
2097 } else {
2098 if (void 0 !== b) {
2099 throw new k("argument-error", Og + " property must be a non empty string when specified.");
2100 }
2101 }
2102 } else {
2103 if (void 0 !== b) {
2104 throw new k("argument-error", Ng + " property must be a non null object when specified.");
2105 }
2106 }
2107 if (void 0 !== (a = a[Qd]) && "boolean" != typeof a) {
2108 throw new k("argument-error", Qd + " property must be a boolean when specified.");
2109 }
2110 if ((this.f = !!a) && !this.b && !this.a) {
2111 throw new k("argument-error", Qd + " property can't be true when no mobile application is provided.");
2112 }
2113 }
2114 function Pg(a) {
2115 var b = {};
2116 b.continueUrl = a.h;
2117 b.canHandleCodeInApp = a.f;
2118 (b.androidPackageName = a.a) && (b.androidMinimumVersion = a.c, b.androidInstallApp = a.g);
2119 b.iOSBundleId = a.b;
2120 for (var c in b) {
2121 null === b[c] && delete b[c];
2122 }
2123 return b;
2124 }
2125 function Vj(a) {
2126 this.b = a.sub;
2127 Ia();
2128 this.a = a.provider_id || a.firebase && a.firebase.sign_in_provider || null;
2129 }
2130 function Qg(a) {
2131 if (a = a.split("."), 3 != a.length) {
2132 return null;
2133 }
2134 a = a[1];
2135 for (var b = (4 - a.length % 4) % 4, c = 0; c < b; c++) {
2136 a += ".";
2137 }
2138 try {
2139 var d = JSON.parse(jj(a));
2140 if (d.sub && d.iss && d.aud && d.exp) {
2141 return new Vj(d);
2142 }
2143 } catch (e) {
2144 }
2145 return null;
2146 }
2147 function Rd(a) {
2148 for (var b in Sd) {
2149 if (Sd[b].Na == a) {
2150 return Sd[b];
2151 }
2152 }
2153 return null;
2154 }
2155 function Td(a) {
2156 var b = {};
2157 b["facebook.com"] = Rg;
2158 b["google.com"] = Sg;
2159 b["github.com"] = Tg;
2160 b["twitter.com"] = Ug;
2161 var c = a && a[Vg];
2162 try {
2163 if (c) {
2164 return b[c] ? new b[c](a) : new ca(a);
2165 }
2166 if (void 0 !== a[Ud]) {
2167 return new Vd(a);
2168 }
2169 } catch (d) {
2170 }
2171 return null;
2172 }
2173 function Vd(a) {
2174 var b = a[Vg];
2175 if (!b && a[Ud]) {
2176 var c = Qg(a[Ud]);
2177 c && c.a && (b = c.a);
2178 }
2179 if (!b) {
2180 throw Error("Invalid additional user info!");
2181 }
2182 "anonymous" != b && "custom" != b || (b = null);
2183 c = !1;
2184 void 0 !== a.isNewUser ? c = !!a.isNewUser : "identitytoolkit#SignupNewUserResponse" === a.kind && (c = !0);
2185 r(this, "providerId", b);
2186 r(this, "isNewUser", c);
2187 }
2188 function ca(a) {
2189 Vd.call(this, a);
2190 a = Gb(a.rawUserInfo || "{}");
2191 r(this, "profile", Pd(a || {}));
2192 }
2193 function Rg(a) {
2194 if (ca.call(this, a), "facebook.com" != this.providerId) {
2195 throw Error("Invalid provider ID!");
2196 }
2197 }
2198 function Tg(a) {
2199 if (ca.call(this, a), "github.com" != this.providerId) {
2200 throw Error("Invalid provider ID!");
2201 }
2202 r(this, "username", this.profile && this.profile.login || null);
2203 }
2204 function Sg(a) {
2205 if (ca.call(this, a), "google.com" != this.providerId) {
2206 throw Error("Invalid provider ID!");
2207 }
2208 }
2209 function Ug(a) {
2210 if (ca.call(this, a), "twitter.com" != this.providerId) {
2211 throw Error("Invalid provider ID!");
2212 }
2213 r(this, "username", a.screenName || null);
2214 }
2215 function zc(a, b) {
2216 return a.then(function(a) {
2217 if (a[V]) {
2218 var c = Qg(a[V]);
2219 if (!c || b != c.b) {
2220 throw new k("user-mismatch");
2221 }
2222 return a;
2223 }
2224 throw new k("user-mismatch");
2225 }).s(function(a) {
2226 throw a && a.code && a.code == Hb + "user-not-found" ? new k("user-mismatch") : a;
2227 });
2228 }
2229 function $a(a, b) {
2230 if (b.idToken || b.accessToken) {
2231 b.idToken && r(this, "idToken", b.idToken), b.accessToken && r(this, "accessToken", b.accessToken);
2232 } else {
2233 if (!b.oauthToken || !b.oauthTokenSecret) {
2234 throw new k("internal-error", "failed to construct a credential");
2235 }
2236 r(this, "accessToken", b.oauthToken);
2237 r(this, "secret", b.oauthTokenSecret);
2238 }
2239 r(this, "providerId", a);
2240 }
2241 function Wd(a) {
2242 var b = {};
2243 return a.idToken && (b.id_token = a.idToken), a.accessToken && (b.access_token = a.accessToken), a.secret && (b.oauth_token_secret = a.secret), b.providerId = a.providerId, {postBody:"" + jg(b), requestUri:"http://localhost"};
2244 }
2245 function Ib(a, b) {
2246 this.rc = b || [];
2247 ba(this, {providerId:a, isOAuthProvider:!0});
2248 this.rb = {};
2249 this.Wa = (Rd(a) || {}).Ma || null;
2250 this.Ua = null;
2251 }
2252 function N(a) {
2253 Ib.call(this, a, Ac);
2254 this.a = [];
2255 }
2256 function ab() {
2257 N.call(this, "facebook.com");
2258 }
2259 function Wg(a) {
2260 if (!a) {
2261 throw new k("argument-error", "credential failed: expected 1 argument (the OAuth access token).");
2262 }
2263 var b = a;
2264 return O(a) && (b = a.accessToken), (new ab).credential(null, b);
2265 }
2266 function bb() {
2267 N.call(this, "github.com");
2268 }
2269 function Xg(a) {
2270 if (!a) {
2271 throw new k("argument-error", "credential failed: expected 1 argument (the OAuth access token).");
2272 }
2273 var b = a;
2274 return O(a) && (b = a.accessToken), (new bb).credential(null, b);
2275 }
2276 function cb() {
2277 N.call(this, "google.com");
2278 this.sa("profile");
2279 }
2280 function Yg(a, b) {
2281 var c = a;
2282 return O(a) && (c = a.idToken, b = a.accessToken), (new cb).credential(c, b);
2283 }
2284 function Jb() {
2285 Ib.call(this, "twitter.com", Zg);
2286 }
2287 function $g(a, b) {
2288 var c = a;
2289 if (O(c) || (c = {oauthToken:a, oauthTokenSecret:b}), !c.oauthToken || !c.oauthTokenSecret) {
2290 throw new k("argument-error", "credential failed: expected 2 arguments (the OAuth access token and secret).");
2291 }
2292 return new $a("twitter.com", c);
2293 }
2294 function Kb(a, b) {
2295 this.a = a;
2296 this.f = b;
2297 r(this, "providerId", "password");
2298 }
2299 function Xd() {
2300 ba(this, {providerId:"password", isOAuthProvider:!1});
2301 }
2302 function db(a) {
2303 if (!(a.Pa && a.Oa || a.Da && a.Y)) {
2304 throw new k("internal-error");
2305 }
2306 this.a = a;
2307 r(this, "providerId", "phone");
2308 }
2309 function Yd(a) {
2310 return a.a.Da && a.a.Y ? {temporaryProof:a.a.Da, phoneNumber:a.a.Y} : {sessionInfo:a.a.Pa, code:a.a.Oa};
2311 }
2312 function Ja(a) {
2313 try {
2314 this.a = a || q.auth();
2315 } catch (b) {
2316 throw new k("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().");
2317 }
2318 ba(this, {providerId:"phone", isOAuthProvider:!1});
2319 }
2320 function ah(a, b) {
2321 if (!a) {
2322 throw new k("missing-verification-id");
2323 }
2324 if (!b) {
2325 throw new k("missing-verification-code");
2326 }
2327 return new db({Pa:a, Oa:b});
2328 }
2329 function Bc(a) {
2330 if (a.temporaryProof && a.phoneNumber) {
2331 return new db({Da:a.temporaryProof, Y:a.phoneNumber});
2332 }
2333 var b = a && a.providerId;
2334 if (!b || "password" === b) {
2335 return null;
2336 }
2337 var c = a && a.oauthAccessToken, d = a && a.oauthTokenSecret;
2338 a = a && a.oauthIdToken;
2339 try {
2340 switch(b) {
2341 case "google.com":
2342 return Yg(a, c);
2343 case "facebook.com":
2344 return Wg(c);
2345 case "github.com":
2346 return Xg(c);
2347 case "twitter.com":
2348 return $g(c, d);
2349 default:
2350 return (new N(b)).credential(a, c);
2351 }
2352 } catch (e) {
2353 return null;
2354 }
2355 }
2356 function Zd(a) {
2357 if (!a.isOAuthProvider) {
2358 throw new k("invalid-oauth-provider");
2359 }
2360 }
2361 function ka(a, b, c, d, e) {
2362 if (this.b = a, this.c = b || null, this.f = c || null, this.g = d || null, this.a = e || null, !this.f && !this.a) {
2363 throw new k("invalid-auth-event");
2364 }
2365 if (this.f && this.a) {
2366 throw new k("invalid-auth-event");
2367 }
2368 if (this.f && !this.g) {
2369 throw new k("invalid-auth-event");
2370 }
2371 }
2372 function bh(a) {
2373 return a = a || {}, a.type ? new ka(a.type, a.eventId, a.urlResponse, a.sessionId, a.error && Hg(a.error)) : null;
2374 }
2375 function $d() {
2376 this.b = null;
2377 this.a = [];
2378 }
2379 function ae(a) {
2380 var b = "unauthorized-domain", c = void 0, d = pa(a);
2381 a = d.b;
2382 d = d.c;
2383 "chrome-extension" == d ? c = Tc("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.", a) : "http" == d || "https" == d ? c = Tc("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.", a) : b = "operation-not-supported-in-this-environment";
2384 k.call(this, b, c);
2385 }
2386 function Lb(a, b, c) {
2387 k.call(this, a, c);
2388 a = b || {};
2389 a.sb && r(this, "email", a.sb);
2390 a.Y && r(this, "phoneNumber", a.Y);
2391 a.credential && r(this, "credential", a.credential);
2392 }
2393 function Cc(a) {
2394 if (a.code) {
2395 var b = a.code || "";
2396 0 == b.indexOf(Hb) && (b = b.substring(Hb.length));
2397 var c = {credential:Bc(a)};
2398 if (a.email) {
2399 c.sb = a.email;
2400 } else {
2401 if (!a.phoneNumber) {
2402 return new k(b, a.message || void 0);
2403 }
2404 c.Y = a.phoneNumber;
2405 }
2406 return new Lb(b, c, a.message);
2407 }
2408 return null;
2409 }
2410 function Dc(a) {
2411 this.f = a;
2412 }
2413 function da(a, b, c) {
2414 var d = "Node" == U();
2415 if (!(d = l.XMLHttpRequest || d && q.INTERNAL.node && q.INTERNAL.node.XMLHttpRequest)) {
2416 throw new k("internal-error", "The XMLHttpRequest compatibility library was not found.");
2417 }
2418 this.b = a;
2419 a = b || {};
2420 this.i = a.secureTokenEndpoint || "https://securetoken.googleapis.com/v1/token";
2421 this.l = a.secureTokenTimeout || Wj;
2422 this.c = rb(a.secureTokenHeaders || Xj);
2423 this.g = a.firebaseEndpoint || "https://www.googleapis.com/identitytoolkit/v3/relyingparty/";
2424 this.h = a.firebaseTimeout || Yj;
2425 this.a = rb(a.firebaseHeaders || Zj);
2426 c && (this.a["X-Client-Version"] = c, this.c["X-Client-Version"] = c);
2427 this.f = new wc;
2428 this.o = new Dc(d);
2429 }
2430 function ch(a, b) {
2431 b ? a.a["X-Firebase-Locale"] = b : delete a.a["X-Firebase-Locale"];
2432 }
2433 function dh(a, b) {
2434 b ? (a.a["X-Client-Version"] = b, a.c["X-Client-Version"] = b) : (delete a.a["X-Client-Version"], delete a.c["X-Client-Version"]);
2435 }
2436 function eh(a, b, c, d, e, g, h) {
2437 Nd() ? (Ej() ? a = n(a.m, a) : (be || (be = new t(function(a, b) {
2438 ak(a, b);
2439 })), a = n(a.u, a)), a(b, c, d, e, g, h)) : c && c(null);
2440 }
2441 function ak(a, b) {
2442 ((window.gapi || {}).client || {}).request ? a() : (l[fh] = function() {
2443 ((window.gapi || {}).client || {}).request ? a() : b(Error("CORS_UNSUPPORTED"));
2444 }, mj(Fd(gd(bk, {onload:fh})), function() {
2445 b(Error("CORS_UNSUPPORTED"));
2446 }));
2447 }
2448 function ck(a, b) {
2449 return new t(function(c, d) {
2450 "refresh_token" == b.grant_type && b.refresh_token || "authorization_code" == b.grant_type && b.code ? eh(a, a.i + "?key=" + encodeURIComponent(a.b), function(a) {
2451 a ? a.error ? d(ce(a)) : a.access_token && a.refresh_token ? c(a) : d(new k("internal-error")) : d(new k("network-request-failed"));
2452 }, "POST", "" + jg(b), a.c, a.l.get()) : d(new k("internal-error"));
2453 });
2454 }
2455 function dk(a, b, c, d, e, g) {
2456 var h = pa(a.g + b);
2457 A(h, "key", a.b);
2458 g && A(h, "cb", "" + Ia());
2459 var f = "GET" == c;
2460 if (f) {
2461 for (var l in d) {
2462 d.hasOwnProperty(l) && A(h, l, d[l]);
2463 }
2464 }
2465 return new t(function(b, g) {
2466 eh(a, "" + h, function(a) {
2467 a ? a.error ? g(ce(a, e || {})) : b(a) : g(new k("network-request-failed"));
2468 }, c, f ? void 0 : Ff(Cg(d)), a.a, a.h.get());
2469 });
2470 }
2471 function Ec(a) {
2472 if (!ek.test(a.email)) {
2473 throw new k("invalid-email");
2474 }
2475 }
2476 function gh(a) {
2477 "email" in a && Ec(a);
2478 }
2479 function fk(a, b) {
2480 return v(a, gk, {identifier:b, continueUri:yc() ? xc() : "http://localhost"}).then(function(a) {
2481 return a.allProviders || [];
2482 });
2483 }
2484 function hk(a) {
2485 return v(a, ik, {}).then(function(a) {
2486 return a.authorizedDomains || [];
2487 });
2488 }
2489 function sa(a) {
2490 if (!a[V]) {
2491 throw new k("internal-error");
2492 }
2493 }
2494 function de(a) {
2495 if (a.phoneNumber || a.temporaryProof) {
2496 if (!a.phoneNumber || !a.temporaryProof) {
2497 throw new k("internal-error");
2498 }
2499 } else {
2500 if (!a.sessionInfo) {
2501 throw new k("missing-verification-id");
2502 }
2503 if (!a.code) {
2504 throw new k("missing-verification-code");
2505 }
2506 }
2507 }
2508 function jk(a, b) {
2509 return v(a, kk, b);
2510 }
2511 function lk(a, b, c) {
2512 return v(a, mk, {idToken:b, deleteProvider:c});
2513 }
2514 function ee(a) {
2515 if (!a.requestUri || !a.sessionId && !a.postBody) {
2516 throw new k("internal-error");
2517 }
2518 }
2519 function hh(a) {
2520 var b = null;
2521 if (a.needConfirmation ? (a.code = "account-exists-with-different-credential", b = Cc(a)) : "FEDERATED_USER_ID_ALREADY_LINKED" == a.errorMessage ? (a.code = "credential-already-in-use", b = Cc(a)) : "EMAIL_EXISTS" == a.errorMessage ? (a.code = "email-already-in-use", b = Cc(a)) : a.errorMessage && (b = ih(a.errorMessage)), b) {
2522 throw b;
2523 }
2524 if (!a[V]) {
2525 throw new k("internal-error");
2526 }
2527 }
2528 function jh(a, b) {
2529 return b.returnIdpCredential = !0, v(a, nk, b);
2530 }
2531 function kh(a, b) {
2532 return b.returnIdpCredential = !0, v(a, ok, b);
2533 }
2534 function lh(a, b) {
2535 return b.returnIdpCredential = !0, b.autoCreate = !1, v(a, pk, b);
2536 }
2537 function fe(a) {
2538 if (!a.oobCode) {
2539 throw new k("invalid-action-code");
2540 }
2541 }
2542 function v(a, b, c) {
2543 if (!Kj(c, b.ea)) {
2544 return z(new k("internal-error"));
2545 }
2546 var d, e = b.zb || "POST";
2547 return p(c).then(b.D).then(function() {
2548 return b.T && (c.returnSecureToken = !0), dk(a, b.endpoint, e, c, b.Pb, b.nb || !1);
2549 }).then(function(a) {
2550 return d = a;
2551 }).then(b.O).then(function() {
2552 if (!b.ga) {
2553 return d;
2554 }
2555 if (!(b.ga in d)) {
2556 throw new k("internal-error");
2557 }
2558 return d[b.ga];
2559 });
2560 }
2561 function ih(a) {
2562 return ce({error:{errors:[{message:a}], code:400, message:a}});
2563 }
2564 function ce(a, b) {
2565 var c = (a.error && a.error.errors && a.error.errors[0] || {}).reason || "", d = {keyInvalid:"invalid-api-key", ipRefererBlocked:"app-not-authorized"};
2566 if (c = d[c] ? new k(d[c]) : null) {
2567 return c;
2568 }
2569 c = a.error && a.error.message || "";
2570 d = {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", FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",
2571 INVALID_MESSAGE_PAYLOAD:"invalid-message-payload", INVALID_RECIPIENT_EMAIL:"invalid-recipient-email", INVALID_SENDER:"invalid-sender", EMAIL_NOT_FOUND:"user-not-found", EXPIRED_OOB_CODE:"expired-action-code", INVALID_OOB_CODE:"invalid-action-code", MISSING_OOB_CODE:"internal-error", CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login", INVALID_ID_TOKEN:"invalid-user-token", TOKEN_EXPIRED:"user-token-expired", USER_NOT_FOUND:"user-token-expired", CORS_UNSUPPORTED:"cors-unsupported", DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",
2572 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",
2573 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", 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_OAUTH_CLIENT_ID:"invalid-oauth-client-id", INVALID_CERT_HASH:"invalid-cert-hash"};
2574 ma(d, b || {});
2575 b = (b = c.match(/^[^\s]+\s*:\s*(.*)$/)) && 1 < b.length ? b[1] : void 0;
2576 for (var e in d) {
2577 if (0 === c.indexOf(e)) {
2578 return new k(d[e], b);
2579 }
2580 }
2581 return !b && a && (b = Fb(a)), new k("internal-error", b);
2582 }
2583 function Mb(a) {
2584 for (var b in ge) {
2585 if (ge[b].id === a) {
2586 return a = ge[b], {firebaseEndpoint:a.Va, secureTokenEndpoint:a.ab};
2587 }
2588 }
2589 return null;
2590 }
2591 function qk(a) {
2592 this.b = a;
2593 this.a = null;
2594 this.Ya = rk(this);
2595 }
2596 function rk(a) {
2597 return sk().then(function() {
2598 return new t(function(b, c) {
2599 y("gapi.iframes.getContext")().open({where:document.body, url:a.b, messageHandlersFilter:y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"), attributes:{style:{position:"absolute", top:"-100px", width:"1px", height:"1px"}}, dontclear:!0}, function(d) {
2600 function e() {
2601 clearTimeout(g);
2602 b();
2603 }
2604 a.a = d;
2605 a.a.restyle({setHideOnLeave:!1});
2606 var g = setTimeout(function() {
2607 c(Error("Network Error"));
2608 }, tk.get());
2609 d.ping(e).then(e, function() {
2610 c(Error("Network Error"));
2611 });
2612 });
2613 });
2614 });
2615 }
2616 function uk(a, b) {
2617 return a.Ya.then(function() {
2618 return new t(function(c) {
2619 a.a.send(b.type, b, c, y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"));
2620 });
2621 });
2622 }
2623 function vk(a, b) {
2624 a.Ya.then(function() {
2625 a.a.register("authEvent", b, y("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"));
2626 });
2627 }
2628 function sk() {
2629 return he || (he = (new t(function(a, b) {
2630 if (Nd()) {
2631 var c = function() {
2632 Eg();
2633 y("gapi.load")("gapi.iframes", {callback:a, ontimeout:function() {
2634 Eg();
2635 b(Error("Network Error"));
2636 }, timeout:wk.get()});
2637 };
2638 if (y("gapi.iframes.Iframe")) {
2639 a();
2640 } else {
2641 if (y("gapi.load")) {
2642 c();
2643 } else {
2644 var d = "__iframefcb" + Math.floor(1E6 * Math.random());
2645 l[d] = function() {
2646 y("gapi.load") ? c() : b(Error("Network Error"));
2647 };
2648 d = gd(xk, {onload:d});
2649 p(Fd(d)).s(function() {
2650 b(Error("Network Error"));
2651 });
2652 }
2653 }
2654 } else {
2655 b(Error("Network Error"));
2656 }
2657 })).s(function(a) {
2658 throw he = null, a;
2659 }));
2660 }
2661 function mh(a, b, c) {
2662 this.i = a;
2663 this.g = b;
2664 this.h = c;
2665 this.f = null;
2666 this.a = hg(this.i, "/__/auth/iframe");
2667 A(this.a, "apiKey", this.g);
2668 A(this.a, "appName", this.h);
2669 this.b = null;
2670 this.c = [];
2671 }
2672 function nh(a, b, c, d, e) {
2673 this.m = a;
2674 this.u = b;
2675 this.c = c;
2676 this.l = d;
2677 this.i = this.g = this.h = null;
2678 this.a = e;
2679 this.f = null;
2680 }
2681 function ie(a) {
2682 try {
2683 return q.app(a).auth().Ka();
2684 } catch (b) {
2685 return [];
2686 }
2687 }
2688 function oh(a, b, c, d, e) {
2689 this.u = a;
2690 this.f = b;
2691 this.b = c;
2692 this.c = d || null;
2693 this.h = e || null;
2694 this.m = this.o = this.v = null;
2695 this.g = [];
2696 this.l = this.a = null;
2697 }
2698 function ph(a) {
2699 var b = xc();
2700 return hk(a).then(function(a) {
2701 a: {
2702 var c = pa(b), e = c.c;
2703 c = c.b;
2704 for (var g = 0; g < a.length; g++) {
2705 var h = a[g], f = c, k = e;
2706 if (0 == h.indexOf("chrome-extension://") ? f = pa(h).b == f && "chrome-extension" == k : "http" != k && "https" != k ? f = !1 : yk.test(h) ? f = f == h : (h = h.split(".").join("\\."), f = RegExp("^(.+\\." + h + "|" + h + ")$", "i").test(f)), f) {
2707 a = !0;
2708 break a;
2709 }
2710 }
2711 a = !1;
2712 }
2713 if (!a) {
2714 throw new ae(xc());
2715 }
2716 });
2717 }
2718 function qh(a) {
2719 return a.l ? a.l : (a.l = Jd().then(function() {
2720 if (!a.o) {
2721 var b = a.c, c = a.h, d = ie(a.b), e = new mh(a.u, a.f, a.b);
2722 e.f = b;
2723 e.b = c;
2724 e.c = xa(d || []);
2725 a.o = "" + e;
2726 }
2727 a.i = new qk(a.o);
2728 zk(a);
2729 }), a.l);
2730 }
2731 function rh(a) {
2732 return a.m || (a.v = a.c ? Ya(a.c, ie(a.b)) : null, a.m = new da(a.f, Mb(a.h), a.v)), a.m;
2733 }
2734 function Nb(a, b, c, d, e, g, h, f, k, l) {
2735 return a = new nh(a, b, c, d, e), a.h = g, a.g = h, a.i = f, a.b = rb(k || null), a.f = l, "" + a;
2736 }
2737 function zk(a) {
2738 if (!a.i) {
2739 throw Error("IfcHandler must be initialized!");
2740 }
2741 vk(a.i, function(b) {
2742 var c = {};
2743 if (b && b.authEvent) {
2744 var d = !1;
2745 b = bh(b.authEvent);
2746 for (c = 0; c < a.g.length; c++) {
2747 d = a.g[c](b) || d;
2748 }
2749 return c = {}, c.status = d ? "ACK" : "ERROR", p(c);
2750 }
2751 return c.status = "ERROR", p(c);
2752 });
2753 }
2754 function Ak(a) {
2755 var b = {type:"webStorageSupport"};
2756 return qh(a).then(function() {
2757 return uk(a.i, b);
2758 }).then(function(a) {
2759 if (a && a.length && void 0 !== a[0].webStorageSupport) {
2760 return a[0].webStorageSupport;
2761 }
2762 throw Error();
2763 });
2764 }
2765 function sh(a) {
2766 if (this.a = a || q.INTERNAL.reactNative && q.INTERNAL.reactNative.AsyncStorage, !this.a) {
2767 throw new k("internal-error", "The React Native compatibility library was not found.");
2768 }
2769 }
2770 function Fc() {
2771 this.a = {};
2772 }
2773 function th(a, b, c, d, e, g) {
2774 try {
2775 var h = !!l.indexedDB;
2776 } catch (Zb) {
2777 h = !1;
2778 }
2779 if (!h) {
2780 throw new k("web-storage-unsupported");
2781 }
2782 this.u = a;
2783 this.h = b;
2784 this.g = c;
2785 this.l = d;
2786 this.m = e;
2787 this.f = {};
2788 this.c = [];
2789 this.a = 0;
2790 this.o = g || l.indexedDB;
2791 }
2792 function Bk(a) {
2793 return new t(function(b, c) {
2794 var d = a.o.open(a.u, a.m);
2795 d.onerror = function(a) {
2796 c(Error(a.target.errorCode));
2797 };
2798 d.onupgradeneeded = function(b) {
2799 b = b.target.result;
2800 try {
2801 b.createObjectStore(a.h, {keyPath:a.g});
2802 } catch (g) {
2803 c(g);
2804 }
2805 };
2806 d.onsuccess = function(a) {
2807 b(a.target.result);
2808 };
2809 });
2810 }
2811 function Gc(a) {
2812 return a.i || (a.i = Bk(a)), a.i;
2813 }
2814 function Ob(a, b) {
2815 return b.objectStore(a.h);
2816 }
2817 function Pb(a, b, c) {
2818 return b.transaction([a.h], c ? "readwrite" : "readonly");
2819 }
2820 function eb(a) {
2821 return new t(function(b, c) {
2822 a.onsuccess = function(a) {
2823 a && a.target ? b(a.target.result) : b();
2824 };
2825 a.onerror = function(a) {
2826 c(Error(a.target.errorCode));
2827 };
2828 });
2829 }
2830 function Ck(a) {
2831 function b() {
2832 return a.b = Ca(800).then(n(a.zc, a)).then(function(b) {
2833 0 < b.length && M(a.c, function(a) {
2834 a(b);
2835 });
2836 }).then(b).s(function(a) {
2837 "STOP_EVENT" != a.message && b();
2838 }), a.b;
2839 }
2840 a.b && a.b.cancel("STOP_EVENT");
2841 b();
2842 }
2843 function je() {
2844 if (!Dk()) {
2845 if ("Node" == U()) {
2846 throw new k("internal-error", "The LocalStorage compatibility library was not found.");
2847 }
2848 throw new k("web-storage-unsupported");
2849 }
2850 this.a = uh() || q.INTERNAL.node.localStorage;
2851 }
2852 function uh() {
2853 try {
2854 var a = l.localStorage, b = Za();
2855 return a && (a.setItem(b, "1"), a.removeItem(b)), a;
2856 } catch (c) {
2857 return null;
2858 }
2859 }
2860 function Dk() {
2861 var a = "Node" == U();
2862 if (!(a = uh() || a && q.INTERNAL.node && q.INTERNAL.node.localStorage)) {
2863 return !1;
2864 }
2865 try {
2866 return a.setItem("__sak", "1"), a.removeItem("__sak"), !0;
2867 } catch (b) {
2868 return !1;
2869 }
2870 }
2871 function vh() {
2872 }
2873 function ke() {
2874 if (!Ek()) {
2875 if ("Node" == U()) {
2876 throw new k("internal-error", "The SessionStorage compatibility library was not found.");
2877 }
2878 throw new k("web-storage-unsupported");
2879 }
2880 this.a = wh() || q.INTERNAL.node.sessionStorage;
2881 }
2882 function wh() {
2883 try {
2884 var a = l.sessionStorage, b = Za();
2885 return a && (a.setItem(b, "1"), a.removeItem(b)), a;
2886 } catch (c) {
2887 return null;
2888 }
2889 }
2890 function Ek() {
2891 var a = "Node" == U();
2892 if (!(a = wh() || a && q.INTERNAL.node && q.INTERNAL.node.sessionStorage)) {
2893 return !1;
2894 }
2895 try {
2896 return a.setItem("__sak", "1"), a.removeItem("__sak"), !0;
2897 } catch (b) {
2898 return !1;
2899 }
2900 }
2901 function Fk() {
2902 var a = {};
2903 a.Browser = Gk;
2904 a.Node = Hk;
2905 a.ReactNative = Ik;
2906 this.a = a[U()];
2907 }
2908 function Jk(a) {
2909 var b = new k("invalid-persistence-type"), c = new k("unsupported-persistence-type");
2910 a: {
2911 for (d in fb) {
2912 if (fb[d] == a) {
2913 var d = !0;
2914 break a;
2915 }
2916 }
2917 d = !1;
2918 }
2919 if (!d || "string" != typeof a) {
2920 throw b;
2921 }
2922 switch(U()) {
2923 case "ReactNative":
2924 if ("session" === a) {
2925 throw c;
2926 }
2927 break;
2928 case "Node":
2929 if ("none" !== a) {
2930 throw c;
2931 }
2932 break;
2933 default:
2934 if (!Md() && "none" !== a) {
2935 throw c;
2936 }
2937 }
2938 }
2939 function Qb(a, b, c, d, e) {
2940 this.i = a;
2941 this.g = b;
2942 this.A = c;
2943 this.u = d;
2944 this.v = e;
2945 this.a = {};
2946 le || (le = new Fk);
2947 a = le;
2948 try {
2949 if (Hd()) {
2950 me || (me = new th("firebaseLocalStorageDb", "firebaseLocalStorage", "fbase_key", "value", 1));
2951 var g = me;
2952 } else {
2953 g = new a.a.C;
2954 }
2955 this.l = g;
2956 } catch (h) {
2957 this.l = new Fc, this.u = !0;
2958 }
2959 try {
2960 this.o = new a.a.jb;
2961 } catch (h) {
2962 this.o = new Fc;
2963 }
2964 this.w = new Fc;
2965 this.h = n(this.m, this);
2966 this.b = {};
2967 }
2968 function Rb() {
2969 return ne || (ne = new Qb("firebase", ":", !(Dg(F()) || !Ld()), Eb(), Md())), ne;
2970 }
2971 function gb(a, b) {
2972 switch(b) {
2973 case "session":
2974 return a.o;
2975 case "none":
2976 return a.w;
2977 default:
2978 return a.l;
2979 }
2980 }
2981 function Sb(a, b, c) {
2982 return a.i + a.g + b.name + (c ? a.g + c : "");
2983 }
2984 function hb(a, b, c) {
2985 return c = Sb(a, b, c), "local" == b.C && (a.b[c] = null), gb(a, b.C).X(c);
2986 }
2987 function xh(a, b, c, d) {
2988 b = Sb(a, b, c);
2989 a.v && (a.b[b] = l.localStorage.getItem(b));
2990 qb(a.a) && (gb(a, "local").ia(a.h), a.u || Hd() || !a.v || Kk(a));
2991 a.a[b] || (a.a[b] = []);
2992 a.a[b].push(d);
2993 }
2994 function Lk(a, b, c) {
2995 b = Sb(a, ea("local"), b);
2996 a.a[b] && (Z(a.a[b], function(a) {
2997 return a == c;
2998 }), 0 == a.a[b].length && delete a.a[b]);
2999 qb(a.a) && Mk(a);
3000 }
3001 function Kk(a) {
3002 oe(a);
3003 a.f = setInterval(function() {
3004 for (var b in a.a) {
3005 var c = l.localStorage.getItem(b), d = a.b[b];
3006 c != d && (a.b[b] = c, c = new Ba({type:"storage", key:b, target:window, oldValue:d, newValue:c, a:!0}), a.m(c));
3007 }
3008 }, 1E3);
3009 }
3010 function oe(a) {
3011 a.f && (clearInterval(a.f), a.f = null);
3012 }
3013 function Mk(a) {
3014 gb(a, "local").da(a.h);
3015 oe(a);
3016 }
3017 function Nk(a) {
3018 this.a = a;
3019 this.b = Rb();
3020 }
3021 function Ok(a) {
3022 return a.b.get(pe, a.a).then(function(a) {
3023 return bh(a);
3024 });
3025 }
3026 function Pk() {
3027 this.a = Rb();
3028 }
3029 function yh(a, b, c, d, e, g, h) {
3030 this.u = a;
3031 this.i = b;
3032 this.l = c;
3033 this.m = d || null;
3034 this.o = h || null;
3035 this.h = b + ":" + c;
3036 this.A = new Pk;
3037 this.g = new Nk(this.h);
3038 this.f = null;
3039 this.b = [];
3040 this.v = e || 500;
3041 this.w = g || 2E3;
3042 this.a = this.c = null;
3043 }
3044 function Hc(a) {
3045 return new k("invalid-cordova-configuration", a);
3046 }
3047 function Qk() {
3048 for (var a = 20, b = []; 0 < a;) {
3049 b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62 * Math.random()))), a--;
3050 }
3051 return b.join("");
3052 }
3053 function Rk(a) {
3054 var b = new bg;
3055 Cd(b, a);
3056 a = [];
3057 var c = 8 * b.g;
3058 56 > b.c ? Cd(b, zh, 56 - b.c) : Cd(b, zh, b.b - (b.c - 56));
3059 for (var d = 63; 56 <= d; d--) {
3060 b.f[d] = 255 & c, c /= 256;
3061 }
3062 Bd(b);
3063 for (d = c = 0; d < b.i; d++) {
3064 for (var e = 24; 0 <= e; e -= 8) {
3065 a[c++] = b.a[d] >> e & 255;
3066 }
3067 }
3068 return ij(a);
3069 }
3070 function Sk(a, b, c, d) {
3071 var e = Qk(), g = new ka(b, d, null, e, new k("no-auth-event")), h = y("BuildInfo.packageName", l);
3072 if ("string" != typeof h) {
3073 throw new k("invalid-cordova-configuration");
3074 }
3075 var f = y("BuildInfo.displayName", l), m = {};
3076 if (F().toLowerCase().match(/iphone|ipad|ipod/)) {
3077 m.ibi = h;
3078 } else {
3079 if (!F().toLowerCase().match(/android/)) {
3080 return z(new k("operation-not-supported-in-this-environment"));
3081 }
3082 m.apn = h;
3083 }
3084 f && (m.appDisplayName = f);
3085 e = Rk(e);
3086 m.sessionId = e;
3087 var n = Nb(a.u, a.i, a.l, b, c, null, d, a.m, m, a.o);
3088 return a.ba().then(function() {
3089 var b = a.h;
3090 return a.A.a.set(pe, g.B(), b);
3091 }).then(function() {
3092 var b = y("cordova.plugins.browsertab.isAvailable", l);
3093 if ("function" != typeof b) {
3094 throw new k("invalid-cordova-configuration");
3095 }
3096 var c = null;
3097 b(function(b) {
3098 if (b) {
3099 if ("function" != typeof(c = y("cordova.plugins.browsertab.openUrl", l))) {
3100 throw new k("invalid-cordova-configuration");
3101 }
3102 c(n);
3103 } else {
3104 if ("function" != typeof(c = y("cordova.InAppBrowser.open", l))) {
3105 throw new k("invalid-cordova-configuration");
3106 }
3107 b = F();
3108 b = !(!b.match(/(iPad|iPhone|iPod).*OS 7_\d/i) && !b.match(/(iPad|iPhone|iPod).*OS 8_\d/i));
3109 a.a = c(n, b ? "_blank" : "_system", "location=yes");
3110 }
3111 });
3112 });
3113 }
3114 function Ah(a, b) {
3115 for (var c = 0; c < a.b.length; c++) {
3116 try {
3117 a.b[c](b);
3118 } catch (d) {
3119 }
3120 }
3121 }
3122 function Bh(a) {
3123 return a.f || (a.f = a.ba().then(function() {
3124 return new t(function(b) {
3125 function c(d) {
3126 return b(d), a.Ja(c), !1;
3127 }
3128 a.ua(c);
3129 Tk(a);
3130 });
3131 })), a.f;
3132 }
3133 function qe(a) {
3134 var b = null;
3135 return Ok(a.g).then(function(c) {
3136 return b = c, c = a.g, hb(c.b, pe, c.a);
3137 }).then(function() {
3138 return b;
3139 });
3140 }
3141 function Tk(a) {
3142 function b(b) {
3143 d = !0;
3144 e && e.cancel();
3145 qe(a).then(function(d) {
3146 var e = c;
3147 if (d && b && b.url) {
3148 e = null;
3149 var g = b.url, h = pa(g), f = Wa(h, "link"), k = Wa(pa(f), "link");
3150 h = Wa(h, "deep_link_id");
3151 g = Wa(pa(h), "link") || h || k || f || g;
3152 -1 != g.indexOf("/__/auth/callback") && (e = pa(g), e = Gb(Wa(e, "firebaseError") || null), e = (e = "object" == typeof e ? Hg(e) : null) ? new ka(d.b, d.c, null, null, e) : new ka(d.b, d.c, g, d.g));
3153 e = e || c;
3154 }
3155 Ah(a, e);
3156 });
3157 }
3158 var c = new ka("unknown", null, null, null, new k("no-auth-event")), d = !1, e = Ca(a.v).then(function() {
3159 return qe(a).then(function() {
3160 d || Ah(a, c);
3161 });
3162 }), g = l.handleOpenURL;
3163 l.handleOpenURL = function(a) {
3164 if (0 == a.toLowerCase().indexOf(y("BuildInfo.packageName", l).toLowerCase() + "://") && b({url:a}), "function" == typeof g) {
3165 try {
3166 g(a);
3167 } catch (Zb) {
3168 console.error(Zb);
3169 }
3170 }
3171 };
3172 re || (re = new $d);
3173 re.subscribe(b);
3174 }
3175 function Uk(a) {
3176 this.a = a;
3177 this.b = Rb();
3178 }
3179 function Vk(a) {
3180 return a.b.set(se, "pending", a.a);
3181 }
3182 function te(a) {
3183 return hb(a.b, se, a.a);
3184 }
3185 function Wk(a) {
3186 return a.b.get(se, a.a).then(function(a) {
3187 return "pending" == a;
3188 });
3189 }
3190 function ta(a, b, c) {
3191 this.v = a;
3192 this.l = b;
3193 this.u = c;
3194 this.h = [];
3195 this.f = !1;
3196 this.i = n(this.m, this);
3197 this.c = new Ic;
3198 this.o = new Ch;
3199 this.g = new Uk(this.l + ":" + this.u);
3200 this.b = {};
3201 this.b.unknown = this.c;
3202 this.b.signInViaRedirect = this.c;
3203 this.b.linkViaRedirect = this.c;
3204 this.b.reauthViaRedirect = this.c;
3205 this.b.signInViaPopup = this.o;
3206 this.b.linkViaPopup = this.o;
3207 this.b.reauthViaPopup = this.o;
3208 this.a = Dh(this.v, this.l, this.u, Jc);
3209 }
3210 function Dh(a, b, c, d) {
3211 var e = q.SDK_VERSION || null;
3212 return Kd() ? new yh(a, b, c, e, void 0, void 0, d) : new oh(a, b, c, e, d);
3213 }
3214 function Eh(a) {
3215 a.f || (a.f = !0, a.a.ua(a.i));
3216 var b = a.a;
3217 return a.a.ba().s(function(c) {
3218 throw a.a == b && a.reset(), c;
3219 });
3220 }
3221 function Fh(a) {
3222 a.a.Db() && Eh(a).s(function(b) {
3223 var c = new ka("unknown", null, null, null, new k("operation-not-supported-in-this-environment"));
3224 ue(b) && a.m(c);
3225 });
3226 a.a.yb() || Gh(a.c);
3227 }
3228 function Hh(a, b, c, d, e, g) {
3229 return a.a.vb(b, c, d, function() {
3230 a.f || (a.f = !0, a.a.ua(a.i));
3231 }, function() {
3232 a.reset();
3233 }, e, g);
3234 }
3235 function ue(a) {
3236 return !(!a || "auth/cordova-not-ready" != a.code);
3237 }
3238 function Ih(a, b, c) {
3239 var d = b + ":" + c;
3240 return ve[d] || (ve[d] = new ta(a, b, c)), ve[d];
3241 }
3242 function Ic() {
3243 this.b = null;
3244 this.f = [];
3245 this.c = [];
3246 this.a = null;
3247 this.g = !1;
3248 }
3249 function Gh(a) {
3250 a.g || (a.g = !0, ib(a, !1, null, null));
3251 }
3252 function Xk(a, b, c) {
3253 c = c.va(b.b, b.c);
3254 var d = b.f, e = b.g, g = !!b.b.match(/Redirect$/);
3255 return c(d, e).then(function(b) {
3256 ib(a, g, b, null);
3257 }).s(function(b) {
3258 ib(a, g, null, b);
3259 });
3260 }
3261 function Yk(a, b) {
3262 if (a.b = function() {
3263 return z(b);
3264 }, a.c.length) {
3265 for (var c = 0; c < a.c.length; c++) {
3266 a.c[c](b);
3267 }
3268 }
3269 }
3270 function Jh(a, b) {
3271 if (a.b = function() {
3272 return p(b);
3273 }, a.f.length) {
3274 for (var c = 0; c < a.f.length; c++) {
3275 a.f[c](b);
3276 }
3277 }
3278 }
3279 function ib(a, b, c, d) {
3280 b ? d ? Yk(a, d) : Jh(a, c) : Jh(a, {user:null});
3281 a.f = [];
3282 a.c = [];
3283 }
3284 function Zk(a) {
3285 var b = new k("timeout");
3286 a.a && a.a.cancel();
3287 a.a = Ca($k.get()).then(function() {
3288 a.b || ib(a, !0, null, b);
3289 });
3290 }
3291 function Ch() {
3292 }
3293 function al(a, b) {
3294 var c = a.c, d = a.b;
3295 return b.va(d, c)(a.f, a.g).then(function(a) {
3296 b.fa(d, a, null, c);
3297 }).s(function(a) {
3298 b.fa(d, null, a, c);
3299 });
3300 }
3301 function we(a, b) {
3302 this.a = b;
3303 r(this, "verificationId", a);
3304 }
3305 function xe(a, b, c, d) {
3306 return (new Ja(a)).Qa(b, c).then(function(a) {
3307 return new we(a, d);
3308 });
3309 }
3310 function Kh(a, b, c, d, e, g) {
3311 if (this.h = a, this.i = b, this.g = c, this.c = d, this.f = e, this.l = !!g, this.b = null, this.a = this.c, this.f < this.c) {
3312 throw Error("Proactive refresh lower bound greater than upper bound!");
3313 }
3314 }
3315 function bl(a, b) {
3316 return b ? (a.a = a.c, a.g()) : (b = a.a, a.a *= 2, a.a > a.f && (a.a = a.f), b);
3317 }
3318 function ye(a, b) {
3319 ze(a);
3320 a.b = Ca(bl(a, b)).then(function() {
3321 return a.l ? p() : Ij();
3322 }).then(function() {
3323 return a.h();
3324 }).then(function() {
3325 ye(a, !0);
3326 }).s(function(b) {
3327 a.i(b) && ye(a, !1);
3328 });
3329 }
3330 function ze(a) {
3331 a.b && (a.b.cancel(), a.b = null);
3332 }
3333 function Ae(a) {
3334 this.f = a;
3335 this.b = this.a = null;
3336 this.c = 0;
3337 }
3338 function Lh(a, b) {
3339 var c = b[V], d = b.refreshToken;
3340 b = Mh(b.expiresIn);
3341 a.b = c;
3342 a.c = b;
3343 a.a = d;
3344 }
3345 function Mh(a) {
3346 return Ia() + 1E3 * parseInt(a, 10);
3347 }
3348 function cl(a, b) {
3349 return ck(a.f, b).then(function(b) {
3350 return a.b = b.access_token, a.c = Mh(b.expires_in), a.a = b.refresh_token, {accessToken:a.b, expirationTime:a.c, refreshToken:a.a};
3351 }).s(function(b) {
3352 throw "auth/user-token-expired" == b.code && (a.a = null), b;
3353 });
3354 }
3355 function Kc(a, b) {
3356 this.a = a || null;
3357 this.b = b || null;
3358 ba(this, {lastSignInTime:Fg(b || null), creationTime:Fg(a || null)});
3359 }
3360 function dl(a) {
3361 return new Kc(a.a, a.b);
3362 }
3363 function el(a, b, c, d, e, g) {
3364 ba(this, {uid:a, displayName:d || null, photoURL:e || null, email:c || null, phoneNumber:g || null, providerId:b});
3365 }
3366 function Tb(a, b) {
3367 P.call(this, a);
3368 for (var c in b) {
3369 this[c] = b[c];
3370 }
3371 }
3372 function W(a, b, c) {
3373 this.A = [];
3374 this.G = a.apiKey;
3375 this.o = a.appName;
3376 this.w = a.authDomain || null;
3377 a = q.SDK_VERSION ? Ya(q.SDK_VERSION) : null;
3378 this.c = new da(this.G, Mb(Jc), a);
3379 this.h = new Ae(this.c);
3380 Be(this, b[V]);
3381 Lh(this.h, b);
3382 r(this, "refreshToken", this.h.a);
3383 Nh(this, c || {});
3384 S.call(this);
3385 this.I = !1;
3386 this.w && Ga() && (this.a = Ih(this.w, this.G, this.o));
3387 this.N = [];
3388 this.i = null;
3389 this.l = fl(this);
3390 this.U = n(this.Ga, this);
3391 var d = this;
3392 this.ha = null;
3393 this.ra = function(a) {
3394 d.na(a.h);
3395 };
3396 this.W = null;
3397 this.R = [];
3398 this.qa = function(a) {
3399 Lc(d, a.f);
3400 };
3401 this.V = null;
3402 }
3403 function Ce(a, b) {
3404 a.W && R(a.W, "languageCodeChanged", a.ra);
3405 (a.W = b) && na(b, "languageCodeChanged", a.ra);
3406 }
3407 function Lc(a, b) {
3408 a.R = b;
3409 dh(a.c, q.SDK_VERSION ? Ya(q.SDK_VERSION, a.R) : null);
3410 }
3411 function De(a, b) {
3412 a.V && R(a.V, "frameworkChanged", a.qa);
3413 (a.V = b) && na(b, "frameworkChanged", a.qa);
3414 }
3415 function Oh(a) {
3416 try {
3417 return q.app(a.o).auth();
3418 } catch (b) {
3419 throw new k("internal-error", "No firebase.auth.Auth instance is available for the Firebase App '" + a.o + "'!");
3420 }
3421 }
3422 function fl(a) {
3423 return new Kh(function() {
3424 return a.F(!0);
3425 }, function(a) {
3426 return !(!a || "auth/network-request-failed" != a.code);
3427 }, function() {
3428 var b = a.h.c - Ia() - 3E5;
3429 return 0 < b ? b : 0;
3430 }, 3E4, 96E4, !1);
3431 }
3432 function Ph(a) {
3433 a.m || a.l.b || (a.l.start(), R(a, "tokenChanged", a.U), na(a, "tokenChanged", a.U));
3434 }
3435 function Ee(a) {
3436 R(a, "tokenChanged", a.U);
3437 ze(a.l);
3438 }
3439 function Be(a, b) {
3440 a.pa = b;
3441 r(a, "_lat", b);
3442 }
3443 function gl(a, b) {
3444 Z(a.N, function(a) {
3445 return a == b;
3446 });
3447 }
3448 function Ka(a) {
3449 for (var b = [], c = 0; c < a.N.length; c++) {
3450 b.push(a.N[c](a));
3451 }
3452 return Pi(b).then(function() {
3453 return a;
3454 });
3455 }
3456 function Mc(a) {
3457 a.a && !a.I && (a.I = !0, a.a.subscribe(a));
3458 }
3459 function Nh(a, b) {
3460 ba(a, {uid:b.uid, displayName:b.displayName || null, photoURL:b.photoURL || null, email:b.email || null, emailVerified:b.emailVerified || !1, phoneNumber:b.phoneNumber || null, isAnonymous:b.isAnonymous || !1, metadata:new Kc(b.createdAt, b.lastLoginAt), providerData:[]});
3461 }
3462 function Qh() {
3463 }
3464 function Fe(a) {
3465 return p().then(function() {
3466 if (a.m) {
3467 throw new k("app-deleted");
3468 }
3469 });
3470 }
3471 function Ge(a) {
3472 return yd(a.providerData, function(a) {
3473 return a.providerId;
3474 });
3475 }
3476 function He(a, b) {
3477 b && (Rh(a, b.providerId), a.providerData.push(b));
3478 }
3479 function Rh(a, b) {
3480 Z(a.providerData, function(a) {
3481 return a.providerId == b;
3482 });
3483 }
3484 function ua(a, b, c) {
3485 ("uid" != b || c) && a.hasOwnProperty(b) && r(a, b, c);
3486 }
3487 function Sh(a, b) {
3488 a != b && (ba(a, {uid:b.uid, displayName:b.displayName, photoURL:b.photoURL, email:b.email, emailVerified:b.emailVerified, phoneNumber:b.phoneNumber, isAnonymous:b.isAnonymous, providerData:[]}), b.metadata ? r(a, "metadata", dl(b.metadata)) : r(a, "metadata", new Kc), M(b.providerData, function(b) {
3489 He(a, b);
3490 }), a.h = b.h, r(a, "refreshToken", a.h.a));
3491 }
3492 function Ie(a) {
3493 return a.F().then(function(b) {
3494 var c = a.isAnonymous;
3495 return hl(a, b).then(function() {
3496 return c || ua(a, "isAnonymous", !1), b;
3497 });
3498 });
3499 }
3500 function La(a, b) {
3501 b[V] && a.pa != b[V] && (Lh(a.h, b), E(a, new Tb("tokenChanged")), Be(a, b[V]), ua(a, "refreshToken", a.h.a));
3502 }
3503 function hl(a, b) {
3504 return v(a.c, il, {idToken:b}).then(n(a.kc, a));
3505 }
3506 function jl(a) {
3507 return (a = a.providerUserInfo) && a.length ? yd(a, function(a) {
3508 return new el(a.rawId, a.providerId, a.email, a.displayName, a.photoUrl, a.phoneNumber);
3509 }) : [];
3510 }
3511 function Nc(a, b) {
3512 return Ie(a).then(function() {
3513 if (wa(Ge(a), b)) {
3514 return Ka(a).then(function() {
3515 throw new k("provider-already-linked");
3516 });
3517 }
3518 });
3519 }
3520 function Oc(a, b, c) {
3521 var d = Bc(b);
3522 return b = Td(b), ja({user:a, credential:d, additionalUserInfo:b, operationType:c});
3523 }
3524 function Th(a, b) {
3525 return La(a, b), a.reload().then(function() {
3526 return a;
3527 });
3528 }
3529 function Uh(a, b, c, d, e) {
3530 if (!Ga()) {
3531 return z(new k("operation-not-supported-in-this-environment"));
3532 }
3533 if (a.i && !e) {
3534 return z(a.i);
3535 }
3536 var g = Rd(c.providerId), f = Za(a.uid + ":::"), l = null;
3537 (!Eb() || Ld()) && a.w && c.isOAuthProvider && (l = Nb(a.w, a.G, a.o, b, c, null, f, q.SDK_VERSION || null));
3538 var m = zg(l, g && g.za, g && g.ya);
3539 return d = d().then(function() {
3540 if (Vh(a), !e) {
3541 return a.F().then(function() {
3542 });
3543 }
3544 }).then(function() {
3545 return Hh(a.a, m, b, c, f, !!l);
3546 }).then(function() {
3547 return new t(function(c, d) {
3548 a.fa(b, null, new k("cancelled-popup-request"), a.g || null);
3549 a.f = c;
3550 a.v = d;
3551 a.g = f;
3552 a.b = a.a.Ca(a, b, m, f);
3553 });
3554 }).then(function(a) {
3555 return m && Fa(m), a ? ja(a) : null;
3556 }).s(function(a) {
3557 throw m && Fa(m), a;
3558 }), D(a, d, e);
3559 }
3560 function Wh(a, b, c, d, e) {
3561 if (!Ga()) {
3562 return z(new k("operation-not-supported-in-this-environment"));
3563 }
3564 if (a.i && !e) {
3565 return z(a.i);
3566 }
3567 var g = null, f = Za(a.uid + ":::");
3568 return d = d().then(function() {
3569 if (Vh(a), !e) {
3570 return a.F().then(function() {
3571 });
3572 }
3573 }).then(function() {
3574 return a.Z = f, Ka(a);
3575 }).then(function(b) {
3576 return a.ca && (b = a.ca, b = b.b.set(Je, a.B(), b.a)), b;
3577 }).then(function() {
3578 return a.a.Aa(b, c, f);
3579 }).s(function(b) {
3580 if (g = b, a.ca) {
3581 return Xh(a.ca);
3582 }
3583 throw g;
3584 }).then(function() {
3585 if (g) {
3586 throw g;
3587 }
3588 }), D(a, d, e);
3589 }
3590 function Vh(a) {
3591 if (!a.a || !a.I) {
3592 if (a.a && !a.I) {
3593 throw new k("internal-error");
3594 }
3595 throw new k("auth-domain-config-required");
3596 }
3597 }
3598 function D(a, b, c) {
3599 var d = kl(a, b, c);
3600 return a.A.push(d), Qa(d, function() {
3601 $b(a.A, d);
3602 }), d;
3603 }
3604 function kl(a, b, c) {
3605 return a.i && !c ? (b.cancel(), z(a.i)) : b.s(function(b) {
3606 throw !b || "auth/user-disabled" != b.code && "auth/user-token-expired" != b.code || (a.i || E(a, new Tb("userInvalidated")), a.i = b), b;
3607 });
3608 }
3609 function Yh(a) {
3610 if (!a.apiKey) {
3611 return null;
3612 }
3613 var b = {apiKey:a.apiKey, authDomain:a.authDomain, appName:a.appName}, c = {};
3614 if (!(a.stsTokenManager && a.stsTokenManager.accessToken && a.stsTokenManager.expirationTime)) {
3615 return null;
3616 }
3617 c[V] = a.stsTokenManager.accessToken;
3618 c.refreshToken = a.stsTokenManager.refreshToken || null;
3619 c.expiresIn = (a.stsTokenManager.expirationTime - Ia()) / 1E3;
3620 var d = new W(b, c, a);
3621 return a.providerData && M(a.providerData, function(a) {
3622 a && He(d, ja(a));
3623 }), a.redirectEventId && (d.Z = a.redirectEventId), d;
3624 }
3625 function ll(a, b, c, d) {
3626 var e = new W(a, b);
3627 return c && (e.ca = c), d && Lc(e, d), e.reload().then(function() {
3628 return e;
3629 });
3630 }
3631 function ml(a) {
3632 this.a = a;
3633 this.b = Rb();
3634 }
3635 function Xh(a) {
3636 return hb(a.b, Je, a.a);
3637 }
3638 function nl(a, b) {
3639 return a.b.get(Je, a.a).then(function(a) {
3640 return a && b && (a.authDomain = b), Yh(a || {});
3641 });
3642 }
3643 function Ke(a, b) {
3644 this.a = a;
3645 this.b = b || Rb();
3646 this.c = null;
3647 this.f = ol(this);
3648 xh(this.b, ea("local"), this.a, n(this.g, this));
3649 }
3650 function Le(a, b) {
3651 var c, d = [];
3652 for (c in fb) {
3653 fb[c] !== b && d.push(hb(a.b, ea(fb[c]), a.a));
3654 }
3655 return d.push(hb(a.b, Me, a.a)), Oi(d);
3656 }
3657 function ol(a) {
3658 var b = ea("local"), c = ea("session"), d = ea("none");
3659 return a.b.get(c, a.a).then(function(e) {
3660 return e ? c : a.b.get(d, a.a).then(function(c) {
3661 return c ? d : a.b.get(b, a.a).then(function(c) {
3662 return c ? b : a.b.get(Me, a.a).then(function(a) {
3663 return a ? ea(a) : b;
3664 });
3665 });
3666 });
3667 }).then(function(b) {
3668 return a.c = b, Le(a, b.C);
3669 }).s(function() {
3670 a.c || (a.c = b);
3671 });
3672 }
3673 function ea(a) {
3674 return {name:"authUser", C:a};
3675 }
3676 function pl(a) {
3677 return jb(a, function() {
3678 return a.b.set(Me, a.c.C, a.a);
3679 });
3680 }
3681 function Zh(a, b) {
3682 return jb(a, function() {
3683 return a.b.set(a.c, b.B(), a.a);
3684 });
3685 }
3686 function $h(a) {
3687 return jb(a, function() {
3688 return hb(a.b, a.c, a.a);
3689 });
3690 }
3691 function ai(a, b) {
3692 return jb(a, function() {
3693 return a.b.get(a.c, a.a).then(function(a) {
3694 return a && b && (a.authDomain = b), Yh(a || {});
3695 });
3696 });
3697 }
3698 function jb(a, b) {
3699 return a.f = a.f.then(b, b), a.f;
3700 }
3701 function X(a) {
3702 if (this.l = !1, r(this, "app", a), !this.app.options || !this.app.options.apiKey) {
3703 throw new k("invalid-api-key");
3704 }
3705 a = q.SDK_VERSION ? Ya(q.SDK_VERSION) : null;
3706 this.c = new da(this.app.options && this.app.options.apiKey, Mb(Jc), a);
3707 this.N = [];
3708 this.m = [];
3709 this.I = [];
3710 this.Kb = q.INTERNAL.createSubscribe(n(this.ac, this));
3711 this.R = void 0;
3712 this.Lb = q.INTERNAL.createSubscribe(n(this.bc, this));
3713 Ub(this, null);
3714 this.h = new Ke(this.app.options.apiKey + ":" + this.app.name);
3715 this.G = new ml(this.app.options.apiKey + ":" + this.app.name);
3716 this.U = B(this, ql(this));
3717 this.i = B(this, rl(this));
3718 this.W = !1;
3719 this.ha = n(this.yc, this);
3720 this.Ga = n(this.ka, this);
3721 this.pa = n(this.Tb, this);
3722 this.qa = n(this.Zb, this);
3723 this.ra = n(this.$b, this);
3724 sl(this);
3725 this.INTERNAL = {};
3726 this.INTERNAL["delete"] = n(this["delete"], this);
3727 this.INTERNAL.logFramework = n(this.gc, this);
3728 this.o = 0;
3729 S.call(this);
3730 tl(this);
3731 this.A = [];
3732 }
3733 function bi(a) {
3734 P.call(this, "languageCodeChanged");
3735 this.h = a;
3736 }
3737 function ci(a) {
3738 P.call(this, "frameworkChanged");
3739 this.f = a;
3740 }
3741 function tl(a) {
3742 Object.defineProperty(a, "lc", {get:function() {
3743 return this.$();
3744 }, set:function(a) {
3745 this.na(a);
3746 }, enumerable:!1});
3747 a.V = null;
3748 }
3749 function Ne(a) {
3750 return a.Jb || z(new k("auth-domain-config-required"));
3751 }
3752 function sl(a) {
3753 var b = a.app.options.authDomain, c = a.app.options.apiKey;
3754 b && Ga() && (a.Jb = a.U.then(function() {
3755 if (!a.l) {
3756 if (a.a = Ih(b, c, a.app.name), a.a.subscribe(a), a.currentUser && Mc(a.currentUser), a.w) {
3757 Mc(a.w);
3758 var d = a.w;
3759 d.na(a.$());
3760 Ce(d, a);
3761 d = a.w;
3762 Lc(d, a.A);
3763 De(d, a);
3764 a.w = null;
3765 }
3766 return a.a;
3767 }
3768 }));
3769 }
3770 function di(a, b) {
3771 var c = {};
3772 return c.apiKey = a.app.options.apiKey, c.authDomain = a.app.options.authDomain, c.appName = a.app.name, a.U.then(function() {
3773 return ll(c, b, a.G, a.Ka());
3774 }).then(function(b) {
3775 return a.currentUser && b.uid == a.currentUser.uid ? (Sh(a.currentUser, b), a.ka(b)) : (Ub(a, b), Mc(b), a.ka(b));
3776 }).then(function() {
3777 Pc(a);
3778 });
3779 }
3780 function Ub(a, b) {
3781 a.currentUser && (gl(a.currentUser, a.Ga), R(a.currentUser, "tokenChanged", a.pa), R(a.currentUser, "userDeleted", a.qa), R(a.currentUser, "userInvalidated", a.ra), Ee(a.currentUser));
3782 b && (b.N.push(a.Ga), na(b, "tokenChanged", a.pa), na(b, "userDeleted", a.qa), na(b, "userInvalidated", a.ra), 0 < a.o && Ph(b));
3783 r(a, "currentUser", b);
3784 b && (b.na(a.$()), Ce(b, a), Lc(b, a.A), De(b, a));
3785 }
3786 function ul(a) {
3787 var b = nl(a.G, a.app.options.authDomain).then(function(b) {
3788 return (a.w = b) && (b.ca = a.G), Xh(a.G);
3789 });
3790 return B(a, b);
3791 }
3792 function ql(a) {
3793 var b = a.app.options.authDomain, c = ul(a).then(function() {
3794 return ai(a.h, b);
3795 }).then(function(b) {
3796 return b ? (b.ca = a.G, a.w && (a.w.Z || null) == (b.Z || null) ? b : b.reload().then(function() {
3797 return Zh(a.h, b).then(function() {
3798 return b;
3799 });
3800 }).s(function(c) {
3801 return "auth/network-request-failed" == c.code ? b : $h(a.h);
3802 })) : null;
3803 }).then(function(b) {
3804 Ub(a, b || null);
3805 });
3806 return B(a, c);
3807 }
3808 function rl(a) {
3809 return a.U.then(function() {
3810 return a.aa();
3811 }).s(function() {
3812 }).then(function() {
3813 if (!a.l) {
3814 return a.ha();
3815 }
3816 }).s(function() {
3817 }).then(function() {
3818 if (!a.l) {
3819 a.W = !0;
3820 var b = a.h;
3821 xh(b.b, ea("local"), b.a, a.ha);
3822 }
3823 });
3824 }
3825 function Vb(a, b) {
3826 var c = null, d = null;
3827 return B(a, b.then(function(b) {
3828 return c = Bc(b), d = Td(b), di(a, b);
3829 }).then(function() {
3830 return ja({user:a.currentUser, credential:c, additionalUserInfo:d, operationType:"signIn"});
3831 }));
3832 }
3833 function Qc(a) {
3834 return a.currentUser && a.currentUser._lat || null;
3835 }
3836 function Pc(a) {
3837 if (a.W) {
3838 for (var b = 0; b < a.m.length; b++) {
3839 a.m[b] && a.m[b](Qc(a));
3840 }
3841 if (a.R !== a.getUid() && a.I.length) {
3842 for (a.R = a.getUid(), b = 0; b < a.I.length; b++) {
3843 a.I[b] && a.I[b](Qc(a));
3844 }
3845 }
3846 }
3847 }
3848 function vl(a, b) {
3849 a.I.push(b);
3850 B(a, a.i.then(function() {
3851 !a.l && wa(a.I, b) && a.R !== a.getUid() && (a.R = a.getUid(), b(Qc(a)));
3852 }));
3853 }
3854 function B(a, b) {
3855 return a.N.push(b), Qa(b, function() {
3856 $b(a.N, b);
3857 }), b;
3858 }
3859 function ei(a, b, c, d) {
3860 a: {
3861 c = Array.prototype.slice.call(c);
3862 for (var e = 0, g = !1, f = 0; f < b.length; f++) {
3863 if (b[f].optional) {
3864 g = !0;
3865 } else {
3866 if (g) {
3867 throw new k("internal-error", "Argument validator encountered a required argument after an optional argument.");
3868 }
3869 e++;
3870 }
3871 }
3872 if (g = b.length, c.length < e || g < c.length) {
3873 d = "Expected " + (e == g ? 1 == e ? "1 argument" : e + " arguments" : e + "-" + g + " arguments") + " but got " + c.length + ".";
3874 } else {
3875 for (e = 0; e < c.length; e++) {
3876 if (g = b[e].optional && void 0 === c[e], !b[e].M(c[e]) && !g) {
3877 if (b = b[e], 0 > e || e >= fi.length) {
3878 throw new k("internal-error", "Argument validator received an unsupported number of arguments.");
3879 }
3880 c = fi[e];
3881 d = (d ? "" : c + " argument ") + (b.name ? '"' + b.name + '" ' : "") + "must be " + b.K + ".";
3882 break a;
3883 }
3884 }
3885 d = null;
3886 }
3887 }
3888 if (d) {
3889 throw new k("argument-error", a + " failed: " + d);
3890 }
3891 }
3892 function m(a, b) {
3893 return {name:a || "", K:"a valid string", optional:!!b, M:x};
3894 }
3895 function gi() {
3896 return {name:"opt_forceRefresh", K:"a boolean", optional:!0, M:va};
3897 }
3898 function H(a, b) {
3899 return {name:a || "", K:"a valid object", optional:!!b, M:O};
3900 }
3901 function kb(a, b) {
3902 return {name:a || "", K:"a function", optional:!!b, M:G};
3903 }
3904 function Ma(a, b) {
3905 return {name:a || "", K:"null", optional:!!b, M:Wb};
3906 }
3907 function wl() {
3908 return {name:"", K:"an HTML element", optional:!1, M:function(a) {
3909 return !!(a && a instanceof Element);
3910 }};
3911 }
3912 function xl() {
3913 return {name:"auth", K:"an instance of Firebase Auth", optional:!0, M:function(a) {
3914 return !!(a && a instanceof X);
3915 }};
3916 }
3917 function yl() {
3918 return {name:"app", K:"an instance of Firebase App", optional:!0, M:function(a) {
3919 return !!(a && a instanceof q.app.App);
3920 }};
3921 }
3922 function Na(a) {
3923 return {name:a ? a + "Credential" : "credential", K:a ? "a valid " + a + " credential" : "a valid credential", optional:!1, M:function(b) {
3924 if (!b) {
3925 return !1;
3926 }
3927 var c = !a || b.providerId === a;
3928 return !(!b.wa || !c);
3929 }};
3930 }
3931 function lb() {
3932 return {name:"authProvider", K:"a valid Auth provider", optional:!1, M:function(a) {
3933 return !!(a && a.providerId && a.hasOwnProperty && a.hasOwnProperty("isOAuthProvider"));
3934 }};
3935 }
3936 function Rc() {
3937 return {name:"applicationVerifier", K:"an implementation of firebase.auth.ApplicationVerifier", optional:!1, M:function(a) {
3938 return !!(a && x(a.type) && G(a.verify));
3939 }};
3940 }
3941 function I(a, b, c, d) {
3942 return {name:c || "", K:a.K + " or " + b.K, optional:!!d, M:function(c) {
3943 return a.M(c) || b.M(c);
3944 }};
3945 }
3946 function Oe(a, b, c, d, e, g) {
3947 if (r(this, "type", "recaptcha"), this.b = this.c = null, this.m = !1, this.l = b, this.a = c || {theme:"light", type:"image"}, this.g = [], this.a[hi]) {
3948 throw new k("argument-error", "sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");
3949 }
3950 if (this.h = "invisible" === this.a[zl], !dc(b) || !this.h && dc(b).hasChildNodes()) {
3951 throw new k("argument-error", "reCAPTCHA container is either not found or already contains inner elements!");
3952 }
3953 this.u = new da(a, g || null, e || null);
3954 this.o = d || function() {
3955 return null;
3956 };
3957 var f = this;
3958 this.i = [];
3959 var m = this.a[ii];
3960 this.a[ii] = function(a) {
3961 if (ji(f, a), "function" == typeof m) {
3962 m(a);
3963 } else {
3964 if ("string" == typeof m) {
3965 var b = y(m, l);
3966 "function" == typeof b && b(a);
3967 }
3968 }
3969 };
3970 var n = this.a[ki];
3971 this.a[ki] = function() {
3972 if (ji(f, null), "function" == typeof n) {
3973 n();
3974 } else {
3975 if ("string" == typeof n) {
3976 var a = y(n, l);
3977 "function" == typeof a && a();
3978 }
3979 }
3980 };
3981 }
3982 function ji(a, b) {
3983 for (var c = 0; c < a.i.length; c++) {
3984 try {
3985 a.i[c](b);
3986 } catch (d) {
3987 }
3988 }
3989 }
3990 function Al(a, b) {
3991 Z(a.i, function(a) {
3992 return a == b;
3993 });
3994 }
3995 function Pe(a, b) {
3996 return a.g.push(b), Qa(b, function() {
3997 $b(a.g, b);
3998 }), b;
3999 }
4000 function Sc(a) {
4001 if (a.m) {
4002 throw new k("internal-error", "RecaptchaVerifier instance has been destroyed.");
4003 }
4004 }
4005 function li() {
4006 this.b = l.grecaptcha ? 1 / 0 : 0;
4007 this.c = null;
4008 this.a = "__rcb" + Math.floor(1E6 * Math.random());
4009 }
4010 function Bl(a, b) {
4011 return new t(function(c, d) {
4012 if (Nd()) {
4013 if (!l.grecaptcha || b !== a.c && !a.b) {
4014 l[a.a] = function() {
4015 if (l.grecaptcha) {
4016 a.c = b;
4017 var e = l.grecaptcha.render;
4018 l.grecaptcha.render = function(b, c) {
4019 return b = e(b, c), a.b++, b;
4020 };
4021 c();
4022 } else {
4023 d(new k("internal-error"));
4024 }
4025 delete l[a.a];
4026 };
4027 var e = gd(Cl, {onload:a.a, hl:b || ""});
4028 p(Fd(e)).s(function() {
4029 d(new k("internal-error", "Unable to load external reCAPTCHA dependencies!"));
4030 });
4031 } else {
4032 c();
4033 }
4034 } else {
4035 d(new k("network-request-failed"));
4036 }
4037 });
4038 }
4039 function Qe(a, b, c) {
4040 try {
4041 this.f = c || q.app();
4042 } catch (g) {
4043 throw new k("argument-error", "No firebase.app.App instance is currently initialized.");
4044 }
4045 if (!this.f.options || !this.f.options.apiKey) {
4046 throw new k("invalid-api-key");
4047 }
4048 c = this.f.options.apiKey;
4049 var d = this, e = null;
4050 try {
4051 e = this.f.auth().Ka();
4052 } catch (g) {
4053 }
4054 e = q.SDK_VERSION ? Ya(q.SDK_VERSION, e) : null;
4055 Oe.call(this, c, a, b, function() {
4056 try {
4057 var a = d.f.auth().$();
4058 } catch (h) {
4059 a = null;
4060 }
4061 return a;
4062 }, e, Mb(Jc));
4063 }
4064 function J(a, b) {
4065 for (var c in b) {
4066 var d = b[c].name;
4067 a[d] = mi(d, a[c], b[c].j);
4068 }
4069 }
4070 function K(a, b, c, d) {
4071 a[b] = mi(b, c, d);
4072 }
4073 function mi(a, b, c) {
4074 function d() {
4075 var a = Array.prototype.slice.call(arguments);
4076 return ei(g, c, a), b.apply(this, a);
4077 }
4078 if (!c) {
4079 return b;
4080 }
4081 var e, g = Dl(a);
4082 for (e in b) {
4083 d[e] = b[e];
4084 }
4085 for (e in b.prototype) {
4086 d.prototype[e] = b.prototype[e];
4087 }
4088 return d;
4089 }
4090 function Dl(a) {
4091 return a = a.split("."), a[a.length - 1];
4092 }
4093 var q = Xb(6)["default"], Ed = Ed || {}, l = this, fc = "closure_uid_" + (1E9 * Math.random() >>> 0), Kf = 0, Ia = Date.now || function() {
4094 return +new Date;
4095 };
4096 u(L, Error);
4097 L.prototype.name = "CustomError";
4098 var cf = String.prototype.trim ? function(a) {
4099 return a.trim();
4100 } : function(a) {
4101 return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "");
4102 }, Ai = /&/g, Bi = /</g, Ci = />/g, Di = /"/g, Ei = /'/g, Fi = /\x00/g, zi = /[\x00&<>"']/;
4103 u(Wc, L);
4104 Wc.prototype.name = "AssertionError";
4105 var We = Array.prototype.indexOf ? function(a, b, c) {
4106 return Array.prototype.indexOf.call(a, b, c);
4107 } : function(a, b, c) {
4108 if (c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c, x(a)) {
4109 return x(b) && 1 == b.length ? a.indexOf(b, c) : -1;
4110 }
4111 for (; c < a.length; c++) {
4112 if (c in a && a[c] === b) {
4113 return c;
4114 }
4115 }
4116 return -1;
4117 }, M = Array.prototype.forEach ? function(a, b, c) {
4118 Array.prototype.forEach.call(a, b, c);
4119 } : function(a, b, c) {
4120 for (var d = a.length, e = x(a) ? a.split("") : a, g = 0; g < d; g++) {
4121 g in e && b.call(c, e[g], g, a);
4122 }
4123 }, yd = Array.prototype.map ? function(a, b, c) {
4124 return Array.prototype.map.call(a, b, c);
4125 } : function(a, b, c) {
4126 for (var d = a.length, e = Array(d), g = x(a) ? a.split("") : a, f = 0; f < d; f++) {
4127 f in g && (e[f] = b.call(c, g[f], f, a));
4128 }
4129 return e;
4130 }, nj = Array.prototype.some ? function(a, b, c) {
4131 return Array.prototype.some.call(a, b, c);
4132 } : function(a, b, c) {
4133 for (var d = a.length, e = x(a) ? a.split("") : a, g = 0; g < d; g++) {
4134 if (g in e && b.call(c, e[g], g, a)) {
4135 return !0;
4136 }
4137 }
4138 return !1;
4139 };
4140 a: {
4141 var ni = l.navigator;
4142 if (ni) {
4143 var oi = ni.userAgent;
4144 if (oi) {
4145 var pb = oi;
4146 break a;
4147 }
4148 }
4149 pb = "";
4150 }
4151 var $e = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
4152 Yc[" "] = Y;
4153 var El = C("Opera"), T = C("Trident") || C("MSIE"), pi = C("Edge"), Fj = pi || T, Mf = C("Gecko") && !(w(pb.toLowerCase(), "webkit") && !C("Edge")) && !(C("Trident") || C("MSIE")) && !C("Edge"), Fl = w(pb.toLowerCase(), "webkit") && !C("Edge");
4154 a: {
4155 var Re = "", Se = function() {
4156 var a = pb;
4157 return Mf ? /rv:([^\);]+)(\)|;)/.exec(a) : pi ? /Edge\/([\d\.]+)/.exec(a) : T ? /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a) : Fl ? /WebKit\/(\S+)/.exec(a) : El ? /(?:Version)[ \/]?(\S+)/.exec(a) : void 0;
4158 }();
4159 if (Se && (Re = Se ? Se[1] : ""), T) {
4160 var Te = af();
4161 if (null != Te && Te > parseFloat(Re)) {
4162 var Zc = Te + "";
4163 break a;
4164 }
4165 }
4166 Zc = Re;
4167 }
4168 var Ki = {}, qi = l.document;
4169 var ra = qi && T ? af() || ("CSS1Compat" == qi.compatMode ? parseInt(Zc, 10) : 5) : void 0;
4170 $c.prototype.get = function() {
4171 if (0 < this.b) {
4172 this.b--;
4173 var a = this.a;
4174 this.a = a.next;
4175 a.next = null;
4176 } else {
4177 a = this.c();
4178 }
4179 return a;
4180 };
4181 var jf = new $c(function() {
4182 return new ad;
4183 }, function(a) {
4184 a.reset();
4185 }, 100);
4186 ad.prototype.set = function(a, b) {
4187 this.a = a;
4188 this.b = b;
4189 this.next = null;
4190 };
4191 ad.prototype.reset = function() {
4192 this.next = this.b = this.a = null;
4193 };
4194 var cd, ac, bd = !1, gf = new function() {
4195 this.b = this.a = null;
4196 }, ya = 0, ub = 2, fa = 3;
4197 lf.prototype.reset = function() {
4198 this.f = this.b = this.g = this.a = null;
4199 this.c = !1;
4200 };
4201 var mf = new $c(function() {
4202 return new lf;
4203 }, function(a) {
4204 a.reset();
4205 }, 100);
4206 t.prototype.then = function(a, b, c) {
4207 return sf(this, G(a) ? a : null, G(b) ? b : null, c);
4208 };
4209 df(t);
4210 var f = t.prototype;
4211 f.s = function(a, b) {
4212 return sf(this, null, a, b);
4213 };
4214 f.cancel = function(a) {
4215 this.a == ya && tb(function() {
4216 pf(this, new Pa(a));
4217 }, this);
4218 };
4219 f.Ac = function(a) {
4220 this.a = ya;
4221 za(this, ub, a);
4222 };
4223 f.Bc = function(a) {
4224 this.a = ya;
4225 za(this, fa, a);
4226 };
4227 f.Qb = function() {
4228 for (var a; a = qf(this);) {
4229 rf(this, a, this.a, this.i);
4230 }
4231 this.h = !1;
4232 };
4233 var uf = hf;
4234 u(Pa, L);
4235 Pa.prototype.name = "cancel";
4236 var Wi = !T || 9 <= +ra;
4237 Aa.prototype.la = !0;
4238 Aa.prototype.ja = function() {
4239 return this.a;
4240 };
4241 Aa.prototype.toString = function() {
4242 return "Const{" + this.a + "}";
4243 };
4244 var vf = {};
4245 vb("");
4246 Ra.prototype.la = !0;
4247 Ra.prototype.ja = function() {
4248 return this.a;
4249 };
4250 Ra.prototype.toString = function() {
4251 return "TrustedResourceUrl{" + this.a + "}";
4252 };
4253 var Ui = /%{(\w+)}/g, Ti = /^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i, xf = {};
4254 aa.prototype.la = !0;
4255 aa.prototype.ja = function() {
4256 return this.a;
4257 };
4258 aa.prototype.toString = function() {
4259 return "SafeUrl{" + this.a + "}";
4260 };
4261 var Bf = /^(?:(?:https?|mailto|ftp):|[^:\/?#]*(?:[\/?#]|$))/i, zf = {};
4262 hd("about:blank");
4263 Sa.prototype.la = !0;
4264 Sa.prototype.ja = function() {
4265 return this.a;
4266 };
4267 Sa.prototype.toString = function() {
4268 return "SafeHtml{" + this.a + "}";
4269 };
4270 var Cf = {};
4271 cc("<!DOCTYPE html>");
4272 cc("");
4273 cc("<br>");
4274 var Ef = {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"}, Hf = {'"':'\\"', "\\":"\\\\", "/":"\\/", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\u000b"}, $i = /\uffff/.test("\uffff") ? /[\\"\x00-\x1f\x7f-\uffff]/g : /[\\"\x00-\x1f\x7f-\xff]/g, If = 0, Jf = {};
4275 ec.prototype.oa = !1;
4276 ec.prototype.ta = function() {
4277 if (this.Fa) {
4278 for (; this.Fa.length;) {
4279 this.Fa.shift()();
4280 }
4281 }
4282 };
4283 var Gl = Object.freeze || function(a) {
4284 return a;
4285 }, Rf = !T || 9 <= +ra, Hl = T && !bf("9"), ej = function() {
4286 if (!l.addEventListener || !Object.defineProperty) {
4287 return !1;
4288 }
4289 var a = !1, b = Object.defineProperty({}, "passive", {get:function() {
4290 a = !0;
4291 }});
4292 return l.addEventListener("test", Y, b), l.removeEventListener("test", Y, b), a;
4293 }();
4294 P.prototype.c = function() {
4295 this.Bb = !1;
4296 };
4297 u(Ba, P);
4298 var aj = Gl({2:"touch", 3:"pen", 4:"mouse"});
4299 Ba.prototype.c = function() {
4300 Ba.ib.c.call(this);
4301 var a = this.a;
4302 if (a.preventDefault) {
4303 a.preventDefault();
4304 } else {
4305 if (a.returnValue = !1, Hl) {
4306 try {
4307 (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode) && (a.keyCode = -1);
4308 } catch (b) {
4309 }
4310 }
4311 }
4312 };
4313 Ba.prototype.g = function() {
4314 return this.a;
4315 };
4316 var wb = "closure_listenable_" + (1E6 * Math.random() | 0), cj = 0, pd = "closure_lm_" + (1E6 * Math.random() | 0), rd = {}, Qf = 0, sd = "__closure_events_fn_" + (1E9 * Math.random() >>> 0);
4317 u(S, ec);
4318 S.prototype[wb] = !0;
4319 S.prototype.removeEventListener = function(a, b, c, d) {
4320 R(this, a, b, c, d);
4321 };
4322 S.prototype.ta = function() {
4323 if (S.ib.ta.call(this), this.u) {
4324 var a, b = this.u, c = 0;
4325 for (a in b.a) {
4326 for (var d = b.a[a], e = 0; e < d.length; e++) {
4327 ++c, gc(d[e]);
4328 }
4329 delete b.a[a];
4330 b.b--;
4331 }
4332 }
4333 this.Ra = null;
4334 };
4335 ud.prototype.a = null;
4336 var Il = 0;
4337 ud.prototype.reset = function(a, b, c, d, e) {
4338 "number" == typeof e || Il++;
4339 d || Ia();
4340 this.b = b;
4341 delete this.a;
4342 };
4343 jc.prototype.toString = function() {
4344 return this.name;
4345 };
4346 var tg = new jc("SEVERE", 1E3), gj = new jc("CONFIG", 700), hj = new jc("FINE", 500);
4347 vd.prototype.log = function(a, b, c) {
4348 if (a.value >= Vf(this).value) {
4349 for (G(b) && (b = b()), a = new ud(a, b + "", this.f), c && (a.a = c), c = "log:" + a.b, (a = l.console) && a.timeStamp && a.timeStamp(c), (a = l.msWriteProfilerMark) && a(c), c = this; c;) {
4350 c = c.a;
4351 }
4352 }
4353 };
4354 var wd = {}, kc = null;
4355 f = Ta.prototype;
4356 f.P = function() {
4357 xd(this);
4358 for (var a = [], b = 0; b < this.a.length; b++) {
4359 a.push(this.b[this.a[b]]);
4360 }
4361 return a;
4362 };
4363 f.S = function() {
4364 return xd(this), this.a.concat();
4365 };
4366 f.clear = function() {
4367 this.b = {};
4368 this.c = this.a.length = 0;
4369 };
4370 f.get = function(a, b) {
4371 return Da(this.b, a) ? this.b[a] : b;
4372 };
4373 f.set = function(a, b) {
4374 Da(this.b, a) || (this.c++, this.a.push(a));
4375 this.b[a] = b;
4376 };
4377 f.forEach = function(a, b) {
4378 for (var c = this.S(), d = 0; d < c.length; d++) {
4379 var e = c[d], g = this.get(e);
4380 a.call(b, g, e, this);
4381 }
4382 };
4383 var mc = null, lc = null;
4384 oa.prototype.cancel = function(a) {
4385 if (this.a) {
4386 this.c instanceof oa && this.c.cancel();
4387 } else {
4388 if (this.b) {
4389 var b = this.b;
4390 delete this.b;
4391 a ? b.cancel(a) : 0 >= --b.l && b.cancel();
4392 }
4393 this.v ? this.v.call(this.o, this) : this.u = !0;
4394 this.a || (a = new yb, nc(this), xb(this, !1, a));
4395 }
4396 };
4397 oa.prototype.m = function(a, b) {
4398 this.i = !1;
4399 xb(this, a, b);
4400 };
4401 oa.prototype.A = function(a) {
4402 nc(this);
4403 xb(this, !0, a);
4404 };
4405 oa.prototype.then = function(a, b, c) {
4406 var d, e, g = new t(function(a, b) {
4407 d = a;
4408 e = b;
4409 });
4410 return zd(this, d, function(a) {
4411 a instanceof yb ? g.cancel() : e(a);
4412 }), g.then(a, b, c);
4413 };
4414 df(oa);
4415 u(oc, L);
4416 oc.prototype.message = "Deferred has already fired";
4417 oc.prototype.name = "AlreadyCalledError";
4418 u(yb, L);
4419 yb.prototype.message = "Deferred was canceled";
4420 yb.prototype.name = "CanceledError";
4421 Zf.prototype.c = function() {
4422 throw delete pc[this.a], this.b;
4423 };
4424 var Ad, pc = {};
4425 u(qc, function() {
4426 this.b = -1;
4427 });
4428 for (var $f = 64, Jl = $f - 1, ri = [], Ue = 0; Ue < Jl; Ue++) {
4429 ri[Ue] = 0;
4430 }
4431 var zh = Xc(128, ri);
4432 qc.prototype.reset = function() {
4433 this.g = this.c = 0;
4434 this.a = l.Int32Array ? new Int32Array(this.h) : xa(this.h);
4435 };
4436 var ag = [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,
4437 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298];
4438 u(bg, qc);
4439 var oj = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], gg = /^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;
4440 Ua.prototype.toString = function() {
4441 var a = [], b = this.c;
4442 b && a.push(Ab(b, si, !0), ":");
4443 var c = this.b;
4444 return (c || "file" == b) && (a.push("//"), (b = this.l) && a.push(Ab(b, si, !0), "@"), a.push(encodeURIComponent(c + "").replace(/%25([0-9a-fA-F]{2})/g, "%$1")), null != (c = this.i) && a.push(":", c + "")), (c = this.g) && (this.b && "/" != c.charAt(0) && a.push("/"), a.push(Ab(c, "/" == c.charAt(0) ? Kl : Ll, !0))), (c = "" + this.a) && a.push("?", c), (c = this.h) && a.push("#", Ab(c, Ml)), a.join("");
4445 };
4446 var si = /[#\/\?@]/g, Ll = /[#\?:]/g, Kl = /[#\?]/g, sj = /[#\?@]/g, Ml = /#/g;
4447 f = Va.prototype;
4448 f.clear = function() {
4449 this.a = this.c = null;
4450 this.b = 0;
4451 };
4452 f.forEach = function(a, b) {
4453 qa(this);
4454 this.a.forEach(function(c, d) {
4455 M(c, function(c) {
4456 a.call(b, c, d, this);
4457 }, this);
4458 }, this);
4459 };
4460 f.S = function() {
4461 qa(this);
4462 for (var a = this.a.P(), b = this.a.S(), c = [], d = 0; d < b.length; d++) {
4463 for (var e = a[d], g = 0; g < e.length; g++) {
4464 c.push(b[d]);
4465 }
4466 }
4467 return c;
4468 };
4469 f.P = function(a) {
4470 qa(this);
4471 var b = [];
4472 if (x(a)) {
4473 lg(this, a) && (b = Xc(b, this.a.get(Xa(this, a))));
4474 } else {
4475 a = this.a.P();
4476 for (var c = 0; c < a.length; c++) {
4477 b = Xc(b, a[c]);
4478 }
4479 }
4480 return b;
4481 };
4482 f.set = function(a, b) {
4483 return qa(this), this.c = null, a = Xa(this, a), lg(this, a) && (this.b -= this.a.get(a).length), this.a.set(a, [b]), this.b += 1, this;
4484 };
4485 f.get = function(a, b) {
4486 return a = a ? this.P(a) : [], 0 < a.length ? a[0] + "" : b;
4487 };
4488 f.toString = function() {
4489 if (this.c) {
4490 return this.c;
4491 }
4492 if (!this.a) {
4493 return "";
4494 }
4495 for (var a = [], b = this.a.S(), c = 0; c < b.length; c++) {
4496 var d = b[c], e = encodeURIComponent(d + "");
4497 d = this.P(d);
4498 for (var g = 0; g < d.length; g++) {
4499 var f = e;
4500 "" !== d[g] && (f += "=" + encodeURIComponent(d[g] + ""));
4501 a.push(f);
4502 }
4503 }
4504 return this.c = a.join("&");
4505 };
4506 rc.prototype.c = null;
4507 u(sc, rc);
4508 sc.prototype.a = function() {
4509 var a = mg(this);
4510 return a ? new ActiveXObject(a) : new XMLHttpRequest;
4511 };
4512 sc.prototype.b = function() {
4513 var a = {};
4514 return mg(this) && (a[0] = !0, a[1] = !0), a;
4515 };
4516 var og = new sc;
4517 u(Ea, S);
4518 var ng = "", Nl = Ea.prototype, Ol = Wf("goog.net.XhrIo");
4519 Nl.J = Ol;
4520 var yj = /^https?$/i, wj = ["POST", "PUT"];
4521 f = Ea.prototype;
4522 f.Ea = function() {
4523 void 0 !== Ed && this.a && (this.g = "Timed out after " + this.f + "ms, aborting", Q(this.J, ia(this, this.g)), E(this, "timeout"), this.abort(8));
4524 };
4525 f.abort = function() {
4526 this.a && this.b && (Q(this.J, ia(this, "Aborting")), this.b = !1, this.c = !0, this.a.abort(), this.c = !1, E(this, "complete"), E(this, "abort"), tc(this));
4527 };
4528 f.ta = function() {
4529 this.a && (this.b && (this.b = !1, this.c = !0, this.a.abort(), this.c = !1), tc(this, !0));
4530 Ea.ib.ta.call(this);
4531 };
4532 f.Ab = function() {
4533 this.oa || (this.G || this.h || this.c ? sg(this) : this.jc());
4534 };
4535 f.jc = function() {
4536 sg(this);
4537 };
4538 f.getResponse = function() {
4539 try {
4540 if (!this.a) {
4541 return null;
4542 }
4543 if ("response" in this.a) {
4544 return this.a.response;
4545 }
4546 switch(this.l) {
4547 case ng:
4548 case "text":
4549 return this.a.responseText;
4550 case "arraybuffer":
4551 if ("mozResponseArrayBuffer" in this.a) {
4552 return this.a.mozResponseArrayBuffer;
4553 }
4554 }
4555 var a = this.J;
4556 return a && a.log(tg, "Response type " + this.l + " is not supported on this browser", void 0), null;
4557 } catch (b) {
4558 return Q(this.J, "Can not get response: " + b.message), null;
4559 }
4560 };
4561 var ek = /^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/, Cj = 0, Bj = 1;
4562 u(Gd, L);
4563 u(wc, rc);
4564 wc.prototype.a = function() {
4565 var a = new XMLHttpRequest;
4566 if ("withCredentials" in a) {
4567 return a;
4568 }
4569 if ("undefined" != typeof XDomainRequest) {
4570 return new ug;
4571 }
4572 throw Error("Unsupported browser");
4573 };
4574 wc.prototype.b = function() {
4575 return {};
4576 };
4577 f = ug.prototype;
4578 f.open = function(a, b, c) {
4579 if (null != c && !c) {
4580 throw Error("Only async requests are supported.");
4581 }
4582 this.a.open(a, b);
4583 };
4584 f.send = function(a) {
4585 if (a) {
4586 if ("string" != typeof a) {
4587 throw Error("Only string data is supported");
4588 }
4589 this.a.send(a);
4590 } else {
4591 this.a.send();
4592 }
4593 };
4594 f.abort = function() {
4595 this.a.abort();
4596 };
4597 f.setRequestHeader = function() {
4598 };
4599 f.getResponseHeader = function(a) {
4600 return "content-type" == a.toLowerCase() ? this.a.contentType : "";
4601 };
4602 f.Wb = function() {
4603 this.status = 200;
4604 this.responseText = this.a.responseText;
4605 this.readyState = 4;
4606 this.onreadystatechange && this.onreadystatechange();
4607 };
4608 f.xb = function() {
4609 this.status = 500;
4610 this.responseText = "";
4611 this.readyState = 4;
4612 this.onreadystatechange && this.onreadystatechange();
4613 };
4614 f.Yb = function() {
4615 this.xb();
4616 };
4617 f.Xb = function() {
4618 this.status = 200;
4619 this.readyState = 1;
4620 this.onreadystatechange && this.onreadystatechange();
4621 };
4622 f.getAllResponseHeaders = function() {
4623 return "content-type: " + this.a.contentType;
4624 };
4625 var yk = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Id = "Firefox", xg = "Chrome", Bg = {Gc:"FirebaseCore-web", Ic:"FirebaseUI-web"};
4626 Ha.prototype.get = function() {
4627 return this.a ? this.b : this.c;
4628 };
4629 var ti = {};
4630 try {
4631 var Ve = {};
4632 Object.defineProperty(Ve, "abcd", {configurable:!0, enumerable:!0, value:1});
4633 Object.defineProperty(Ve, "abcd", {configurable:!0, enumerable:!0, value:2});
4634 var Gg = 2 == Ve.abcd;
4635 } catch (a) {
4636 Gg = !1;
4637 }
4638 var Mj = "email", Nj = "newEmail", Oj = "requestType", Qj = "email", Pj = "fromEmail", Sj = "data", Rj = "operation";
4639 u(k, Error);
4640 k.prototype.B = function() {
4641 return {code:this.code, message:this.message};
4642 };
4643 k.prototype.toJSON = function() {
4644 return this.B();
4645 };
4646 var Hb = "auth/", Tj = {"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.",
4647 "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.",
4648 "dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.", "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.",
4649 "invalid-app-id":"The mobile app identifier is not registed for the current project.", "invalid-user-token":"The user's credential is no longer valid. The user must sign in again.", "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.",
4650 "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-email":"The email address is badly formatted.", "invalid-api-key":"Your API key is invalid, please check you have copied it correctly.",
4651 "invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.", "invalid-credential":"The supplied auth credential is malformed or has expired.", "invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.", "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-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.",
4652 "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.",
4653 "invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].", "invalid-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.",
4654 "invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.", "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.",
4655 "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-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.",
4656 "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.",
4657 "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.",
4658 "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.", timeout:"The operation has timed out.",
4659 "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-persistence-type":"The current environment does not support the specified persistence type.", "user-cancelled":"User did not grant your application the permissions it requested.",
4660 "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."}, Jg = "android",
4661 Qd = "handleCodeInApp", Ng = "iOS", Uj = "url", Lg = "installApp", Mg = "minimumVersion", Kg = "packageName", Og = "bundleId", Zg = "oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "), Ac = ["client_id", "response_type", "scope", "redirect_uri", "state"], Sd = {Hc:{Ma:"locale", za:500, ya:600, Na:"facebook.com", $a:Ac}, Jc:{Ma:null, za:500, ya:620, Na:"github.com", $a:Ac}, Kc:{Ma:"hl", za:515, ya:680, Na:"google.com",
4662 $a:Ac}, Qc:{Ma:"lang", za:485, ya:705, Na:"twitter.com", $a:Zg}}, Ud = "idToken", Vg = "providerId";
4663 u(ca, Vd);
4664 u(Rg, ca);
4665 u(Tg, ca);
4666 u(Sg, ca);
4667 u(Ug, ca);
4668 $a.prototype.wa = function(a) {
4669 return jh(a, Wd(this));
4670 };
4671 $a.prototype.b = function(a, b) {
4672 var c = Wd(this);
4673 return c.idToken = b, kh(a, c);
4674 };
4675 $a.prototype.c = function(a, b) {
4676 return zc(lh(a, Wd(this)), b);
4677 };
4678 $a.prototype.B = function() {
4679 var a = {providerId:this.providerId};
4680 return this.idToken && (a.oauthIdToken = this.idToken), this.accessToken && (a.oauthAccessToken = this.accessToken), this.secret && (a.oauthTokenSecret = this.secret), a;
4681 };
4682 Ib.prototype.Ba = function(a) {
4683 return this.rb = rb(a), this;
4684 };
4685 u(N, Ib);
4686 N.prototype.sa = function(a) {
4687 return wa(this.a, a) || this.a.push(a), this;
4688 };
4689 N.prototype.wb = function() {
4690 return xa(this.a);
4691 };
4692 N.prototype.credential = function(a, b) {
4693 if (!a && !b) {
4694 throw new k("argument-error", "credential failed: must provide the ID token and/or the access token.");
4695 }
4696 return new $a(this.providerId, {idToken:a || null, accessToken:b || null});
4697 };
4698 u(ab, N);
4699 r(ab, "PROVIDER_ID", "facebook.com");
4700 u(bb, N);
4701 r(bb, "PROVIDER_ID", "github.com");
4702 u(cb, N);
4703 r(cb, "PROVIDER_ID", "google.com");
4704 u(Jb, Ib);
4705 r(Jb, "PROVIDER_ID", "twitter.com");
4706 Kb.prototype.wa = function(a) {
4707 return v(a, ui, {email:this.a, password:this.f});
4708 };
4709 Kb.prototype.b = function(a, b) {
4710 return v(a, vi, {idToken:b, email:this.a, password:this.f});
4711 };
4712 Kb.prototype.c = function(a, b) {
4713 return zc(this.wa(a), b);
4714 };
4715 Kb.prototype.B = function() {
4716 return {email:this.a, password:this.f};
4717 };
4718 ba(Xd, {PROVIDER_ID:"password"});
4719 db.prototype.wa = function(a) {
4720 return a.Qa(Yd(this));
4721 };
4722 db.prototype.b = function(a, b) {
4723 var c = Yd(this);
4724 return c.idToken = b, v(a, Pl, c);
4725 };
4726 db.prototype.c = function(a, b) {
4727 var c = Yd(this);
4728 return c.operation = "REAUTH", a = v(a, Ql, c), zc(a, b);
4729 };
4730 db.prototype.B = function() {
4731 var a = {providerId:"phone"};
4732 return this.a.Pa && (a.verificationId = this.a.Pa), this.a.Oa && (a.verificationCode = this.a.Oa), this.a.Da && (a.temporaryProof = this.a.Da), this.a.Y && (a.phoneNumber = this.a.Y), a;
4733 };
4734 Ja.prototype.Qa = function(a, b) {
4735 var c = this.a.c;
4736 return p(b.verify()).then(function(d) {
4737 if (!x(d)) {
4738 throw new k("argument-error", "An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");
4739 }
4740 switch(b.type) {
4741 case "recaptcha":
4742 return jk(c, {phoneNumber:a, recaptchaToken:d}).then(function(a) {
4743 return "function" == typeof b.reset && b.reset(), a;
4744 }, function(a) {
4745 throw "function" == typeof b.reset && b.reset(), a;
4746 });
4747 default:
4748 throw new k("argument-error", 'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.');
4749 }
4750 });
4751 };
4752 ba(Ja, {PROVIDER_ID:"phone"});
4753 ka.prototype.B = function() {
4754 return {type:this.b, eventId:this.c, urlResponse:this.f, sessionId:this.g, error:this.a && this.a.B()};
4755 };
4756 var re = null;
4757 $d.prototype.subscribe = function(a) {
4758 var b = this;
4759 this.a.push(a);
4760 this.b || (this.b = function(a) {
4761 for (var c = 0; c < b.a.length; c++) {
4762 b.a[c](a);
4763 }
4764 }, "function" == typeof(a = y("universalLinks.subscribe", l)) && a(null, this.b));
4765 };
4766 $d.prototype.unsubscribe = function(a) {
4767 Z(this.a, function(b) {
4768 return b == a;
4769 });
4770 };
4771 u(ae, k);
4772 u(Lb, k);
4773 Lb.prototype.B = function() {
4774 var a = {code:this.code, message:this.message};
4775 this.email && (a.email = this.email);
4776 this.phoneNumber && (a.phoneNumber = this.phoneNumber);
4777 var b = this.credential && this.credential.B();
4778 return b && ma(a, b), a;
4779 };
4780 Lb.prototype.toJSON = function() {
4781 return this.B();
4782 };
4783 u(Dc, rc);
4784 Dc.prototype.a = function() {
4785 return new this.f;
4786 };
4787 Dc.prototype.b = function() {
4788 return {};
4789 };
4790 var be, V = "idToken", Wj = new Ha(3E4, 6E4), Xj = {"Content-Type":"application/x-www-form-urlencoded"}, Yj = new Ha(3E4, 6E4), Zj = {"Content-Type":"application/json"};
4791 da.prototype.m = function(a, b, c, d, e, g) {
4792 var f = "Node" == U(), k = Ag() ? f ? new Ea(this.o) : new Ea : new Ea(this.f);
4793 if (g) {
4794 k.f = Math.max(0, g);
4795 var l = setTimeout(function() {
4796 E(k, "timeout");
4797 }, g);
4798 }
4799 Nf(k, "complete", function() {
4800 l && clearTimeout(l);
4801 var a = null;
4802 try {
4803 a = JSON.parse(zj(this)) || null;
4804 } catch (dm) {
4805 a = null;
4806 }
4807 b && b(a);
4808 });
4809 qd(k, "ready", function() {
4810 l && clearTimeout(l);
4811 Lf(this);
4812 });
4813 qd(k, "timeout", function() {
4814 l && clearTimeout(l);
4815 Lf(this);
4816 b && b(null);
4817 });
4818 vj(k, a, c, d, e);
4819 };
4820 var bk = vb("https://apis.google.com/js/client.js?onload=%{onload}"), fh = "__fcb" + Math.floor(1E6 * Math.random());
4821 da.prototype.u = function(a, b, c, d, e) {
4822 var g = this;
4823 be.then(function() {
4824 window.gapi.client.setApiKey(g.b);
4825 var f = window.gapi.auth.getToken();
4826 window.gapi.auth.setToken(null);
4827 window.gapi.client.request({path:a, method:c, body:d, headers:e, authType:"none", callback:function(a) {
4828 window.gapi.auth.setToken(f);
4829 b && b(a);
4830 }});
4831 }).s(function(a) {
4832 b && b({error:{message:a && a.message || "CORS_UNSUPPORTED"}});
4833 });
4834 };
4835 da.prototype.gb = function() {
4836 return v(this, Rl, {});
4837 };
4838 da.prototype.kb = function(a, b) {
4839 return v(this, wi, {idToken:a, email:b});
4840 };
4841 da.prototype.lb = function(a, b) {
4842 return v(this, vi, {idToken:a, password:b});
4843 };
4844 var Sl = {displayName:"DISPLAY_NAME", photoUrl:"PHOTO_URL"};
4845 f = da.prototype;
4846 f.mb = function(a, b) {
4847 var c = {idToken:a}, d = [];
4848 return Xe(Sl, function(a, g) {
4849 var e = b[g];
4850 null === e ? d.push(a) : g in b && (c[g] = e);
4851 }), d.length && (c.deleteAttribute = d), v(this, wi, c);
4852 };
4853 f.cb = function(a, b) {
4854 return a = {requestType:"PASSWORD_RESET", email:a}, ma(a, b), v(this, Tl, a);
4855 };
4856 f.bb = function(a, b) {
4857 return a = {requestType:"VERIFY_EMAIL", idToken:a}, ma(a, b), v(this, Ul, a);
4858 };
4859 f.Qa = function(a) {
4860 return v(this, Vl, a);
4861 };
4862 f.Ta = function(a, b) {
4863 return v(this, Wl, {oobCode:a, newPassword:b});
4864 };
4865 f.Ia = function(a) {
4866 return v(this, Xl, {oobCode:a});
4867 };
4868 f.Sa = function(a) {
4869 return v(this, Yl, {oobCode:a});
4870 };
4871 var Yl = {endpoint:"setAccountInfo", D:fe, ga:"email"}, Xl = {endpoint:"resetPassword", D:fe, O:function(a) {
4872 if (!a.email || !a.requestType) {
4873 throw new k("internal-error");
4874 }
4875 }}, Zl = {endpoint:"signupNewUser", D:function(a) {
4876 if (Ec(a), !a.password) {
4877 throw new k("weak-password");
4878 }
4879 }, O:sa, T:!0}, gk = {endpoint:"createAuthUri"}, $l = {endpoint:"deleteAccount", ea:["idToken"]}, mk = {endpoint:"setAccountInfo", ea:["idToken", "deleteProvider"], D:function(a) {
4880 if (!la(a.deleteProvider)) {
4881 throw new k("internal-error");
4882 }
4883 }}, il = {endpoint:"getAccountInfo"}, Ul = {endpoint:"getOobConfirmationCode", ea:["idToken", "requestType"], D:function(a) {
4884 if ("VERIFY_EMAIL" != a.requestType) {
4885 throw new k("internal-error");
4886 }
4887 }, ga:"email"}, Tl = {endpoint:"getOobConfirmationCode", ea:["requestType"], D:function(a) {
4888 if ("PASSWORD_RESET" != a.requestType) {
4889 throw new k("internal-error");
4890 }
4891 Ec(a);
4892 }, ga:"email"}, ik = {nb:!0, endpoint:"getProjectConfig", zb:"GET"}, am = {nb:!0, endpoint:"getRecaptchaParam", zb:"GET", O:function(a) {
4893 if (!a.recaptchaSiteKey) {
4894 throw new k("internal-error");
4895 }
4896 }}, Wl = {endpoint:"resetPassword", D:fe, ga:"email"}, kk = {endpoint:"sendVerificationCode", ea:["phoneNumber", "recaptchaToken"], ga:"sessionInfo"}, wi = {endpoint:"setAccountInfo", ea:["idToken"], D:gh, T:!0}, vi = {endpoint:"setAccountInfo", ea:["idToken"], D:function(a) {
4897 if (gh(a), !a.password) {
4898 throw new k("weak-password");
4899 }
4900 }, O:sa, T:!0}, Rl = {endpoint:"signupNewUser", O:sa, T:!0}, nk = {endpoint:"verifyAssertion", D:ee, O:hh, T:!0}, pk = {endpoint:"verifyAssertion", D:ee, O:function(a) {
4901 if (a.errorMessage && "USER_NOT_FOUND" == a.errorMessage) {
4902 throw new k("user-not-found");
4903 }
4904 if (a.errorMessage) {
4905 throw ih(a.errorMessage);
4906 }
4907 if (!a[V]) {
4908 throw new k("internal-error");
4909 }
4910 }, T:!0}, ok = {endpoint:"verifyAssertion", D:function(a) {
4911 if (ee(a), !a.idToken) {
4912 throw new k("internal-error");
4913 }
4914 }, O:hh, T:!0}, bm = {endpoint:"verifyCustomToken", D:function(a) {
4915 if (!a.token) {
4916 throw new k("invalid-custom-token");
4917 }
4918 }, O:sa, T:!0}, ui = {endpoint:"verifyPassword", D:function(a) {
4919 if (Ec(a), !a.password) {
4920 throw new k("wrong-password");
4921 }
4922 }, O:sa, T:!0}, Vl = {endpoint:"verifyPhoneNumber", D:de, O:sa}, Pl = {endpoint:"verifyPhoneNumber", D:function(a) {
4923 if (!a.idToken) {
4924 throw new k("internal-error");
4925 }
4926 de(a);
4927 }, O:function(a) {
4928 if (a.temporaryProof) {
4929 throw a.code = "credential-already-in-use", Cc(a);
4930 }
4931 sa(a);
4932 }}, Ql = {Pb:{USER_NOT_FOUND:"user-not-found"}, endpoint:"verifyPhoneNumber", D:de, O:sa}, ge = {Mc:{Va:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/", ab:"https://securetoken.googleapis.com/v1/token", id:"p"}, Oc:{Va:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/", ab:"https://staging-securetoken.sandbox.googleapis.com/v1/token", id:"s"}, Pc:{Va:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/", ab:"https://test-securetoken.sandbox.googleapis.com/v1/token",
4933 id:"t"}};
4934 var Jc = Mb("__EID__") ? "__EID__" : void 0;
4935 var xk = vb("https://apis.google.com/js/api.js?onload=%{onload}"), wk = new Ha(3E4, 6E4), tk = new Ha(5E3, 15E3), he = null;
4936 mh.prototype.toString = function() {
4937 return this.f ? A(this.a, "v", this.f) : ha(this.a.a, "v"), this.b ? A(this.a, "eid", this.b) : ha(this.a.a, "eid"), this.c.length ? A(this.a, "fw", this.c.join(",")) : ha(this.a.a, "fw"), "" + this.a;
4938 };
4939 nh.prototype.toString = function() {
4940 var a = hg(this.m, "/__/auth/handler");
4941 if (A(a, "apiKey", this.u), A(a, "appName", this.c), A(a, "authType", this.l), this.a.isOAuthProvider) {
4942 var b = this.a;
4943 try {
4944 var c = q.app(this.c).auth().$();
4945 } catch (Zb) {
4946 c = null;
4947 }
4948 b.Ua = c;
4949 A(a, "providerId", this.a.providerId);
4950 b = this.a;
4951 c = Cg(b.rb);
4952 for (var d in c) {
4953 c[d] = "" + c[d];
4954 }
4955 d = b.rc;
4956 c = rb(c);
4957 for (var e = 0; e < d.length; e++) {
4958 var g = d[e];
4959 g in c && delete c[g];
4960 }
4961 b.Wa && b.Ua && !c[b.Wa] && (c[b.Wa] = b.Ua);
4962 qb(c) || A(a, "customParameters", Fb(c));
4963 }
4964 if ("function" == typeof this.a.wb && (b = this.a.wb(), b.length && A(a, "scopes", b.join(","))), this.h ? A(a, "redirectUrl", this.h) : ha(a.a, "redirectUrl"), this.g ? A(a, "eventId", this.g) : ha(a.a, "eventId"), this.i ? A(a, "v", this.i) : ha(a.a, "v"), this.b) {
4965 for (var f in this.b) {
4966 this.b.hasOwnProperty(f) && !Wa(a, f) && A(a, f, this.b[f]);
4967 }
4968 }
4969 return this.f ? A(a, "eid", this.f) : ha(a.a, "eid"), f = ie(this.c), f.length && A(a, "fw", f.join(",")), "" + a;
4970 };
4971 f = oh.prototype;
4972 f.Ca = function(a, b, c) {
4973 var d = new k("popup-closed-by-user"), e = new k("web-storage-unsupported"), g = this, f = !1;
4974 return this.ba().then(function() {
4975 Ak(g).then(function(c) {
4976 c || (a && Fa(a), b(e), f = !0);
4977 });
4978 }).s(function() {
4979 }).then(function() {
4980 if (!f) {
4981 return Gj(a);
4982 }
4983 }).then(function() {
4984 if (!f) {
4985 return Ca(c).then(function() {
4986 b(d);
4987 });
4988 }
4989 });
4990 };
4991 f.Db = function() {
4992 var a = F();
4993 return !Eb(a) && !Dg(a);
4994 };
4995 f.yb = function() {
4996 return !1;
4997 };
4998 f.vb = function(a, b, c, d, e, g, f) {
4999 if (!a) {
5000 return z(new k("popup-blocked"));
5001 }
5002 if (f && !Eb()) {
5003 return this.ba().s(function(b) {
5004 Fa(a);
5005 e(b);
5006 }), d(), p();
5007 }
5008 this.a || (this.a = ph(rh(this)));
5009 var h = this;
5010 return this.a.then(function() {
5011 var b = h.ba().s(function(b) {
5012 throw Fa(a), e(b), b;
5013 });
5014 return d(), b;
5015 }).then(function() {
5016 Zd(c);
5017 f || vg(Nb(h.u, h.f, h.b, b, c, null, g, h.c, void 0, h.h), a);
5018 }).s(function(a) {
5019 throw "auth/network-request-failed" == a.code && (h.a = null), a;
5020 });
5021 };
5022 f.Aa = function(a, b, c) {
5023 this.a || (this.a = ph(rh(this)));
5024 var d = this;
5025 return this.a.then(function() {
5026 Zd(b);
5027 vg(Nb(d.u, d.f, d.b, a, b, xc(), c, d.c, void 0, d.h));
5028 }).s(function(a) {
5029 throw "auth/network-request-failed" == a.code && (d.a = null), a;
5030 });
5031 };
5032 f.ba = function() {
5033 var a = this;
5034 return qh(this).then(function() {
5035 return a.i.Ya;
5036 }).s(function() {
5037 throw a.a = null, new k("network-request-failed");
5038 });
5039 };
5040 f.Hb = function() {
5041 return !0;
5042 };
5043 f.ua = function(a) {
5044 this.g.push(a);
5045 };
5046 f.Ja = function(a) {
5047 Z(this.g, function(b) {
5048 return b == a;
5049 });
5050 };
5051 f = sh.prototype;
5052 f.get = function(a) {
5053 return p(this.a.getItem(a)).then(function(a) {
5054 return a && Gb(a);
5055 });
5056 };
5057 f.set = function(a, b) {
5058 return p(this.a.setItem(a, Fb(b)));
5059 };
5060 f.X = function(a) {
5061 return p(this.a.removeItem(a));
5062 };
5063 f.ia = function() {
5064 };
5065 f.da = function() {
5066 };
5067 f = Fc.prototype;
5068 f.get = function(a) {
5069 return p(this.a[a]);
5070 };
5071 f.set = function(a, b) {
5072 return this.a[a] = b, p();
5073 };
5074 f.X = function(a) {
5075 return delete this.a[a], p();
5076 };
5077 f.ia = function() {
5078 };
5079 f.da = function() {
5080 };
5081 var me;
5082 f = th.prototype;
5083 f.set = function(a, b) {
5084 var c, d = !1, e = this;
5085 return Qa(Gc(this).then(function(b) {
5086 return c = b, b = Ob(e, Pb(e, c, !0)), eb(b.get(a));
5087 }).then(function(g) {
5088 var f = Ob(e, Pb(e, c, !0));
5089 return g ? (g.value = b, eb(f.put(g))) : (e.a++, d = !0, g = {}, g[e.g] = a, g[e.l] = b, eb(f.add(g)));
5090 }).then(function() {
5091 e.f[a] = b;
5092 }), function() {
5093 d && e.a--;
5094 });
5095 };
5096 f.get = function(a) {
5097 var b = this;
5098 return Gc(this).then(function(c) {
5099 return eb(Ob(b, Pb(b, c, !1)).get(a));
5100 }).then(function(a) {
5101 return a && a.value;
5102 });
5103 };
5104 f.X = function(a) {
5105 var b = !1, c = this;
5106 return Qa(Gc(this).then(function(d) {
5107 return b = !0, c.a++, eb(Ob(c, Pb(c, d, !0))["delete"](a));
5108 }).then(function() {
5109 delete c.f[a];
5110 }), function() {
5111 b && c.a--;
5112 });
5113 };
5114 f.zc = function() {
5115 var a = this;
5116 return Gc(this).then(function(b) {
5117 var c = Ob(a, Pb(a, b, !1));
5118 return c.getAll ? eb(c.getAll()) : new t(function(a, b) {
5119 var d = [], e = c.openCursor();
5120 e.onsuccess = function(b) {
5121 (b = b.target.result) ? (d.push(b.value), b["continue"]()) : a(d);
5122 };
5123 e.onerror = function(a) {
5124 b(Error(a.target.errorCode));
5125 };
5126 });
5127 }).then(function(b) {
5128 var c = {}, d = [];
5129 if (0 == a.a) {
5130 for (d = 0; d < b.length; d++) {
5131 c[b[d][a.g]] = b[d][a.l];
5132 }
5133 d = wg(a.f, c);
5134 a.f = c;
5135 }
5136 return d;
5137 });
5138 };
5139 f.ia = function(a) {
5140 0 == this.c.length && Ck(this);
5141 this.c.push(a);
5142 };
5143 f.da = function(a) {
5144 Z(this.c, function(b) {
5145 return b == a;
5146 });
5147 0 == this.c.length && this.b && this.b.cancel("STOP_EVENT");
5148 };
5149 f = je.prototype;
5150 f.get = function(a) {
5151 var b = this;
5152 return p().then(function() {
5153 return Gb(b.a.getItem(a));
5154 });
5155 };
5156 f.set = function(a, b) {
5157 var c = this;
5158 return p().then(function() {
5159 var d = Fb(b);
5160 null === d ? c.X(a) : c.a.setItem(a, d);
5161 });
5162 };
5163 f.X = function(a) {
5164 var b = this;
5165 return p().then(function() {
5166 b.a.removeItem(a);
5167 });
5168 };
5169 f.ia = function(a) {
5170 l.window && na(l.window, "storage", a);
5171 };
5172 f.da = function(a) {
5173 l.window && R(l.window, "storage", a);
5174 };
5175 f = vh.prototype;
5176 f.get = function() {
5177 return p(null);
5178 };
5179 f.set = function() {
5180 return p();
5181 };
5182 f.X = function() {
5183 return p();
5184 };
5185 f.ia = function() {
5186 };
5187 f.da = function() {
5188 };
5189 f = ke.prototype;
5190 f.get = function(a) {
5191 var b = this;
5192 return p().then(function() {
5193 return Gb(b.a.getItem(a));
5194 });
5195 };
5196 f.set = function(a, b) {
5197 var c = this;
5198 return p().then(function() {
5199 var d = Fb(b);
5200 null === d ? c.X(a) : c.a.setItem(a, d);
5201 });
5202 };
5203 f.X = function(a) {
5204 var b = this;
5205 return p().then(function() {
5206 b.a.removeItem(a);
5207 });
5208 };
5209 f.ia = function() {
5210 };
5211 f.da = function() {
5212 };
5213 var le, ne, Gk = {C:je, jb:ke}, Hk = {C:je, jb:ke}, Ik = {C:sh, jb:vh}, fb = {Lc:"local", NONE:"none", Nc:"session"};
5214 Qb.prototype.get = function(a, b) {
5215 return gb(this, a.C).get(Sb(this, a, b));
5216 };
5217 Qb.prototype.set = function(a, b, c) {
5218 var d = Sb(this, a, c), e = this, g = gb(this, a.C);
5219 return g.set(d, b).then(function() {
5220 return g.get(d);
5221 }).then(function(b) {
5222 "local" == a.C && (e.b[d] = b);
5223 });
5224 };
5225 Qb.prototype.m = function(a) {
5226 if (a && a.g) {
5227 var b = a.a.key;
5228 if (null == b) {
5229 for (var c in this.a) {
5230 var d = this.b[c];
5231 void 0 === d && (d = null);
5232 var e = l.localStorage.getItem(c);
5233 e !== d && (this.b[c] = e, this.c(c));
5234 }
5235 } else {
5236 if (0 == b.indexOf(this.i + this.g) && this.a[b]) {
5237 if (void 0 !== a.a.a ? gb(this, "local").da(this.h) : oe(this), this.A) {
5238 if (c = l.localStorage.getItem(b), (d = a.a.newValue) !== c) {
5239 null !== d ? l.localStorage.setItem(b, d) : l.localStorage.removeItem(b);
5240 } else {
5241 if (this.b[b] === d && void 0 === a.a.a) {
5242 return;
5243 }
5244 }
5245 }
5246 var g = this;
5247 c = function() {
5248 void 0 === a.a.a && g.b[b] === l.localStorage.getItem(b) || (g.b[b] = l.localStorage.getItem(b), g.c(b));
5249 };
5250 T && ra && 10 == ra && l.localStorage.getItem(b) !== a.a.newValue && a.a.newValue !== a.a.oldValue ? setTimeout(c, 10) : c();
5251 }
5252 }
5253 } else {
5254 M(a, n(this.c, this));
5255 }
5256 };
5257 Qb.prototype.c = function(a) {
5258 this.a[a] && M(this.a[a], function(a) {
5259 a();
5260 });
5261 };
5262 var pe = {name:"authEvent", C:"local"};
5263 f = yh.prototype;
5264 f.ba = function() {
5265 return this.xa ? this.xa : this.xa = Hj().then(function() {
5266 if ("function" != typeof y("universalLinks.subscribe", l)) {
5267 throw Hc("cordova-universal-links-plugin is not installed");
5268 }
5269 if (void 0 === y("BuildInfo.packageName", l)) {
5270 throw Hc("cordova-plugin-buildinfo is not installed");
5271 }
5272 if ("function" != typeof y("cordova.plugins.browsertab.openUrl", l)) {
5273 throw Hc("cordova-plugin-browsertab is not installed");
5274 }
5275 if ("function" != typeof y("cordova.InAppBrowser.open", l)) {
5276 throw Hc("cordova-plugin-inappbrowser is not installed");
5277 }
5278 }, function() {
5279 throw new k("cordova-not-ready");
5280 });
5281 };
5282 f.Ca = function(a, b) {
5283 return b(new k("operation-not-supported-in-this-environment")), p();
5284 };
5285 f.vb = function() {
5286 return z(new k("operation-not-supported-in-this-environment"));
5287 };
5288 f.Hb = function() {
5289 return !1;
5290 };
5291 f.Db = function() {
5292 return !0;
5293 };
5294 f.yb = function() {
5295 return !0;
5296 };
5297 f.Aa = function(a, b, c) {
5298 if (this.c) {
5299 return z(new k("redirect-operation-pending"));
5300 }
5301 var d = this, e = l.document, g = null, f = null, m = null, n = null;
5302 return this.c = Qa(p().then(function() {
5303 return Zd(b), Bh(d);
5304 }).then(function() {
5305 return Sk(d, a, b, c);
5306 }).then(function() {
5307 return (new t(function(a, b) {
5308 f = function() {
5309 var b = y("cordova.plugins.browsertab.close", l);
5310 return a(), "function" == typeof b && b(), d.a && "function" == typeof d.a.close && (d.a.close(), d.a = null), !1;
5311 };
5312 d.ua(f);
5313 m = function() {
5314 g || (g = Ca(d.w).then(function() {
5315 b(new k("redirect-cancelled-by-user"));
5316 }));
5317 };
5318 n = function() {
5319 Od() && m();
5320 };
5321 e.addEventListener("resume", m, !1);
5322 F().toLowerCase().match(/android/) || e.addEventListener("visibilitychange", n, !1);
5323 })).s(function(a) {
5324 return qe(d).then(function() {
5325 throw a;
5326 });
5327 });
5328 }), function() {
5329 m && e.removeEventListener("resume", m, !1);
5330 n && e.removeEventListener("visibilitychange", n, !1);
5331 g && g.cancel();
5332 f && d.Ja(f);
5333 d.c = null;
5334 });
5335 };
5336 f.ua = function(a) {
5337 this.b.push(a);
5338 Bh(this).s(function(b) {
5339 "auth/invalid-cordova-configuration" === b.code && (b = new ka("unknown", null, null, null, new k("no-auth-event")), a(b));
5340 });
5341 };
5342 f.Ja = function(a) {
5343 Z(this.b, function(b) {
5344 return b == a;
5345 });
5346 };
5347 var se = {name:"pendingRedirect", C:"session"};
5348 ta.prototype.reset = function() {
5349 this.f = !1;
5350 this.a.Ja(this.i);
5351 this.a = Dh(this.v, this.l, this.u);
5352 };
5353 ta.prototype.subscribe = function(a) {
5354 if (wa(this.h, a) || this.h.push(a), !this.f) {
5355 var b = this;
5356 Wk(this.g).then(function(a) {
5357 a ? te(b.g).then(function() {
5358 Eh(b).s(function(a) {
5359 var c = new ka("unknown", null, null, null, new k("operation-not-supported-in-this-environment"));
5360 ue(a) && b.m(c);
5361 });
5362 }) : Fh(b);
5363 }).s(function() {
5364 Fh(b);
5365 });
5366 }
5367 };
5368 ta.prototype.unsubscribe = function(a) {
5369 Z(this.h, function(b) {
5370 return b == a;
5371 });
5372 };
5373 ta.prototype.m = function(a) {
5374 if (!a) {
5375 throw new k("invalid-auth-event");
5376 }
5377 for (var b = !1, c = 0; c < this.h.length; c++) {
5378 var d = this.h[c];
5379 if (d.ob(a.b, a.c)) {
5380 (b = this.b[a.b]) && b.h(a, d);
5381 b = !0;
5382 break;
5383 }
5384 }
5385 return Gh(this.c), b;
5386 };
5387 var cm = new Ha(2E3, 1E4), $k = new Ha(3E4, 6E4);
5388 ta.prototype.aa = function() {
5389 return this.c.aa();
5390 };
5391 ta.prototype.Aa = function(a, b, c) {
5392 var d, e = this;
5393 return Vk(this.g).then(function() {
5394 return e.a.Aa(a, b, c).s(function(a) {
5395 if (ue(a)) {
5396 throw new k("operation-not-supported-in-this-environment");
5397 }
5398 return d = a, te(e.g).then(function() {
5399 throw d;
5400 });
5401 }).then(function() {
5402 return e.a.Hb() ? new t(function() {
5403 }) : te(e.g).then(function() {
5404 return e.aa();
5405 }).then(function() {
5406 }).s(function() {
5407 });
5408 });
5409 });
5410 };
5411 ta.prototype.Ca = function(a, b, c, d) {
5412 return this.a.Ca(c, function(c) {
5413 a.fa(b, null, c, d);
5414 }, cm.get());
5415 };
5416 var ve = {};
5417 Ic.prototype.reset = function() {
5418 this.b = null;
5419 this.a && (this.a.cancel(), this.a = null);
5420 };
5421 Ic.prototype.h = function(a, b) {
5422 if (!a) {
5423 return z(new k("invalid-auth-event"));
5424 }
5425 this.reset();
5426 this.g = !0;
5427 var c = a.b, d = a.c, e = a.a && "auth/web-storage-unsupported" == a.a.code, g = a.a && "auth/operation-not-supported-in-this-environment" == a.a.code;
5428 return "unknown" != c || e || g ? a.a ? (ib(this, !0, null, a.a), a = p()) : a = b.va(c, d) ? Xk(this, a, b) : z(new k("invalid-auth-event")) : (ib(this, !1, null, null), a = p()), a;
5429 };
5430 Ic.prototype.aa = function() {
5431 var a = this;
5432 return new t(function(b, c) {
5433 a.b ? a.b().then(b, c) : (a.f.push(b), a.c.push(c), Zk(a));
5434 });
5435 };
5436 Ch.prototype.h = function(a, b) {
5437 if (!a) {
5438 return z(new k("invalid-auth-event"));
5439 }
5440 var c = a.b, d = a.c;
5441 return a.a ? (b.fa(a.b, null, a.a, a.c), a = p()) : a = b.va(c, d) ? al(a, b) : z(new k("invalid-auth-event")), a;
5442 };
5443 we.prototype.confirm = function(a) {
5444 return a = ah(this.verificationId, a), this.a(a);
5445 };
5446 Kh.prototype.start = function() {
5447 this.a = this.c;
5448 ye(this, !0);
5449 };
5450 Ae.prototype.B = function() {
5451 return {apiKey:this.f.b, refreshToken:this.a, accessToken:this.b, expirationTime:this.c};
5452 };
5453 Ae.prototype.getToken = function(a) {
5454 return a = !!a, this.b && !this.a ? z(new k("user-token-expired")) : a || !this.b || Ia() > this.c - 3E4 ? this.a ? cl(this, {grant_type:"refresh_token", refresh_token:this.a}) : p(null) : p({accessToken:this.b, expirationTime:this.c, refreshToken:this.a});
5455 };
5456 Kc.prototype.B = function() {
5457 return {lastLoginAt:this.b, createdAt:this.a};
5458 };
5459 u(Tb, P);
5460 u(W, S);
5461 W.prototype.na = function(a) {
5462 this.ha = a;
5463 ch(this.c, a);
5464 };
5465 W.prototype.$ = function() {
5466 return this.ha;
5467 };
5468 W.prototype.Ka = function() {
5469 return xa(this.R);
5470 };
5471 W.prototype.Ga = function() {
5472 this.l.b && (ze(this.l), this.l.start());
5473 };
5474 r(W.prototype, "providerId", "firebase");
5475 f = W.prototype;
5476 f.reload = function() {
5477 var a = this;
5478 return D(this, Fe(this).then(function() {
5479 return Ie(a).then(function() {
5480 return Ka(a);
5481 }).then(Qh);
5482 }));
5483 };
5484 f.F = function(a) {
5485 var b = this;
5486 return D(this, Fe(this).then(function() {
5487 return b.h.getToken(a);
5488 }).then(function(a) {
5489 if (!a) {
5490 throw new k("internal-error");
5491 }
5492 return a.accessToken != b.pa && (Be(b, a.accessToken), E(b, new Tb("tokenChanged"))), ua(b, "refreshToken", a.refreshToken), a.accessToken;
5493 }));
5494 };
5495 f.getToken = function(a) {
5496 return ti["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."] || (ti["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."] = !0, "undefined" != typeof console && "function" == typeof console.warn && console.warn("firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.")), this.F(a);
5497 };
5498 f.kc = function(a) {
5499 if (!(a = a.users) || !a.length) {
5500 throw new k("internal-error");
5501 }
5502 a = a[0];
5503 Nh(this, {uid:a.localId, displayName:a.displayName, photoURL:a.photoUrl, email:a.email, emailVerified:!!a.emailVerified, phoneNumber:a.phoneNumber, lastLoginAt:a.lastLoginAt, createdAt:a.createdAt});
5504 for (var b = jl(a), c = 0; c < b.length; c++) {
5505 He(this, b[c]);
5506 }
5507 ua(this, "isAnonymous", !(this.email && a.passwordHash || this.providerData && this.providerData.length));
5508 };
5509 f.Za = function(a) {
5510 var b = this, c = null;
5511 return D(this, a.c(this.c, this.uid).then(function(a) {
5512 return La(b, a), c = Oc(b, a, "reauthenticate"), b.i = null, b.reload();
5513 }).then(function() {
5514 return c;
5515 }), !0);
5516 };
5517 f.mc = function(a) {
5518 return this.Za(a).then(function() {
5519 });
5520 };
5521 f.Xa = function(a) {
5522 var b = this, c = null;
5523 return D(this, Nc(this, a.providerId).then(function() {
5524 return b.F();
5525 }).then(function(c) {
5526 return a.b(b.c, c);
5527 }).then(function(a) {
5528 return c = Oc(b, a, "link"), Th(b, a);
5529 }).then(function() {
5530 return c;
5531 }));
5532 };
5533 f.cc = function(a) {
5534 return this.Xa(a).then(function(a) {
5535 return a.user;
5536 });
5537 };
5538 f.dc = function(a, b) {
5539 var c = this;
5540 return D(this, Nc(this, "phone").then(function() {
5541 return xe(Oh(c), a, b, n(c.Xa, c));
5542 }));
5543 };
5544 f.nc = function(a, b) {
5545 var c = this;
5546 return D(this, p().then(function() {
5547 return xe(Oh(c), a, b, n(c.Za, c));
5548 }), !0);
5549 };
5550 f.kb = function(a) {
5551 var b = this;
5552 return D(this, this.F().then(function(c) {
5553 return b.c.kb(c, a);
5554 }).then(function(a) {
5555 return La(b, a), b.reload();
5556 }));
5557 };
5558 f.Dc = function(a) {
5559 var b = this;
5560 return D(this, this.F().then(function(c) {
5561 return a.b(b.c, c);
5562 }).then(function(a) {
5563 return La(b, a), b.reload();
5564 }));
5565 };
5566 f.lb = function(a) {
5567 var b = this;
5568 return D(this, this.F().then(function(c) {
5569 return b.c.lb(c, a);
5570 }).then(function(a) {
5571 return La(b, a), b.reload();
5572 }));
5573 };
5574 f.mb = function(a) {
5575 if (void 0 === a.displayName && void 0 === a.photoURL) {
5576 return Fe(this);
5577 }
5578 var b = this;
5579 return D(this, this.F().then(function(c) {
5580 return b.c.mb(c, {displayName:a.displayName, photoUrl:a.photoURL});
5581 }).then(function(a) {
5582 return La(b, a), ua(b, "displayName", a.displayName || null), ua(b, "photoURL", a.photoUrl || null), M(b.providerData, function(a) {
5583 "password" === a.providerId && (r(a, "displayName", b.displayName), r(a, "photoURL", b.photoURL));
5584 }), Ka(b);
5585 }).then(Qh));
5586 };
5587 f.Cc = function(a) {
5588 var b = this;
5589 return D(this, Ie(this).then(function(c) {
5590 return wa(Ge(b), a) ? lk(b.c, c, [a]).then(function(a) {
5591 var c = {};
5592 return M(a.providerUserInfo || [], function(a) {
5593 c[a.providerId] = !0;
5594 }), M(Ge(b), function(a) {
5595 c[a] || Rh(b, a);
5596 }), c[Ja.PROVIDER_ID] || r(b, "phoneNumber", null), Ka(b);
5597 }) : Ka(b).then(function() {
5598 throw new k("no-such-provider");
5599 });
5600 }));
5601 };
5602 f["delete"] = function() {
5603 var a = this;
5604 return D(this, this.F().then(function(b) {
5605 return v(a.c, $l, {idToken:b});
5606 }).then(function() {
5607 E(a, new Tb("userDeleted"));
5608 })).then(function() {
5609 for (var b = 0; b < a.A.length; b++) {
5610 a.A[b].cancel("app-deleted");
5611 }
5612 Ce(a, null);
5613 De(a, null);
5614 a.A = [];
5615 a.m = !0;
5616 Ee(a);
5617 r(a, "refreshToken", null);
5618 a.a && a.a.unsubscribe(a);
5619 });
5620 };
5621 f.ob = function(a, b) {
5622 return !!("linkViaPopup" == a && (this.g || null) == b && this.f || "reauthViaPopup" == a && (this.g || null) == b && this.f || "linkViaRedirect" == a && (this.Z || null) == b || "reauthViaRedirect" == a && (this.Z || null) == b);
5623 };
5624 f.fa = function(a, b, c, d) {
5625 "linkViaPopup" != a && "reauthViaPopup" != a || d != (this.g || null) || (c && this.v ? this.v(c) : b && !c && this.f && this.f(b), this.b && (this.b.cancel(), this.b = null), delete this.f, delete this.v);
5626 };
5627 f.va = function(a, b) {
5628 return "linkViaPopup" == a && b == (this.g || null) ? n(this.tb, this) : "reauthViaPopup" == a && b == (this.g || null) ? n(this.ub, this) : "linkViaRedirect" == a && (this.Z || null) == b ? n(this.tb, this) : "reauthViaRedirect" == a && (this.Z || null) == b ? n(this.ub, this) : null;
5629 };
5630 f.ec = function(a) {
5631 var b = this;
5632 return Uh(this, "linkViaPopup", a, function() {
5633 return Nc(b, a.providerId).then(function() {
5634 return Ka(b);
5635 });
5636 }, !1);
5637 };
5638 f.oc = function(a) {
5639 return Uh(this, "reauthViaPopup", a, function() {
5640 return p();
5641 }, !0);
5642 };
5643 f.fc = function(a) {
5644 var b = this;
5645 return Wh(this, "linkViaRedirect", a, function() {
5646 return Nc(b, a.providerId);
5647 }, !1);
5648 };
5649 f.pc = function(a) {
5650 return Wh(this, "reauthViaRedirect", a, function() {
5651 return p();
5652 }, !0);
5653 };
5654 f.tb = function(a, b) {
5655 var c = this;
5656 this.b && (this.b.cancel(), this.b = null);
5657 var d = null;
5658 return D(this, this.F().then(function(d) {
5659 return kh(c.c, {requestUri:a, sessionId:b, idToken:d});
5660 }).then(function(a) {
5661 return d = Oc(c, a, "link"), Th(c, a);
5662 }).then(function() {
5663 return d;
5664 }));
5665 };
5666 f.ub = function(a, b) {
5667 var c = this;
5668 this.b && (this.b.cancel(), this.b = null);
5669 var d = null;
5670 return D(this, p().then(function() {
5671 return zc(lh(c.c, {requestUri:a, sessionId:b}), c.uid);
5672 }).then(function(a) {
5673 return d = Oc(c, a, "reauthenticate"), La(c, a), c.i = null, c.reload();
5674 }).then(function() {
5675 return d;
5676 }), !0);
5677 };
5678 f.bb = function(a) {
5679 var b = this, c = null;
5680 return D(this, this.F().then(function(b) {
5681 return c = b, void 0 === a || qb(a) ? {} : Pg(new Ig(a));
5682 }).then(function(a) {
5683 return b.c.bb(c, a);
5684 }).then(function(a) {
5685 if (b.email != a) {
5686 return b.reload();
5687 }
5688 }).then(function() {
5689 }));
5690 };
5691 f.toJSON = function() {
5692 return this.B();
5693 };
5694 f.B = function() {
5695 var a = {uid:this.uid, displayName:this.displayName, photoURL:this.photoURL, email:this.email, emailVerified:this.emailVerified, phoneNumber:this.phoneNumber, isAnonymous:this.isAnonymous, providerData:[], apiKey:this.G, appName:this.o, authDomain:this.w, stsTokenManager:this.h.B(), redirectEventId:this.Z || null};
5696 return this.metadata && ma(a, this.metadata.B()), M(this.providerData, function(b) {
5697 a.providerData.push(Jj(b));
5698 }), a;
5699 };
5700 var Je = {name:"redirectUser", C:"session"};
5701 Ke.prototype.g = function() {
5702 var a = this, b = ea("local");
5703 jb(this, function() {
5704 return p().then(function() {
5705 return a.c && "local" != a.c.C ? a.b.get(b, a.a) : null;
5706 }).then(function(c) {
5707 if (c) {
5708 return Le(a, "local").then(function() {
5709 a.c = b;
5710 });
5711 }
5712 });
5713 });
5714 };
5715 var Me = {name:"persistence", C:"session"};
5716 Ke.prototype.eb = function(a) {
5717 var b = null, c = this;
5718 return Jk(a), jb(this, function() {
5719 return a != c.c.C ? c.b.get(c.c, c.a).then(function(d) {
5720 return b = d, Le(c, a);
5721 }).then(function() {
5722 if (c.c = ea(a), b) {
5723 return c.b.set(c.c, b, c.a);
5724 }
5725 }) : p();
5726 });
5727 };
5728 u(X, S);
5729 u(bi, P);
5730 u(ci, P);
5731 f = X.prototype;
5732 f.eb = function(a) {
5733 return a = this.h.eb(a), B(this, a);
5734 };
5735 f.na = function(a) {
5736 this.V === a || this.l || (this.V = a, ch(this.c, this.V), E(this, new bi(this.$())));
5737 };
5738 f.$ = function() {
5739 return this.V;
5740 };
5741 f.Ec = function() {
5742 var a = l.navigator;
5743 this.na(a ? a.languages && a.languages[0] || a.language || a.userLanguage || null : null);
5744 };
5745 f.gc = function(a) {
5746 this.A.push(a);
5747 dh(this.c, q.SDK_VERSION ? Ya(q.SDK_VERSION, this.A) : null);
5748 E(this, new ci(this.A));
5749 };
5750 f.Ka = function() {
5751 return xa(this.A);
5752 };
5753 f.toJSON = function() {
5754 return {apiKey:this.app.options.apiKey, authDomain:this.app.options.authDomain, appName:this.app.name, currentUser:this.currentUser && this.currentUser.B()};
5755 };
5756 f.ob = function(a, b) {
5757 switch(a) {
5758 case "unknown":
5759 case "signInViaRedirect":
5760 return !0;
5761 case "signInViaPopup":
5762 return this.g == b && !!this.f;
5763 default:
5764 return !1;
5765 }
5766 };
5767 f.fa = function(a, b, c, d) {
5768 "signInViaPopup" == a && this.g == d && (c && this.v ? this.v(c) : b && !c && this.f && this.f(b), this.b && (this.b.cancel(), this.b = null), delete this.f, delete this.v);
5769 };
5770 f.va = function(a, b) {
5771 return "signInViaRedirect" == a || "signInViaPopup" == a && this.g == b && this.f ? n(this.Sb, this) : null;
5772 };
5773 f.Sb = function(a, b) {
5774 var c = this;
5775 a = {requestUri:a, sessionId:b};
5776 this.b && (this.b.cancel(), this.b = null);
5777 var d = null, e = null, f = jh(c.c, a).then(function(a) {
5778 return d = Bc(a), e = Td(a), a;
5779 });
5780 return a = c.U.then(function() {
5781 return f;
5782 }).then(function(a) {
5783 return di(c, a);
5784 }).then(function() {
5785 return ja({user:c.currentUser, credential:d, additionalUserInfo:e, operationType:"signIn"});
5786 }), B(this, a);
5787 };
5788 f.wc = function(a) {
5789 if (!Ga()) {
5790 return z(new k("operation-not-supported-in-this-environment"));
5791 }
5792 var b = this, c = Rd(a.providerId), d = Za(), e = null;
5793 (!Eb() || Ld()) && this.app.options.authDomain && a.isOAuthProvider && (e = Nb(this.app.options.authDomain, this.app.options.apiKey, this.app.name, "signInViaPopup", a, null, d, q.SDK_VERSION || null));
5794 var f = zg(e, c && c.za, c && c.ya);
5795 return c = Ne(this).then(function(b) {
5796 return Hh(b, f, "signInViaPopup", a, d, !!e);
5797 }).then(function() {
5798 return new t(function(a, c) {
5799 b.fa("signInViaPopup", null, new k("cancelled-popup-request"), b.g);
5800 b.f = a;
5801 b.v = c;
5802 b.g = d;
5803 b.b = b.a.Ca(b, "signInViaPopup", f, d);
5804 });
5805 }).then(function(a) {
5806 return f && Fa(f), a ? ja(a) : null;
5807 }).s(function(a) {
5808 throw f && Fa(f), a;
5809 }), B(this, c);
5810 };
5811 f.xc = function(a) {
5812 if (!Ga()) {
5813 return z(new k("operation-not-supported-in-this-environment"));
5814 }
5815 var b = this;
5816 return B(this, Ne(this).then(function() {
5817 return pl(b.h);
5818 }).then(function() {
5819 return b.a.Aa("signInViaRedirect", a);
5820 }));
5821 };
5822 f.aa = function() {
5823 if (!Ga()) {
5824 return z(new k("operation-not-supported-in-this-environment"));
5825 }
5826 var a = this;
5827 return B(this, Ne(this).then(function() {
5828 return a.a.aa();
5829 }).then(function(a) {
5830 return a ? ja(a) : null;
5831 }));
5832 };
5833 f.hb = function() {
5834 var a = this;
5835 return B(this, this.i.then(function() {
5836 return a.currentUser ? (Ub(a, null), $h(a.h).then(function() {
5837 Pc(a);
5838 })) : p();
5839 }));
5840 };
5841 f.yc = function() {
5842 var a = this;
5843 return ai(this.h, this.app.options.authDomain).then(function(b) {
5844 if (!a.l) {
5845 var c;
5846 if (c = a.currentUser && b) {
5847 c = a.currentUser.uid;
5848 var d = b.uid;
5849 c = void 0 !== c && null !== c && "" !== c && void 0 !== d && null !== d && "" !== d && c == d;
5850 }
5851 if (c) {
5852 return Sh(a.currentUser, b), a.currentUser.F();
5853 }
5854 (a.currentUser || b) && (Ub(a, b), b && (Mc(b), b.ca = a.G), a.a && a.a.subscribe(a), Pc(a));
5855 }
5856 });
5857 };
5858 f.ka = function(a) {
5859 return Zh(this.h, a);
5860 };
5861 f.Tb = function() {
5862 Pc(this);
5863 this.ka(this.currentUser);
5864 };
5865 f.Zb = function() {
5866 this.hb();
5867 };
5868 f.$b = function() {
5869 this.hb();
5870 };
5871 f.ac = function(a) {
5872 var b = this;
5873 this.addAuthTokenListener(function() {
5874 a.next(b.currentUser);
5875 });
5876 };
5877 f.bc = function(a) {
5878 var b = this;
5879 vl(this, function() {
5880 a.next(b.currentUser);
5881 });
5882 };
5883 f.ic = function(a, b, c) {
5884 var d = this;
5885 return this.W && q.Promise.resolve().then(function() {
5886 G(a) ? a(d.currentUser) : G(a.next) && a.next(d.currentUser);
5887 }), this.Kb(a, b, c);
5888 };
5889 f.hc = function(a, b, c) {
5890 var d = this;
5891 return this.W && q.Promise.resolve().then(function() {
5892 d.R = d.getUid();
5893 G(a) ? a(d.currentUser) : G(a.next) && a.next(d.currentUser);
5894 }), this.Lb(a, b, c);
5895 };
5896 f.Vb = function(a) {
5897 var b = this;
5898 return B(this, this.i.then(function() {
5899 return b.currentUser ? b.currentUser.F(a).then(function(a) {
5900 return {accessToken:a};
5901 }) : null;
5902 }));
5903 };
5904 f.tc = function(a) {
5905 return this.Eb(a).then(function(a) {
5906 return a.user;
5907 });
5908 };
5909 f.Eb = function(a) {
5910 var b = this;
5911 return this.i.then(function() {
5912 return Vb(b, v(b.c, bm, {token:a}));
5913 }).then(function(a) {
5914 var c = a.user;
5915 return ua(c, "isAnonymous", !1), b.ka(c), a;
5916 });
5917 };
5918 f.Fb = function(a, b) {
5919 var c = this;
5920 return this.i.then(function() {
5921 return Vb(c, v(c.c, ui, {email:a, password:b}));
5922 });
5923 };
5924 f.uc = function(a, b) {
5925 return this.Fb(a, b).then(function(a) {
5926 return a.user;
5927 });
5928 };
5929 f.Ob = function(a, b) {
5930 return this.qb(a, b).then(function(a) {
5931 return a.user;
5932 });
5933 };
5934 f.qb = function(a, b) {
5935 var c = this;
5936 return this.i.then(function() {
5937 return Vb(c, v(c.c, Zl, {email:a, password:b}));
5938 });
5939 };
5940 f.sc = function(a) {
5941 return this.fb(a).then(function(a) {
5942 return a.user;
5943 });
5944 };
5945 f.fb = function(a) {
5946 var b = this;
5947 return this.i.then(function() {
5948 return Vb(b, a.wa(b.c));
5949 });
5950 };
5951 f.gb = function() {
5952 return this.Gb().then(function(a) {
5953 return a.user;
5954 });
5955 };
5956 f.Gb = function() {
5957 var a = this;
5958 return this.i.then(function() {
5959 var b = a.currentUser;
5960 return b && b.isAnonymous ? ja({user:b, credential:null, additionalUserInfo:ja({providerId:null, isNewUser:!1}), operationType:"signIn"}) : Vb(a, a.c.gb()).then(function(b) {
5961 var c = b.user;
5962 return ua(c, "isAnonymous", !0), a.ka(c), b;
5963 });
5964 });
5965 };
5966 f.getUid = function() {
5967 return this.currentUser && this.currentUser.uid || null;
5968 };
5969 f.Mb = function(a) {
5970 this.addAuthTokenListener(a);
5971 0 < ++this.o && this.currentUser && Ph(this.currentUser);
5972 };
5973 f.qc = function(a) {
5974 var b = this;
5975 M(this.m, function(c) {
5976 c == a && b.o--;
5977 });
5978 0 > this.o && (this.o = 0);
5979 0 == this.o && this.currentUser && Ee(this.currentUser);
5980 this.removeAuthTokenListener(a);
5981 };
5982 f.addAuthTokenListener = function(a) {
5983 var b = this;
5984 this.m.push(a);
5985 B(this, this.i.then(function() {
5986 b.l || wa(b.m, a) && a(Qc(b));
5987 }));
5988 };
5989 f.removeAuthTokenListener = function(a) {
5990 Z(this.m, function(b) {
5991 return b == a;
5992 });
5993 };
5994 f["delete"] = function() {
5995 this.l = !0;
5996 for (var a = 0; a < this.N.length; a++) {
5997 this.N[a].cancel("app-deleted");
5998 }
5999 return this.N = [], this.h && (a = this.h, Lk(a.b, a.a, this.ha)), this.a && this.a.unsubscribe(this), q.Promise.resolve();
6000 };
6001 f.Rb = function(a) {
6002 return B(this, fk(this.c, a));
6003 };
6004 f.Fc = function(a) {
6005 return this.Ia(a).then(function(a) {
6006 return a.data.email;
6007 });
6008 };
6009 f.Ta = function(a, b) {
6010 return B(this, this.c.Ta(a, b).then(function() {
6011 }));
6012 };
6013 f.Ia = function(a) {
6014 return B(this, this.c.Ia(a).then(function(a) {
6015 return new Lj(a);
6016 }));
6017 };
6018 f.Sa = function(a) {
6019 return B(this, this.c.Sa(a).then(function() {
6020 }));
6021 };
6022 f.cb = function(a, b) {
6023 var c = this;
6024 return B(this, p().then(function() {
6025 return void 0 === b || qb(b) ? {} : Pg(new Ig(b));
6026 }).then(function(b) {
6027 return c.c.cb(a, b);
6028 }).then(function() {
6029 }));
6030 };
6031 f.vc = function(a, b) {
6032 return B(this, xe(this, a, b, n(this.fb, this)));
6033 };
6034 var fi = "First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "), ii = "callback", ki = "expired-callback", hi = "sitekey", zl = "size";
6035 f = Oe.prototype;
6036 f.xa = function() {
6037 var a = this;
6038 return this.c ? this.c : this.c = Pe(this, p().then(function() {
6039 if (yc()) {
6040 return Jd();
6041 }
6042 throw new k("operation-not-supported-in-this-environment", "RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.");
6043 }).then(function() {
6044 return Bl((mb || (mb = new li), mb), a.o());
6045 }).then(function() {
6046 return v(a.u, am, {});
6047 }).then(function(b) {
6048 a.a[hi] = b.recaptchaSiteKey;
6049 }).s(function(b) {
6050 throw a.c = null, b;
6051 }));
6052 };
6053 f.render = function() {
6054 Sc(this);
6055 var a = this;
6056 return Pe(this, this.xa().then(function() {
6057 if (null === a.b) {
6058 var b = a.l;
6059 if (!a.h) {
6060 var c = dc(b);
6061 b = Vi("DIV");
6062 c.appendChild(b);
6063 }
6064 a.b = grecaptcha.render(b, a.a);
6065 }
6066 return a.b;
6067 }));
6068 };
6069 f.verify = function() {
6070 Sc(this);
6071 var a = this;
6072 return Pe(this, this.render().then(function(b) {
6073 return new t(function(c) {
6074 var d = grecaptcha.getResponse(b);
6075 if (d) {
6076 c(d);
6077 } else {
6078 var e = function(b) {
6079 b && (Al(a, e), c(b));
6080 };
6081 a.i.push(e);
6082 a.h && grecaptcha.execute(a.b);
6083 }
6084 });
6085 }));
6086 };
6087 f.reset = function() {
6088 Sc(this);
6089 null !== this.b && grecaptcha.reset(this.b);
6090 };
6091 f.clear = function() {
6092 Sc(this);
6093 this.m = !0;
6094 (mb || (mb = new li), mb).b--;
6095 for (var a = 0; a < this.g.length; a++) {
6096 this.g[a].cancel("RecaptchaVerifier instance has been destroyed.");
6097 }
6098 if (!this.h) {
6099 a = dc(this.l);
6100 for (var b; b = a.firstChild;) {
6101 a.removeChild(b);
6102 }
6103 }
6104 };
6105 var Cl = vb("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"), mb = null;
6106 u(Qe, Oe);
6107 J(X.prototype, {Sa:{name:"applyActionCode", j:[m("code")]}, Ia:{name:"checkActionCode", j:[m("code")]}, Ta:{name:"confirmPasswordReset", j:[m("code"), m("newPassword")]}, Ob:{name:"createUserWithEmailAndPassword", j:[m("email"), m("password")]}, qb:{name:"createUserAndRetrieveDataWithEmailAndPassword", j:[m("email"), m("password")]}, Rb:{name:"fetchProvidersForEmail", j:[m("email")]}, aa:{name:"getRedirectResult", j:[]}, hc:{name:"onAuthStateChanged", j:[I(H(), kb(), "nextOrObserver"), kb("opt_error",
6108 !0), kb("opt_completed", !0)]}, ic:{name:"onIdTokenChanged", j:[I(H(), kb(), "nextOrObserver"), kb("opt_error", !0), kb("opt_completed", !0)]}, cb:{name:"sendPasswordResetEmail", j:[m("email"), I(H("opt_actionCodeSettings", !0), Ma(null, !0), "opt_actionCodeSettings", !0)]}, eb:{name:"setPersistence", j:[m("persistence")]}, fb:{name:"signInAndRetrieveDataWithCredential", j:[Na()]}, gb:{name:"signInAnonymously", j:[]}, Gb:{name:"signInAnonymouslyAndRetrieveData", j:[]}, sc:{name:"signInWithCredential",
6109 j:[Na()]}, tc:{name:"signInWithCustomToken", j:[m("token")]}, Eb:{name:"signInAndRetrieveDataWithCustomToken", j:[m("token")]}, uc:{name:"signInWithEmailAndPassword", j:[m("email"), m("password")]}, Fb:{name:"signInAndRetrieveDataWithEmailAndPassword", j:[m("email"), m("password")]}, vc:{name:"signInWithPhoneNumber", j:[m("phoneNumber"), Rc()]}, wc:{name:"signInWithPopup", j:[lb()]}, xc:{name:"signInWithRedirect", j:[lb()]}, hb:{name:"signOut", j:[]}, toJSON:{name:"toJSON", j:[m(null, !0)]},
6110 Ec:{name:"useDeviceLanguage", j:[]}, Fc:{name:"verifyPasswordResetCode", j:[m("code")]}});
6111 (function(a, b) {
6112 for (var c in b) {
6113 var d = b[c].name;
6114 if (d !== c) {
6115 var e = b[c].Nb;
6116 Object.defineProperty(a, d, {get:function() {
6117 return this[c];
6118 }, set:function(a) {
6119 ei(d, [e], [a], !0);
6120 this[c] = a;
6121 }, enumerable:!0});
6122 }
6123 }
6124 })(X.prototype, {lc:{name:"languageCode", Nb:I(m(), Ma(), "languageCode")}});
6125 X.Persistence = fb;
6126 X.Persistence.LOCAL = "local";
6127 X.Persistence.SESSION = "session";
6128 X.Persistence.NONE = "none";
6129 J(W.prototype, {"delete":{name:"delete", j:[]}, F:{name:"getIdToken", j:[gi()]}, getToken:{name:"getToken", j:[gi()]}, Xa:{name:"linkAndRetrieveDataWithCredential", j:[Na()]}, cc:{name:"linkWithCredential", j:[Na()]}, dc:{name:"linkWithPhoneNumber", j:[m("phoneNumber"), Rc()]}, ec:{name:"linkWithPopup", j:[lb()]}, fc:{name:"linkWithRedirect", j:[lb()]}, Za:{name:"reauthenticateAndRetrieveDataWithCredential", j:[Na()]}, mc:{name:"reauthenticateWithCredential", j:[Na()]}, nc:{name:"reauthenticateWithPhoneNumber",
6130 j:[m("phoneNumber"), Rc()]}, oc:{name:"reauthenticateWithPopup", j:[lb()]}, pc:{name:"reauthenticateWithRedirect", j:[lb()]}, reload:{name:"reload", j:[]}, bb:{name:"sendEmailVerification", j:[I(H("opt_actionCodeSettings", !0), Ma(null, !0), "opt_actionCodeSettings", !0)]}, toJSON:{name:"toJSON", j:[m(null, !0)]}, Cc:{name:"unlink", j:[m("provider")]}, kb:{name:"updateEmail", j:[m("email")]}, lb:{name:"updatePassword", j:[m("password")]}, Dc:{name:"updatePhoneNumber", j:[Na("phone")]}, mb:{name:"updateProfile",
6131 j:[H("profile")]}});
6132 J(t.prototype, {s:{name:"catch"}, then:{name:"then"}});
6133 J(we.prototype, {confirm:{name:"confirm", j:[m("verificationCode")]}});
6134 K(Xd, "credential", function(a, b) {
6135 return new Kb(a, b);
6136 }, [m("email"), m("password")]);
6137 J(ab.prototype, {sa:{name:"addScope", j:[m("scope")]}, Ba:{name:"setCustomParameters", j:[H("customOAuthParameters")]}});
6138 K(ab, "credential", Wg, [I(m(), H(), "token")]);
6139 J(bb.prototype, {sa:{name:"addScope", j:[m("scope")]}, Ba:{name:"setCustomParameters", j:[H("customOAuthParameters")]}});
6140 K(bb, "credential", Xg, [I(m(), H(), "token")]);
6141 J(cb.prototype, {sa:{name:"addScope", j:[m("scope")]}, Ba:{name:"setCustomParameters", j:[H("customOAuthParameters")]}});
6142 K(cb, "credential", Yg, [I(m(), I(H(), Ma()), "idToken"), I(m(), Ma(), "accessToken", !0)]);
6143 J(Jb.prototype, {Ba:{name:"setCustomParameters", j:[H("customOAuthParameters")]}});
6144 K(Jb, "credential", $g, [I(m(), H(), "token"), m("secret", !0)]);
6145 J(N.prototype, {sa:{name:"addScope", j:[m("scope")]}, credential:{name:"credential", j:[I(m(), Ma(), "idToken", !0), I(m(), Ma(), "accessToken", !0)]}, Ba:{name:"setCustomParameters", j:[H("customOAuthParameters")]}});
6146 K(Ja, "credential", ah, [m("verificationId"), m("verificationCode")]);
6147 J(Ja.prototype, {Qa:{name:"verifyPhoneNumber", j:[m("phoneNumber"), Rc()]}});
6148 J(k.prototype, {toJSON:{name:"toJSON", j:[m(null, !0)]}});
6149 J(Lb.prototype, {toJSON:{name:"toJSON", j:[m(null, !0)]}});
6150 J(ae.prototype, {toJSON:{name:"toJSON", j:[m(null, !0)]}});
6151 J(Qe.prototype, {clear:{name:"clear", j:[]}, render:{name:"render", j:[]}, verify:{name:"verify", j:[]}});
6152 (function() {
6153 if (void 0 === q || !q.INTERNAL || !q.INTERNAL.registerService) {
6154 throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");
6155 }
6156 var a = {Auth:X, Error:k};
6157 K(a, "EmailAuthProvider", Xd, []);
6158 K(a, "FacebookAuthProvider", ab, []);
6159 K(a, "GithubAuthProvider", bb, []);
6160 K(a, "GoogleAuthProvider", cb, []);
6161 K(a, "TwitterAuthProvider", Jb, []);
6162 K(a, "OAuthProvider", N, [m("providerId")]);
6163 K(a, "PhoneAuthProvider", Ja, [xl()]);
6164 K(a, "RecaptchaVerifier", Qe, [I(m(), wl(), "recaptchaContainer"), H("recaptchaParameters", !0), yl()]);
6165 q.INTERNAL.registerService("auth", function(a, c) {
6166 return a = new X(a), c({INTERNAL:{getUid:n(a.getUid, a), getToken:n(a.Vb, a), addAuthTokenListener:n(a.Mb, a), removeAuthTokenListener:n(a.qc, a)}}), a;
6167 }, a, function(a, c) {
6168 if ("create" === a) {
6169 try {
6170 c.auth();
6171 } catch (d) {
6172 }
6173 }
6174 });
6175 q.INTERNAL.extendNamespace({User:W});
6176 })();
6177 }).call(void 0 !== va ? va : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
6178 }).call(Wb, Xb(12));
6179 }}, [76]);
6180} catch (va) {
6181 throw Error("Cannot instantiate firebase-auth.js - be sure to load firebase-app.js first.");
6182};
6183
6184/*!
6185 * @license Firebase v4.9.1
6186 * Build: rev-631e1ad
6187 * Terms: https://firebase.google.com/terms/
6188 */
6189try{webpackJsonpFirebase([0],[,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(0),a=n(0),s=n(0),u=n(0),l=n(13),h=n(0);t.LUIDGenerator=function(){var e=1;return function(){return e++}}(),t.sha1=function(e){var t=s.stringToByteArray(e),n=new a.Sha1;n.update(t);var r=n.digest();return o.base64.encodeByteArray(r)};var c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n="",r=0;r<e.length;r++)Array.isArray(e[r])||e[r]&&"object"==typeof e[r]&&"number"==typeof e[r].length?n+=c.apply(null,e[r]):"object"==typeof e[r]?n+=u.stringify(e[r]):n+=e[r],n+=" ";return n};t.logger=null;var p=!0;t.enableLogging=function(e,n){r.assert(!n||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?("undefined"!=typeof console&&("function"==typeof console.log?t.logger=console.log.bind(console):"object"==typeof console.log&&(t.logger=function(e){console.log(e)})),n&&l.SessionStorage.set("logging_enabled",!0)):"function"==typeof e?t.logger=e:(t.logger=null,l.SessionStorage.remove("logging_enabled"))},t.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!0===p&&(p=!1,null===t.logger&&!0===l.SessionStorage.get("logging_enabled")&&t.enableLogging(!0)),t.logger){var r=c.apply(null,e);t.logger(r)}},t.logWrapper=function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.log.apply(void 0,[e].concat(n))}},t.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("undefined"!=typeof console){var n="FIREBASE INTERNAL ERROR: "+c.apply(void 0,e);void 0!==console.error?console.error(n):console.log(n)}},t.fatal=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=c.apply(void 0,e);throw Error("FIREBASE FATAL ERROR: "+n)},t.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("undefined"!=typeof console){var n="FIREBASE WARNING: "+c.apply(void 0,e);void 0!==console.warn?console.warn(n):console.log(n)}},t.warnIfPageIsSecure=function(){"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&t.warn("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},t.warnAboutUnsupportedMethod=function(e){t.warn(e+" is unsupported and will likely change soon. Please do not use.")},t.isInvalidJSONNumber=function(e){return"number"==typeof e&&(e!=e||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY)},t.executeWhenDOMReady=function(e){if(h.isNodeSdk()||"complete"===document.readyState)e();else{var t=!1,n=function(){if(!document.body)return void setTimeout(n,Math.floor(10));t||(t=!0,e())};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))}},t.MIN_NAME="[MIN_NAME]",t.MAX_NAME="[MAX_NAME]",t.nameCompare=function(e,n){if(e===n)return 0;if(e===t.MIN_NAME||n===t.MAX_NAME)return-1;if(n===t.MIN_NAME||e===t.MAX_NAME)return 1;var r=t.tryParseInt(e),i=t.tryParseInt(n);return null!==r?null!==i?r-i==0?e.length-n.length:r-i:-1:null!==i?1:e<n?-1:1},t.stringCompare=function(e,t){return e===t?0:e<t?-1:1},t.requireKey=function(e,t){if(t&&e in t)return t[e];throw Error("Missing required key ("+e+") in object: "+u.stringify(t))},t.ObjectToUniqueKey=function(e){if("object"!=typeof e||null===e)return u.stringify(e);var n=[];for(var r in e)n.push(r);n.sort();for(var i="{",o=0;o<n.length;o++)0!==o&&(i+=","),i+=u.stringify(n[o]),i+=":",i+=t.ObjectToUniqueKey(e[n[o]]);return i+="}"},t.splitStringBySize=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r},t.each=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;++n)t(n,e[n]);else i.forEach(e,function(e,n){return t(n,e)})},t.bindCallback=function(e,t){return t?e.bind(t):e},t.doubleToIEEE754String=function(e){r.assert(!t.isInvalidJSONNumber(e),"Invalid JSON number");var n,i,o,a,s,u,l;for(0===e?(i=0,o=0,n=1/e==-1/0?1:0):(n=e<0,e=Math.abs(e),e>=Math.pow(2,-1022)?(a=Math.min(Math.floor(Math.log(e)/Math.LN2),1023),i=a+1023,o=Math.round(e*Math.pow(2,52-a)-Math.pow(2,52))):(i=0,o=Math.round(e/Math.pow(2,-1074)))),u=[],s=52;s;s-=1)u.push(o%2?1:0),o=Math.floor(o/2);for(s=11;s;s-=1)u.push(i%2?1:0),i=Math.floor(i/2);u.push(n?1:0),u.reverse(),l=u.join("");var h="";for(s=0;s<64;s+=8){var c=parseInt(l.substr(s,8),2).toString(16);1===c.length&&(c="0"+c),h+=c}return h.toLowerCase()},t.isChromeExtensionContentScript=function(){return!("object"!=typeof window||!window.chrome||!window.chrome.extension||/^chrome/.test(window.location.href))},t.isWindowsStoreApp=function(){return"object"==typeof Windows&&"object"==typeof Windows.UI},t.errorForServerCode=function(e,t){var n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==e?n="Client doesn't have permission to access the desired data.":"unavailable"==e&&(n="The service is unavailable");var r=Error(e+" at "+t.path+": "+n);return r.code=e.toUpperCase(),r},t.e=RegExp("^-?\\d{1,10}$"),t.tryParseInt=function(e){if(t.e.test(e)){var n=+e;if(n>=-2147483648&&n<=2147483647)return n}return null},t.exceptionGuard=function(e){try{e()}catch(e){setTimeout(function(){var n=e.stack||"";throw t.warn("Exception was thrown by user callback.",n),e},Math.floor(0))}},t.callUserCallback=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"function"==typeof e&&t.exceptionGuard(function(){e.apply(void 0,n)})},t.beingCrawled=function(){return("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},t.exportPropGetter=function(e,t,n){Object.defineProperty(e,t,{get:n})},t.setTimeoutNonBlocking=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(0),o=function(){function e(e,t){if(void 0===t){this.n=e.split("/");for(var n=0,r=0;r<this.n.length;r++)this.n[r].length>0&&(this.n[n]=this.n[r],n++);this.n.length=n,this.i=0}else this.n=e,this.i=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!0,configurable:!0}),e.prototype.getFront=function(){return this.i>=this.n.length?null:this.n[this.i]},e.prototype.getLength=function(){return this.n.length-this.i},e.prototype.popFront=function(){var t=this.i;return t<this.n.length&&t++,new e(this.n,t)},e.prototype.getBack=function(){return this.i<this.n.length?this.n[this.n.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.i;t<this.n.length;t++)""!==this.n[t]&&(e+="/"+this.n[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.i;t<this.n.length;t++)""!==this.n[t]&&(e+="/"+encodeURIComponent(this.n[t]+""));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.n.slice(this.i+e)},e.prototype.parent=function(){if(this.i>=this.n.length)return null;for(var t=[],n=this.i;n<this.n.length-1;n++)t.push(this.n[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],r=this.i;r<this.n.length;r++)n.push(this.n[r]);if(t instanceof e)for(var r=t.i;r<t.n.length;r++)n.push(t.n[r]);else for(var i=t.split("/"),r=0;r<i.length;r++)i[r].length>0&&n.push(i[r]);return new e(n,0)},e.prototype.isEmpty=function(){return this.i>=this.n.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());throw Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),i=t.slice(),o=0;o<n.length&&o<i.length;o++){var a=r.nameCompare(n[o],i[o]);if(0!==a)return a}return n.length===i.length?0:n.length<i.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.i,n=e.i;t<=this.n.length;t++,n++)if(this.n[t]!==e.n[n])return!1;return!0},e.prototype.contains=function(e){var t=this.i,n=e.i;if(this.getLength()>e.getLength())return!1;for(;t<this.n.length;){if(this.n[t]!==e.n[n])return!1;++t,++n}return!0},e}();t.Path=o;var a=function(){function e(e,t){this.o=t,this.u=e.slice(),this.l=Math.max(1,this.u.length);for(var n=0;n<this.u.length;n++)this.l+=i.stringLength(this.u[n]);this.f()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),e.prototype.push=function(e){this.u.length>0&&(this.l+=1),this.u.push(e),this.l+=i.stringLength(e),this.f()},e.prototype.pop=function(){var e=this.u.pop();this.l-=i.stringLength(e),this.u.length>0&&(this.l-=1)},e.prototype.f=function(){if(this.l>e.MAX_PATH_LENGTH_BYTES)throw Error(this.o+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.l+").");if(this.u.length>e.MAX_PATH_DEPTH)throw Error(this.o+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0==this.u.length?"":"in property '"+this.u.join(".")+"'"},e}();t.ValidationPath=a},function(e,t,n){"use strict";function r(e){a=e}function i(e){s=e}var o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var a,s,u=n(15),l=n(1),h=n(5),c=n(16);t.setNodeFromJSON=r,t.setMaxNode=i;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?l.nameCompare(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return h.NamedNode.MIN},t.prototype.maxPost=function(){return new h.NamedNode(l.MAX_NAME,new c.LeafNode("[PRIORITY-POST]",s))},t.prototype.makePost=function(e,t){var n=a(e);return new h.NamedNode(t,new c.LeafNode("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(u.Index);t.PriorityIndex=p,t.PRIORITY_INDEX=new p},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(0),a=n(1),s=n(17),u=n(5),l=n(37),h=n(3),c=n(10),p=n(39),d=n(16),f=n(41),_=function(){function e(e,t,n){this._=e,this.y=t,this.g=n,this.m=null,this.y&&l.validatePriorityNode(this.y),this._.isEmpty()&&o.assert(!this.y||this.y.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return i||(i=new e(new s.SortedMap(f.NAME_COMPARATOR),null,p.IndexMap.Default))},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.y||i},e.prototype.updatePriority=function(t){return this._.isEmpty()?this:new e(this._,t,this.g)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this._.get(e);return null===t?i:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this._.get(e)},e.prototype.updateImmediateChild=function(t,n){if(o.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var r=new u.NamedNode(t,n),a=void 0,s=void 0,l=void 0;return n.isEmpty()?(a=this._.remove(t),s=this.g.removeFromIndexes(r,this._)):(a=this._.insert(t,n),s=this.g.addToIndexes(r,this._)),l=a.isEmpty()?i:this.y,new e(a,l,s)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;o.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,r)},e.prototype.isEmpty=function(){return this._.isEmpty()},e.prototype.numChildren=function(){return this._.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(h.PRIORITY_INDEX,function(a,s){n[a]=s.val(t),r++,o&&e.e.test(a)?i=Math.max(i,+a):o=!1}),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.m){var e="";this.getPriority().isEmpty()||(e+="priority:"+l.priorityHashText(this.getPriority().val())+":"),this.forEachChild(h.PRIORITY_INDEX,function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)}),this.m=""===e?"":a.sha1(e)}return this.m},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.C(n);if(r){var i=r.getPredecessorKey(new u.NamedNode(e,t));return i?i.name:null}return this._.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.C(e);if(t){var n=t.minKey();return n&&n.name}return this._.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new u.NamedNode(t,this._.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.C(e);if(t){var n=t.maxKey();return n&&n.name}return this._.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new u.NamedNode(t,this._.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.C(e);return n?n.inorderTraversal(function(e){return t(e.name,e.node)}):this._.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.C(t);if(n)return n.getIteratorFrom(e,function(e){return e});for(var r=this._.getIteratorFrom(e.name,u.NamedNode.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.C(t);if(n)return n.getReverseIteratorFrom(e,function(e){return e});for(var r=this._.getReverseIteratorFrom(e.name,u.NamedNode.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===t.MAX_NODE?-1:0},e.prototype.withIndex=function(t){if(t===c.KEY_INDEX||this.g.hasIndex(t))return this;var n=this.g.addIndex(t,this._);return new e(this._,this.y,n)},e.prototype.isIndexed=function(e){return e===c.KEY_INDEX||this.g.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this._.count()===t._.count()){for(var n=this.getIterator(h.PRIORITY_INDEX),r=t.getIterator(h.PRIORITY_INDEX),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},e.prototype.C=function(e){return e===c.KEY_INDEX?null:this.g.get(""+e)},e.e=/^(0|[1-9]\d*)$/,e}();t.ChildrenNode=_;var y=function(e){function t(){return e.call(this,new s.SortedMap(f.NAME_COMPARATOR),_.EMPTY_NODE,p.IndexMap.Default)||this}return r(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return _.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(_);t.MaxNode=y,t.MAX_NODE=new y,Object.defineProperties(u.NamedNode,{MIN:{value:new u.NamedNode(a.MIN_NAME,_.EMPTY_NODE)},MAX:{value:new u.NamedNode(a.MAX_NAME,t.MAX_NODE)}}),c.KeyIndex.__EMPTY_NODE=_.EMPTY_NODE,d.LeafNode.__childrenNodeConstructor=_,l.setMaxNode(t.MAX_NODE),h.setMaxNode(t.MAX_NODE)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}();t.NamedNode=r},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(0),o=n(1),a=n(0),s=n(0);t.N=/[\[\].#$\/\u0000-\u001F\u007F]/,t.P=/[\[\].#$\u0000-\u001F\u007F]/,t.S=10485760,t.isValidKey=function(e){return"string"==typeof e&&0!==e.length&&!t.N.test(e)},t.isValidPathString=function(e){return"string"==typeof e&&0!==e.length&&!t.P.test(e)},t.isValidRootPathString=function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),t.isValidPathString(e)},t.isValidPriority=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!o.isInvalidJSONNumber(e)||e&&"object"==typeof e&&i.contains(e,".sv")},t.validateFirebaseDataArg=function(e,n,r,i,o){o&&void 0===r||t.validateFirebaseData(a.errorPrefix(e,n,o),r,i)},t.validateFirebaseData=function(e,n,a){var u=a instanceof r.Path?new r.ValidationPath(a,e):a;if(void 0===n)throw Error(e+"contains undefined "+u.toErrorString());if("function"==typeof n)throw Error(e+"contains a function "+u.toErrorString()+" with contents = "+n);if(o.isInvalidJSONNumber(n))throw Error(e+"contains "+n+" "+u.toErrorString());if("string"==typeof n&&n.length>t.S/3&&s.stringLength(n)>t.S)throw Error(e+"contains a string greater than "+t.S+" utf8 bytes "+u.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"==typeof n){var l=!1,h=!1;if(i.forEach(n,function(n,r){if(".value"===n)l=!0;else if(".priority"!==n&&".sv"!==n&&(h=!0,!t.isValidKey(n)))throw Error(e+" contains an invalid key ("+n+") "+u.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');u.push(n),t.validateFirebaseData(e,r,u),u.pop()}),l&&h)throw Error(e+' contains ".value" child '+u.toErrorString()+" in addition to actual children.")}},t.validateFirebaseMergePaths=function(e,n){var i,o;for(i=0;i<n.length;i++){o=n[i];for(var a=o.slice(),s=0;s<a.length;s++)if(".priority"===a[s]&&s===a.length-1);else if(!t.isValidKey(a[s]))throw Error(e+"contains an invalid key ("+a[s]+") in path "+o+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}n.sort(r.Path.comparePaths);var u=null;for(i=0;i<n.length;i++){if(o=n[i],null!==u&&u.contains(o))throw Error(e+"contains a path "+u+" that is ancestor of another path "+o);u=o}},t.validateFirebaseMergeDataArg=function(e,n,o,s,u){if(!u||void 0!==o){var l=a.errorPrefix(e,n,u);if(!o||"object"!=typeof o||Array.isArray(o))throw Error(l+" must be an object containing the children to replace.");var h=[];i.forEach(o,function(e,n){var i=new r.Path(e);if(t.validateFirebaseData(l,n,s.child(i)),".priority"===i.getBack()&&!t.isValidPriority(n))throw Error(l+"contains an invalid value for '"+i+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");h.push(i)}),t.validateFirebaseMergePaths(l,h)}},t.validatePriority=function(e,n,r,i){if(!i||void 0!==r){if(o.isInvalidJSONNumber(r))throw Error(a.errorPrefix(e,n,i)+"is "+r+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!t.isValidPriority(r))throw Error(a.errorPrefix(e,n,i)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},t.validateEventType=function(e,t,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 Error(a.errorPrefix(e,t,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},t.validateKey=function(e,n,r,i){if(!(i&&void 0===r||t.isValidKey(r)))throw Error(a.errorPrefix(e,n,i)+'was an invalid key = "'+r+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},t.validatePathString=function(e,n,r,i){if(!(i&&void 0===r||t.isValidPathString(r)))throw Error(a.errorPrefix(e,n,i)+'was an invalid path = "'+r+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},t.validateRootPathString=function(e,n,r,i){r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),t.validatePathString(e,n,r,i)},t.validateWritablePath=function(e,t){if(".info"===t.getFront())throw Error(e+" failed = Can't modify data under /.info/")},t.validateUrl=function(e,n,r){var i=""+r.path;if("string"!=typeof r.repoInfo.host||0===r.repoInfo.host.length||!t.isValidKey(r.repoInfo.namespace)&&"localhost"!==r.repoInfo.host.split(":")[0]||0!==i.length&&!t.isValidRootPathString(i))throw Error(a.errorPrefix(e,n,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},t.validateCredential=function(e,t,n,r){if((!r||void 0!==n)&&"string"!=typeof n)throw Error(a.errorPrefix(e,t,r)+"must be a valid credential (a string).")},t.validateBoolean=function(e,t,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw Error(a.errorPrefix(e,t,r)+"must be a boolean.")},t.validateString=function(e,t,n,r){if((!r||void 0!==n)&&"string"!=typeof n)throw Error(a.errorPrefix(e,t,r)+"must be a valid string.")},t.validateObject=function(e,t,n,r){if(!(r&&void 0===n||n&&"object"==typeof n&&null!==n))throw Error(a.errorPrefix(e,t,r)+"must be a valid object.")},t.validateObjectContainsKey=function(e,t,n,r,o,s){if(!n||"object"!=typeof n||!i.contains(n,r)){if(o)return;throw Error(a.errorPrefix(e,t,o)+'must contain the key "'+r+'"')}if(s){var u=i.safeGet(n,r);if("number"===s&&"number"!=typeof u||"string"===s&&"string"!=typeof u||"boolean"===s&&"boolean"!=typeof u||"function"===s&&"function"!=typeof u||"object"===s&&"object"!=typeof u&&u)throw o?Error(a.errorPrefix(e,t,o)+'contains invalid value for key "'+r+'" (must be of type "'+s+'")'):Error(a.errorPrefix(e,t,o)+'must contain the key "'+r+'" with type "'+s+'"')}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(t.OperationType||(t.OperationType={}));var i=function(){function e(e,t,n,i){this.fromUser=e,this.fromServer=t,this.queryId=n,this.tagged=i,r.assert(!i||t,"Tagged queries must be from server.")}return e.User=new e(!0,!1,null,!1),e.Server=new e(!1,!0,null,!1),e.forServerTaggedQuery=function(t){return new e(!1,!0,t,!0)},e}();t.OperationSource=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r,i){this.type=e,this.snapshotNode=t,this.childName=n,this.oldSnap=r,this.prevName=i}return e.valueChange=function(t){return new e(e.VALUE,t)},e.childAddedChange=function(t,n){return new e(e.CHILD_ADDED,n,t)},e.childRemovedChange=function(t,n){return new e(e.CHILD_REMOVED,n,t)},e.childChangedChange=function(t,n,r){return new e(e.CHILD_CHANGED,n,t,r)},e.childMovedChange=function(t,n){return new e(e.CHILD_MOVED,n,t)},e.CHILD_ADDED="child_added",e.CHILD_REMOVED="child_removed",e.CHILD_CHANGED="child_changed",e.CHILD_MOVED="child_moved",e.VALUE="value",e}();t.Change=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(15),a=n(5),s=n(1),u=n(0),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return i},set:function(e){i=e},enumerable:!0,configurable:!0}),t.prototype.compare=function(e,t){return s.nameCompare(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw u.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return a.NamedNode.MIN},t.prototype.maxPost=function(){return new a.NamedNode(s.MAX_NAME,i)},t.prototype.makePost=function(e,t){return u.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new a.NamedNode(e,i)},t.prototype.toString=function(){return".key"},t}(o.Index);t.KeyIndex=l,t.KEY_INDEX=new l},function(e,t,n){"use strict";function r(e,t){if(void 0===t&&(t=null),null===e)return i.ChildrenNode.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),u.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e){var n=e;return new o.LeafNode(n,r(t))}if(e instanceof Array||!d){var f=i.ChildrenNode.EMPTY_NODE,_=e;return s.forEach(_,function(e,t){if(s.contains(_,e)&&"."!==e.substring(0,1)){var n=r(t);!n.isLeafNode()&&n.isEmpty()||(f=f.updateImmediateChild(e,n))}}),f.updatePriority(r(t))}var y=[],v=!1,g=e;if(s.forEach(g,function(e,t){if("string"!=typeof e||"."!==e.substring(0,1)){var n=r(g[e]);n.isEmpty()||(v=v||!n.getPriority().isEmpty(),y.push(new a.NamedNode(e,n)))}}),0==y.length)return i.ChildrenNode.EMPTY_NODE;var m=l.buildChildSet(y,h.NAME_ONLY_COMPARATOR,function(e){return e.name},h.NAME_COMPARATOR);if(v){var C=l.buildChildSet(y,p.PRIORITY_INDEX.getCompare());return new i.ChildrenNode(m,r(t),new c.IndexMap({".priority":C},{".priority":p.PRIORITY_INDEX}))}return new i.ChildrenNode(m,r(t),c.IndexMap.Default)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(16),a=n(5),s=n(0),u=n(0),l=n(40),h=n(41),c=n(39),p=n(3),d=!0;t.nodeFromJSON=r,p.setNodeFromJSON(r)},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80),i=n(81),o=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new r.DOMStorageWrapper(t)}}catch(e){}return new i.MemoryStorage};t.PersistentStorage=o("localStorage"),t.SessionStorage=o("sessionStorage")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_VERSION="5",t.VERSION_PARAM="v",t.TRANSPORT_SESSION_PARAM="s",t.REFERER_PARAM="r",t.FORGE_REF="f",t.FORGE_DOMAIN="firebaseio.com",t.LAST_SESSION_PARAM="ls",t.WEBSOCKET="websocket",t.LONG_POLLING="long_polling"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(1),o=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new r.NamedNode(i.MIN_NAME,e),o=new r.NamedNode(i.MIN_NAME,t);return 0!==this.compare(n,o)},e.prototype.minPost=function(){return r.NamedNode.MIN},e}();t.Index=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(1),a=n(37),s=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.T=t,this.y=n,this.m=null,i.assert(void 0!==this.T&&null!==this.T,"LeafNode shouldn't be created with null/undefined value."),a.validatePriorityNode(this.y)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return r},set:function(e){r=e},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.y},e.prototype.updatePriority=function(t){return new e(this.T,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.y:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.y:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.y)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(i.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.m){var e="";this.y.isEmpty()||(e+="priority:"+a.priorityHashText(this.y.val())+":");var t=typeof this.T;e+=t+":",e+="number"===t?o.doubleToIEEE754String(this.T):this.T,this.m=o.sha1(e)}return this.m},e.prototype.getValue=function(){return this.T},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(i.assert(t.isLeafNode(),"Unknown node type"),this.w(t))},e.prototype.w=function(t){var n=typeof t.T,r=typeof this.T,o=e.VALUE_TYPE_ORDER.indexOf(n),a=e.VALUE_TYPE_ORDER.indexOf(r);return i.assert(o>=0,"Unknown leaf type: "+n),i.assert(a>=0,"Unknown leaf type: "+r),o===a?"object"===r?0:this.T<t.T?-1:this.T===t.T?0:1:a-o},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.T===t.T&&this.y.equals(t.y)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();t.LeafNode=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.I=r,this.R=i,this.O=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.I?e.left:e.right;else{if(0===o){this.O.push(e);break}this.O.push(e),e=this.I?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.O.length)return null;var e,t=this.O.pop();if(e=this.R?this.R(t.key,t.value):{key:t.key,value:t.value},this.I)for(t=t.left;!t.isEmpty();)this.O.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.O.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.O.length>0},e.prototype.peek=function(){if(0===this.O.length)return null;var e=this.O[this.O.length-1];return this.R?this.R(e.key,e.value):{key:e.key,value:e.value}},e}();t.SortedMapIterator=r;var i=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:a.EMPTY_NODE,this.right=null!=o?o:a.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.A=function(){return this.left.isEmpty()?this:this.left.A()},e.prototype.minKey=function(){return this.A().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r,i;return i=this,r=n(e,i.key),i=r<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===r?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.D()},e.prototype.M=function(){if(this.left.isEmpty())return a.EMPTY_NODE;var e=this;return e.left.L()||e.left.left.L()||(e=e.F()),e=e.copy(null,null,null,e.left.M(),null),e.D()},e.prototype.remove=function(e,t){var n,r;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.L()||n.left.left.L()||(n=n.F()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.L()&&(n=n.x()),n.right.isEmpty()||n.right.L()||n.right.left.L()||(n=n.k()),0===t(e,n.key)){if(n.right.isEmpty())return a.EMPTY_NODE;r=n.right.A(),n=n.copy(r.key,r.value,null,null,n.right.M())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.D()},e.prototype.L=function(){return this.color},e.prototype.D=function(){var e=this;return e.right.L()&&!e.left.L()&&(e=e.W()),e.left.L()&&e.left.left.L()&&(e=e.x()),e.left.L()&&e.right.L()&&(e=e.j()),e},e.prototype.F=function(){var e=this.j();return e.right.left.L()&&(e=e.copy(null,null,null,null,e.right.x()),e=e.W(),e=e.j()),e},e.prototype.k=function(){var e=this.j();return e.left.left.L()&&(e=e.x(),e=e.j()),e},e.prototype.W=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.x=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.j=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.V=function(){var e=this.Q();return Math.pow(2,e)<=this.count()+1},e.prototype.Q=function(){var e;if(this.L()&&this.left.L())throw Error("Red node has red child("+this.key+","+this.value+")");if(this.right.L())throw Error("Right child of ("+this.key+","+this.value+") is red");if((e=this.left.Q())!==this.right.Q())throw Error("Black depths differ");return e+(this.L()?0:1)},e.RED=!0,e.BLACK=!1,e}();t.LLRBNode=i;var o=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new i(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.Q=function(){return 0},e.prototype.L=function(){return!1},e}();t.LLRBEmptyNode=o;var a=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.U=t,this.B=n}return e.prototype.insert=function(t,n){return new e(this.U,this.B.insert(t,n,this.U).copy(null,null,i.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.U,this.B.remove(t,this.U).copy(null,null,i.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.B;!n.isEmpty();){if(0===(t=this.U(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.B,r=null;!n.isEmpty();){if(0===(t=this.U(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.B.isEmpty()},e.prototype.count=function(){return this.B.count()},e.prototype.minKey=function(){return this.B.minKey()},e.prototype.maxKey=function(){return this.B.maxKey()},e.prototype.inorderTraversal=function(e){return this.B.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.B.reverseTraversal(e)},e.prototype.getIterator=function(e){return new r(this.B,null,this.U,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new r(this.B,e,this.U,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new r(this.B,e,this.U,!0,t)},e.prototype.getReverseIterator=function(e){return new r(this.B,null,this.U,!0,e)},e.EMPTY_NODE=new o,e}();t.SortedMap=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(43),i=n(11),o=n(2),a=n(44),s=n(86),u=n(97),l=n(0),h=n(1),c=n(0),p=n(98),d=n(25),f=n(100),_=n(49),y=n(101),v=n(50),g=n(106),m=n(32),C=function(){function e(e,t,n){var r=this;this.H=e,this.app=n,this.dataUpdateCount=0,this.G=null,this.K=new y.EventQueue,this.Y=1,this.X=null,this.z=new a.SparseSnapshotTree,this.J=null;var i=new p.AuthTokenProvider(n);if(this.$=d.StatsManager.getCollection(e),t||h.beingCrawled())this.Z=new g.ReadonlyRestClient(this.H,this.ee.bind(this),i),setTimeout(this.te.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(void 0!==o&&null!==o){if("object"!=typeof o)throw Error("Only objects are supported for option databaseAuthVariableOverride");try{l.stringify(o)}catch(e){throw Error("Invalid authOverride provided: "+e)}}this.J=new v.PersistentConnection(this.H,this.ee.bind(this),this.te.bind(this),this.ne.bind(this),i,o),this.Z=this.J}i.addTokenChangeListener(function(e){r.Z.refreshAuthToken(e)}),this.re=d.StatsManager.getOrCreateReporter(e,function(){return new f.StatsReporter(r.$,r.Z)}),this.ie(),this.oe=new u.SnapshotHolder,this.ae=new s.SyncTree({startListening:function(e,t,n,i){var o=[],a=r.oe.getNode(e.path);return a.isEmpty()||(o=r.ae.applyServerOverwrite(e.path,a),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),this.se("connected",!1),this.ue=new s.SyncTree({startListening:function(e,t,n,i){return r.Z.listen(e,n,t,function(t,n){var o=i(t,n);r.K.raiseEventsForChangedPath(e.path,o)}),[]},stopListening:function(e,t){r.Z.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.H.secure?"https://":"http://")+this.H.host},e.prototype.name=function(){return this.H.namespace},e.prototype.serverTime=function(){var e=this.oe.getNode(new o.Path(".info/serverTimeOffset")),t=e.val()||0;return(new Date).getTime()+t},e.prototype.generateServerValues=function(){return r.generateWithValues({timestamp:this.serverTime()})},e.prototype.ee=function(e,t,n,r){this.dataUpdateCount++;var a=new o.Path(e);t=this.X?this.X(e,t):t;var s=[];if(r)if(n){var u=c.map(t,function(e){return i.nodeFromJSON(e)});s=this.ue.applyTaggedQueryMerge(a,u,r)}else{var l=i.nodeFromJSON(t);s=this.ue.applyTaggedQueryOverwrite(a,l,r)}else if(n){var h=c.map(t,function(e){return i.nodeFromJSON(e)});s=this.ue.applyServerMerge(a,h)}else{var p=i.nodeFromJSON(t);s=this.ue.applyServerOverwrite(a,p)}var d=a;s.length>0&&(d=this.le(a)),this.K.raiseEventsForChangedPath(d,s)},e.prototype.he=function(e){this.X=e},e.prototype.te=function(e){this.se("connected",e),!1===e&&this.ce()},e.prototype.ne=function(e){var t=this;h.each(e,function(e,n){t.se(n,e)})},e.prototype.se=function(e,t){var n=new o.Path("/.info/"+e),r=i.nodeFromJSON(t);this.oe.updateSnapshot(n,r);var a=this.ae.applyServerOverwrite(n,r);this.K.raiseEventsForChangedPath(n,a)},e.prototype.pe=function(){return this.Y++},e.prototype.setWithPriority=function(e,t,n,o){var a=this;this.de("set",{path:""+e,value:t,priority:n});var s=this.generateServerValues(),u=i.nodeFromJSON(t,n),l=r.resolveDeferredValueSnapshot(u,s),c=this.pe(),p=this.ue.applyUserOverwrite(e,l,c,!0);this.K.queueEvents(p),this.Z.put(""+e,u.val(!0),function(t,n){var r="ok"===t;r||h.warn("set at "+e+" failed: "+t);var i=a.ue.ackUserWrite(c,!r);a.K.raiseEventsForChangedPath(e,i),a.callOnCompleteCallback(o,t,n)});var d=this.fe(e);this.le(d),this.K.raiseEventsForChangedPath(d,[])},e.prototype.update=function(e,t,n){var o=this;this.de("update",{path:""+e,value:t});var a=!0,s=this.generateServerValues(),u={};if(c.forEach(t,function(e,t){a=!1;var n=i.nodeFromJSON(t);u[e]=r.resolveDeferredValueSnapshot(n,s)}),a)h.log("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var l=this.pe(),p=this.ue.applyUserMerge(e,u,l);this.K.queueEvents(p),this.Z.merge(""+e,t,function(t,r){var i="ok"===t;i||h.warn("update at "+e+" failed: "+t);var a=o.ue.ackUserWrite(l,!i),s=a.length>0?o.le(e):e;o.K.raiseEventsForChangedPath(s,a),o.callOnCompleteCallback(n,t,r)}),c.forEach(t,function(t){var n=o.fe(e.child(t));o.le(n)}),this.K.raiseEventsForChangedPath(e,[])}},e.prototype.ce=function(){var e=this;this.de("onDisconnectEvents");var t=this.generateServerValues(),n=r.resolveDeferredValueTree(this.z,t),i=[];n.forEachTree(o.Path.Empty,function(t,n){i=i.concat(e.ue.applyServerOverwrite(t,n));var r=e.fe(t);e.le(r)}),this.z=new a.SparseSnapshotTree,this.K.raiseEventsForChangedPath(o.Path.Empty,i)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.Z.onDisconnectCancel(""+e,function(r,i){"ok"===r&&n.z.forget(e),n.callOnCompleteCallback(t,r,i)})},e.prototype.onDisconnectSet=function(e,t,n){var r=this,o=i.nodeFromJSON(t);this.Z.onDisconnectPut(""+e,o.val(!0),function(t,i){"ok"===t&&r.z.remember(e,o),r.callOnCompleteCallback(n,t,i)})},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var o=this,a=i.nodeFromJSON(t,n);this.Z.onDisconnectPut(""+e,a.val(!0),function(t,n){"ok"===t&&o.z.remember(e,a),o.callOnCompleteCallback(r,t,n)})},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(c.isEmpty(t))return h.log("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.Z.onDisconnectMerge(""+e,t,function(o,a){"ok"===o&&c.forEach(t,function(t,n){var o=i.nodeFromJSON(n);r.z.remember(e.child(t),o)}),r.callOnCompleteCallback(n,o,a)})},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.ae.addEventRegistration(e,t):this.ue.addEventRegistration(e,t),this.K.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.ae.removeEventRegistration(e,t):this.ue.removeEventRegistration(e,t),this.K.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.J&&this.J.interrupt("repo_interrupt")},e.prototype.resume=function(){this.J&&this.J.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.G||(this.G=new _.StatsListener(this.$)),t=this.G.get()):t=this.$.get();var n=Object.keys(t).reduce(function(e,t){return Math.max(t.length,e)},0);c.forEach(t,function(e,t){for(var r=e.length;r<n+2;r++)e+=" ";console.log(e+t)})}},e.prototype.statsIncrementCounter=function(e){this.$.incrementCounter(e),this.re.includeStat(e)},e.prototype.de=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";this.J&&(n=this.J.id+":"),h.log.apply(void 0,[n].concat(e))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&h.exceptionGuard(function(){if("ok"==t)e(null);else{var r=(t||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=Error(i);o.code=r,e(o)}})},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new m.Database(this))},enumerable:!0,configurable:!0}),e}();t.Repo=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n){this._e=e,this.ye=t,this.ve=n}return e.prototype.isFullyInitialized=function(){return this.ye},e.prototype.isFiltered=function(){return this.ve},e.prototype.isCompleteForPath=function(e){if(e.isEmpty())return this.isFullyInitialized()&&!this.ve;var t=e.getFront();return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.ve||this._e.hasChild(e)},e.prototype.getNode=function(){return this._e},e}();t.CacheNode=r},,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=n(82),a=n(1),s=n(83),u=n(36),l=n(18),h=n(2),c=n(107),p=n(7),d=n(0),f=n(0),_=n(47),y=function(e){function t(t,n){if(!(t instanceof l.Repo))throw Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,c.QueryParams.DEFAULT,!1)||this}return r(t,e),t.prototype.getKey=function(){return d.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return d.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e+="":e instanceof h.Path||(null===this.path.getFront()?p.validateRootPathString("Reference.child",1,e,!1):p.validatePathString("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){d.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){d.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){d.validateArgCount("Reference.set",1,2,arguments.length),p.validateWritablePath("Reference.set",this.path),p.validateFirebaseDataArg("Reference.set",1,e,this.path,!1),d.validateCallback("Reference.set",2,t,!0);var n=new f.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(d.validateArgCount("Reference.update",1,2,arguments.length),p.validateWritablePath("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,a.warn("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.")}p.validateFirebaseMergeDataArg("Reference.update",1,e,this.path,!1),d.validateCallback("Reference.update",2,t,!0);var i=new f.Deferred;return this.repo.update(this.path,e,i.wrapCallback(t)),i.promise},t.prototype.setWithPriority=function(e,t,n){if(d.validateArgCount("Reference.setWithPriority",2,3,arguments.length),p.validateWritablePath("Reference.setWithPriority",this.path),p.validateFirebaseDataArg("Reference.setWithPriority",1,e,this.path,!1),p.validatePriority("Reference.setWithPriority",2,t,!1),d.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 f.Deferred;return this.repo.setWithPriority(this.path,e,t,r.wrapCallback(n)),r.promise},t.prototype.remove=function(e){return d.validateArgCount("Reference.remove",0,1,arguments.length),p.validateWritablePath("Reference.remove",this.path),d.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(d.validateArgCount("Reference.transaction",1,3,arguments.length),p.validateWritablePath("Reference.transaction",this.path),d.validateCallback("Reference.transaction",1,e,!1),d.validateCallback("Reference.transaction",2,t,!0),p.validateBoolean("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 f.Deferred;"function"==typeof t&&r.promise.catch(function(){});var i=function(e,n,i){e?r.reject(e):r.resolve(new o.TransactionResult(n,i)),"function"==typeof t&&t(e,n,i)};return this.repo.startTransaction(this.path,e,i,n),r.promise},t.prototype.setPriority=function(e,t){d.validateArgCount("Reference.setPriority",1,2,arguments.length),p.validateWritablePath("Reference.setPriority",this.path),p.validatePriority("Reference.setPriority",1,e,!1),d.validateCallback("Reference.setPriority",2,t,!0);var n=new f.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){d.validateArgCount("Reference.push",0,2,arguments.length),p.validateWritablePath("Reference.push",this.path),p.validateFirebaseDataArg("Reference.push",1,e,this.path,!0),d.validateCallback("Reference.push",2,t,!0);var n,r=this.repo.serverTime(),i=s.nextPushId(r),o=this.child(i),a=this.child(i);return n=null!=e?o.set(e,t).then(function(){return a}):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof t&&n.catch(function(){}),o},t.prototype.onDisconnect=function(){return p.validateWritablePath("Reference.onDisconnect",this.path),new i.OnDisconnect(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),t}(u.Query);t.Reference=y,u.Query.__referenceConstructor=y,_.SyncPoint.__referenceConstructor=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(7),o=n(2),a=n(3),s=function(){function e(e,t,n){this._e=e,this.ge=t,this.me=n}return e.prototype.val=function(){return r.validateArgCount("DataSnapshot.val",0,0,arguments.length),this._e.val()},e.prototype.exportVal=function(){return r.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this._e.val(!0)},e.prototype.toJSON=function(){return r.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return r.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this._e.isEmpty()},e.prototype.child=function(t){r.validateArgCount("DataSnapshot.child",0,1,arguments.length),t+="",i.validatePathString("DataSnapshot.child",1,t,!1);var n=new o.Path(t),s=this.ge.child(n);return new e(this._e.getChild(n),s,a.PRIORITY_INDEX)},e.prototype.hasChild=function(e){r.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),i.validatePathString("DataSnapshot.hasChild",1,e,!1);var t=new o.Path(e);return!this._e.getChild(t).isEmpty()},e.prototype.getPriority=function(){return r.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this._e.getPriority().val()},e.prototype.forEach=function(t){var n=this;return r.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),r.validateCallback("DataSnapshot.forEach",1,t,!1),!this._e.isLeafNode()&&!!this._e.forEachChild(this.me,function(r,i){return t(new e(i,n.ge.child(r),a.PRIORITY_INDEX))})},e.prototype.hasChildren=function(){return r.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this._e.isLeafNode()&&!this._e.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ge.getKey()},enumerable:!0,configurable:!0}),e.prototype.numChildren=function(){return r.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this._e.numChildren()},e.prototype.getRef=function(){return r.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ge},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}();t.DataSnapshot=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(17),o=n(2),a=n(1),s=n(0),u=function(){return r||(r=new i.SortedMap(a.stringCompare)),r},l=function(){function e(e,t){void 0===t&&(t=u()),this.value=e,this.children=t}return e.fromObject=function(t){var n=e.Empty;return s.forEach(t,function(e,t){n=n.set(new o.Path(e),t)}),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:o.Path.Empty,value:this.value};if(e.isEmpty())return null;var n=e.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(e.popFront(),t);return null!=i?{path:new o.Path(n).child(i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,function(){return!0})},e.prototype.subtree=function(t){if(t.isEmpty())return this;var n=t.getFront(),r=this.children.get(n);return null!==r?r.subtree(t.popFront()):e.Empty},e.prototype.set=function(t,n){if(t.isEmpty())return new e(n,this.children);var r=t.getFront(),i=this.children.get(r)||e.Empty,o=i.set(t.popFront(),n),a=this.children.insert(r,o);return new e(this.value,a)},e.prototype.remove=function(t){if(t.isEmpty())return this.children.isEmpty()?e.Empty:new e(null,this.children);var n=t.getFront(),r=this.children.get(n);if(r){var i=r.remove(t.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?e.Empty:new e(this.value,o)}return this},e.prototype.get=function(e){if(e.isEmpty())return this.value;var t=e.getFront(),n=this.children.get(t);return n?n.get(e.popFront()):null},e.prototype.setTree=function(t,n){if(t.isEmpty())return n;var r=t.getFront(),i=this.children.get(r)||e.Empty,o=i.setTree(t.popFront(),n),a=void 0;return a=o.isEmpty()?this.children.remove(r):this.children.insert(r,o),new e(this.value,a)},e.prototype.fold=function(e){return this.Ce(o.Path.Empty,e)},e.prototype.Ce=function(e,t){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.Ce(e.child(r),t)}),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.Ee(e,o.Path.Empty,t)},e.prototype.Ee=function(e,t,n){var r=!!this.value&&n(t,this.value);if(r)return r;if(e.isEmpty())return null;var i=e.getFront(),o=this.children.get(i);return o?o.Ee(e.popFront(),t.child(i),n):null},e.prototype.foreachOnPath=function(e,t){return this.Ne(e,o.Path.Empty,t)},e.prototype.Ne=function(t,n,r){if(t.isEmpty())return this;this.value&&r(n,this.value);var i=t.getFront(),o=this.children.get(i);return o?o.Ne(t.popFront(),n.child(i),r):e.Empty},e.prototype.foreach=function(e){this.Pe(o.Path.Empty,e)},e.prototype.Pe=function(e,t){this.children.inorderTraversal(function(n,r){r.Pe(e.child(n),t)}),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal(function(t,n){n.value&&e(t,n.value)})},e.Empty=new e(null),e}();t.ImmutableTree=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(4),a=n(3),s=function(){function e(e){this.me=e}return e.prototype.updateChild=function(e,t,n,o,a,s){r.assert(e.isIndexed(this.me),"A node must be indexed if only a child is updated");var u=e.getImmediateChild(t);return u.getChild(o).equals(n.getChild(o))&&u.isEmpty()==n.isEmpty()?e:(null!=s&&(n.isEmpty()?e.hasChild(t)?s.trackChildChange(i.Change.childRemovedChange(t,u)):r.assert(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):u.isEmpty()?s.trackChildChange(i.Change.childAddedChange(t,n)):s.trackChildChange(i.Change.childChangedChange(t,n,u))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.me))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(a.PRIORITY_INDEX,function(e,r){t.hasChild(e)||n.trackChildChange(i.Change.childRemovedChange(e,r))}),t.isLeafNode()||t.forEachChild(a.PRIORITY_INDEX,function(t,r){if(e.hasChild(t)){var o=e.getImmediateChild(t);o.equals(r)||n.trackChildChange(i.Change.childChangedChange(t,r,o))}else n.trackChildChange(i.Change.childAddedChange(t,r))})),t.withIndex(this.me)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?o.ChildrenNode.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.me},e}();t.IndexedFilter=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99),i=function(){function e(){}return e.getCollection=function(e){var t=""+e;return this.be[t]||(this.be[t]=new r.StatsCollection),this.be[t]},e.getOrCreateReporter=function(e,t){var n=""+e;return this.Se[n]||(this.Se[n]=t()),this.Se[n]},e.be={},e.Se={},e}();t.StatsManager=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(18),o=n(1),a=n(33),s=n(7);n(109);var u,l=function(){function e(){this.Te={},this.we=!1}return e.getInstance=function(){return u||(u=new e),u},e.prototype.interrupt=function(){for(var e in this.Te)for(var t in this.Te[e])this.Te[e][t].interrupt()},e.prototype.resume=function(){for(var e in this.Te)for(var t in this.Te[e])this.Te[e][t].resume()},e.prototype.databaseFromApp=function(e,t){var n=t||e.options.databaseURL;void 0===n&&o.fatal("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var r=a.parseRepoInfo(n),i=r.repoInfo;return s.validateUrl("Invalid Firebase Database URL",1,r),r.path.isEmpty()||o.fatal("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(i,e).database},e.prototype.deleteRepo=function(e){var t=r.safeGet(this.Te,e.app.name);t&&r.safeGet(t,e.H.toURLString())===e||o.fatal("Database "+e.app.name+"("+e.H+") has already been deleted."),e.interrupt(),delete t[e.H.toURLString()]},e.prototype.createRepo=function(e,t){var n=r.safeGet(this.Te,t.name);n||(n={},this.Te[t.name]=n);var a=r.safeGet(n,e.toURLString());return a&&o.fatal("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),a=new i.Repo(e,this.we,t),n[e.toURLString()]=a,a},e.prototype.forceRestClient=function(e){this.we=e},e}();t.RepoManager=l},,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(33),o=n(2),a=n(21),s=n(18),u=n(26),l=n(0),h=n(7),c=function(){function e(e){this.Ie=e,e instanceof s.Repo||r.fatal("Don't call new Database() directly - please use firebase.database()."),this.B=new a.Reference(e,o.Path.Empty),this.INTERNAL=new p(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.Ie.app},enumerable:!0,configurable:!0}),e.prototype.ref=function(e){return this.Re("ref"),l.validateArgCount("database.ref",0,1,arguments.length),void 0!==e?this.B.child(e):this.B},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.Re(t),l.validateArgCount(t,1,1,arguments.length);var n=i.parseRepoInfo(e);h.validateUrl(t,1,n);var o=n.repoInfo;return o.host!==this.Ie.H.host&&r.fatal(t+": Host name does not match the current database: (found "+o.host+" but expected "+this.Ie.H.host+")"),this.ref(""+n.path)},e.prototype.Re=function(e){null===this.Ie&&r.fatal("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){l.validateArgCount("database.goOffline",0,0,arguments.length),this.Re("goOffline"),this.Ie.interrupt()},e.prototype.goOnline=function(){l.validateArgCount("database.goOnline",0,0,arguments.length),this.Re("goOnline"),this.Ie.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"}},e}();t.Database=c;var p=function(){function e(e){this.database=e}return e.prototype.delete=function(){return this.database.Re("delete"),u.RepoManager.getInstance().deleteRepo(this.database.Ie),this.database.Ie=null,this.database.B=null,this.database.INTERNAL=null,this.database=null,Promise.resolve()},e}();t.DatabaseInternals=p},function(e,t,n){"use strict";function r(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(34),a=n(1);t.parseRepoInfo=function(e){var n=t.parseURL(e),r=n.subdomain;"firebase"===n.domain&&a.fatal(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!=r||"localhost"===n.domain||a.fatal("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||a.warnIfPageIsSecure();var s="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new o.RepoInfo(n.host,n.secure,r,s),path:new i.Path(n.pathString)}},t.parseURL=function(e){var t="",n="",i="",o="",a=!0,s="https",u=443;if("string"==typeof e){var l=e.indexOf("//");l>=0&&(s=e.substring(0,l-1),e=e.substring(l+2));var h=e.indexOf("/");-1===h&&(h=e.length),t=e.substring(0,h),o=r(e.substring(h)),l=t.indexOf(":"),l>=0?(a="https"===s||"wss"===s,u=parseInt(t.substring(l+1),10)):l=e.length;var c=t.split(".");3===c.length?(n=c[1],i=c[0].toLowerCase()):2===c.length?n=c[0]:"localhost"===c[0].slice(0,l).toLowerCase()&&(n="localhost")}return{host:t,port:u,domain:n,subdomain:i,secure:a,scheme:s,pathString:o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(13),a=n(14),s=function(){function e(e,t,n,r,i){void 0===i&&(i=""),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=o.PersistentStorage.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&o.PersistentStorage.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){r.assert("string"==typeof e,"typeof type must == string"),r.assert("object"==typeof t,"typeof params must == object");var n;if(e===a.WEBSOCKET)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(e!==a.LONG_POLLING)throw Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var o=[];return i.forEach(t,function(e,t){o.push(e+"="+t)}),n+o.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();t.RepoInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(7),o=n(1),a=n(0),s=function(){function e(e,t){this.Ie=e,this.Oe=t}return e.prototype.cancel=function(e){r.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),r.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new a.Deferred;return this.Ie.onDisconnectCancel(this.Oe,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){r.validateArgCount("OnDisconnect.remove",0,1,arguments.length),i.validateWritablePath("OnDisconnect.remove",this.Oe),r.validateCallback("OnDisconnect.remove",1,e,!0);var t=new a.Deferred;return this.Ie.onDisconnectSet(this.Oe,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){r.validateArgCount("OnDisconnect.set",1,2,arguments.length),i.validateWritablePath("OnDisconnect.set",this.Oe),i.validateFirebaseDataArg("OnDisconnect.set",1,e,this.Oe,!1),r.validateCallback("OnDisconnect.set",2,t,!0);var n=new a.Deferred;return this.Ie.onDisconnectSet(this.Oe,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){r.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),i.validateWritablePath("OnDisconnect.setWithPriority",this.Oe),i.validateFirebaseDataArg("OnDisconnect.setWithPriority",1,e,this.Oe,!1),i.validatePriority("OnDisconnect.setWithPriority",2,t,!1),r.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var o=new a.Deferred;return this.Ie.onDisconnectSetWithPriority(this.Oe,e,t,o.wrapCallback(n)),o.promise},e.prototype.update=function(e,t){if(r.validateArgCount("OnDisconnect.update",1,2,arguments.length),i.validateWritablePath("OnDisconnect.update",this.Oe),Array.isArray(e)){for(var n={},s=0;s<e.length;++s)n[""+s]=e[s];e=n,o.warn("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.")}i.validateFirebaseMergeDataArg("OnDisconnect.update",1,e,this.Oe,!1),r.validateCallback("OnDisconnect.update",2,t,!0);var u=new a.Deferred;return this.Ie.onDisconnectUpdate(this.Oe,e,u.wrapCallback(t)),u.promise},e}();t.OnDisconnect=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(10),a=n(3),s=n(38),u=n(42),l=n(1),h=n(2),c=n(7),p=n(0),d=n(84),f=n(0),_=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.Ae=n,this.De=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return i.assert(r,"Reference.ts has not been loaded"),r},set:function(e){r=e},enumerable:!0,configurable:!0}),e.Me=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===o.KEY_INDEX){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",h="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!=l.MIN_NAME)throw Error(r);if("string"!=typeof t)throw Error(h)}if(e.hasEnd()){if(e.getIndexEndName()!=l.MAX_NAME)throw Error(r);if("string"!=typeof n)throw Error(h)}}else if(e.getIndex()===a.PRIORITY_INDEX){if(null!=t&&!c.isValidPriority(t)||null!=n&&!c.isValidPriority(n))throw 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(i.assert(e.getIndex()instanceof u.PathIndex||e.getIndex()===s.VALUE_INDEX,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.Le=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.Fe=function(e){if(!0===this.De)throw Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.Ae},e.prototype.getRef=function(){return p.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){p.validateArgCount("Query.on",2,4,arguments.length),c.validateEventType("Query.on",1,t,!1),p.validateCallback("Query.on",2,n,!1);var o=e.xe("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new d.ValueEventRegistration(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new d.ChildEventRegistration(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){p.validateArgCount("Query.off",0,3,arguments.length),c.validateEventType("Query.off",1,e,!0),p.validateCallback("Query.off",2,t,!0),p.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new d.ValueEventRegistration(o,null,n||null)}else e&&(t&&(i={},i[e]=t),r=new d.ChildEventRegistration(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;p.validateArgCount("Query.once",1,4,arguments.length),c.validateEventType("Query.once",1,t,!1),p.validateCallback("Query.once",2,n,!0);var a=e.xe("Query.once",r,i),s=!0,u=new f.Deferred;u.promise.catch(function(){});var l=function(e){s&&(s=!1,o.off(t,l),n&&n.bind(a.context)(e),u.resolve(e))};return this.on(t,l,function(e){o.off(t,l),a.cancel&&a.cancel.bind(a.context)(e),u.reject(e)}),u.promise},e.prototype.limitToFirst=function(t){if(p.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.Ae.limitToFirst(t),this.De)},e.prototype.limitToLast=function(t){if(p.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.Ae.limitToLast(t),this.De)},e.prototype.orderByChild=function(t){if(p.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');c.validatePathString("Query.orderByChild",1,t,!1),this.Fe("Query.orderByChild");var n=new h.Path(t);if(n.isEmpty())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new u.PathIndex(n),i=this.Ae.orderBy(r);return e.Me(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){p.validateArgCount("Query.orderByKey",0,0,arguments.length),this.Fe("Query.orderByKey");var t=this.Ae.orderBy(o.KEY_INDEX);return e.Me(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){p.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.Fe("Query.orderByPriority");var t=this.Ae.orderBy(a.PRIORITY_INDEX);return e.Me(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){p.validateArgCount("Query.orderByValue",0,0,arguments.length),this.Fe("Query.orderByValue");var t=this.Ae.orderBy(s.VALUE_INDEX);return e.Me(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),p.validateArgCount("Query.startAt",0,2,arguments.length),c.validateFirebaseDataArg("Query.startAt",1,t,this.path,!0),c.validateKey("Query.startAt",2,n,!0);var r=this.Ae.startAt(t,n);if(e.Le(r),e.Me(r),this.Ae.hasStart())throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.De)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),p.validateArgCount("Query.endAt",0,2,arguments.length),c.validateFirebaseDataArg("Query.endAt",1,t,this.path,!0),c.validateKey("Query.endAt",2,n,!0);var r=this.Ae.endAt(t,n);if(e.Le(r),e.Me(r),this.Ae.hasEnd())throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.De)},e.prototype.equalTo=function(e,t){if(p.validateArgCount("Query.equalTo",1,2,arguments.length),c.validateFirebaseDataArg("Query.equalTo",1,e,this.path,!1),c.validateKey("Query.equalTo",2,t,!0),this.Ae.hasStart())throw Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.Ae.hasEnd())throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return p.validateArgCount("Query.toString",0,0,arguments.length),""+this.repo+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return p.validateArgCount("Query.toJSON",0,1,arguments.length),""+this},e.prototype.queryObject=function(){return this.Ae.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=l.ObjectToUniqueKey(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(p.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e))throw Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var n=this.repo===t.repo,r=this.path.equals(t.path),i=this.queryIdentifier()===t.queryIdentifier();return n&&r&&i},e.xe=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,p.validateCallback(e,3,r.cancel,!0),r.context=n,p.validateContextObject(e,4,r.context,!0);else if(t)if("object"==typeof t&&null!==t)r.context=t;else{if("function"!=typeof t)throw Error(p.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}();t.Query=_},function(e,t,n){"use strict";function r(e){i=e}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(0),a=n(1),s=n(0);t.setMaxNode=r,t.priorityHashText=function(e){return"number"==typeof e?"number:"+a.doubleToIEEE754String(e):"string:"+e},t.validatePriorityNode=function(e){if(e.isLeafNode()){var t=e.val();o.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&s.contains(t,".sv"),"Priority must be a string or number.")}else o.assert(e===i||e.isEmpty(),"priority of unexpected type.");o.assert(e===i||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),o=n(5),a=n(1),s=n(11),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?a.nameCompare(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return o.NamedNode.MIN},t.prototype.maxPost=function(){return o.NamedNode.MAX},t.prototype.makePost=function(e,t){var n=s.nodeFromJSON(e);return new o.NamedNode(t,n)},t.prototype.toString=function(){return".value"},t}(i.Index);t.ValueIndex=u,t.VALUE_INDEX=new u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(40),a=n(0),s=n(5),u=n(3),l=n(10),h={},c=function(){function e(e,t){this.ke=e,this.We=t}return Object.defineProperty(e,"Default",{get:function(){return i.assert(h&&u.PRIORITY_INDEX,"ChildrenNode.ts has not been loaded"),r=r||new e({".priority":h},{".priority":u.PRIORITY_INDEX})},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=a.safeGet(this.ke,e);if(!t)throw Error("No index defined for "+e);return t===h?null:t},e.prototype.hasIndex=function(e){return a.contains(this.We,""+e)},e.prototype.addIndex=function(t,n){i.assert(t!==l.KEY_INDEX,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r=[],u=!1,c=n.getIterator(s.NamedNode.Wrap),p=c.getNext();p;)u=u||t.isDefinedOn(p.node),r.push(p),p=c.getNext();var d;d=u?o.buildChildSet(r,t.getCompare()):h;var f=""+t,_=a.clone(this.We);_[f]=t;var y=a.clone(this.ke);return y[f]=d,new e(y,_)},e.prototype.addToIndexes=function(t,n){var r=this;return new e(a.map(this.ke,function(e,u){var l=a.safeGet(r.We,u);if(i.assert(l,"Missing index implementation for "+u),e===h){if(l.isDefinedOn(t.node)){for(var c=[],p=n.getIterator(s.NamedNode.Wrap),d=p.getNext();d;)d.name!=t.name&&c.push(d),d=p.getNext();return c.push(t),o.buildChildSet(c,l.getCompare())}return h}var f=n.get(t.name),_=e;return f&&(_=_.remove(new s.NamedNode(t.name,f))),_.insert(t,t.node)}),this.We)},e.prototype.removeFromIndexes=function(t,n){return new e(a.map(this.ke,function(e){if(e===h)return e;var r=n.get(t.name);return r?e.remove(new s.NamedNode(t.name,r)):e}),this.We)},e}();t.IndexMap=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),i=n(17),o=Math.log(2),a=function(){function e(e){this.count=function(e){return parseInt(Math.log(e)/o,10)}(e+1),this.je=this.count-1;var t=function(e){return parseInt(Array(e+1).join("1"),2)}(this.count);this.Ve=e+1&t}return e.prototype.nextBitIsOne=function(){var e=!(this.Ve&1<<this.je);return this.je--,e},e}();t.buildChildSet=function(e,t,n,o){e.sort(t);var s=function(t,i){var o,a,u=i-t;if(0==u)return null;if(1==u)return o=e[t],a=n?n(o):o,new r.LLRBNode(a,o.node,r.LLRBNode.BLACK,null,null);var l=parseInt(u/2,10)+t,h=s(t,l),c=s(l+1,i);return o=e[l],a=n?n(o):o,new r.LLRBNode(a,o.node,r.LLRBNode.BLACK,h,c)},u=new a(e.length),l=function(t){for(var i=null,o=null,a=e.length,u=function(t,i){var o=a-t,u=a;a-=t;var h=s(o+1,u),c=e[o],p=n?n(c):c;l(new r.LLRBNode(p,c.node,i,null,h))},l=function(e){i?(i.left=e,i=e):(o=e,i=e)},h=0;h<t.count;++h){var c=t.nextBitIsOne(),p=Math.pow(2,t.count-(h+1));c?u(p,r.LLRBNode.BLACK):(u(p,r.LLRBNode.BLACK),u(p,r.LLRBNode.RED))}return o}(u);return new i.SortedMap(o||t,l)}},function(e,t,n){"use strict";function r(e,t){return o.nameCompare(e.name,t.name)}function i(e,t){return o.nameCompare(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);t.NAME_ONLY_COMPARATOR=r,t.NAME_COMPARATOR=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),a=n(15),s=n(4),u=n(5),l=n(11),h=function(e){function t(t){var n=e.call(this)||this;return n.Qe=t,i.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return r(t,e),t.prototype.extractChild=function(e){return e.getChild(this.Qe)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.Qe).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?o.nameCompare(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=l.nodeFromJSON(e),r=s.ChildrenNode.EMPTY_NODE.updateChild(this.Qe,n);return new u.NamedNode(t,r)},t.prototype.maxPost=function(){var e=s.ChildrenNode.EMPTY_NODE.updateChild(this.Qe,s.MAX_NODE);return new u.NamedNode(o.MAX_NAME,e)},t.prototype.toString=function(){return this.Qe.slice().join("/")},t}(a.Index);t.PathIndex=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(44),a=n(16),s=n(11),u=n(3);t.generateWithValues=function(e){return e=e||{},e.timestamp=e.timestamp||(new Date).getTime(),e},t.resolveDeferredValue=function(e,t){return e&&"object"==typeof e?(r.assert(".sv"in e,"Unexpected leaf node or priority contents"),t[e[".sv"]]):e},t.resolveDeferredValueTree=function(e,n){var r=new o.SparseSnapshotTree;return e.forEachTree(new i.Path(""),function(e,i){r.remember(e,t.resolveDeferredValueSnapshot(i,n))}),r},t.resolveDeferredValueSnapshot=function(e,n){var r,i=e.getPriority().val(),o=t.resolveDeferredValue(i,n);if(e.isLeafNode()){var l=e,h=t.resolveDeferredValue(l.getValue(),n);return h!==l.getValue()||o!==l.getPriority().val()?new a.LeafNode(h,s.nodeFromJSON(o)):e}var c=e;return r=c,o!==c.getPriority().val()&&(r=r.updatePriority(new a.LeafNode(o))),c.forEachChild(u.PRIORITY_INDEX,function(e,i){var o=t.resolveDeferredValueSnapshot(i,n);o!==i&&(r=r.updateImmediateChild(e,o))}),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(3),o=n(45),a=function(){function e(){this.T=null,this._=null}return e.prototype.find=function(e){if(null!=this.T)return this.T.getChild(e);if(e.isEmpty()||null==this._)return null;var t=e.getFront();return e=e.popFront(),this._.contains(t)?this._.get(t).find(e):null},e.prototype.remember=function(t,n){if(t.isEmpty())this.T=n,this._=null;else if(null!==this.T)this.T=this.T.updateChild(t,n);else{null==this._&&(this._=new o.CountedSet);var r=t.getFront();this._.contains(r)||this._.add(r,new e);var i=this._.get(r);t=t.popFront(),i.remember(t,n)}},e.prototype.forget=function(e){if(e.isEmpty())return this.T=null,this._=null,!0;if(null!==this.T){if(this.T.isLeafNode())return!1;var t=this.T;this.T=null;var n=this;return t.forEachChild(i.PRIORITY_INDEX,function(e,t){n.remember(new r.Path(e),t)}),this.forget(e)}if(null!==this._){var o=e.getFront();return e=e.popFront(),this._.contains(o)&&this._.get(o).forget(e)&&this._.remove(o),!!this._.isEmpty()&&(this._=null,!0)}return!0},e.prototype.forEachTree=function(e,t){null!==this.T?t(e,this.T):this.forEachChild(function(n,i){var o=new r.Path(e+"/"+n);i.forEachTree(o,t)})},e.prototype.forEachChild=function(e){null!==this._&&this._.each(function(t,n){e(t,n)})},e}();t.SparseSnapshotTree=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.set={}}return e.prototype.add=function(e,t){this.set[e]=null===t||t},e.prototype.contains=function(e){return r.contains(this.set,e)},e.prototype.get=function(e){return this.contains(e)?this.set[e]:void 0},e.prototype.remove=function(e){delete this.set[e]},e.prototype.clear=function(){this.set={}},e.prototype.isEmpty=function(){return r.isEmpty(this.set)},e.prototype.count=function(){return r.getCount(this.set)},e.prototype.each=function(e){r.forEach(this.set,function(t,n){return e(t,n)})},e.prototype.keys=function(){var e=[];return r.forEach(this.set,function(t){e.push(t)}),e},e}();t.CountedSet=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),i=n(2),o=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=r.OperationType.OVERWRITE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,i.Path.Empty,this.snap.getImmediateChild(t)):new e(this.source,this.path.popFront(),this.snap)},e}();t.Overwrite=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(19),o=n(4),a=n(0),s=n(0),u=n(48),l=n(90),h=function(){function e(){this.qe={}}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return a.assert(r,"Reference.ts has not been loaded"),r},set:function(e){a.assert(!r,"__referenceConstructor has already been defined"),r=e},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return s.isEmpty(this.qe)},e.prototype.applyOperation=function(e,t,n){var r=e.source.queryId;if(null!==r){var i=s.safeGet(this.qe,r);return a.assert(null!=i,"SyncTree gave us an op for an invalid query."),i.applyOperation(e,t,n)}var o=[];return s.forEach(this.qe,function(r,i){o=o.concat(i.applyOperation(e,t,n))}),o},e.prototype.addEventRegistration=function(e,t,n,r,a){var h=e.queryIdentifier(),c=s.safeGet(this.qe,h);if(!c){var p=n.calcCompleteEventCache(a?r:null),d=!1;p?d=!0:r instanceof o.ChildrenNode?(p=n.calcCompleteEventChildren(r),d=!1):(p=o.ChildrenNode.EMPTY_NODE,d=!1);var f=new u.ViewCache(new i.CacheNode(p,d,!1),new i.CacheNode(r,a,!1));c=new l.View(e,f),this.qe[h]=c}return c.addEventRegistration(t),c.getInitialEvents(t)},e.prototype.removeEventRegistration=function(t,n,r){var i=t.queryIdentifier(),o=[],a=[],u=this.hasCompleteView();if("default"===i){var l=this;s.forEach(this.qe,function(e,t){a=a.concat(t.removeEventRegistration(n,r)),t.isEmpty()&&(delete l.qe[e],t.getQuery().getQueryParams().loadsAllData()||o.push(t.getQuery()))})}else{var h=s.safeGet(this.qe,i);h&&(a=a.concat(h.removeEventRegistration(n,r)),h.isEmpty()&&(delete this.qe[i],h.getQuery().getQueryParams().loadsAllData()||o.push(h.getQuery())))}return u&&!this.hasCompleteView()&&o.push(new e.__referenceConstructor(t.repo,t.path)),{removed:o,events:a}},e.prototype.getQueryViews=function(){var e=this;return Object.keys(this.qe).map(function(t){return e.qe[t]}).filter(function(e){return!e.getQuery().getQueryParams().loadsAllData()})},e.prototype.getCompleteServerCache=function(e){var t=null;return s.forEach(this.qe,function(n,r){t=t||r.getCompleteServerCache(e)}),t},e.prototype.viewForQuery=function(e){if(e.getQueryParams().loadsAllData())return this.getCompleteView();var t=e.queryIdentifier();return s.safeGet(this.qe,t)},e.prototype.viewExistsForQuery=function(e){return null!=this.viewForQuery(e)},e.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},e.prototype.getCompleteView=function(){return s.findValue(this.qe,function(e){return e.getQuery().getQueryParams().loadsAllData()})||null},e}();t.SyncPoint=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(19),o=function(){function e(e,t){this.Ue=e,this.Be=t}return e.prototype.updateEventSnap=function(t,n,r){return new e(new i.CacheNode(t,n,r),this.Be)},e.prototype.updateServerSnap=function(t,n,r){return new e(this.Ue,new i.CacheNode(t,n,r))},e.prototype.getEventCache=function(){return this.Ue},e.prototype.getCompleteEventSnap=function(){return this.Ue.isFullyInitialized()?this.Ue.getNode():null},e.prototype.getServerCache=function(){return this.Be},e.prototype.getCompleteServerSnap=function(){return this.Be.isFullyInitialized()?this.Be.getNode():null},e.Empty=new e(new i.CacheNode(r.ChildrenNode.EMPTY_NODE,!1,!1),new i.CacheNode(r.ChildrenNode.EMPTY_NODE,!1,!1)),e}();t.ViewCache=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.He=e,this.Ge=null}return e.prototype.get=function(){var e=this.He.get(),t=r.clone(e);return this.Ge&&r.forEach(this.Ge,function(e,n){t[e]=t[e]-n}),this.Ge=e,t},e}();t.StatsListener=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),o=n(0),a=n(0),s=n(0),u=n(1),l=n(2),h=n(102),c=n(103),p=n(0),d=n(52),f=n(0),_=n(0),y=n(55),v=1e3,g=3e5,m=function(e){function t(n,r,i,o,a,s){var l=e.call(this)||this;if(l.H=n,l.ee=r,l.te=i,l.ne=o,l.Ke=a,l.Ye=s,l.id=t.Xe++,l.de=u.logWrapper("p:"+l.id+":"),l.ze={},l.Je={},l.$e=[],l.Ze=0,l.et=[],l.tt=!1,l.nt=v,l.rt=g,l.it=null,l.lastSessionId=null,l.ot=null,l.at=!1,l.st={},l.ut=0,l.lt=null,l.ht=null,l.ct=!1,l.pt=0,l.dt=!0,l.ft=null,l._t=null,s&&!_.isNodeSdk())throw Error("Auth override specified in options, but not supported on non Node.js platforms");return l.yt(0),h.VisibilityMonitor.getInstance().on("visible",l.vt,l),-1===n.host.indexOf("fblocal")&&c.OnlineMonitor.getInstance().on("online",l.gt,l),l}return r(t,e),t.prototype.sendRequest=function(e,t,n){var r=++this.ut,i={r:r,a:e,b:t};this.de(a.stringify(i)),s.assert(this.tt,"sendRequest call when we're not connected not allowed."),this.lt.sendRequest(i),n&&(this.st[r]=n)},t.prototype.listen=function(e,t,n,r){var i=e.queryIdentifier(),o=""+e.path;this.de("Listen called for "+o+" "+i),this.Je[o]=this.Je[o]||{},s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),s.assert(!this.Je[o][i],"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:t,query:e,tag:n};this.Je[o][i]=a,this.tt&&this.mt(a)},t.prototype.mt=function(e){var n=this,r=e.query,i=""+r.path,o=r.queryIdentifier();this.de("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r.queryObject(),a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,function(a){var s=a.d,u=a.s;t.Ct(s,r),(n.Je[i]&&n.Je[i][o])===e&&(n.de("listen response",a),"ok"!==u&&n.Et(i,o),e.onComplete&&e.onComplete(u,s))})},t.Ct=function(e,t){if(e&&"object"==typeof e&&o.contains(e,"w")){var n=o.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+t.getQueryParams().getIndex()+'"',i=""+t.path;u.warn("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.")}}},t.prototype.refreshAuthToken=function(e){this.ht=e,this.de("Auth token refreshed"),this.ht?this.tryAuth():this.tt&&this.sendRequest("unauth",{},function(){}),this.Nt(e)},t.prototype.Nt=function(e){(e&&40===e.length||p.isAdmin(e))&&(this.de("Admin auth credential detected. Reducing max reconnect time."),this.rt=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.tt&&this.ht){var t=this.ht,n=p.isValidFormat(t)?"auth":"gauth",r={cred:t};null===this.Ye?r.noauth=!0:"object"==typeof this.Ye&&(r.authvar=this.Ye),this.sendRequest(n,r,function(n){var r=n.s,i=n.d||"error";e.ht===t&&("ok"===r?e.pt=0:e.Pt(r,i))})}},t.prototype.unlisten=function(e,t){var n=""+e.path,r=e.queryIdentifier();this.de("Unlisten called for "+n+" "+r),s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.Et(n,r)&&this.tt&&this.bt(n,r,e.queryObject(),t)},t.prototype.bt=function(e,t,n,r){this.de("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.tt?this.St("o",e,t,n):this.et.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.tt?this.St("om",e,t,n):this.et.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.tt?this.St("oc",e,null,t):this.et.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.St=function(e,t,n,r){var i={p:t,d:n};this.de("onDisconnect "+e,i),this.sendRequest(e,i,function(e){r&&setTimeout(function(){r(e.s,e.d)},Math.floor(0))})},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){var o={p:t,d:n};void 0!==i&&(o.h=i),this.$e.push({action:e,request:o,onComplete:r}),this.Ze++;var a=this.$e.length-1;this.tt?this.Tt(a):this.de("Buffering put: "+t)},t.prototype.Tt=function(e){var t=this,n=this.$e[e].action,r=this.$e[e].request,i=this.$e[e].onComplete;this.$e[e].queued=this.tt,this.sendRequest(n,r,function(r){t.de(n+" response",r),delete t.$e[e],t.Ze--,0===t.Ze&&(t.$e=[]),i&&i(r.s,r.d)})},t.prototype.reportStats=function(e){var t=this;if(this.tt){var n={c:e};this.de("reportStats",n),this.sendRequest("s",n,function(e){if("ok"!==e.s){var n=e.d;t.de("reportStats","Error sending stats: "+n)}})}},t.prototype.wt=function(e){if("r"in e){this.de("from server: "+a.stringify(e));var t=e.r,n=this.st[t];n&&(delete this.st[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.It(e.a,e.b)}},t.prototype.It=function(e,t){this.de("handleServerMessage",e,t),"d"===e?this.ee(t.p,t.d,!1,t.t):"m"===e?this.ee(t.p,t.d,!0,t.t):"c"===e?this.Rt(t.p,t.q):"ac"===e?this.Pt(t.s,t.d):"sd"===e?this.Ot(t):u.error("Unrecognized action received from server: "+a.stringify(e)+"\nAre you using the latest client?")},t.prototype.At=function(e,t){this.de("connection ready"),this.tt=!0,this._t=(new Date).getTime(),this.Dt(e),this.lastSessionId=t,this.dt&&this.Mt(),this.Lt(),this.dt=!1,this.te(!0)},t.prototype.yt=function(e){var t=this;s.assert(!this.lt,"Scheduling a connect when we're already connected/ing?"),this.ot&&clearTimeout(this.ot),this.ot=setTimeout(function(){t.ot=null,t.Ft()},Math.floor(e))},t.prototype.vt=function(e){e&&!this.at&&this.nt===this.rt&&(this.de("Window became visible. Reducing delay."),this.nt=v,this.lt||this.yt(0)),this.at=e},t.prototype.gt=function(e){e?(this.de("Browser went online."),this.nt=v,this.lt||this.yt(0)):(this.de("Browser went offline. Killing connection."),this.lt&&this.lt.close())},t.prototype.xt=function(){if(this.de("data client disconnected"),this.tt=!1,this.lt=null,this.kt(),this.st={},this.Wt()){if(this.at){if(this._t){var e=(new Date).getTime()-this._t;e>3e4&&(this.nt=v),this._t=null}}else this.de("Window isn't visible. Delaying reconnect."),this.nt=this.rt,this.ft=(new Date).getTime();var t=(new Date).getTime()-this.ft,n=Math.max(0,this.nt-t);n=Math.random()*n,this.de("Trying to reconnect in "+n+"ms"),this.yt(n),this.nt=Math.min(this.rt,1.3*this.nt)}this.te(!1)},t.prototype.Ft=function(){if(this.Wt()){this.de("Making a connection attempt"),this.ft=(new Date).getTime(),this._t=null;var e=this.wt.bind(this),n=this.At.bind(this),r=this.xt.bind(this),i=this.id+":"+t.jt++,o=this,a=this.lastSessionId,l=!1,h=null,c=function(){h?h.close():(l=!0,r())},p=function(e){s.assert(h,"sendRequest call when we're not connected not allowed."),h.sendRequest(e)};this.lt={close:c,sendRequest:p};var _=this.ct;this.ct=!1,this.Ke.getToken(_).then(function(t){l?u.log("getToken() completed but was canceled"):(u.log("getToken() completed. Creating connection."),o.ht=t&&t.accessToken,h=new d.Connection(i,o.H,e,n,r,function(e){u.warn(e+" ("+o.H+")"),o.interrupt("server_kill")},a))}).then(null,function(e){o.de("Failed to get token: "+e),l||(f.CONSTANTS.NODE_ADMIN&&u.warn(e),c())})}},t.prototype.interrupt=function(e){u.log("Interrupting connection for reason: "+e),this.ze[e]=!0,this.lt?this.lt.close():(this.ot&&(clearTimeout(this.ot),this.ot=null),this.tt&&this.xt())},t.prototype.resume=function(e){u.log("Resuming connection for reason: "+e),delete this.ze[e],o.isEmpty(this.ze)&&(this.nt=v,this.lt||this.yt(0))},t.prototype.Dt=function(e){var t=e-(new Date).getTime();this.ne({serverTimeOffset:t})},t.prototype.kt=function(){for(var e=0;e<this.$e.length;e++){var t=this.$e[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.$e[e],this.Ze--)}0===this.Ze&&(this.$e=[])},t.prototype.Rt=function(e,t){var n;n=t?t.map(function(e){return u.ObjectToUniqueKey(e)}).join("$"):"default";var r=this.Et(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.Et=function(e,t){var n,r=""+new l.Path(e);return void 0!==this.Je[r]?(n=this.Je[r][t],delete this.Je[r][t],0===o.getCount(this.Je[r])&&delete this.Je[r]):n=void 0,n},t.prototype.Pt=function(e,t){u.log("Auth token revoked: "+e+"/"+t),this.ht=null,this.ct=!0,this.lt.close(),"invalid_token"!==e&&"permission_denied"!==e||++this.pt>=3&&(this.nt=3e4,this.Ke.notifyForInvalidToken())},t.prototype.Ot=function(e){this.it?this.it(e):"msg"in e&&"undefined"!=typeof console&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.Lt=function(){var e=this;this.tryAuth(),o.forEach(this.Je,function(t,n){o.forEach(n,function(t,n){e.mt(n)})});for(var t=0;t<this.$e.length;t++)this.$e[t]&&this.Tt(t);for(;this.et.length;){var n=this.et.shift();this.St(n.action,n.pathString,n.data,n.onComplete)}},t.prototype.Mt=function(){var e={},t="js";f.CONSTANTS.NODE_ADMIN?t="admin_node":f.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+i.default.SDK_VERSION.replace(/\./g,"-")]=1,_.isMobileCordova()?e["framework.cordova"]=1:_.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.Wt=function(){var e=c.OnlineMonitor.getInstance().currentlyOnline();return o.isEmpty(this.ze)&&e},t.Xe=0,t.jt=0,t}(y.ServerActions);t.PersistentConnection=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.Vt=e,this.Qt={},r.assert(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Array.isArray(this.Qt[e]))for(var r=this.Qt[e].slice(),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,t)},e.prototype.on=function(e,t,n){this.qt(e),this.Qt[e]=this.Qt[e]||[],this.Qt[e].push({callback:t,context:n});var r=this.getInitialEvent(e);r&&t.apply(n,r)},e.prototype.off=function(e,t,n){this.qt(e);for(var r=this.Qt[e]||[],i=0;i<r.length;i++)if(r[i].callback===t&&(!n||n===r[i].context))return void r.splice(i,1)},e.prototype.qt=function(e){r.assert(this.Vt.find(function(t){return t===e}),"Unknown event: "+e)},e}();t.EventEmitter=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(13),o=n(14),a=n(104),s=function(){function e(e,t,n,i,o,s,u){this.id=e,this.H=t,this.Ut=n,this.At=i,this.z=o,this.Bt=s,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.Ht=0,this.de=r.logWrapper("c:"+this.id+":"),this.Gt=new a.TransportManager(t),this.de("Connection created"),this.Kt()}return e.prototype.Kt=function(){var e=this,t=this.Gt.initialTransport();this.Yt=new t(this.Xt(),this.H,void 0,this.lastSessionId),this.zt=t.responsesRequiredToBeHealthy||0;var n=this.Jt(this.Yt),i=this.$t(this.Yt);this.Zt=this.Yt,this.en=this.Yt,this.tn=null,this.nn=!1,setTimeout(function(){e.Yt&&e.Yt.open(n,i)},Math.floor(0));var o=t.healthyTimeout||0;o>0&&(this.rn=r.setTimeoutNonBlocking(function(){e.rn=null,e.nn||(e.Yt&&e.Yt.bytesReceived>102400?(e.de("Connection exceeded healthy timeout but has received "+e.Yt.bytesReceived+" bytes. Marking connection healthy."),e.nn=!0,e.Yt.markConnectionHealthy()):e.Yt&&e.Yt.bytesSent>10240?e.de("Connection exceeded healthy timeout but has sent "+e.Yt.bytesSent+" bytes. Leaving connection alive."):(e.de("Closing unhealthy connection after timeout."),e.close()))},Math.floor(o)))},e.prototype.Xt=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.$t=function(e){var t=this;return function(n){e===t.Yt?t.in(n):e===t.tn?(t.de("Secondary connection lost."),t.an()):t.de("closing an old connection")}},e.prototype.Jt=function(e){var t=this;return function(n){2!=t.Ht&&(e===t.en?t.sn(n):e===t.tn?t.un(n):t.de("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.ln(t)},e.prototype.tryCleanupConnection=function(){this.Zt===this.tn&&this.en===this.tn&&(this.de("cleaning up and promoting a connection: "+this.tn.connId),this.Yt=this.tn,this.tn=null)},e.prototype.hn=function(e){if("t"in e){var t=e.t;"a"===t?this.cn():"r"===t?(this.de("Got a reset on secondary, closing it"),this.tn.close(),this.Zt!==this.tn&&this.en!==this.tn||this.close()):"o"===t&&(this.de("got pong on secondary."),this.pn--,this.cn())}},e.prototype.un=function(e){var t=r.requireKey("t",e),n=r.requireKey("d",e);if("c"==t)this.hn(n);else{if("d"!=t)throw Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.cn=function(){this.pn<=0?(this.de("Secondary connection is healthy."),this.nn=!0,this.tn.markConnectionHealthy(),this.dn()):(this.de("sending ping on secondary."),this.tn.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.dn=function(){this.tn.start(),this.de("sending client ack on secondary"),this.tn.send({t:"c",d:{t:"a",d:{}}}),this.de("Ending transmission on primary"),this.Yt.send({t:"c",d:{t:"n",d:{}}}),this.Zt=this.tn,this.tryCleanupConnection()},e.prototype.sn=function(e){var t=r.requireKey("t",e),n=r.requireKey("d",e);"c"==t?this.fn(n):"d"==t&&this.wt(n)},e.prototype.wt=function(e){this._n(),this.Ut(e)},e.prototype._n=function(){this.nn||--this.zt<=0&&(this.de("Primary connection is healthy."),this.nn=!0,this.Yt.markConnectionHealthy())},e.prototype.fn=function(e){var t=r.requireKey("t",e);if("d"in e){var n=e.d;if("h"===t)this.yn(n);else if("n"===t){this.de("recvd end transmission on primary"),this.en=this.tn;for(var i=0;i<this.pendingDataMessages.length;++i)this.wt(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.vn(n):"r"===t?this.gn(n):"e"===t?r.error("Server Error: "+n):"o"===t?(this.de("got pong on primary."),this._n(),this.mn()):r.error("Unknown control packet command: "+t)}},e.prototype.yn=function(e){var t=e.ts,n=e.v,i=e.h;this.sessionId=e.s,this.H.updateHost(i),0==this.Ht&&(this.Yt.start(),this.Cn(this.Yt,t),o.PROTOCOL_VERSION!==n&&r.warn("Protocol version mismatch detected"),this.En())},e.prototype.En=function(){var e=this.Gt.upgradeTransport();e&&this.Nn(e)},e.prototype.Nn=function(e){var t=this;this.tn=new e(this.Xt(),this.H,this.sessionId),this.pn=e.responsesRequiredToBeHealthy||0;var n=this.Jt(this.tn),i=this.$t(this.tn);this.tn.open(n,i),r.setTimeoutNonBlocking(function(){t.tn&&(t.de("Timed out trying to upgrade."),t.tn.close())},Math.floor(6e4))},e.prototype.gn=function(e){this.de("Reset packet received. New host: "+e),this.H.updateHost(e),1===this.Ht?this.close():(this.Pn(),this.Kt())},e.prototype.Cn=function(e,t){var n=this;this.de("Realtime connection established."),this.Yt=e,this.Ht=1,this.At&&(this.At(t,this.sessionId),this.At=null),0===this.zt?(this.de("Primary connection is healthy."),this.nn=!0):r.setTimeoutNonBlocking(function(){n.mn()},Math.floor(5e3))},e.prototype.mn=function(){this.nn||1!==this.Ht||(this.de("sending ping on primary."),this.ln({t:"c",d:{t:"p",d:{}}}))},e.prototype.an=function(){var e=this.tn;this.tn=null,this.Zt!==e&&this.en!==e||this.close()},e.prototype.in=function(e){this.Yt=null,e||0!==this.Ht?1===this.Ht&&this.de("Realtime connection lost."):(this.de("Realtime connection failed."),this.H.isCacheableHost()&&(i.PersistentStorage.remove("host:"+this.H.host),this.H.internalHost=this.H.host)),this.close()},e.prototype.vn=function(e){this.de("Connection shutdown command received. Shutting down..."),this.Bt&&(this.Bt(e),this.Bt=null),this.z=null,this.close()},e.prototype.ln=function(e){if(1!==this.Ht)throw"Connection is not connected";this.Zt.send(e)},e.prototype.close=function(){2!==this.Ht&&(this.de("Closing realtime connection."),this.Ht=2,this.Pn(),this.z&&(this.z(),this.z=null))},e.prototype.Pn=function(){this.de("Shutting down all connections"),this.Yt&&(this.Yt.close(),this.Yt=null),this.tn&&(this.tn.close(),this.tn=null),this.rn&&(clearTimeout(this.rn),this.rn=null)},e}();t.Connection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(45),o=n(25),a=n(105),s=n(14),u=n(0),l=n(0);t.FIREBASE_LONGPOLL_START_PARAM="start",t.FIREBASE_LONGPOLL_CLOSE_COMMAND="close",t.FIREBASE_LONGPOLL_COMMAND_CB_NAME="pLPCommand",t.FIREBASE_LONGPOLL_DATA_CB_NAME="pRTLPCB",t.FIREBASE_LONGPOLL_ID_PARAM="id",t.FIREBASE_LONGPOLL_PW_PARAM="pw",t.FIREBASE_LONGPOLL_SERIAL_PARAM="ser",t.FIREBASE_LONGPOLL_CALLBACK_ID_PARAM="cb",t.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM="seg",t.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET="ts",t.FIREBASE_LONGPOLL_DATA_PARAM="d",t.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM="disconn",t.FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM="dframe";var h=function(){function e(e,t,n,i){this.connId=e,this.repoInfo=t,this.transportSessionId=n,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.bn=!1,this.de=r.logWrapper(e),this.$=o.StatsManager.getCollection(t),this.urlFn=function(e){return t.connectionURL(s.LONG_POLLING,e)}}return e.prototype.open=function(e,n){var i=this;this.curSegmentNum=0,this.z=n,this.myPacketOrderer=new a.PacketReceiver(e),this.Sn=!1,this.Tn=setTimeout(function(){i.de("Timed out trying to connect."),i.wn(),i.Tn=null},Math.floor(3e4)),r.executeWhenDOMReady(function(){if(!i.Sn){i.scriptTagHolder=new c(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e[1],a=e[2];if(e[3],e[4],i.In(e),i.scriptTagHolder)if(i.Tn&&(clearTimeout(i.Tn),i.Tn=null),i.bn=!0,r==t.FIREBASE_LONGPOLL_START_PARAM)i.id=o,i.password=a;else{if(r!==t.FIREBASE_LONGPOLL_CLOSE_COMMAND)throw Error("Unrecognized command received: "+r);o?(i.scriptTagHolder.sendNewPolls=!1,i.myPacketOrderer.closeAfter(o,function(){i.wn()})):i.wn()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],r=e[1];i.In(e),i.myPacketOrderer.handleResponse(n,r)},function(){i.wn()},i.urlFn);var e={};e[t.FIREBASE_LONGPOLL_START_PARAM]="t",e[t.FIREBASE_LONGPOLL_SERIAL_PARAM]=Math.floor(1e8*Math.random()),i.scriptTagHolder.uniqueCallbackIdentifier&&(e[t.FIREBASE_LONGPOLL_CALLBACK_ID_PARAM]=i.scriptTagHolder.uniqueCallbackIdentifier),e[s.VERSION_PARAM]=s.PROTOCOL_VERSION,i.transportSessionId&&(e[s.TRANSPORT_SESSION_PARAM]=i.transportSessionId),i.lastSessionId&&(e[s.LAST_SESSION_PARAM]=i.lastSessionId),!l.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(s.FORGE_DOMAIN)&&(e[s.REFERER_PARAM]=s.FORGE_REF);var n=i.urlFn(e);i.de("Connecting via long-poll to "+n),i.scriptTagHolder.addTag(n,function(){})}})},e.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},e.forceAllow=function(){e.Rn=!0},e.forceDisallow=function(){e.On=!0},e.isAvailable=function(){return e.Rn||!e.On&&"undefined"!=typeof document&&null!=document.createElement&&!r.isChromeExtensionContentScript()&&!r.isWindowsStoreApp()&&!l.isNodeSdk()},e.prototype.markConnectionHealthy=function(){},e.prototype.An=function(){this.Sn=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.Tn&&(clearTimeout(this.Tn),this.Tn=null)},e.prototype.wn=function(){this.Sn||(this.de("Longpoll is closing itself"),this.An(),this.z&&(this.z(this.bn),this.z=null))},e.prototype.close=function(){this.Sn||(this.de("Longpoll is being closed."),this.An())},e.prototype.send=function(e){var t=u.stringify(e);this.bytesSent+=t.length,this.$.incrementCounter("bytes_sent",t.length);for(var n=u.base64Encode(t),i=r.splitStringBySize(n,1840),o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++},e.prototype.addDisconnectPingFrame=function(e,n){if(!l.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var r={};r[t.FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM]="t",r[t.FIREBASE_LONGPOLL_ID_PARAM]=e,r[t.FIREBASE_LONGPOLL_PW_PARAM]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},e.prototype.In=function(e){var t=u.stringify(e).length;this.bytesReceived+=t,this.$.incrementCounter("bytes_received",t)},e}();t.BrowserPollConnection=h;var c=function(){function e(n,o,a,s){if(this.onDisconnect=a,this.urlFn=s,this.outstandingRequests=new i.CountedSet,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,l.isNodeSdk())this.commandCB=n,this.onMessageCB=o;else{this.uniqueCallbackIdentifier=r.LUIDGenerator(),window[t.FIREBASE_LONGPOLL_COMMAND_CB_NAME+this.uniqueCallbackIdentifier]=n,window[t.FIREBASE_LONGPOLL_DATA_CB_NAME+this.uniqueCallbackIdentifier]=o,this.myIFrame=e.Dn();var u="";this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)&&(u='<script>document.domain="'+document.domain+'";<\/script>');var h="<html><body>"+u+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(h),this.myIFrame.doc.close()}catch(e){r.log("frame writing exception"),e.stack&&r.log(e.stack),r.log(e)}}}return e.Dn=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||r.log("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var n=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==n.myIFrame&&(document.body.removeChild(n.myIFrame),n.myIFrame=null)},Math.floor(0))),l.isNodeSdk()&&this.myID){var r={};r[t.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM]="t",r[t.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,r[t.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW;var i=this.urlFn(r);e.nodeRestRequest(i)}var o=this.onDisconnect;o&&(this.onDisconnect=null,o())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.Mn(););},e.prototype.Mn=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e[t.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,e[t.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW,e[t.FIREBASE_LONGPOLL_SERIAL_PARAM]=this.currentSerial;for(var n=this.urlFn(e),r="",i=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+r.length<=1870;){var o=this.pendingSegs.shift();r=r+"&"+t.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM+i+"="+o.seg+"&"+t.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET+i+"="+o.ts+"&"+t.FIREBASE_LONGPOLL_DATA_PARAM+i+"="+o.d,i++}return n+=r,this.Ln(n,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.Mn()},e.prototype.Ln=function(e,t){var n=this;this.outstandingRequests.add(t,1);var r=function(){n.outstandingRequests.remove(t),n.Mn()},i=setTimeout(r,Math.floor(25e3)),o=function(){clearTimeout(i),r()};this.addTag(e,o)},e.prototype.addTag=function(e,t){var n=this;l.isNodeSdk()?this.doNodeLongPoll(e,t):setTimeout(function(){try{if(!n.sendNewPolls)return;var i=n.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var e=i.readyState;e&&"loaded"!==e&&"complete"!==e||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=function(){r.log("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(i)}catch(e){}},Math.floor(1))},e}();t.FirebaseIFrameScriptHolder=c},function(e,t,n){"use strict";(function(e){function r(e){d=e}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),o=n(0),a=n(1),s=n(25),u=n(14),l=n(0),h=n(13),c=n(0),p=n(0),d=null;"undefined"!=typeof MozWebSocket?d=MozWebSocket:"undefined"!=typeof WebSocket&&(d=WebSocket),t.setWebSocketImpl=r;var f=function(){function t(e,n,r,i){this.connId=e,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.de=a.logWrapper(this.connId),this.$=s.StatsManager.getCollection(n),this.connURL=t.Fn(n,r,i)}return t.Fn=function(e,t,n){var r={};return r[u.VERSION_PARAM]=u.PROTOCOL_VERSION,!p.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(u.FORGE_DOMAIN)&&(r[u.REFERER_PARAM]=u.FORGE_REF),t&&(r[u.TRANSPORT_SESSION_PARAM]=t),n&&(r[u.LAST_SESSION_PARAM]=n),e.connectionURL(u.WEBSOCKET,r)},t.prototype.open=function(t,n){var r=this;this.onDisconnect=n,this.onMessage=t,this.de("Websocket connecting to "+this.connURL),this.bn=!1,h.PersistentStorage.set("previous_websocket_failure",!0);try{if(p.isNodeSdk()){var o=l.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",a={headers:{"User-Agent":"Firebase/"+u.PROTOCOL_VERSION+"/"+i.default.SDK_VERSION+"/"+e.platform+"/"+o}},s=e.env,c=0==this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;c&&(a.proxy={origin:c}),this.mySock=new d(this.connURL,[],a)}else this.mySock=new d(this.connURL)}catch(e){this.de("Error instantiating WebSocket.");var f=e.message||e.data;return f&&this.de(f),void this.wn()}this.mySock.onopen=function(){r.de("Websocket connected."),r.bn=!0},this.mySock.onclose=function(){r.de("Websocket connection was disconnected."),r.mySock=null,r.wn()},this.mySock.onmessage=function(e){r.handleIncomingFrame(e)},this.mySock.onerror=function(e){r.de("WebSocket error. Closing connection.");var t=e.message||e.data;t&&r.de(t),r.wn()}},t.prototype.start=function(){},t.forceDisallow=function(){t.On=!0},t.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&null!==d&&!t.On},t.previouslyFailed=function(){return h.PersistentStorage.isInMemoryStorage||!0===h.PersistentStorage.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){h.PersistentStorage.remove("previous_websocket_failure")},t.prototype.xn=function(e){if(this.frames.push(e),this.frames.length==this.totalFrames){var t=this.frames.join("");this.frames=null;var n=c.jsonEval(t);this.onMessage(n)}},t.prototype.kn=function(e){this.totalFrames=e,this.frames=[]},t.prototype.Wn=function(e){if(o.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=+e;if(!isNaN(t))return this.kn(t),null}return this.kn(1),e},t.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.$.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.xn(t);else{var n=this.Wn(t);null!==n&&this.xn(n)}}},t.prototype.send=function(e){this.resetKeepAlive();var t=c.stringify(e);this.bytesSent+=t.length,this.$.incrementCounter("bytes_sent",t.length);var n=a.splitStringBySize(t,16384);n.length>1&&this.jn(n.length+"");for(var r=0;r<n.length;r++)this.jn(n[r])},t.prototype.An=function(){this.Sn=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.wn=function(){this.Sn||(this.de("WebSocket is closing itself"),this.An(),this.onDisconnect&&(this.onDisconnect(this.bn),this.onDisconnect=null))},t.prototype.close=function(){this.Sn||(this.de("WebSocket is being closed"),this.An())},t.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){e.mySock&&e.jn("0"),e.resetKeepAlive()},Math.floor(45e3))},t.prototype.jn=function(e){try{this.mySock.send(e)}catch(e){this.de("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.wn.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}();t.WebSocketConnection=f}).call(t,n(27))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}();t.ServerActions=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),i=n(3),o=n(5),a=n(4),s=function(){function e(t){this.Vn=new r.IndexedFilter(t.getIndex()),this.me=t.getIndex(),this.Qn=e.qn(t),this.Un=e.Bn(t)}return e.prototype.getStartPost=function(){return this.Qn},e.prototype.getEndPost=function(){return this.Un},e.prototype.matches=function(e){return this.me.compare(this.getStartPost(),e)<=0&&this.me.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,s){return this.matches(new o.NamedNode(t,n))||(n=a.ChildrenNode.EMPTY_NODE),this.Vn.updateChild(e,t,n,r,i,s)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=a.ChildrenNode.EMPTY_NODE);var r=t.withIndex(this.me);r=r.updatePriority(a.ChildrenNode.EMPTY_NODE);var s=this;return t.forEachChild(i.PRIORITY_INDEX,function(e,t){s.matches(new o.NamedNode(e,t))||(r=r.updateImmediateChild(e,a.ChildrenNode.EMPTY_NODE))}),this.Vn.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.Vn},e.prototype.getIndex=function(){return this.me},e.qn=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.Bn=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}();t.RangedFilter=s},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(79)},function(e,t,n){"use strict";function r(t){var n=t.INTERNAL.registerService("database",function(e,t,n){return l.RepoManager.getInstance().databaseFromApp(e,n)},{Reference:s.Reference,Query:a.Query,Database:o.Database,enableLogging:u.enableLogging,INTERNAL:h,ServerValue:d,TEST_ACCESS:c},null,!0);p.isNodeSdk()&&(e.exports=n)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),o=n(32);t.Database=o.Database;var a=n(36);t.Query=a.Query;var s=n(21);t.Reference=s.Reference;var u=n(1);t.enableLogging=u.enableLogging;var l=n(26),h=n(111),c=n(112),p=n(0),d=o.Database.ServerValue;t.ServerValue=d,t.registerDatabase=r,r(i.default);var f=n(22);t.DataSnapshot=f.DataSnapshot;var _=n(35);t.OnDisconnect=_.OnDisconnect},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.Hn=e,this.Gn="firebase:"}return e.prototype.set=function(e,t){null==t?this.Hn.removeItem(this.Kn(e)):this.Hn.setItem(this.Kn(e),r.stringify(t))},e.prototype.get=function(e){var t=this.Hn.getItem(this.Kn(e));return null==t?null:r.jsonEval(t)},e.prototype.remove=function(e){this.Hn.removeItem(this.Kn(e))},e.prototype.Kn=function(e){return this.Gn+e},e.prototype.toString=function(){return""+this.Hn},e}();t.DOMStorageWrapper=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.Yn={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.Yn[e]:this.Yn[e]=t},e.prototype.get=function(e){return r.contains(this.Yn,e)?this.Yn[e]:null},e.prototype.remove=function(e){delete this.Yn[e]},e}();t.MemoryStorage=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return r.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}();t.TransactionResult=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.nextPushId=function(){var e="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",t=0,n=[];return function(i){var o=i===t;t=i;var a,s=Array(8);for(a=7;a>=0;a--)s[a]=e.charAt(i%64),i=Math.floor(i/64);r.assert(0===i,"Cannot push at time == 0");var u=s.join("");if(o){for(a=11;a>=0&&63===n[a];a--)n[a]=0;n[a]++}else for(a=0;a<12;a++)n[a]=Math.floor(64*Math.random());for(a=0;a<12;a++)u+=e.charAt(n[a]);return r.assert(20===u.length,"nextPushId: Length should be 20."),u}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),i=n(85),o=n(0),a=n(0),s=function(){function e(e,t,n){this.Xn=e,this.zn=t,this.Jn=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new i.DataEvent("value",this,new r.DataSnapshot(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.Jn;if("cancel"===e.getEventType()){a.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var n=this.zn;return function(){n.call(t,e.error)}}var r=this.Xn;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.zn?new i.CancelEvent(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.Xn||!this.Xn||t.Xn===this.Xn&&t.Jn===this.Jn)},e.prototype.hasAnyCallback=function(){return null!==this.Xn},e}();t.ValueEventRegistration=s;var u=function(){function e(e,t,n){this.$n=e,this.zn=t,this.Jn=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,o.contains(this.$n,t)},e.prototype.createCancelEvent=function(e,t){return this.zn?new i.CancelEvent(this,e,t):null},e.prototype.createEvent=function(e,t){a.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),o=t.getQueryParams().getIndex();return new i.DataEvent(e.type,this,new r.DataSnapshot(e.snapshotNode,n,o),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.Jn;if("cancel"===e.getEventType()){a.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var n=this.zn;return function(){n.call(t,e.error)}}var r=this.$n[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){if(t instanceof e){if(!this.$n||!t.$n)return!0;if(this.Jn===t.Jn){var n=o.getCount(t.$n);if(n===o.getCount(this.$n)){if(1===n){var r=o.getAnyKey(t.$n),i=o.getAnyKey(this.$n);return!(i!==r||t.$n[r]&&this.$n[i]&&t.$n[r]!==this.$n[i])}return o.every(this.$n,function(e,n){return t.$n[e]===n})}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.$n},e}();t.ChildEventRegistration=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath()+":"+this.eventType+":"+r.stringify(this.snapshot.exportVal())},e}();t.DataEvent=i;var o=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path+":cancel"},e}();t.CancelEvent=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(87),a=n(4),s=n(0),u=n(23),l=n(88),h=n(89),c=n(8),p=n(46),d=n(2),f=n(47),_=n(95),y=function(){function e(e){this.Zn=e,this.er=u.ImmutableTree.Empty,this.tr=new _.WriteTree,this.nr={},this.rr={}}return e.prototype.applyUserOverwrite=function(e,t,n,r){return this.tr.addOverwrite(e,t,n,r),r?this.ir(new p.Overwrite(c.OperationSource.User,e,t)):[]},e.prototype.applyUserMerge=function(e,t,n){this.tr.addMerge(e,t,n);var r=u.ImmutableTree.fromObject(t);return this.ir(new h.Merge(c.OperationSource.User,e,r))},e.prototype.ackUserWrite=function(e,t){void 0===t&&(t=!1);var n=this.tr.getWrite(e);if(this.tr.removeWrite(e)){var r=u.ImmutableTree.Empty;return null!=n.snap?r=r.set(d.Path.Empty,!0):s.forEach(n.children,function(e,t){r=r.set(new d.Path(e),t)}),this.ir(new o.AckUserWrite(n.path,r,t))}return[]},e.prototype.applyServerOverwrite=function(e,t){return this.ir(new p.Overwrite(c.OperationSource.Server,e,t))},e.prototype.applyServerMerge=function(e,t){var n=u.ImmutableTree.fromObject(t);return this.ir(new h.Merge(c.OperationSource.Server,e,n))},e.prototype.applyListenComplete=function(e){return this.ir(new l.ListenComplete(c.OperationSource.Server,e))},e.prototype.applyTaggedQueryOverwrite=function(t,n,r){var i=this.or(r);if(null!=i){var o=e.ar(i),a=o.path,s=o.queryId,u=d.Path.relativePath(a,t),l=new p.Overwrite(c.OperationSource.forServerTaggedQuery(s),u,n);return this.sr(a,l)}return[]},e.prototype.applyTaggedQueryMerge=function(t,n,r){var i=this.or(r);if(i){var o=e.ar(i),a=o.path,s=o.queryId,l=d.Path.relativePath(a,t),p=u.ImmutableTree.fromObject(n),f=new h.Merge(c.OperationSource.forServerTaggedQuery(s),l,p);return this.sr(a,f)}return[]},e.prototype.applyTaggedListenComplete=function(t,n){var r=this.or(n);if(r){var i=e.ar(r),o=i.path,a=i.queryId,s=d.Path.relativePath(o,t),u=new l.ListenComplete(c.OperationSource.forServerTaggedQuery(a),s);return this.sr(o,u)}return[]},e.prototype.addEventRegistration=function(t,n){var i=t.path,o=null,s=!1;this.er.foreachOnPath(i,function(e,t){var n=d.Path.relativePath(e,i);o=o||t.getCompleteServerCache(n),s=s||t.hasCompleteView()});var u=this.er.get(i);u?(s=s||u.hasCompleteView(),o=o||u.getCompleteServerCache(d.Path.Empty)):(u=new f.SyncPoint,this.er=this.er.set(i,u));var l;null!=o?l=!0:(l=!1,o=a.ChildrenNode.EMPTY_NODE,this.er.subtree(i).foreachChild(function(e,t){var n=t.getCompleteServerCache(d.Path.Empty);n&&(o=o.updateImmediateChild(e,n))}));var h=u.viewExistsForQuery(t);if(!h&&!t.getQueryParams().loadsAllData()){var c=e.ur(t);r.assert(!(c in this.rr),"View does not exist, but we have a tag");var p=e.lr();this.rr[c]=p,this.nr["_"+p]=c}var _=this.tr.childWrites(i),y=u.addEventRegistration(t,n,_,o,l);if(!h&&!s){var v=u.viewForQuery(t);y=y.concat(this.hr(t,v))}return y},e.prototype.removeEventRegistration=function(t,n,r){var i=this,o=t.path,a=this.er.get(o),s=[];if(a&&("default"===t.queryIdentifier()||a.viewExistsForQuery(t))){var u=a.removeEventRegistration(t,n,r);a.isEmpty()&&(this.er=this.er.remove(o));var l=u.removed;s=u.events;var h=-1!==l.findIndex(function(e){return e.getQueryParams().loadsAllData()}),c=this.er.findOnPath(o,function(e,t){return t.hasCompleteView()});if(h&&!c){var p=this.er.subtree(o);if(!p.isEmpty())for(var d=this.cr(p),f=0;f<d.length;++f){var _=d[f],y=_.getQuery(),v=this.pr(_);this.Zn.startListening(e.dr(y),this.fr(y),v.hashFn,v.onComplete)}}!c&&l.length>0&&!r&&(h?this.Zn.stopListening(e.dr(t),null):l.forEach(function(t){var n=i.rr[e.ur(t)];i.Zn.stopListening(e.dr(t),n)})),this._r(l)}return s},e.prototype.calcCompleteEventCache=function(e,t){var n=this.tr,r=this.er.findOnPath(e,function(t,n){var r=d.Path.relativePath(t,e),i=n.getCompleteServerCache(r);if(i)return i});return n.calcCompleteEventCache(e,r,t,!0)},e.prototype.cr=function(e){return e.fold(function(e,t,n){if(t&&t.hasCompleteView())return[t.getCompleteView()];var r=[];return t&&(r=t.getQueryViews()),s.forEach(n,function(e,t){r=r.concat(t)}),r})},e.prototype._r=function(t){for(var n=0;n<t.length;++n){var r=t[n];if(!r.getQueryParams().loadsAllData()){var i=e.ur(r),o=this.rr[i];delete this.rr[i],delete this.nr["_"+o]}}},e.dr=function(e){return e.getQueryParams().loadsAllData()&&!e.getQueryParams().isDefault()?e.getRef():e},e.prototype.hr=function(t,n){var i=t.path,o=this.fr(t),a=this.pr(n),u=this.Zn.startListening(e.dr(t),o,a.hashFn,a.onComplete),l=this.er.subtree(i);if(o)r.assert(!l.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var h=l.fold(function(e,t,n){if(!e.isEmpty()&&t&&t.hasCompleteView())return[t.getCompleteView().getQuery()];var r=[];return t&&(r=r.concat(t.getQueryViews().map(function(e){return e.getQuery()}))),s.forEach(n,function(e,t){r=r.concat(t)}),r}),c=0;c<h.length;++c){var p=h[c];this.Zn.stopListening(e.dr(p),this.fr(p))}return u},e.prototype.pr=function(e){var t=this,n=e.getQuery(),r=this.fr(n);return{hashFn:function(){return(e.getServerCache()||a.ChildrenNode.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return r?t.applyTaggedListenComplete(n.path,r):t.applyListenComplete(n.path);var o=i.errorForServerCode(e,n);return t.removeEventRegistration(n,null,o)}}},e.ur=function(e){return e.path+"$"+e.queryIdentifier()},e.ar=function(e){var t=e.indexOf("$");return r.assert(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new d.Path(e.substr(0,t))}},e.prototype.or=function(e){return this.nr["_"+e]},e.prototype.fr=function(t){var n=e.ur(t);return s.safeGet(this.rr,n)},e.lr=function(){return e.yr++},e.prototype.sr=function(e,t){var n=this.er.get(e);r.assert(n,"Missing sync point for query tag that we're tracking");var i=this.tr.childWrites(e);return n.applyOperation(t,i,null)},e.prototype.ir=function(e){return this.vr(e,this.er,null,this.tr.childWrites(d.Path.Empty))},e.prototype.vr=function(e,t,n,r){if(e.path.isEmpty())return this.gr(e,t,n,r);var i=t.get(d.Path.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(d.Path.Empty));var o=[],a=e.path.getFront(),s=e.operationForChild(a),u=t.children.get(a);if(u&&s){var l=n?n.getImmediateChild(a):null,h=r.child(a);o=o.concat(this.vr(s,u,l,h))}return i&&(o=o.concat(i.applyOperation(e,r,n))),o},e.prototype.gr=function(e,t,n,r){var i=this,o=t.get(d.Path.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(d.Path.Empty));var a=[];return t.children.inorderTraversal(function(t,o){var s=n?n.getImmediateChild(t):null,u=r.child(t),l=e.operationForChild(t);l&&(a=a.concat(i.gr(l,o,s,u)))}),o&&(a=a.concat(o.applyOperation(e,r,n))),a},e.yr=1,e}();t.SyncTree=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(8),a=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=o.OperationType.ACK_USER_WRITE,this.source=o.OperationSource.User}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return r.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new i.Path(t));return new e(i.Path.Empty,n,this.revert)}return r.assert(this.path.getFront()===t,"operationForChild called for unrelated child."),new e(this.path.popFront(),this.affectedTree,this.revert)},e}();t.AckUserWrite=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(8),o=function(){function e(e,t){this.source=e,this.path=t,this.type=i.OperationType.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,r.Path.Empty):new e(this.source,this.path.popFront())},e}();t.ListenComplete=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),i=n(46),o=n(2),a=n(0),s=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=r.OperationType.MERGE}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){var n=this.children.subtree(new o.Path(t));return n.isEmpty()?null:n.value?new i.Overwrite(this.source,o.Path.Empty,n.value):new e(this.source,o.Path.Empty,n)}return a.assert(this.path.getFront()===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,this.path.popFront(),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source+" merge: "+this.children+")"},e}();t.Merge=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),i=n(91),o=n(4),a=n(19),s=n(48),u=n(94),l=n(0),h=n(8),c=n(9),p=n(3),d=function(){function e(e,t){this.mr=e,this.Cr=[];var n=this.mr.getQueryParams(),l=new r.IndexedFilter(n.getIndex()),h=n.getNodeFilter();this.Er=new i.ViewProcessor(h);var c=t.getServerCache(),p=t.getEventCache(),d=l.updateFullNode(o.ChildrenNode.EMPTY_NODE,c.getNode(),null),f=h.updateFullNode(o.ChildrenNode.EMPTY_NODE,p.getNode(),null),_=new a.CacheNode(d,c.isFullyInitialized(),l.filtersNodes()),y=new a.CacheNode(f,p.isFullyInitialized(),h.filtersNodes());this.Nr=new s.ViewCache(y,_),this.Pr=new u.EventGenerator(this.mr)}return e.prototype.getQuery=function(){return this.mr},e.prototype.getServerCache=function(){return this.Nr.getServerCache().getNode()},e.prototype.getCompleteServerCache=function(e){var t=this.Nr.getCompleteServerSnap();return t&&(this.mr.getQueryParams().loadsAllData()||!e.isEmpty()&&!t.getImmediateChild(e.getFront()).isEmpty())?t.getChild(e):null},e.prototype.isEmpty=function(){return 0===this.Cr.length},e.prototype.addEventRegistration=function(e){this.Cr.push(e)},e.prototype.removeEventRegistration=function(e,t){var n=[];if(t){l.assert(null==e,"A cancel should cancel all event registrations.");var r=this.mr.path;this.Cr.forEach(function(e){t=t;var i=e.createCancelEvent(t,r);i&&n.push(i)})}if(e){for(var i=[],o=0;o<this.Cr.length;++o){var a=this.Cr[o];if(a.matches(e)){if(e.hasAnyCallback()){i=i.concat(this.Cr.slice(o+1));break}}else i.push(a)}this.Cr=i}else this.Cr=[];return n},e.prototype.applyOperation=function(e,t,n){e.type===h.OperationType.MERGE&&null!==e.source.queryId&&(l.assert(this.Nr.getCompleteServerSnap(),"We should always have a full cache before handling merges"),l.assert(this.Nr.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.Nr,i=this.Er.applyOperation(r,e,t,n);return this.Er.assertIndexed(i.viewCache),l.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.Nr=i.viewCache,this.br(i.changes,i.viewCache.getEventCache().getNode(),null)},e.prototype.getInitialEvents=function(e){var t=this.Nr.getEventCache(),n=[];return t.getNode().isLeafNode()||t.getNode().forEachChild(p.PRIORITY_INDEX,function(e,t){n.push(c.Change.childAddedChange(e,t))}),t.isFullyInitialized()&&n.push(c.Change.valueChange(t.getNode())),this.br(n,t.getNode(),e)},e.prototype.br=function(e,t,n){var r=n?[n]:this.Cr;return this.Pr.generateEventsForChanges(e,t,r)},e}();t.View=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),i=n(0),o=n(92),a=n(9),s=n(4),u=n(10),l=n(23),h=n(2),c=n(93),p=function(){function e(e,t){this.viewCache=e,this.changes=t}return e}();t.ProcessorResult=p;var d=function(){function e(e){this.Sr=e}return e.prototype.assertIndexed=function(e){i.assert(e.getEventCache().getNode().isIndexed(this.Sr.getIndex()),"Event snap not indexed"),i.assert(e.getServerCache().getNode().isIndexed(this.Sr.getIndex()),"Server snap not indexed")},e.prototype.applyOperation=function(t,n,a,s){var u,l,h=new o.ChildChangeAccumulator;if(n.type===r.OperationType.OVERWRITE){var c=n;c.source.fromUser?u=this.Tr(t,c.path,c.snap,a,s,h):(i.assert(c.source.fromServer,"Unknown source."),l=c.source.tagged||t.getServerCache().isFiltered()&&!c.path.isEmpty(),u=this.wr(t,c.path,c.snap,a,s,l,h))}else if(n.type===r.OperationType.MERGE){var d=n;d.source.fromUser?u=this.Ir(t,d.path,d.children,a,s,h):(i.assert(d.source.fromServer,"Unknown source."),l=d.source.tagged||t.getServerCache().isFiltered(),u=this.Rr(t,d.path,d.children,a,s,l,h))}else if(n.type===r.OperationType.ACK_USER_WRITE){var f=n;u=f.revert?this.Or(t,f.path,a,s,h):this.Ar(t,f.path,f.affectedTree,a,s,h)}else{if(n.type!==r.OperationType.LISTEN_COMPLETE)throw i.assertionError("Unknown operation type: "+n.type);u=this.Dr(t,n.path,a,h)}var _=h.getChanges();return e.Mr(t,u,_),new p(u,_)},e.Mr=function(e,t,n){var r=t.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=e.getCompleteEventSnap();(n.length>0||!e.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(a.Change.valueChange(t.getCompleteEventSnap()))}},e.prototype.Lr=function(e,t,n,r,o){var a=e.getEventCache();if(null!=n.shadowingWrite(t))return e;var u=void 0,l=void 0;if(t.isEmpty())if(i.assert(e.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),e.getServerCache().isFiltered()){var h=e.getCompleteServerSnap(),c=h instanceof s.ChildrenNode?h:s.ChildrenNode.EMPTY_NODE,p=n.calcCompleteEventChildren(c);u=this.Sr.updateFullNode(e.getEventCache().getNode(),p,o)}else{var d=n.calcCompleteEventCache(e.getCompleteServerSnap());u=this.Sr.updateFullNode(e.getEventCache().getNode(),d,o)}else{var f=t.getFront();if(".priority"==f){i.assert(1==t.getLength(),"Can't have a priority with additional path components");var _=a.getNode();l=e.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(t,_,l);u=null!=y?this.Sr.updatePriority(_,y):a.getNode()}else{var v=t.popFront(),g=void 0;if(a.isCompleteForChild(f)){l=e.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(t,a.getNode(),l);g=null!=m?a.getNode().getImmediateChild(f).updateChild(v,m):a.getNode().getImmediateChild(f)}else g=n.calcCompleteChild(f,e.getServerCache());u=null!=g?this.Sr.updateChild(a.getNode(),f,g,v,r,o):a.getNode()}}return e.updateEventSnap(u,a.isFullyInitialized()||t.isEmpty(),this.Sr.filtersNodes())},e.prototype.wr=function(e,t,n,r,i,o,a){var s,u=e.getServerCache(),l=o?this.Sr:this.Sr.getIndexedFilter();if(t.isEmpty())s=l.updateFullNode(u.getNode(),n,null);else if(l.filtersNodes()&&!u.isFiltered()){var h=u.getNode().updateChild(t,n);s=l.updateFullNode(u.getNode(),h,null)}else{var p=t.getFront();if(!u.isCompleteForPath(t)&&t.getLength()>1)return e;var d=t.popFront(),f=u.getNode().getImmediateChild(p),_=f.updateChild(d,n);s=".priority"==p?l.updatePriority(u.getNode(),_):l.updateChild(u.getNode(),p,_,d,c.NO_COMPLETE_CHILD_SOURCE,null)}var y=e.updateServerSnap(s,u.isFullyInitialized()||t.isEmpty(),l.filtersNodes()),v=new c.WriteTreeCompleteChildSource(r,y,i);return this.Lr(y,t,r,v,a)},e.prototype.Tr=function(e,t,n,r,i,o){var a,u,l=e.getEventCache(),h=new c.WriteTreeCompleteChildSource(r,e,i);if(t.isEmpty())u=this.Sr.updateFullNode(e.getEventCache().getNode(),n,o),a=e.updateEventSnap(u,!0,this.Sr.filtersNodes());else{var p=t.getFront();if(".priority"===p)u=this.Sr.updatePriority(e.getEventCache().getNode(),n),a=e.updateEventSnap(u,l.isFullyInitialized(),l.isFiltered());else{var d=t.popFront(),f=l.getNode().getImmediateChild(p),_=void 0;if(d.isEmpty())_=n;else{var y=h.getCompleteChild(p);_=null!=y?".priority"===d.getBack()&&y.getChild(d.parent()).isEmpty()?y:y.updateChild(d,n):s.ChildrenNode.EMPTY_NODE}if(f.equals(_))a=e;else{var v=this.Sr.updateChild(l.getNode(),p,_,d,h,o);a=e.updateEventSnap(v,l.isFullyInitialized(),this.Sr.filtersNodes())}}}return a},e.Fr=function(e,t){return e.getEventCache().isCompleteForChild(t)},e.prototype.Ir=function(t,n,r,i,o,a){var s=this,u=t;return r.foreach(function(r,l){var h=n.child(r);e.Fr(t,h.getFront())&&(u=s.Tr(u,h,l,i,o,a))}),r.foreach(function(r,l){var h=n.child(r);e.Fr(t,h.getFront())||(u=s.Tr(u,h,l,i,o,a))}),u},e.prototype.xr=function(e,t){return t.foreach(function(t,n){e=e.updateChild(t,n)}),e},e.prototype.Rr=function(e,t,n,r,i,o,a){var s=this;if(e.getServerCache().getNode().isEmpty()&&!e.getServerCache().isFullyInitialized())return e;var u,c=e;u=t.isEmpty()?n:l.ImmutableTree.Empty.setTree(t,n);var p=e.getServerCache().getNode();return u.children.inorderTraversal(function(t,n){if(p.hasChild(t)){var u=e.getServerCache().getNode().getImmediateChild(t),l=s.xr(u,n);c=s.wr(c,new h.Path(t),l,r,i,o,a)}}),u.children.inorderTraversal(function(t,n){var u=!e.getServerCache().isCompleteForChild(t)&&null==n.value;if(!p.hasChild(t)&&!u){var l=e.getServerCache().getNode().getImmediateChild(t),d=s.xr(l,n);c=s.wr(c,new h.Path(t),d,r,i,o,a)}}),c},e.prototype.Ar=function(e,t,n,r,i,o){if(null!=r.shadowingWrite(t))return e;var a=e.getServerCache().isFiltered(),s=e.getServerCache();if(null!=n.value){if(t.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(t))return this.wr(e,t,s.getNode().getChild(t),r,i,a,o);if(t.isEmpty()){var c=l.ImmutableTree.Empty;return s.getNode().forEachChild(u.KEY_INDEX,function(e,t){c=c.set(new h.Path(e),t)}),this.Rr(e,t,c,r,i,a,o)}return e}var p=l.ImmutableTree.Empty;return n.foreach(function(e,n){var r=t.child(e);s.isCompleteForPath(r)&&(p=p.set(e,s.getNode().getChild(r)))}),this.Rr(e,t,p,r,i,a,o)},e.prototype.Dr=function(e,t,n,r){var i=e.getServerCache(),o=e.updateServerSnap(i.getNode(),i.isFullyInitialized()||t.isEmpty(),i.isFiltered());return this.Lr(o,t,n,c.NO_COMPLETE_CHILD_SOURCE,r)},e.prototype.Or=function(e,t,n,r,o){var a;if(null!=n.shadowingWrite(t))return e;var u=new c.WriteTreeCompleteChildSource(n,e,r),l=e.getEventCache().getNode(),p=void 0;if(t.isEmpty()||".priority"===t.getFront()){var d=void 0;if(e.getServerCache().isFullyInitialized())d=n.calcCompleteEventCache(e.getCompleteServerSnap());else{var f=e.getServerCache().getNode();i.assert(f instanceof s.ChildrenNode,"serverChildren would be complete if leaf node"),d=n.calcCompleteEventChildren(f)}d=d,p=this.Sr.updateFullNode(l,d,o)}else{var _=t.getFront(),y=n.calcCompleteChild(_,e.getServerCache());null==y&&e.getServerCache().isCompleteForChild(_)&&(y=l.getImmediateChild(_)),p=null!=y?this.Sr.updateChild(l,_,y,t.popFront(),u,o):e.getEventCache().getNode().hasChild(_)?this.Sr.updateChild(l,_,s.ChildrenNode.EMPTY_NODE,t.popFront(),u,o):l,p.isEmpty()&&e.getServerCache().isFullyInitialized()&&(a=n.calcCompleteEventCache(e.getCompleteServerSnap()),a.isLeafNode()&&(p=this.Sr.updateFullNode(p,a,o)))}return a=e.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(h.Path.Empty),e.updateEventSnap(p,a,this.Sr.filtersNodes())},e}();t.ViewProcessor=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(0),a=function(){function e(){this.kr={}}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;o.assert(t==i.Change.CHILD_ADDED||t==i.Change.CHILD_CHANGED||t==i.Change.CHILD_REMOVED,"Only child changes supported for tracking"),o.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var a=r.safeGet(this.kr,n);if(a){var s=a.type;if(t==i.Change.CHILD_ADDED&&s==i.Change.CHILD_REMOVED)this.kr[n]=i.Change.childChangedChange(n,e.snapshotNode,a.snapshotNode);else if(t==i.Change.CHILD_REMOVED&&s==i.Change.CHILD_ADDED)delete this.kr[n];else if(t==i.Change.CHILD_REMOVED&&s==i.Change.CHILD_CHANGED)this.kr[n]=i.Change.childRemovedChange(n,a.oldSnap);else if(t==i.Change.CHILD_CHANGED&&s==i.Change.CHILD_ADDED)this.kr[n]=i.Change.childAddedChange(n,e.snapshotNode);else{if(t!=i.Change.CHILD_CHANGED||s!=i.Change.CHILD_CHANGED)throw o.assertionError("Illegal combination of changes: "+e+" occurred after "+a);this.kr[n]=i.Change.childChangedChange(n,e.snapshotNode,a.oldSnap)}}else this.kr[n]=e},e.prototype.getChanges=function(){return r.getValues(this.kr)},e}();t.ChildChangeAccumulator=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(19),i=function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}();t.Wr=i,t.NO_COMPLETE_CHILD_SOURCE=new i;var o=function(){function e(e,t,n){void 0===n&&(n=null),this.jr=e,this.Nr=t,this.Vr=n}return e.prototype.getCompleteChild=function(e){var t=this.Nr.getEventCache();if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.Vr?new r.CacheNode(this.Vr,!0,!1):this.Nr.getServerCache();return this.jr.calcCompleteChild(e,n)},e.prototype.getChildAfterChild=function(e,t,n){var r=null!=this.Vr?this.Vr:this.Nr.getCompleteServerSnap(),i=this.jr.calcIndexedSlice(r,t,1,n,e);return 0===i.length?null:i[0]},e}();t.WriteTreeCompleteChildSource=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(9),o=n(0),a=function(){function e(e){this.mr=e,this.me=this.mr.getQueryParams().getIndex()}return e.prototype.generateEventsForChanges=function(e,t,n){var r=this,o=[],a=[];return e.forEach(function(e){e.type===i.Change.CHILD_CHANGED&&r.me.indexedValueChanged(e.oldSnap,e.snapshotNode)&&a.push(i.Change.childMovedChange(e.childName,e.snapshotNode))}),this.Qr(o,i.Change.CHILD_REMOVED,e,n,t),this.Qr(o,i.Change.CHILD_ADDED,e,n,t),this.Qr(o,i.Change.CHILD_MOVED,a,n,t),this.Qr(o,i.Change.CHILD_CHANGED,e,n,t),this.Qr(o,i.Change.VALUE,e,n,t),o},e.prototype.Qr=function(e,t,n,r,i){var o=this,a=n.filter(function(e){return e.type===t});a.sort(this.qr.bind(this)),a.forEach(function(t){var n=o.Ur(t,i);r.forEach(function(r){r.respondsTo(t.type)&&e.push(r.createEvent(n,o.mr))})})},e.prototype.Ur=function(e,t){return"value"===e.type||"child_removed"===e.type?e:(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,this.me),e)},e.prototype.qr=function(e,t){if(null==e.childName||null==t.childName)throw o.assertionError("Should only compare child_ events.");var n=new r.NamedNode(e.childName,e.snapshotNode),i=new r.NamedNode(t.childName,t.snapshotNode);return this.me.compare(n,i)},e}();t.EventGenerator=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(2),a=n(96),s=n(3),u=n(4),l=function(){function e(){this.Br=a.CompoundWrite.Empty,this.Hr=[],this.Gr=-1}return e.prototype.childWrites=function(e){return new h(e,this)},e.prototype.addOverwrite=function(e,t,n,r){i.assert(n>this.Gr,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.Hr.push({path:e,snap:t,writeId:n,visible:r}),r&&(this.Br=this.Br.addWrite(e,t)),this.Gr=n},e.prototype.addMerge=function(e,t,n){i.assert(n>this.Gr,"Stacking an older merge on top of newer ones"),this.Hr.push({path:e,children:t,writeId:n,visible:!0}),this.Br=this.Br.addWrites(e,t),this.Gr=n},e.prototype.getWrite=function(e){for(var t=0;t<this.Hr.length;t++){var n=this.Hr[t];if(n.writeId===e)return n}return null},e.prototype.removeWrite=function(e){var t=this,n=this.Hr.findIndex(function(t){return t.writeId===e});i.assert(n>=0,"removeWrite called with nonexistent writeId.");var o=this.Hr[n];this.Hr.splice(n,1);for(var a=o.visible,s=!1,u=this.Hr.length-1;a&&u>=0;){var l=this.Hr[u];l.visible&&(u>=n&&this.Kr(l,o.path)?a=!1:o.path.contains(l.path)&&(s=!0)),u--}if(a){if(s)return this.Yr(),!0;if(o.snap)this.Br=this.Br.removeWrite(o.path);else{var h=o.children;r.forEach(h,function(e){t.Br=t.Br.removeWrite(o.path.child(e))})}return!0}return!1},e.prototype.getCompleteWriteData=function(e){return this.Br.getCompleteNode(e)},e.prototype.calcCompleteEventCache=function(t,n,r,i){if(r||i){var a=this.Br.childCompoundWrite(t);if(!i&&a.isEmpty())return n;if(i||null!=n||a.hasCompleteWrite(o.Path.Empty)){var s=function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(e.path.contains(t)||t.contains(e.path))},l=e.Xr(this.Hr,s,t),h=n||u.ChildrenNode.EMPTY_NODE;return l.apply(h)}return null}var c=this.Br.getCompleteNode(t);if(null!=c)return c;var p=this.Br.childCompoundWrite(t);if(p.isEmpty())return n;if(null!=n||p.hasCompleteWrite(o.Path.Empty)){var h=n||u.ChildrenNode.EMPTY_NODE;return p.apply(h)}return null},e.prototype.calcCompleteEventChildren=function(e,t){var n=u.ChildrenNode.EMPTY_NODE,r=this.Br.getCompleteNode(e);if(r)return r.isLeafNode()||r.forEachChild(s.PRIORITY_INDEX,function(e,t){n=n.updateImmediateChild(e,t)}),n;if(t){var i=this.Br.childCompoundWrite(e);return t.forEachChild(s.PRIORITY_INDEX,function(e,t){var r=i.childCompoundWrite(new o.Path(e)).apply(t);n=n.updateImmediateChild(e,r)}),i.getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n}return this.Br.childCompoundWrite(e).getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n,r){i.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var o=e.child(t);if(this.Br.hasCompleteWrite(o))return null;var a=this.Br.childCompoundWrite(o);return a.isEmpty()?r.getChild(t):a.apply(r.getChild(t))},e.prototype.calcCompleteChild=function(e,t,n){var r=e.child(t),i=this.Br.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(t)?this.Br.childCompoundWrite(r).apply(n.getNode().getImmediateChild(t)):null},e.prototype.shadowingWrite=function(e){return this.Br.getCompleteNode(e)},e.prototype.calcIndexedSlice=function(e,t,n,r,i,a){var s,u=this.Br.childCompoundWrite(e),l=u.getCompleteNode(o.Path.Empty);if(null!=l)s=l;else{if(null==t)return[];s=u.apply(t)}if(s=s.withIndex(a),s.isEmpty()||s.isLeafNode())return[];for(var h=[],c=a.getCompare(),p=i?s.getReverseIteratorFrom(n,a):s.getIteratorFrom(n,a),d=p.getNext();d&&h.length<r;)0!==c(d,n)&&h.push(d),d=p.getNext();return h},e.prototype.Kr=function(e,t){return e.snap?e.path.contains(t):!!r.findKey(e.children,function(n,r){return e.path.child(r).contains(t)})},e.prototype.Yr=function(){this.Br=e.Xr(this.Hr,e.zr,o.Path.Empty),this.Hr.length>0?this.Gr=this.Hr[this.Hr.length-1].writeId:this.Gr=-1},e.zr=function(e){return e.visible},e.Xr=function(e,t,n){for(var s=a.CompoundWrite.Empty,u=0;u<e.length;++u){var l=e[u];if(t(l)){var h=l.path,c=void 0;if(l.snap)n.contains(h)?(c=o.Path.relativePath(n,h),s=s.addWrite(c,l.snap)):h.contains(n)&&(c=o.Path.relativePath(h,n),s=s.addWrite(o.Path.Empty,l.snap.getChild(c)));else{if(!l.children)throw i.assertionError("WriteRecord should have .snap or .children");if(n.contains(h))c=o.Path.relativePath(n,h),s=s.addWrites(c,l.children);else if(h.contains(n))if(c=o.Path.relativePath(h,n),c.isEmpty())s=s.addWrites(o.Path.Empty,l.children);else{var p=r.safeGet(l.children,c.getFront());if(p){var d=p.getChild(c.popFront());s=s.addWrite(o.Path.Empty,d)}}}}}return s},e}();t.WriteTree=l;var h=function(){function e(e,t){this.Jr=e,this.$r=t}return e.prototype.calcCompleteEventCache=function(e,t,n){return this.$r.calcCompleteEventCache(this.Jr,e,t,n)},e.prototype.calcCompleteEventChildren=function(e){return this.$r.calcCompleteEventChildren(this.Jr,e)},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n){return this.$r.calcEventCacheAfterServerOverwrite(this.Jr,e,t,n)},e.prototype.shadowingWrite=function(e){return this.$r.shadowingWrite(this.Jr.child(e))},e.prototype.calcIndexedSlice=function(e,t,n,r,i){return this.$r.calcIndexedSlice(this.Jr,e,t,n,r,i)},e.prototype.calcCompleteChild=function(e,t){return this.$r.calcCompleteChild(this.Jr,e,t)},e.prototype.child=function(t){return new e(this.Jr.child(t),this.$r)},e}();t.WriteTreeRef=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23),i=n(2),o=n(0),a=n(5),s=n(3),u=n(0),l=function(){function e(e){this.$r=e}return e.prototype.addWrite=function(t,n){if(t.isEmpty())return new e(new r.ImmutableTree(n));var o=this.$r.findRootMostValueAndPath(t);if(null!=o){var a=o.path,s=o.value,u=i.Path.relativePath(a,t);return s=s.updateChild(u,n),new e(this.$r.set(a,s))}var l=new r.ImmutableTree(n);return new e(this.$r.setTree(t,l))},e.prototype.addWrites=function(e,t){var n=this;return o.forEach(t,function(t,r){n=n.addWrite(e.child(t),r)}),n},e.prototype.removeWrite=function(t){return t.isEmpty()?e.Empty:new e(this.$r.setTree(t,r.ImmutableTree.Empty))},e.prototype.hasCompleteWrite=function(e){return null!=this.getCompleteNode(e)},e.prototype.getCompleteNode=function(e){var t=this.$r.findRootMostValueAndPath(e);return null!=t?this.$r.get(t.path).getChild(i.Path.relativePath(t.path,e)):null},e.prototype.getCompleteChildren=function(){var e=[],t=this.$r.value;return null!=t?t.isLeafNode()||t.forEachChild(s.PRIORITY_INDEX,function(t,n){e.push(new a.NamedNode(t,n))}):this.$r.children.inorderTraversal(function(t,n){null!=n.value&&e.push(new a.NamedNode(t,n.value))}),e},e.prototype.childCompoundWrite=function(t){if(t.isEmpty())return this;var n=this.getCompleteNode(t);return new e(null!=n?new r.ImmutableTree(n):this.$r.subtree(t))},e.prototype.isEmpty=function(){return this.$r.isEmpty()},e.prototype.apply=function(t){return e.Zr(i.Path.Empty,this.$r,t)},e.Empty=new e(new r.ImmutableTree(null)),e.Zr=function(t,n,r){if(null!=n.value)return r.updateChild(t,n.value);var i=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(u.assert(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=e.Zr(t.child(n),o,r)}),r.getChild(t).isEmpty()||null===i||(r=r.updateChild(t.child(".priority"),i)),r},e}();t.CompoundWrite=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=function(){function e(){this.ei=r.ChildrenNode.EMPTY_NODE}return e.prototype.getNode=function(e){return this.ei.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.ei=this.ei.updateChild(e,t)},e}();t.SnapshotHolder=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.ti=e}return e.prototype.getToken=function(e){return this.ti.INTERNAL.getToken(e).then(null,function(e){return e&&"auth/token-not-initialized"===e.code?(r.log("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})},e.prototype.addTokenChangeListener=function(e){this.ti.INTERNAL.addAuthTokenListener(e)},e.prototype.removeTokenChangeListener=function(e){this.ti.INTERNAL.removeAuthTokenListener(e)},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.ti.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.ti.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.ti.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',r.warn(e)},e}();t.AuthTokenProvider=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=function(){function e(){this.ni={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),i.contains(this.ni,e)||(this.ni[e]=0),this.ni[e]+=t},e.prototype.get=function(){return r.deepCopy(this.ni)},e}();t.StatsCollection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(49),a=1e4,s=3e4,u=function(){function e(e,t){this.Z=t,this.ri={},this.G=new o.StatsListener(e);var n=a+(s-a)*Math.random();i.setTimeoutNonBlocking(this.ii.bind(this),Math.floor(n))}return e.prototype.includeStat=function(e){this.ri[e]=!0},e.prototype.ii=function(){var e=this,t=this.G.get(),n={},o=!1;r.forEach(t,function(t,i){i>0&&r.contains(e.ri,t)&&(n[t]=i,o=!0)}),o&&this.Z.reportStats(n),i.setTimeoutNonBlocking(this.ii.bind(this),Math.floor(2*Math.random()*3e5))},e}();t.StatsReporter=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(){this.oi=[],this.ai=0}return e.prototype.queueEvents=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n],i=r.getPath();null===t||i.equals(t.getPath())||(this.oi.push(t),t=null),null===t&&(t=new o(i)),t.add(r)}t&&this.oi.push(t)},e.prototype.raiseEventsAtPath=function(e,t){this.queueEvents(t),this.si(function(t){return t.equals(e)})},e.prototype.raiseEventsForChangedPath=function(e,t){this.queueEvents(t),this.si(function(t){return t.contains(e)||e.contains(t)})},e.prototype.si=function(e){this.ai++;for(var t=!0,n=0;n<this.oi.length;n++){var r=this.oi[n];r&&(e(r.getPath())?(this.oi[n].raise(),this.oi[n]=null):t=!1)}t&&(this.oi=[]),this.ai--},e}();t.EventQueue=i;var o=function(){function e(e){this.Oe=e,this.ui=[]}return e.prototype.add=function(e){this.ui.push(e)},e.prototype.raise=function(){for(var e=0;e<this.ui.length;e++){var t=this.ui[e];if(null!==t){this.ui[e]=null;var n=t.getEventRunner();r.logger&&r.log("event: "+t),r.exceptionGuard(n)}}},e.prototype.getPath=function(){return this.Oe},e}();t.EventList=o},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(51),o=n(0),a=function(e){function t(){var t,n,r=e.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",t="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",t="webkitHidden")),r.at=!0,n&&document.addEventListener(n,function(){var e=!document[t];e!==r.at&&(r.at=e,r.trigger("visible",e))},!1),r}return r(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return o.assert("visible"===e,"Unknown event type: "+e),[this.at]},t}(i.EventEmitter);t.VisibilityMonitor=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(51),a=n(0),s=function(e){function t(){var t=e.call(this,["online"])||this;return t.li=!0,"undefined"==typeof window||void 0===window.addEventListener||a.isMobileCordova()||(window.addEventListener("online",function(){t.li||(t.li=!0,t.trigger("online",!0))},!1),window.addEventListener("offline",function(){t.li&&(t.li=!1,t.trigger("online",!1))},!1)),t}return r(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return i.assert("online"===e,"Unknown event type: "+e),[this.li]},t.prototype.currentlyOnline=function(){return this.li},t}(o.EventEmitter);t.OnlineMonitor=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(53),i=n(54),o=n(1),a=function(){function e(e){this.hi(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[r.BrowserPollConnection,i.WebSocketConnection]},enumerable:!0,configurable:!0}),e.prototype.hi=function(t){var n=i.WebSocketConnection&&i.WebSocketConnection.isAvailable(),r=n&&!i.WebSocketConnection.previouslyFailed();if(t.webSocketOnly&&(n||o.warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.ci=[i.WebSocketConnection];else{var a=this.ci=[];o.each(e.ALL_TRANSPORTS,function(e,t){t&&t.isAvailable()&&a.push(t)})}},e.prototype.initialTransport=function(){if(this.ci.length>0)return this.ci[0];throw Error("No transports available")},e.prototype.upgradeTransport=function(){return this.ci.length>1?this.ci[1]:null},e}();t.TransportManager=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.Ut=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},e.prototype.handleResponse=function(e,t){var n=this;this.pendingResponses[e]=t;for(var i=this;this.pendingResponses[this.currentResponseNum]&&"break"!==function(){var e=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var t=0;t<e.length;++t)!function(t){e[t]&&r.exceptionGuard(function(){n.Ut(e[t])})}(t);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++}(););},e}();t.PacketReceiver=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),a=n(0),s=n(0),u=n(0),l=n(55),h=function(e){function t(t,n,r){var i=e.call(this)||this;return i.H=t,i.ee=n,i.Ke=r,i.de=o.logWrapper("p:rest:"),i.Je={},i}return r(t,e),t.prototype.reportStats=function(e){throw Error("Method not implemented.")},t.pi=function(e,t){return void 0!==t?"tag$"+t:(i.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),""+e.path)},t.prototype.listen=function(e,n,r,i){var o=this,a=""+e.path;this.de("Listen called for "+a+" "+e.queryIdentifier());var u=t.pi(e,r),l={};this.Je[u]=l;var h=e.getQueryParams().toRestQueryStringParameters();this.di(a+".json",h,function(e,t){var n=t;if(404===e&&(n=null,e=null),null===e&&o.ee(a,n,!1,r),s.safeGet(o.Je,u)===l){var h;h=e?401==e?"permission_denied":"rest_error:"+e:"ok",i(h,null)}})},t.prototype.unlisten=function(e,n){var r=t.pi(e,n);delete this.Je[r]},t.prototype.refreshAuthToken=function(e){},t.prototype.di=function(e,t,n){var r=this;void 0===t&&(t={}),t.format="export",this.Ke.getToken(!1).then(function(i){var s=i&&i.accessToken;s&&(t.auth=s);var l=(r.H.secure?"https://":"http://")+r.H.host+e+"?"+u.querystring(t);r.de("Sending REST request for "+l);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(n&&4===h.readyState){r.de("REST Response for "+l+" received. status:",h.status,"response:",h.responseText);var e=null;if(h.status>=200&&h.status<300){try{e=a.jsonEval(h.responseText)}catch(e){o.warn("Failed to parse JSON response for "+l+": "+h.responseText)}n(null,e)}else 401!==h.status&&404!==h.status&&o.warn("Got unsuccessful REST response for "+l+" Status: "+h.status),n(h.status);n=null}},h.open("GET",l,!0),h.send()})},t}(l.ServerActions);t.ReadonlyRestClient=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(10),a=n(3),s=n(38),u=n(42),l=n(24),h=n(108),c=n(56),p=n(0),d=function(){function e(){this.fi=!1,this._i=!1,this.yi=!1,this.vi=!1,this.gi=!1,this.mi=0,this.Ci="",this.Ei=null,this.Ni="",this.Pi=null,this.bi="",this.me=a.PRIORITY_INDEX}return e.prototype.hasStart=function(){return this._i},e.prototype.isViewFromLeft=function(){return""===this.Ci?this._i:this.Ci===e.Si.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return r.assert(this._i,"Only valid if start has been set"),this.Ei},e.prototype.getIndexStartName=function(){return r.assert(this._i,"Only valid if start has been set"),this.yi?this.Ni:i.MIN_NAME},e.prototype.hasEnd=function(){return this.vi},e.prototype.getIndexEndValue=function(){return r.assert(this.vi,"Only valid if end has been set"),this.Pi},e.prototype.getIndexEndName=function(){return r.assert(this.vi,"Only valid if end has been set"),this.gi?this.bi:i.MAX_NAME},e.prototype.hasLimit=function(){return this.fi},e.prototype.hasAnchoredLimit=function(){return this.fi&&""!==this.Ci},e.prototype.getLimit=function(){return r.assert(this.fi,"Only valid if limit has been set"),this.mi},e.prototype.getIndex=function(){return this.me},e.prototype.Ti=function(){var t=new e;return t.fi=this.fi,t.mi=this.mi,t._i=this._i,t.Ei=this.Ei,t.yi=this.yi,t.Ni=this.Ni,t.vi=this.vi,t.Pi=this.Pi,t.gi=this.gi,t.bi=this.bi,t.me=this.me,t.Ci=this.Ci,t},e.prototype.limit=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci="",t},e.prototype.limitToFirst=function(t){var n=this.Ti();return n.fi=!0,n.mi=t,n.Ci=e.Si.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.Ti();return n.fi=!0,n.mi=t,n.Ci=e.Si.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.Ti();return n._i=!0,void 0===e&&(e=null),n.Ei=e,null!=t?(n.yi=!0,n.Ni=t):(n.yi=!1,n.Ni=""),n},e.prototype.endAt=function(e,t){var n=this.Ti();return n.vi=!0,void 0===e&&(e=null),n.Pi=e,void 0!==t?(n.gi=!0,n.bi=t):(n.gi=!1,n.bi=""),n},e.prototype.orderBy=function(e){var t=this.Ti();return t.me=e,t},e.prototype.getQueryObject=function(){var t=e.Si,n={};if(this._i&&(n[t.INDEX_START_VALUE]=this.Ei,this.yi&&(n[t.INDEX_START_NAME]=this.Ni)),this.vi&&(n[t.INDEX_END_VALUE]=this.Pi,this.gi&&(n[t.INDEX_END_NAME]=this.bi)),this.fi){n[t.LIMIT]=this.mi;var r=this.Ci;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.me!==a.PRIORITY_INDEX&&(n[t.INDEX]=""+this.me),n},e.prototype.loadsAllData=function(){return!(this._i||this.vi||this.fi)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.me==a.PRIORITY_INDEX},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new l.IndexedFilter(this.getIndex()):this.hasLimit()?new h.LimitedFilter(this):new c.RangedFilter(this)},e.prototype.toRestQueryStringParameters=function(){var t=e.wi,n={};if(this.isDefault())return n;var i;return this.me===a.PRIORITY_INDEX?i=t.PRIORITY_INDEX:this.me===s.VALUE_INDEX?i=t.VALUE_INDEX:this.me===o.KEY_INDEX?i=t.KEY_INDEX:(r.assert(this.me instanceof u.PathIndex,"Unrecognized index type!"),i=""+this.me),n[t.ORDER_BY]=p.stringify(i),this._i&&(n[t.START_AT]=p.stringify(this.Ei),this.yi&&(n[t.START_AT]+=","+p.stringify(this.Ni))),this.vi&&(n[t.END_AT]=p.stringify(this.Pi),this.gi&&(n[t.END_AT]+=","+p.stringify(this.bi))),this.fi&&(this.isViewFromLeft()?n[t.LIMIT_TO_FIRST]=this.mi:n[t.LIMIT_TO_LAST]=this.mi),n},e.Si={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"},e.wi={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"},e.DEFAULT=new e,e}();t.QueryParams=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(56),i=n(4),o=n(5),a=n(0),s=n(9),u=function(){function e(e){this.Ii=new r.RangedFilter(e),this.me=e.getIndex(),this.mi=e.getLimit(),this.Ri=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,a,s){return this.Ii.matches(new o.NamedNode(t,n))||(n=i.ChildrenNode.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.mi?this.Ii.getIndexedFilter().updateChild(e,t,n,r,a,s):this.Oi(e,t,n,a,s)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=i.ChildrenNode.EMPTY_NODE.withIndex(this.me);else if(2*this.mi<t.numChildren()&&t.isIndexed(this.me)){r=i.ChildrenNode.EMPTY_NODE.withIndex(this.me);var o=void 0;o=this.Ri?t.getReverseIteratorFrom(this.Ii.getEndPost(),this.me):t.getIteratorFrom(this.Ii.getStartPost(),this.me);for(var a=0;o.hasNext()&&a<this.mi;){var s=o.getNext(),u=void 0;if(!(u=this.Ri?this.me.compare(this.Ii.getStartPost(),s)<=0:this.me.compare(s,this.Ii.getEndPost())<=0))break;r=r.updateImmediateChild(s.name,s.node),a++}}else{r=t.withIndex(this.me),r=r.updatePriority(i.ChildrenNode.EMPTY_NODE);var l=void 0,h=void 0,c=void 0,o=void 0;if(this.Ri){o=r.getReverseIterator(this.me),l=this.Ii.getEndPost(),h=this.Ii.getStartPost();var p=this.me.getCompare();c=function(e,t){return p(t,e)}}else o=r.getIterator(this.me),l=this.Ii.getStartPost(),h=this.Ii.getEndPost(),c=this.me.getCompare();for(var a=0,d=!1;o.hasNext();){var s=o.getNext();!d&&c(l,s)<=0&&(d=!0);var u=d&&a<this.mi&&c(s,h)<=0;u?a++:r=r.updateImmediateChild(s.name,i.ChildrenNode.EMPTY_NODE)}}return this.Ii.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.Ii.getIndexedFilter()},e.prototype.getIndex=function(){return this.me},e.prototype.Oi=function(e,t,n,r,u){var l;if(this.Ri){var h=this.me.getCompare();l=function(e,t){return h(t,e)}}else l=this.me.getCompare();var c=e;a.assert(c.numChildren()==this.mi,"");var p=new o.NamedNode(t,n),d=this.Ri?c.getFirstChild(this.me):c.getLastChild(this.me),f=this.Ii.matches(p);if(c.hasChild(t)){for(var _=c.getImmediateChild(t),y=r.getChildAfterChild(this.me,d,this.Ri);null!=y&&(y.name==t||c.hasChild(y.name));)y=r.getChildAfterChild(this.me,y,this.Ri);var v=null==y?1:l(y,p);if(f&&!n.isEmpty()&&v>=0)return null!=u&&u.trackChildChange(s.Change.childChangedChange(t,n,_)),c.updateImmediateChild(t,n);null!=u&&u.trackChildChange(s.Change.childRemovedChange(t,_));var g=c.updateImmediateChild(t,i.ChildrenNode.EMPTY_NODE);return null!=y&&this.Ii.matches(y)?(null!=u&&u.trackChildChange(s.Change.childAddedChange(y.name,y.node)),g.updateImmediateChild(y.name,y.node)):g}return n.isEmpty()?e:f&&l(d,p)>=0?(null!=u&&(u.trackChildChange(s.Change.childRemovedChange(d.name,d.node)),u.trackChildChange(s.Change.childAddedChange(t,n))),c.updateImmediateChild(t,n).updateImmediateChild(d.name,i.ChildrenNode.EMPTY_NODE)):e},e}();t.LimitedFilter=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(21),a=n(22),s=n(2),u=n(110),l=n(3),h=n(1),c=n(43),p=n(7),d=n(0),f=n(11),_=n(4),y=n(18);!function(e){e[e.RUN=0]="RUN",e[e.SENT=1]="SENT",e[e.COMPLETED=2]="COMPLETED",e[e.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",e[e.NEEDS_ABORT=4]="NEEDS_ABORT"}(r=t.TransactionStatus||(t.TransactionStatus={})),y.Repo.Ai=25,y.Repo.prototype.ie=function(){this.Di=new u.Tree},y.Repo.prototype.startTransaction=function(e,t,n,s){this.de("transaction on "+e);var u=function(){},y=new o.Reference(this,e);y.on("value",u);var v=function(){y.off("value",u)},g={path:e,update:t,onComplete:n,status:null,order:h.LUIDGenerator(),applyLocally:s,retryCount:0,unwatcher:v,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},m=this.Mi(e);g.currentInputSnapshot=m;var C=g.update(m.val());if(void 0===C){if(g.unwatcher(),g.currentOutputSnapshotRaw=null,g.currentOutputSnapshotResolved=null,g.onComplete){var E=new a.DataSnapshot(g.currentInputSnapshot,new o.Reference(this,g.path),l.PRIORITY_INDEX);g.onComplete(null,!1,E)}}else{p.validateFirebaseData("transaction failed: Data returned ",C,g.path),g.status=r.RUN;var N=this.Di.subTree(e),P=N.getValue()||[];P.push(g),N.setValue(P);var b=void 0;"object"==typeof C&&null!==C&&d.contains(C,".priority")?(b=d.safeGet(C,".priority"),i.assert(p.isValidPriority(b),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):b=(this.ue.calcCompleteEventCache(e)||_.ChildrenNode.EMPTY_NODE).getPriority().val(),b=b;var S=this.generateServerValues(),T=f.nodeFromJSON(C,b),w=c.resolveDeferredValueSnapshot(T,S);g.currentOutputSnapshotRaw=T,g.currentOutputSnapshotResolved=w,g.currentWriteId=this.pe();var I=this.ue.applyUserOverwrite(e,w,g.currentWriteId,g.applyLocally);this.K.raiseEventsForChangedPath(e,I),this.Li()}},y.Repo.prototype.Mi=function(e,t){return this.ue.calcCompleteEventCache(e,t)||_.ChildrenNode.EMPTY_NODE},y.Repo.prototype.Li=function(e){var t=this;if(void 0===e&&(e=this.Di),e||this.Fi(e),null!==e.getValue()){var n=this.xi(e);i.assert(n.length>0,"Sending zero length transaction queue"),n.every(function(e){return e.status===r.RUN})&&this.ki(e.path(),n)}else e.hasChildren()&&e.forEachChild(function(e){t.Li(e)})},y.Repo.prototype.ki=function(e,t){for(var n=this,u=t.map(function(e){return e.currentWriteId}),c=this.Mi(e,u),p=c,d=c.hash(),f=0;f<t.length;f++){var _=t[f];i.assert(_.status===r.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),_.status=r.SENT,_.retryCount++;var y=s.Path.relativePath(e,_.path);p=p.updateChild(y,_.currentOutputSnapshotRaw)}var v=p.val(!0),g=e;this.Z.put(""+g,v,function(i){n.de("transaction put response",{path:""+g,status:i});var s=[];if("ok"===i){for(var u=[],c=0;c<t.length;c++){if(t[c].status=r.COMPLETED,s=s.concat(n.ue.ackUserWrite(t[c].currentWriteId)),t[c].onComplete){var p=t[c].currentOutputSnapshotResolved,d=new o.Reference(n,t[c].path),f=new a.DataSnapshot(p,d,l.PRIORITY_INDEX);u.push(t[c].onComplete.bind(null,null,!0,f))}t[c].unwatcher()}n.Fi(n.Di.subTree(e)),n.Li(),n.K.raiseEventsForChangedPath(e,s);for(var c=0;c<u.length;c++)h.exceptionGuard(u[c])}else{if("datastale"===i)for(var c=0;c<t.length;c++)t[c].status===r.SENT_NEEDS_ABORT?t[c].status=r.NEEDS_ABORT:t[c].status=r.RUN;else{h.warn("transaction at "+g+" failed: "+i);for(var c=0;c<t.length;c++)t[c].status=r.NEEDS_ABORT,t[c].abortReason=i}n.le(e)}},d)},y.Repo.prototype.le=function(e){var t=this.Wi(e),n=t.path(),r=this.xi(t);return this.ji(r,n),n},y.Repo.prototype.ji=function(e,t){if(0!==e.length){for(var n=[],u=[],_=e.filter(function(e){return e.status===r.RUN}),v=_.map(function(e){return e.currentWriteId}),g=0;g<e.length;g++){var m=e[g],C=s.Path.relativePath(t,m.path),E=!1,N=void 0;if(i.assert(null!==C,"rerunTransactionsUnderNode_: relativePath should not be null."),m.status===r.NEEDS_ABORT)E=!0,N=m.abortReason,u=u.concat(this.ue.ackUserWrite(m.currentWriteId,!0));else if(m.status===r.RUN)if(m.retryCount>=y.Repo.Ai)E=!0,N="maxretry",u=u.concat(this.ue.ackUserWrite(m.currentWriteId,!0));else{var P=this.Mi(m.path,v);m.currentInputSnapshot=P;var b=e[g].update(P.val());if(void 0!==b){p.validateFirebaseData("transaction failed: Data returned ",b,m.path);var S=f.nodeFromJSON(b),T="object"==typeof b&&null!=b&&d.contains(b,".priority");T||(S=S.updatePriority(P.getPriority()));var w=m.currentWriteId,I=this.generateServerValues(),R=c.resolveDeferredValueSnapshot(S,I);m.currentOutputSnapshotRaw=S,m.currentOutputSnapshotResolved=R,m.currentWriteId=this.pe(),v.splice(v.indexOf(w),1),u=u.concat(this.ue.applyUserOverwrite(m.path,R,m.currentWriteId,m.applyLocally)),u=u.concat(this.ue.ackUserWrite(w,!0))}else E=!0,N="nodata",u=u.concat(this.ue.ackUserWrite(m.currentWriteId,!0))}if(this.K.raiseEventsForChangedPath(t,u),u=[],E&&(e[g].status=r.COMPLETED,function(e){setTimeout(e,Math.floor(0))}(e[g].unwatcher),e[g].onComplete))if("nodata"===N){var O=new o.Reference(this,e[g].path),A=e[g].currentInputSnapshot,D=new a.DataSnapshot(A,O,l.PRIORITY_INDEX);n.push(e[g].onComplete.bind(null,null,!1,D))}else n.push(e[g].onComplete.bind(null,Error(N),!1,null))}this.Fi(this.Di);for(var g=0;g<n.length;g++)h.exceptionGuard(n[g]);this.Li()}},y.Repo.prototype.Wi=function(e){for(var t,n=this.Di;null!==(t=e.getFront())&&null===n.getValue();)n=n.subTree(t),e=e.popFront();return n},y.Repo.prototype.xi=function(e){var t=[];return this.Vi(e,t),t.sort(function(e,t){return e.order-t.order}),t},y.Repo.prototype.Vi=function(e,t){var n=this,r=e.getValue();if(null!==r)for(var i=0;i<r.length;i++)t.push(r[i]);e.forEachChild(function(e){n.Vi(e,t)})},y.Repo.prototype.Fi=function(e){var t=this,n=e.getValue();if(n){for(var i=0,o=0;o<n.length;o++)n[o].status!==r.COMPLETED&&(n[i]=n[o],i++);n.length=i,e.setValue(n.length>0?n:null)}e.forEachChild(function(e){t.Fi(e)})},y.Repo.prototype.fe=function(e){var t=this,n=this.Wi(e).path(),r=this.Di.subTree(e);return r.forEachAncestor(function(e){t.Qi(e)}),this.Qi(r),r.forEachDescendant(function(e){t.Qi(e)}),n},y.Repo.prototype.Qi=function(e){var t=e.getValue();if(null!==t){for(var n=[],o=[],a=-1,s=0;s<t.length;s++)t[s].status===r.SENT_NEEDS_ABORT||(t[s].status===r.SENT?(i.assert(a===s-1,"All SENT items should be at beginning of queue."),a=s,t[s].status=r.SENT_NEEDS_ABORT,t[s].abortReason="set"):(i.assert(t[s].status===r.RUN,"Unexpected transaction status in abort"),t[s].unwatcher(),o=o.concat(this.ue.ackUserWrite(t[s].currentWriteId,!0)),t[s].onComplete&&n.push(t[s].onComplete.bind(null,Error("set"),!1,null))));-1===a?e.setValue(null):t.length=a+1,this.K.raiseEventsForChangedPath(e.path(),o);for(var s=0;s<n.length;s++)h.exceptionGuard(n[s])}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(0),a=function(){function e(){this.children={},this.childCount=0,this.value=null}return e}();t.TreeNode=a;var s=function(){function e(e,t,n){void 0===e&&(e=""),void 0===t&&(t=null),void 0===n&&(n=new a),this.qi=e,this.Ui=t,this._e=n}return e.prototype.subTree=function(t){for(var n,r=t instanceof i.Path?t:new i.Path(t),s=this;null!==(n=r.getFront());)s=new e(n,s,o.safeGet(s._e.children,n)||new a),r=r.popFront();return s},e.prototype.getValue=function(){return this._e.value},e.prototype.setValue=function(e){r.assert(void 0!==e,"Cannot set value to undefined"),this._e.value=e,this.Bi()},e.prototype.clear=function(){this._e.value=null,this._e.children={},this._e.childCount=0,this.Bi()},e.prototype.hasChildren=function(){return this._e.childCount>0},e.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},e.prototype.forEachChild=function(t){var n=this;o.forEach(this._e.children,function(r,i){t(new e(r,n,i))})},e.prototype.forEachDescendant=function(e,t,n){t&&!n&&e(this),this.forEachChild(function(t){t.forEachDescendant(e,!0,n)}),t&&n&&e(this)},e.prototype.forEachAncestor=function(e,t){for(var n=t?this:this.parent();null!==n;){if(e(n))return!0;n=n.parent()}return!1},e.prototype.forEachImmediateDescendantWithValue=function(e){this.forEachChild(function(t){null!==t.getValue()?e(t):t.forEachImmediateDescendantWithValue(e)})},e.prototype.path=function(){return new i.Path(null===this.Ui?this.qi:this.Ui.path()+"/"+this.qi)},e.prototype.name=function(){return this.qi},e.prototype.parent=function(){return this.Ui},e.prototype.Bi=function(){null!==this.Ui&&this.Ui.Hi(this.qi,this)},e.prototype.Hi=function(e,t){var n=t.isEmpty(),r=o.contains(this._e.children,e);n&&r?(delete this._e.children[e],this._e.childCount--,this.Bi()):n||r||(this._e.children[e]=t._e,this._e.childCount++,this.Bi())},e}();t.Tree=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(54),i=n(53);t.forceLongPolling=function(){r.WebSocketConnection.forceDisallow(),i.BrowserPollConnection.forceAllow()},t.forceWebSockets=function(){i.BrowserPollConnection.forceDisallow()},t.isWebSocketsAvailable=function(){return r.WebSocketConnection.isAvailable()},t.setSecurityDebugCallback=function(e,t){e.repo.J.it=t},t.stats=function(e,t){e.repo.stats(t)},t.statsIncrementCounter=function(e,t){e.repo.statsIncrementCounter(t)},t.dataUpdateCount=function(e){return e.repo.dataUpdateCount},t.interceptServerData=function(e,t){return e.repo.he(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34),i=n(50),o=n(26),a=n(52);t.DataConnection=i.PersistentConnection,i.PersistentConnection.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},i.PersistentConnection.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)},t.RealTimeConnection=a.Connection,t.hijackHash=function(e){var t=i.PersistentConnection.prototype.put;return i.PersistentConnection.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){i.PersistentConnection.prototype.put=t}},t.ConnectionTarget=r.RepoInfo,t.queryIdentifier=function(e){return e.queryIdentifier()},t.listens=function(e){return e.repo.J.Je},t.forceRestClient=function(e){o.RepoManager.getInstance().forceRestClient(e)}}],[78])}catch(e){throw Error("Cannot instantiate firebase-database.js - be sure to load firebase-app.js first.")}
6190
6191/*!
6192 * @license Firebase v4.9.1
6193 * Build: rev-631e1ad
6194 * Terms: https://firebase.google.com/terms/
6195 */
6196try{webpackJsonpFirebase([3],{116:function(e,t,r){r(117)},117:function(e,t,r){"use strict";function n(e){var t=new Uint8Array(e);return window.btoa(String.fromCharCode.apply(null,t))}function o(e){var t=function(e){return self&&"ServiceWorkerGlobalScope"in self?new A(e):new k(e)},r={Messaging:k};e.INTERNAL.registerService("messaging",t,r)}Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(0),a={AVAILABLE_IN_WINDOW:"only-available-in-window",AVAILABLE_IN_SW:"only-available-in-sw",SHOULD_BE_INHERITED:"should-be-overriden",BAD_SENDER_ID:"bad-sender-id",INCORRECT_GCM_SENDER_ID:"incorrect-gcm-sender-id",PERMISSION_DEFAULT:"permission-default",PERMISSION_BLOCKED:"permission-blocked",UNSUPPORTED_BROWSER:"unsupported-browser",NOTIFICATIONS_BLOCKED:"notifications-blocked",FAILED_DEFAULT_REGISTRATION:"failed-serviceworker-registration",SW_REGISTRATION_EXPECTED:"sw-registration-expected",GET_SUBSCRIPTION_FAILED:"get-subscription-failed",INVALID_SAVED_TOKEN:"invalid-saved-token",SW_REG_REDUNDANT:"sw-reg-redundant",TOKEN_SUBSCRIBE_FAILED:"token-subscribe-failed",TOKEN_SUBSCRIBE_NO_TOKEN:"token-subscribe-no-token",TOKEN_SUBSCRIBE_NO_PUSH_SET:"token-subscribe-no-push-set",USE_SW_BEFORE_GET_TOKEN:"use-sw-before-get-token",INVALID_DELETE_TOKEN:"invalid-delete-token",DELETE_TOKEN_NOT_FOUND:"delete-token-not-found",DELETE_SCOPE_NOT_FOUND:"delete-scope-not-found",BG_HANDLER_FUNCTION_EXPECTED:"bg-handler-function-expected",NO_WINDOW_CLIENT_TO_MSG:"no-window-client-to-msg",UNABLE_TO_RESUBSCRIBE:"unable-to-resubscribe",NO_FCM_TOKEN_FOR_RESUBSCRIBE:"no-fcm-token-for-resubscribe",FAILED_TO_DELETE_TOKEN:"failed-to-delete-token",NO_SW_IN_REG:"no-sw-in-reg",BAD_SCOPE:"bad-scope",BAD_VAPID_KEY:"bad-vapid-key",BAD_SUBSCRIPTION:"bad-subscription",BAD_TOKEN:"bad-token",BAD_PUSH_SET:"bad-push-set",FAILED_DELETE_VAPID_KEY:"failed-delete-vapid-key"},c=(i={},i[a.AVAILABLE_IN_WINDOW]="This method is available in a Window context.",i[a.AVAILABLE_IN_SW]="This method is available in a service worker context.",i["should-be-overriden"]="This method should be overriden by extended classes.",i["bad-sender-id"]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",i["permission-default"]="The required permissions were not granted and dismissed instead.",i["permission-blocked"]="The required permissions were not granted and blocked instead.",i["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",i["notifications-blocked"]="Notifications have been blocked.",i[a.FAILED_DEFAULT_REGISTRATION]="We are unable to register the default service worker. {$browserErrorMessage}",i["sw-registration-expected"]="A service worker registration was the expected input.",i["get-subscription-failed"]="There was an error when trying to get any existing Push Subscriptions.",i["invalid-saved-token"]="Unable to access details of the saved token.",i["sw-reg-redundant"]="The service worker being used for push was made redundant.",i["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$message}",i["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",i["token-subscribe-no-push-set"]="FCM returned an invalid response when getting an FCM token.",i["use-sw-before-get-token"]="You must call useServiceWorker() before calling getToken() to ensure your service worker is used.",i["invalid-delete-token"]="You must pass a valid token into deleteToken(), i.e. the token from getToken().",i["delete-token-not-found"]="The deletion attempt for token could not be performed as the token was not found.",i["delete-scope-not-found"]="The deletion attempt for service worker scope could not be performed as the scope was not found.",i["bg-handler-function-expected"]="The input to setBackgroundMessageHandler() must be a function.",i["no-window-client-to-msg"]="An attempt was made to message a non-existant window client.",i["unable-to-resubscribe"]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",i["no-fcm-token-for-resubscribe"]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",i["failed-to-delete-token"]="Unable to delete the currently saved token.",i["no-sw-in-reg"]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",i["incorrect-gcm-sender-id"]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",i["bad-scope"]="The service worker scope must be a string with at least one character.",i["bad-vapid-key"]="The public VAPID key must be a string with at least one character.",i["bad-subscription"]="The subscription must be a valid PushSubscription.",i["bad-token"]="The FCM Token used for storage / lookup was not a valid token string.",i["bad-push-set"]="The FCM push set used for storage / lookup was not not a valid push set string.",i["failed-delete-vapid-key"]="The VAPID key could not be deleted.",i),u={codes:a,map:c},_=function(e){return n(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},d=[4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110],f={userVisibleOnly:!0,applicationServerKey:new Uint8Array(d)},h={ENDPOINT:"https://fcm.googleapis.com",APPLICATION_SERVER_KEY:d,SUBSCRIPTION_OPTIONS:f},p="fcm_token_object_Store",l=function(){function e(){this.e=new s.ErrorFactory("messaging","Messaging",u.map),this.t=null}return e.prototype.r=function(){return this.t?this.t:(this.t=new Promise(function(t,r){var n=indexedDB.open(e.DB_NAME,1);n.onerror=function(e){r(e.target.error)},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(e){var t=e.target.result,r=t.createObjectStore(p,{keyPath:"swScope"});r.createIndex("fcmSenderId","fcmSenderId",{unique:!1}),r.createIndex("fcmToken","fcmToken",{unique:!0})}}),this.t)},e.prototype.closeDatabase=function(){var e=this;return this.t?this.t.then(function(t){t.close(),e.t=null}):Promise.resolve()},e.prototype.getTokenDetailsFromToken=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=i.index("fcmToken"),a=s.get(e);a.onerror=function(e){n(e.target.error)},a.onsuccess=function(e){r(e.target.result)}})})},e.prototype.n=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=i.get(e);s.onerror=function(e){n(e.target.error)},s.onsuccess=function(e){r(e.target.result)}})})},e.prototype.o=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=[],a=i.openCursor();a.onerror=function(e){n(e.target.error)},a.onsuccess=function(t){var n=t.target.result;n?(n.value.fcmSenderId===e&&s.push(n.value),n.continue()):r(s)}})})},e.prototype.subscribeToFCM=function(e,t,r){var n=this,o=_(t.getKey("p256dh")),i=_(t.getKey("auth")),s="authorized_entity="+e+"&endpoint="+t.endpoint+"&encryption_key="+o+"&encryption_auth="+i;r&&(s+="&pushSet="+r);var a=new Headers;a.append("Content-Type","application/x-www-form-urlencoded");var c={method:"POST",headers:a,body:s};return fetch(h.ENDPOINT+"/fcm/connect/subscribe",c).then(function(e){return e.json()}).then(function(e){var t=e;if(t.error){var r=t.error.message;throw n.e.create(u.codes.TOKEN_SUBSCRIBE_FAILED,{message:r})}if(!t.token)throw n.e.create(u.codes.TOKEN_SUBSCRIBE_NO_TOKEN);if(!t.pushSet)throw n.e.create(u.codes.TOKEN_SUBSCRIBE_NO_PUSH_SET);return{token:t.token,pushSet:t.pushSet}})},e.prototype.i=function(e,t){return e.endpoint===t.endpoint&&_(e.getKey("auth"))===t.auth&&_(e.getKey("p256dh"))===t.p256dh},e.prototype.s=function(e,t,r,n,o){var i={swScope:t.scope,endpoint:r.endpoint,auth:_(r.getKey("auth")),p256dh:_(r.getKey("p256dh")),fcmToken:n,fcmPushSet:o,fcmSenderId:e};return this.r().then(function(e){return new Promise(function(t,r){var n=e.transaction([p],"readwrite"),o=n.objectStore(p),s=o.put(i);s.onerror=function(e){r(e.target.error)},s.onsuccess=function(e){t()}})})},e.prototype.getSavedToken=function(e,t){var r=this;return t instanceof ServiceWorkerRegistration?"string"!=typeof e||0===e.length?Promise.reject(this.e.create(u.codes.BAD_SENDER_ID)):this.o(e).then(function(r){if(0!==r.length){var n=r.findIndex(function(r){return t.scope===r.swScope&&e===r.fcmSenderId});if(-1!==n)return r[n]}}).then(function(e){if(e)return t.pushManager.getSubscription().catch(function(e){throw r.e.create(u.codes.GET_SUBSCRIPTION_FAILED)}).then(function(t){if(t&&r.i(t,e))return e.fcmToken})}):Promise.reject(this.e.create(u.codes.SW_REGISTRATION_EXPECTED))},e.prototype.createToken=function(e,t){var r=this;if("string"!=typeof e||0===e.length)return Promise.reject(this.e.create(u.codes.BAD_SENDER_ID));if(!(t instanceof ServiceWorkerRegistration))return Promise.reject(this.e.create(u.codes.SW_REGISTRATION_EXPECTED));var n,o;return t.pushManager.getSubscription().then(function(e){return e||t.pushManager.subscribe(h.SUBSCRIPTION_OPTIONS)}).then(function(t){return n=t,r.subscribeToFCM(e,n)}).then(function(i){return o=i,r.s(e,t,n,o.token,o.pushSet)}).then(function(){return o.token})},e.prototype.deleteToken=function(e){var t=this;return"string"!=typeof e||0===e.length?Promise.reject(this.e.create(u.codes.INVALID_DELETE_TOKEN)):this.getTokenDetailsFromToken(e).then(function(e){if(!e)throw t.e.create(u.codes.DELETE_TOKEN_NOT_FOUND);return t.r().then(function(r){return new Promise(function(n,o){var i=r.transaction([p],"readwrite"),s=i.objectStore(p),a=s.delete(e.swScope);a.onerror=function(e){o(e.target.error)},a.onsuccess=function(r){if(0===r.target.result)return void o(t.e.create(u.codes.FAILED_TO_DELETE_TOKEN));n(e)}})})})},e}(),g=l,E="messagingSenderId",T=function(){function e(e){var t=this;if(this.e=new s.ErrorFactory("messaging","Messaging",u.map),!e.options[E]||"string"!=typeof e.options[E])throw this.e.create(u.codes.BAD_SENDER_ID);this.a=e.options[E],this.c=new g,this.app=e,this.INTERNAL={},this.INTERNAL.delete=function(){return t.delete}}return e.prototype.getToken=function(){var e=this,t=this.u();return"granted"!==t?"denied"===t?Promise.reject(this.e.create(u.codes.NOTIFICATIONS_BLOCKED)):Promise.resolve(null):this._().then(function(t){return e.c.getSavedToken(e.a,t).then(function(r){return r||e.c.createToken(e.a,t)})})},e.prototype.deleteToken=function(e){var t=this;return this.c.deleteToken(e).then(function(){return t._().then(function(e){if(e)return e.pushManager.getSubscription()}).then(function(e){if(e)return e.unsubscribe()})})},e.prototype._=function(){throw this.e.create(u.codes.SHOULD_BE_INHERITED)},e.prototype.requestPermission=function(){throw this.e.create(u.codes.AVAILABLE_IN_WINDOW)},e.prototype.useServiceWorker=function(e){throw this.e.create(u.codes.AVAILABLE_IN_WINDOW)},e.prototype.onMessage=function(e,t,r){throw this.e.create(u.codes.AVAILABLE_IN_WINDOW)},e.prototype.onTokenRefresh=function(e,t,r){throw this.e.create(u.codes.AVAILABLE_IN_WINDOW)},e.prototype.setBackgroundMessageHandler=function(e){throw this.e.create(u.codes.AVAILABLE_IN_SW)},e.prototype.delete=function(){return this.c.closeDatabase()},e.prototype.u=function(){return Notification.permission},e.prototype.getTokenManager=function(){return this.c},e}(),S=T,b={TYPE_OF_MSG:"firebase-messaging-msg-type",DATA:"firebase-messaging-msg-data"},v={PUSH_MSG_RECEIVED:"push-msg-received",NOTIFICATION_CLICKED:"notification-clicked"},I=function(e,t){return r={},r[b.TYPE_OF_MSG]=e,r[b.DATA]=t,r;var r},m={PARAMS:b,TYPES_OF_MSG:v,createNewMsg:I},y={path:"/firebase-messaging-sw.js",scope:"/firebase-cloud-messaging-push-scope"},N=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w=function(e){function t(t){var r=e.call(this,t)||this;return r.d=null,r.f=Object(s.createSubscribe)(function(e){r.d=e}),r.h=null,r.p=Object(s.createSubscribe)(function(e){r.h=e}),r.l(),r}return N(t,e),t.prototype.getToken=function(){var t=this;return this.g()?this.T().then(function(){return e.prototype.getToken.call(t)}):Promise.reject(this.e.create(u.codes.UNSUPPORTED_BROWSER))},t.prototype.T=function(){var e=this;if(this.S)return this.S;var t=document.querySelector('link[rel="manifest"]');return this.S=t?fetch(t.href).then(function(e){return e.json()}).catch(function(){return Promise.resolve()}).then(function(t){if(t&&t.gcm_sender_id&&"103953800507"!==t.gcm_sender_id)throw e.e.create(u.codes.INCORRECT_GCM_SENDER_ID)}):Promise.resolve(),this.S},t.prototype.requestPermission=function(){var e=this;return"granted"===Notification.permission?Promise.resolve():new Promise(function(t,r){var n=function(n){return"granted"===n?t():r("denied"===n?e.e.create(u.codes.PERMISSION_BLOCKED):e.e.create(u.codes.PERMISSION_DEFAULT))},o=Notification.requestPermission(function(e){o||n(e)});o&&o.then(n)})},t.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw this.e.create(u.codes.SW_REGISTRATION_EXPECTED);if(void 0!==this.b)throw this.e.create(u.codes.USE_SW_BEFORE_GET_TOKEN);this.b=e},t.prototype.onMessage=function(e,t,r){return this.f(e,t,r)},t.prototype.onTokenRefresh=function(e,t,r){return this.p(e,t,r)},t.prototype.v=function(e){var t=this,r=e.installing||e.waiting||e.active;return new Promise(function(n,o){if(!r)return void o(t.e.create(u.codes.NO_SW_IN_REG));if("activated"===r.state)return void n(e);if("redundant"===r.state)return void o(t.e.create(u.codes.SW_REG_REDUNDANT));var i=function(){if("activated"===r.state)n(e);else{if("redundant"!==r.state)return;o(t.e.create(u.codes.SW_REG_REDUNDANT))}r.removeEventListener("statechange",i)};r.addEventListener("statechange",i)})},t.prototype._=function(){var e=this;return this.b?this.v(this.b):(this.b=null,navigator.serviceWorker.register(y.path,{scope:y.scope}).catch(function(t){throw e.e.create(u.codes.FAILED_DEFAULT_REGISTRATION,{browserErrorMessage:t.message})}).then(function(t){return e.v(t).then(function(){return e.b=t,t.update(),t})}))},t.prototype.l=function(){var e=this;"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",function(t){if(t.data&&t.data[m.PARAMS.TYPE_OF_MSG]){var r=t.data;switch(r[m.PARAMS.TYPE_OF_MSG]){case m.TYPES_OF_MSG.PUSH_MSG_RECEIVED:case m.TYPES_OF_MSG.NOTIFICATION_CLICKED:var n=r[m.PARAMS.DATA];e.d.next(n)}}},!1)},t.prototype.g=function(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")},t}(S),k=w,O=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),D=function(e){function t(t){var r=e.call(this,t)||this;return self.addEventListener("push",function(e){return r.I(e)},!1),self.addEventListener("pushsubscriptionchange",function(e){return r.m(e)},!1),self.addEventListener("notificationclick",function(e){return r.y(e)},!1),r.N=null,r}return O(t,e),t.prototype.I=function(e){var t,r=this;try{t=e.data.json()}catch(e){return}var n=this.w().then(function(e){if(e){if(t.notification||r.N)return r.k(t)}else{var n=r.O(t);if(n){var o=n.title||"";return self.registration.showNotification(o,n)}if(r.N)return r.N(t)}});e.waitUntil(n)},t.prototype.m=function(e){var t=this,r=this.getToken().then(function(e){if(!e)throw t.e.create(u.codes.NO_FCM_TOKEN_FOR_RESUBSCRIBE);var r=null,n=t.getTokenManager();return n.getTokenDetailsFromToken(e).then(function(e){if(!(r=e))throw t.e.create(u.codes.INVALID_SAVED_TOKEN);return self.registration.pushManager.subscribe(h.SUBSCRIPTION_OPTIONS)}).then(function(e){return n.subscribeToFCM(r.fcmSenderId,e,r.fcmPushSet)}).catch(function(e){return n.deleteToken(r.fcmToken).then(function(){throw t.e.create(u.codes.UNABLE_TO_RESUBSCRIBE,{message:e})})})});e.waitUntil(r)},t.prototype.y=function(e){var t=this;if(e.notification&&e.notification.data&&e.notification.data.FCM_MSG){e.stopImmediatePropagation(),e.notification.close();var r=e.notification.data.FCM_MSG,n=r.notification.click_action;if(n){var o=this.D(n).then(function(e){return e||self.clients.openWindow(n)}).then(function(e){if(e){r.notification,delete r.notification;var n=m.createNewMsg(m.TYPES_OF_MSG.NOTIFICATION_CLICKED,r);return t.A(e,n)}});e.waitUntil(o)}}},t.prototype.O=function(e){if(e&&"object"==typeof e.notification){var t=Object.assign({},e.notification);return t.data=(r={},r.FCM_MSG=e,r),t;var r}},t.prototype.setBackgroundMessageHandler=function(e){if(e&&"function"!=typeof e)throw this.e.create(u.codes.BG_HANDLER_FUNCTION_EXPECTED);this.N=e},t.prototype.D=function(e){var t=new URL(e).href;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){for(var r=null,n=0;n<e.length;n++)if(new URL(e[n].url).href===t){r=e[n];break}if(r)return r.focus(),r})},t.prototype.A=function(e,t){var r=this;return new Promise(function(n,o){if(!e)return o(r.e.create(u.codes.NO_WINDOW_CLIENT_TO_MSG));e.postMessage(t),n()})},t.prototype.w=function(){return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){return e.some(function(e){return"visible"===e.visibilityState})})},t.prototype.k=function(e){var t=this;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(r){var n=m.createNewMsg(m.TYPES_OF_MSG.PUSH_MSG_RECEIVED,e);return Promise.all(r.map(function(e){return t.A(e,n)}))})},t.prototype._=function(){return Promise.resolve(self.registration)},t}(S),A=D,P=r(6);t.registerMessaging=o,o(P.firebase)}},[116])}catch(e){throw Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.")}
6197
6198/*!
6199 * @license Firebase v4.9.1
6200 * Build: rev-631e1ad
6201 * Terms: https://firebase.google.com/terms/
6202 */
6203try{webpackJsonpFirebase([2],{118:function(t,e,n){n(119)},119:function(t,e,n){"use strict";function r(t){return"storage/"+t}function o(){return new te(ee.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function i(t){return new te(ee.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function a(t){return new te(ee.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function s(){return new te(ee.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again.")}function u(t){return new te(ee.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function c(){return new te(ee.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function l(){return new te(ee.CANCELED,"User canceled the upload/download.")}function h(t){return new te(ee.INVALID_URL,"Invalid URL '"+t+"'.")}function p(t){return new te(ee.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function f(){return new te(ee.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function d(){return new te(ee.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function _(){return new te(ee.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function v(t,e,n){return new te(ee.INVALID_ARGUMENT,"Invalid argument in `"+e+"` at index "+t+": "+n)}function b(t,e,n,r){var o,i;return t===e?(o=t,i=1===t?"argument":"arguments"):(o="between "+t+" and "+e,i="arguments"),new te(ee.INVALID_ARGUMENT_COUNT,"Invalid argument count in `"+n+"`: Expected "+o+" "+i+", received "+r+".")}function m(){return new te(ee.APP_DELETED,"The Firebase app was deleted.")}function g(t){return new te(ee.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function y(t,e){return new te(ee.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function R(t){throw new te(ee.INTERNAL_ERROR,"Internal error: "+t)}function E(t){switch(t){case ne.RAW:case ne.BASE64:case ne.BASE64URL:case ne.DATA_URL:return;default:throw"Expected one of the event types: ["+ne.RAW+", "+ne.BASE64+", "+ne.BASE64URL+", "+ne.DATA_URL+"]."}}function w(t,e){switch(t){case ne.RAW:return new re(U(e));case ne.BASE64:case ne.BASE64URL:return new re(A(t,e));case ne.DATA_URL:return new re(N(e),O(e))}throw o()}function U(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)){var o=n<t.length-1&&56320==(64512&t.charCodeAt(n+1));if(o){var i=r,a=t.charCodeAt(++n);r=65536|(1023&i)<<10|1023&a,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 T(t){var e;try{e=decodeURIComponent(t)}catch(t){throw y(ne.DATA_URL,"Malformed data URL.")}return U(e)}function A(t,e){switch(t){case ne.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r){var o=n?"-":"_";throw y(t,"Invalid character '"+o+"' found: is it base64url encoded?")}break;case ne.BASE64URL:var i=-1!==e.indexOf("+"),a=-1!==e.indexOf("/");if(i||a){var o=i?"+":"/";throw y(t,"Invalid character '"+o+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/")}var s;try{s=atob(e)}catch(e){throw y(t,"Invalid character found")}for(var u=new Uint8Array(s.length),c=0;c<s.length;c++)u[c]=s.charCodeAt(c);return u}function N(t){var e=new oe(t);return e.base64?A(ne.BASE64,e.rest):T(e.rest)}function O(t){return new oe(t).contentType}function C(t,e){return!!(t.length>=e.length)&&t.substring(t.length-e.length)===e}function S(t){switch(t){case ae.RUNNING:case ae.PAUSING:case ae.CANCELING:return se.RUNNING;case ae.PAUSED:return se.PAUSED;case ae.SUCCESS:return se.SUCCESS;case ae.CANCELED:return se.CANCELED;case ae.ERROR:default:return se.ERROR}}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){for(var n in t)k(t,n)&&e(n,t[n])}function L(t){if(null==t)return{};var e={};return I(t,function(t,n){e[t]=n}),e}function P(t){return new Promise(t)}function x(t){return Promise.resolve(t)}function D(t){return Promise.reject(t)}function M(t){return null!=t}function W(t){return void 0!==t}function B(t){return"function"==typeof t}function G(t){return"object"==typeof t}function j(t){return G(t)&&null!==t}function q(t){return G(t)&&!Array.isArray(t)}function F(t){return"string"==typeof t||t instanceof String}function H(t){return"number"==typeof t||t instanceof Number}function z(t){return X()&&t instanceof Blob}function X(){return"undefined"!=typeof Blob}function V(t){var e;try{e=JSON.parse(t)}catch(t){return null}return q(e)?e:null}function K(t){if(0==t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}function Z(t,e){var n=e.split("/").filter(function(t){return t.length>0}).join("/");return 0===t.length?n:t+"/"+n}function J(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function Q(t){return Vt+Zt+t}function Y(t){return Kt+Zt+t}function $(t){return Vt+Jt+t}function tt(t){var e=encodeURIComponent,n="?";return I(t,function(t,r){var o=e(t)+"="+e(r);n=n+o+"&"}),n=n.slice(0,-1)}function et(t,e){return e}function nt(t){return!F(t)||t.length<2?t:(t=t,J(t))}function rt(){function t(t,e){return nt(e)}function e(t,e){return M(e)?+e:e}function n(t,e){if(!(F(e)&&e.length>0))return[];var n=encodeURIComponent;return e.split(",").map(function(e){var r=t.bucket,o=t.fullPath;return Y("/b/"+n(r)+"/o/"+n(o))+tt({alt:"media",token:e})})}if(pe)return pe;var r=[];r.push(new he("bucket")),r.push(new he("generation")),r.push(new he("metageneration")),r.push(new he("name","fullPath",!0));var o=new he("name");o.xform=t,r.push(o);var i=new he("size");return i.xform=e,r.push(i),r.push(new he("timeCreated")),r.push(new he("updated")),r.push(new he("md5Hash",null,!0)),r.push(new he("cacheControl",null,!0)),r.push(new he("contentDisposition",null,!0)),r.push(new he("contentEncoding",null,!0)),r.push(new he("contentLanguage",null,!0)),r.push(new he("contentType",null,!0)),r.push(new he("metadata","customMetadata",!0)),r.push(new he("downloadTokens","downloadURLs",!1,n)),pe=r}function ot(t,e){function n(){var n=t.bucket,r=t.fullPath,o=new le(n,r);return e.makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function it(t,e,n){var r={};r.type="file";for(var o=n.length,i=0;i<o;i++){var a=n[i];r[a.local]=a.xform(r,e[a.server])}return ot(r,t),r}function at(t,e,n){var r=V(e);return null===r?null:it(t,r,n)}function st(t,e){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];i.writable&&(n[i.server]=t[i.local])}return JSON.stringify(n)}function ut(t){if(!t||!G(t))throw"Expected Metadata object.";for(var e in t){var n=t[e];if("customMetadata"===e){if(!G(n))throw"Expected object for 'customMetadata' mapping."}else if(j(n))throw"Mapping for '"+e+"' cannot be an object."}}function ct(t,e,n){for(var r=e.length,o=e.length,i=0;i<e.length;i++)if(e[i].optional){r=i;break}if(!(r<=n.length&&n.length<=o))throw b(r,o,t,n.length);for(var i=0;i<n.length;i++)try{e[i].validator(n[i])}catch(e){throw e instanceof Error?v(i,t,e.message):v(i,t,e)}}function lt(t,e){return function(n){t(n),e(n)}}function ht(t,e){function n(t){if(!F(t))throw"Expected string."}var r;return r=t?lt(n,t):n,new fe(r,e)}function pt(){function t(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||X()&&t instanceof Blob))throw"Expected Blob or File."}return new fe(t)}function ft(t){return new fe(ut,t)}function dt(){function t(t){if(!(H(t)&&t>=0))throw"Expected a number 0 or greater."}return new fe(t)}function _t(t,e){function n(e){if(!(null===e||M(e)&&e instanceof Object))throw"Expected an Object.";void 0!==t&&null!==t&&t(e)}return new fe(n,e)}function vt(t){function e(t){if(null!==t&&!B(t))throw"Expected a Function."}return new fe(e,t)}function bt(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=bt();if(void 0!==n){for(var r=new n,o=0;o<t.length;o++)r.append(t[o]);return r.getBlob()}if(X())return new Blob(t);throw Error("This browser doesn't seem to support creating Blobs")}function gt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}function yt(t,e){return-1!==t.indexOf(e)}function Rt(t){return Array.prototype.slice.call(t)}function Et(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}function wt(t){if(!t)throw o()}function Ut(t,e){function n(n,r){var o=at(t,r,e);return wt(null!==o),o}return n}function Tt(t){function e(e,n){var r;return r=401===e.getStatus()?s():402===e.getStatus()?a(t.bucket):403===e.getStatus()?u(t.path):n,r.setServerResponseProp(n.serverResponseProp()),r}return e}function At(t){function e(e,r){var o=n(e,r);return 404===e.getStatus()&&(o=i(t.path)),o.setServerResponseProp(r.serverResponseProp()),o}var n=Tt(t);return e}function Nt(t,e,n){var r=e.fullServerUrl(),o=Q(r),i=t.maxOperationRetryTime(),a=new _e(o,"GET",Ut(t,n),i);return a.errorHandler=At(e),a}function Ot(t,e,n,r){var o=e.fullServerUrl(),i=Q(o),a=st(n,r),s={"Content-Type":"application/json; charset=utf-8"},u=t.maxOperationRetryTime(),c=new _e(i,"PATCH",Ut(t,r),u);return c.headers=s,c.body=a,c.errorHandler=At(e),c}function Ct(t,e){function n(t,e){}var r=e.fullServerUrl(),o=Q(r),i=t.maxOperationRetryTime(),a=new _e(o,"DELETE",n,i);return a.successCodes=[200,204],a.errorHandler=At(e),a}function St(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function kt(t,e,n){var r=L(n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=St(null,e)),r}function It(t,e,n,r,o){var i=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},s=function(){for(var t="",e=0;e<2;e++)t+=(""+Math.random()).slice(2);return t}();a["Content-Type"]="multipart/related; boundary="+s;var u=kt(e,r,o),c=st(u,n),l="--"+s+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+c+"\r\n--"+s+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",h="\r\n--"+s+"--",p=de.getBlob(l,r,h);if(null===p)throw f();var d={name:u.fullPath},_=$(i),v=t.maxUploadRetryTime(),b=new _e(_,"POST",Ut(t,n),v);return b.urlParams=d,b.headers=a,b.body=p.uploadData(),b.errorHandler=Tt(e),b}function Lt(t,e){var n;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(t){wt(!1)}return wt(yt(e||["active"],n)),n}function Pt(t,e,n,r,o){function i(t,e){Lt(t);var n;try{n=t.getResponseHeader("X-Goog-Upload-URL")}catch(t){wt(!1)}return wt(F(n)),n}var a=e.bucketOnlyServerUrl(),s=kt(e,r,o),u={name:s.fullPath},c=$(a),l={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":s.contentType,"Content-Type":"application/json; charset=utf-8"},h=st(s,n),p=t.maxUploadRetryTime(),f=new _e(c,"POST",i,p);return f.urlParams=u,f.headers=l,f.body=h,f.errorHandler=Tt(e),f}function xt(t,e,n,r){function o(t,e){var n,o=Lt(t,["active","final"]);try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(t){wt(!1)}var i=parseInt(n,10);return wt(!isNaN(i)),new ve(i,r.size(),"final"===o)}var i={"X-Goog-Upload-Command":"query"},a=t.maxUploadRetryTime(),s=new _e(n,"POST",o,a);return s.headers=i,s.errorHandler=Tt(e),s}function Dt(t,e,n,r,o,i,a,s){function u(t,n){var o,a=Lt(t,["active","final"]),s=c.current+h,u=r.size();return o="final"===a?Ut(e,i)(t,n):null,new ve(s,u,"final"===a,o)}var c=new ve(0,0);if(a?(c.current=a.current,c.total=a.total):(c.current=0,c.total=r.size()),r.size()!==c.total)throw d();var l=c.total-c.current,h=l;o>0&&(h=Math.min(h,o));var p=c.current,_=p+h,v=h===l?"upload, finalize":"upload",b={"X-Goog-Upload-Command":v,"X-Goog-Upload-Offset":c.current},m=r.slice(p,_);if(null===m)throw f();var g=e.maxUploadRetryTime(),y=new _e(n,"POST",u,g);return y.headers=b,y.body=m.uploadData(),y.progressCallback=s||null,y.errorHandler=Tt(t),y}function Mt(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];x(!0).then(function(){t.apply(null,e)})}}function Wt(t,e,n){function r(){return 2===h}function o(){p||(p=!0,e.apply(null,arguments))}function i(e){c=setTimeout(function(){c=null,t(a,r())},e)}function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!p){if(t)return void o.apply(null,arguments);if(r()||l)return void o.apply(null,arguments);u<64&&(u*=2);var a;1===h?(h=2,a=0):a=1e3*(u+Math.random()),i(a)}}function s(t){f||(f=!0,p||(null!==c?(t||(h=2),clearTimeout(c),i(0)):t||(h=1)))}var u=1,c=null,l=!1,h=0,p=!1,f=!1;return i(0),setTimeout(function(){l=!0,s(!0)},n),s}function Bt(t){t(!1)}function Gt(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}function jt(t){var e=void 0!==Xt.default?Xt.default.SDK_VERSION:"AppManager";t["X-Firebase-Storage-Version"]="webjs/"+e}function qt(t,e,n){var r=tt(t.urlParams),o=t.url+r,i=L(t.headers);return Gt(i,e),jt(i),new Ue(o,t.method,i,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,n)}function Ft(t,e,n){return new Ae(t,new ce,n)}function Ht(t){var e={TaskState:se,TaskEvent:ie,StringFormat:ne,Storage:Ae,Reference:ye};t.INTERNAL.registerService(Oe,Ft,e,void 0,!0)}Object.defineProperty(e,"__esModule",{value:!0});var zt,Xt=n(6),Vt="https://firebasestorage.googleapis.com",Kt="https://firebasestorage.googleapis.com",Zt="/v0",Jt="/v0",Qt=12e4,Yt=6e4,$t=-9007199254740991,te=function(){function t(t,e){this.t=r(t),this.e="Firebase Storage: "+e,this.n=null,this.r="FirebaseError"}return t.prototype.codeProp=function(){return this.code},t.prototype.codeEquals=function(t){return r(t)===this.codeProp()},t.prototype.serverResponseProp=function(){return this.n},t.prototype.setServerResponseProp=function(t){this.n=t},Object.defineProperty(t.prototype,"name",{get:function(){return this.r},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"code",{get:function(){return this.t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.n},enumerable:!0,configurable:!0}),t}(),ee={UNKNOWN:"unknown",OBJECT_NOT_FOUND:"object-not-found",BUCKET_NOT_FOUND:"bucket-not-found",PROJECT_NOT_FOUND:"project-not-found",QUOTA_EXCEEDED:"quota-exceeded",UNAUTHENTICATED:"unauthenticated",UNAUTHORIZED:"unauthorized",RETRY_LIMIT_EXCEEDED:"retry-limit-exceeded",INVALID_CHECKSUM:"invalid-checksum",CANCELED:"canceled",INVALID_EVENT_NAME:"invalid-event-name",INVALID_URL:"invalid-url",INVALID_DEFAULT_BUCKET:"invalid-default-bucket",NO_DEFAULT_BUCKET:"no-default-bucket",CANNOT_SLICE_BLOB:"cannot-slice-blob",SERVER_FILE_WRONG_SIZE:"server-file-wrong-size",NO_DOWNLOAD_URL:"no-download-url",INVALID_ARGUMENT:"invalid-argument",INVALID_ARGUMENT_COUNT:"invalid-argument-count",APP_DELETED:"app-deleted",INVALID_ROOT_OPERATION:"invalid-root-operation",INVALID_FORMAT:"invalid-format",INTERNAL_ERROR:"internal-error"},ne={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},re=function(){function t(t,e){this.data=t,this.contentType=e||null}return t}(),oe=function(){function t(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw y(ne.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=C(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=t.substring(t.indexOf(",")+1)}return t}(),ie={STATE_CHANGED:"state_changed"},ae={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},se={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(zt||(zt={}));var ue=function(){function t(){var t=this;this.o=!1,this.i=new XMLHttpRequest,this.a=zt.NO_ERROR,this.s=P(function(e,n){t.i.addEventListener("abort",function(n){t.a=zt.ABORT,e(t)}),t.i.addEventListener("error",function(n){t.a=zt.NETWORK_ERROR,e(t)}),t.i.addEventListener("load",function(n){e(t)})})}return t.prototype.send=function(t,e,n,r){var o=this;if(this.o)throw R("cannot .send() more than once");return this.o=!0,this.i.open(e,t,!0),M(r)&&I(r,function(t,e){o.i.setRequestHeader(t,""+e)}),M(n)?this.i.send(n):this.i.send(),this.s},t.prototype.getErrorCode=function(){if(!this.o)throw R("cannot .getErrorCode() before sending");return this.a},t.prototype.getStatus=function(){if(!this.o)throw R("cannot .getStatus() before sending");try{return this.i.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.o)throw R("cannot .getResponseText() before sending");return this.i.responseText},t.prototype.abort=function(){this.i.abort()},t.prototype.getResponseHeader=function(t){return this.i.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){M(this.i.upload)&&this.i.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){M(this.i.upload)&&this.i.upload.removeEventListener("progress",t)},t}(),ce=function(){function t(){}return t.prototype.createXhrIo=function(){return new ue},t}(),le=function(){function t(t,e){this.bucket=t,this.u=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.u},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(n){return new t(e,"")}if(""===n.path)return n;throw p(e)},t.makeFromUrl=function(e){function n(t){"/"===t.path.charAt(t.path.length-1)&&(t.u=t.u.slice(0,-1))}function r(t){t.u=decodeURIComponent(t.path)}for(var o=null,i=RegExp("^gs://([A-Za-z0-9.\\-]+)(/(.*))?$","i"),a={bucket:1,path:3},s=RegExp("^https?://firebasestorage\\.googleapis\\.com/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-]+)/o(/([^?#]*).*)?$","i"),u={bucket:1,path:3},c=[{regex:i,indices:a,postModify:n},{regex:s,indices:u,postModify:r}],l=0;l<c.length;l++){var p=c[l],f=p.regex.exec(e);if(f){var d=f[p.indices.bucket],_=f[p.indices.path];_||(_=""),o=new t(d,_),p.postModify(o);break}}if(null==o)throw h(e);return o},t}(),he=function(){function t(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||et}return t}(),pe=null,fe=function(){function t(t,e){var n=this;this.validator=function(e){n.optional&&!W(e)||t(e)},this.optional=!!e}return t}(),de=function(){function t(t,e){var n=0,r="";z(t)?(this.c=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.c=new Uint8Array(t):(this.c=new Uint8Array(t.byteLength),this.c.set(new Uint8Array(t))),n=this.c.length):t instanceof Uint8Array&&(e?this.c=t:(this.c=new Uint8Array(t.length),this.c.set(t)),n=t.length),this.l=n,this.h=r}return t.prototype.size=function(){return this.l},t.prototype.type=function(){return this.h},t.prototype.slice=function(e,n){if(z(this.c)){var r=this.c,o=gt(r,e,n);return null===o?null:new t(o)}return new t(new Uint8Array(this.c.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(X()){var r=e.map(function(e){return e instanceof t?e.c:e});return new t(mt.apply(null,r))}var o=e.map(function(t){return F(t)?w(ne.RAW,t).data:t.c}),i=0;o.forEach(function(t){i+=t.byteLength});var a=new Uint8Array(i),s=0;return o.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.c},t}(),_e=function(){function t(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return t}(),ve=function(){function t(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}return t}(),be=function(){function t(t,e,n){if(B(t)||M(e)||M(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}}return t}(),me=function(){function t(t,e,n,r,o,i){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=o,this.ref=i}return Object.defineProperty(t.prototype,"downloadURL",{get:function(){if(null!==this.metadata){var t=this.metadata.downloadURLs;return null!=t&&null!=t[0]?t[0]:null}return null},enumerable:!0,configurable:!0}),t}(),ge=function(){function t(t,e,n,r,o,i){void 0===i&&(i=null);var a=this;this.p=0,this.f=!1,this.d=!1,this._=[],this.v=null,this.b=null,this.m=null,this.g=1,this.y=null,this.R=null,this.w=t,this.U=e,this.T=n,this.A=o,this.N=i,this.O=r,this.C=this.S(this.A),this.k=ae.RUNNING,this.I=function(t){a.m=null,a.g=1,t.codeEquals(ee.CANCELED)?(a.f=!0,a.L()):(a.v=t,a.P(ae.ERROR))},this.x=function(t){a.m=null,t.codeEquals(ee.CANCELED)?a.L():(a.v=t,a.P(ae.ERROR))},this.D=P(function(t,e){a.y=t,a.R=e,a.M()}),this.D.then(null,function(){})}return t.prototype.W=function(){var t=this,e=this.p;return function(n,r){t.B(e+n)}},t.prototype.S=function(t){return t.size()>262144},t.prototype.M=function(){this.k===ae.RUNNING&&null===this.m&&(this.C?null===this.b?this.G():this.f?this.j():this.d?this.q():this.F():this.H())},t.prototype.z=function(t){var e=this;this.U.getAuthToken().then(function(n){switch(e.k){case ae.RUNNING:t(n);break;case ae.CANCELING:e.P(ae.CANCELED);break;case ae.PAUSING:e.P(ae.PAUSED)}})},t.prototype.G=function(){var t=this;this.z(function(e){var n=Pt(t.U,t.T,t.O,t.A,t.N),r=t.U.makeRequest(n,e);t.m=r,r.getPromise().then(function(e){t.m=null,t.b=e,t.f=!1,t.L()},t.I)})},t.prototype.j=function(){var t=this,e=this.b;this.z(function(n){var r=xt(t.U,t.T,e,t.A),o=t.U.makeRequest(r,n);t.m=o,o.getPromise().then(function(e){e=e,t.m=null,t.B(e.current),t.f=!1,e.finalized&&(t.d=!0),t.L()},t.I)})},t.prototype.F=function(){var t=this,e=262144*this.g,n=new ve(this.p,this.A.size()),r=this.b;this.z(function(o){var i;try{i=Dt(t.T,t.U,r,t.A,e,t.O,n,t.W())}catch(e){return t.v=e,void t.P(ae.ERROR)}var a=t.U.makeRequest(i,o);t.m=a,a.getPromise().then(function(e){t.X(),t.m=null,t.B(e.current),e.finalized?(t.N=e.metadata,t.P(ae.SUCCESS)):t.L()},t.I)})},t.prototype.X=function(){262144*this.g<33554432&&(this.g*=2)},t.prototype.q=function(){var t=this;this.z(function(e){var n=Nt(t.U,t.T,t.O),r=t.U.makeRequest(n,e);t.m=r,r.getPromise().then(function(e){t.m=null,t.N=e,t.P(ae.SUCCESS)},t.x)})},t.prototype.H=function(){var t=this;this.z(function(e){var n=It(t.U,t.T,t.O,t.A,t.N),r=t.U.makeRequest(n,e);t.m=r,r.getPromise().then(function(e){t.m=null,t.N=e,t.B(t.A.size()),t.P(ae.SUCCESS)},t.I)})},t.prototype.B=function(t){var e=this.p;this.p=t,this.p!==e&&this.V()},t.prototype.P=function(t){if(this.k!==t)switch(t){case ae.CANCELING:case ae.PAUSING:this.k=t,null!==this.m&&this.m.cancel();break;case ae.RUNNING:var e=this.k===ae.PAUSED;this.k=t,e&&(this.V(),this.M());break;case ae.PAUSED:this.k=t,this.V();break;case ae.CANCELED:this.v=l(),this.k=t,this.V();break;case ae.ERROR:case ae.SUCCESS:this.k=t,this.V()}},t.prototype.L=function(){switch(this.k){case ae.PAUSING:this.P(ae.PAUSED);break;case ae.CANCELING:this.P(ae.CANCELED);break;case ae.RUNNING:this.M()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=S(this.k);return new me(this.p,this.A.size(),t,this.N,this,this.w)},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e,n,r){function o(e){if(t!==ie.STATE_CHANGED)throw"Expected one of the event types: ["+ie.STATE_CHANGED+"]."}function i(t){try{return void c(t)}catch(t){}try{if(l(t),!(W(t.next)||W(t.error)||W(t.complete)))throw"";return}catch(t){throw u}}function a(t){function e(e,n,o){null!==t&&ct("on",t,arguments);var i=new be(e,n,r);return h.K(i),function(){h.Z(i)}}return e}function s(t){if(null===t)throw u;i(t)}void 0===e&&(e=void 0),void 0===n&&(n=void 0),void 0===r&&(r=void 0);var u="Expected a function or an Object with one of `next`, `error`, `complete` properties.",c=vt(!0).validator,l=_t(null,!0).validator;ct("on",[ht(o),_t(i,!0),vt(!0),vt(!0)],arguments);var h=this,p=[_t(s),vt(!0),vt(!0)];return W(e)||W(n)||W(r)?a(null)(e,n,r):a(p)},t.prototype.then=function(t,e){return this.D.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype.K=function(t){this._.push(t),this.J(t)},t.prototype.Z=function(t){Et(this._,t)},t.prototype.V=function(){var t=this;this.Q(),Rt(this._).forEach(function(e){t.J(e)})},t.prototype.Q=function(){if(null!==this.y){var t=!0;switch(S(this.k)){case se.SUCCESS:Mt(this.y.bind(null,this.snapshot))();break;case se.CANCELED:case se.ERROR:Mt(this.R.bind(null,this.v))();break;default:t=!1}t&&(this.y=null,this.R=null)}},t.prototype.J=function(t){switch(S(this.k)){case se.RUNNING:case se.PAUSED:null!==t.next&&Mt(t.next.bind(t,this.snapshot))();break;case se.SUCCESS:null!==t.complete&&Mt(t.complete.bind(t))();break;case se.CANCELED:case se.ERROR:null!==t.error&&Mt(t.error.bind(t,this.v))();break;default:null!==t.error&&Mt(t.error.bind(t,this.v))()}},t.prototype.resume=function(){ct("resume",[],arguments);var t=this.k===ae.PAUSED||this.k===ae.PAUSING;return t&&this.P(ae.RUNNING),t},t.prototype.pause=function(){ct("pause",[],arguments);var t=this.k===ae.RUNNING;return t&&this.P(ae.PAUSING),t},t.prototype.cancel=function(){ct("cancel",[],arguments);var t=this.k===ae.RUNNING||this.k===ae.PAUSING;return t&&this.P(ae.CANCELING),t},t}(),ye=function(){function t(t,e){this.authWrapper=t,this.location=e instanceof le?e:le.makeFromUrl(e)}return t.prototype.toString=function(){return ct("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 rt()},t.prototype.child=function(t){ct("child",[ht()],arguments);var e=Z(this.location.path,t),n=new le(this.location.bucket,e);return this.newRef(this.authWrapper,n)},Object.defineProperty(t.prototype,"parent",{get:function(){var t=K(this.location.path);if(null===t)return null;var e=new le(this.location.bucket,t);return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){var t=new le(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 J(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),ct("put",[pt(),ft(!0)],arguments),this.Y("put"),new ge(this,this.authWrapper,this.location,this.mappings(),new de(t),e)},t.prototype.putString=function(t,e,n){void 0===e&&(e=ne.RAW),ct("putString",[ht(),ht(E,!0),ft(!0)],arguments),this.Y("putString");var r=w(e,t),o=L(n);return!M(o.contentType)&&M(r.contentType)&&(o.contentType=r.contentType),new ge(this,this.authWrapper,this.location,this.mappings(),new de(r.data,!0),o)},t.prototype.delete=function(){ct("delete",[],arguments),this.Y("delete");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=Ct(t.authWrapper,t.location);return t.authWrapper.makeRequest(n,e).getPromise()})},t.prototype.getMetadata=function(){ct("getMetadata",[],arguments),this.Y("getMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=Nt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()})},t.prototype.updateMetadata=function(t){ct("updateMetadata",[ft()],arguments),this.Y("updateMetadata");var e=this;return this.authWrapper.getAuthToken().then(function(n){var r=Ot(e.authWrapper,e.location,t,e.mappings());return e.authWrapper.makeRequest(r,n).getPromise()})},t.prototype.getDownloadURL=function(){return ct("getDownloadURL",[],arguments),this.Y("getDownloadURL"),this.getMetadata().then(function(t){var e=t.downloadURLs[0];if(M(e))return e;throw _()})},t.prototype.Y=function(t){if(""===this.location.path)throw g(t)},t}(),Re=function(){function t(t){this.D=D(t)}return t.prototype.getPromise=function(){return this.D},t.prototype.cancel=function(t){void 0===t&&(t=!1)},t}(),Ee=function(){function t(){this.$={},this.tt=$t}return t.prototype.addRequest=function(t){function e(){delete r.$[n]}var n=this.tt;this.tt++,this.$[n]=t;var r=this;t.getPromise().then(e,e)},t.prototype.clear=function(){I(this.$,function(t,e){e&&e.cancel(!0)}),this.$={}},t}(),we=function(){function t(e,n,r,o,i){if(this.et=null,this.nt=!1,this.rt=e,null!==this.rt){var a=this.rt.options;M(a)&&(this.et=t.ot(a))}this.it=n,this.at=r,this.st=i,this.ut=o,this.ct=Qt,this.lt=Yt,this.ht=new Ee}return t.ot=function(t){var e=t.storageBucket||null;return null==e?null:le.makeFromBucketSpec(e).bucket},t.prototype.getAuthToken=function(){return null!==this.rt&&M(this.rt.INTERNAL)&&M(this.rt.INTERNAL.getToken)?this.rt.INTERNAL.getToken().then(function(t){return null!==t?t.accessToken:null},function(t){return null}):x(null)},t.prototype.bucket=function(){if(this.nt)throw m();return this.et},t.prototype.service=function(){return this.ut},t.prototype.makeStorageReference=function(t){return this.it(this,t)},t.prototype.makeRequest=function(t,e){if(this.nt)return new Re(m());var n=this.at(t,e,this.st);return this.ht.addRequest(n),n},t.prototype.deleteApp=function(){this.nt=!0,this.rt=null,this.ht.clear()},t.prototype.maxUploadRetryTime=function(){return this.lt},t.prototype.setMaxUploadRetryTime=function(t){this.lt=t},t.prototype.maxOperationRetryTime=function(){return this.ct},t.prototype.setMaxOperationRetryTime=function(t){this.ct=t},t}(),Ue=function(){function t(t,e,n,r,o,i,a,s,u,c,l){this.pt=null,this.ft=null,this.y=null,this.R=null,this.dt=!1,this._t=!1,this.vt=t,this.bt=e,this.mt=n,this.gt=r,this.yt=o.slice(),this.Rt=i.slice(),this.Et=a,this.wt=s,this.Ut=c,this.Tt=u,this.st=l;var h=this;this.D=P(function(t,e){h.y=t,h.R=e,h.M()})}return t.prototype.M=function(){function t(t,e){function r(t){var e=t.loaded,r=t.lengthComputable?t.total:-1;null!==n.Ut&&n.Ut(e,r)}if(e)return void t(!1,new Te(!1,null,!0));var o=n.st.createXhrIo();n.pt=o,null!==n.Ut&&o.addUploadProgressListener(r),o.send(n.vt,n.bt,n.gt,n.mt).then(function(e){null!==n.Ut&&e.removeUploadProgressListener(r),n.pt=null,e=e;var o=e.getErrorCode()===zt.NO_ERROR,i=e.getStatus();if(!o||n.At(i)){var a=e.getErrorCode()===zt.ABORT;return void t(!1,new Te(!1,null,a))}var s=yt(n.yt,i);t(!0,new Te(s,e))})}function e(t,e){var r=n.y,i=n.R,a=e.xhr;if(e.wasSuccessCode)try{var s=n.Et(a,a.getResponseText());W(s)?r(s):r()}catch(t){i(t)}else if(null!==a){var u=o();u.setServerResponseProp(a.getResponseText()),i(n.wt?n.wt(a,u):u)}else if(e.canceled){var u=n._t?m():l();i(u)}else{var u=c();i(u)}}var n=this;this.dt?e(!1,new Te(!1,null,!0)):this.ft=Wt(t,e,this.Tt)},t.prototype.getPromise=function(){return this.D},t.prototype.cancel=function(t){this.dt=!0,this._t=t||!1,null!==this.ft&&Bt(this.ft),null!==this.pt&&this.pt.abort()},t.prototype.At=function(t){var e=t>=500&&t<600,n=[408,429],r=yt(n,t),o=yt(this.Rt,t);return e||r||o},t}(),Te=function(){function t(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}return t}(),Ae=function(){function t(t,e,n){function r(t,e){return new ye(t,e)}if(this.et=null,this.U=new we(t,r,qt,this,e),this.rt=t,null!=n)this.et=le.makeFromBucketSpec(n);else{var o=this.U.bucket();null!=o&&(this.et=new le(o,""))}this.Nt=new Ne(this)}return t.prototype.ref=function(t){function e(t){if(/^[A-Za-z]+:\/\//.test(t))throw"Expected child path but got a URL, use refFromURL instead."}if(ct("ref",[ht(e,!0)],arguments),null==this.et)throw Error("No Storage Bucket defined in Firebase Options.");var n=new ye(this.U,this.et);return null!=t?n.child(t):n},t.prototype.refFromURL=function(t){function e(t){if(!/^[A-Za-z]+:\/\//.test(t))throw"Expected full URL but got a child path, use ref instead.";try{le.makeFromUrl(t)}catch(t){throw"Expected valid full URL but got an invalid one."}}return ct("refFromURL",[ht(e,!1)],arguments),new ye(this.U,t)},Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this.U.maxUploadRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxUploadRetryTime=function(t){ct("setMaxUploadRetryTime",[dt()],arguments),this.U.setMaxUploadRetryTime(t)},Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this.U.maxOperationRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxOperationRetryTime=function(t){ct("setMaxOperationRetryTime",[dt()],arguments),this.U.setMaxOperationRetryTime(t)},Object.defineProperty(t.prototype,"app",{get:function(){return this.rt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"INTERNAL",{get:function(){return this.Nt},enumerable:!0,configurable:!0}),t}(),Ne=function(){function t(t){this.ut=t}return t.prototype.delete=function(){return this.ut.U.deleteApp(),x(void 0)},t}();e.registerStorage=Ht;var Oe="storage";Ht(Xt.default)}},[118])}catch(t){throw Error("Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.")}
6204
6205//# sourceMappingURL=firebase.js.map