binnacle 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +138 -0
- data/LICENSE.txt +22 -0
- data/README.asc +264 -0
- data/Rakefile +48 -0
- data/bin/binnacle +5 -0
- data/binnacle.gemspec +49 -0
- data/lib/binnacle.rb +112 -0
- data/lib/binnacle/client.rb +115 -0
- data/lib/binnacle/commands/commands.rb +20 -0
- data/lib/binnacle/commands/help.rb +21 -0
- data/lib/binnacle/commands/tail.rb +187 -0
- data/lib/binnacle/configuration.rb +278 -0
- data/lib/binnacle/connection.rb +66 -0
- data/lib/binnacle/errors.rb +4 -0
- data/lib/binnacle/http_logging/adapters/ethon.rb +44 -0
- data/lib/binnacle/http_logging/adapters/excon.rb +62 -0
- data/lib/binnacle/http_logging/adapters/http.rb +63 -0
- data/lib/binnacle/http_logging/adapters/httpclient.rb +93 -0
- data/lib/binnacle/http_logging/adapters/net_http.rb +54 -0
- data/lib/binnacle/http_logging/adapters/patron.rb +24 -0
- data/lib/binnacle/http_logging/adapters/typhoeus.rb +20 -0
- data/lib/binnacle/http_logging/http_logger.rb +83 -0
- data/lib/binnacle/logging/formatter.rb +62 -0
- data/lib/binnacle/logging/logging.rb +36 -0
- data/lib/binnacle/logging/request_log_subscriber.rb +120 -0
- data/lib/binnacle/resource.rb +54 -0
- data/lib/binnacle/resources/event.rb +100 -0
- data/lib/binnacle/trap/backtrace.rb +130 -0
- data/lib/binnacle/trap/exception_event.rb +176 -0
- data/lib/binnacle/trap/middleware.rb +45 -0
- data/lib/binnacle/trap/railtie.rb +28 -0
- data/lib/binnacle/version.rb +3 -0
- data/lib/generators/binnacle/binnacle_generator.rb +78 -0
- data/lib/generators/binnacle/templates/firebase-messaging-sw.js.erb +35 -0
- data/spec/adapters/ethon_adapter.rb +19 -0
- data/spec/adapters/excon_adapter.rb +10 -0
- data/spec/adapters/faraday_adapter.rb +46 -0
- data/spec/adapters/http_adapter.rb +14 -0
- data/spec/adapters/http_base_adapter.rb +37 -0
- data/spec/adapters/httparty_adapter.rb +10 -0
- data/spec/adapters/httpclient_adapter.rb +21 -0
- data/spec/adapters/net_http_adapter.rb +14 -0
- data/spec/adapters/open_uri_adapter.rb +17 -0
- data/spec/adapters/patron_adapter.rb +29 -0
- data/spec/adapters/typhoeus_adapter.rb +25 -0
- data/spec/backtrace_spec.rb +197 -0
- data/spec/binnacle_spec.rb +33 -0
- data/spec/client_spec.rb +128 -0
- data/spec/commands_spec.rb +91 -0
- data/spec/configuration_spec.rb +139 -0
- data/spec/connection_spec.rb +34 -0
- data/spec/exception_event_spec.rb +72 -0
- data/spec/http_logger_spec.rb +77 -0
- data/spec/logger_spec.rb +60 -0
- data/spec/spec_helper.rb +117 -0
- data/spec/support/index.html +8 -0
- data/spec/support/index.html.gz +0 -0
- data/spec/support/test.bin +0 -0
- data/spec/support/test_server.rb +31 -0
- data/spec/support/utf8-invalid.html +0 -0
- data/spec/support/utf8.html +8 -0
- data/spec/vcr/binnacle/configure_can_be_configured_via_a_hash_of_options.yml +42 -0
- data/spec/vcr/binnacle/configure_creates_a_module_level_instance_of_a_binnacle_client.yml +42 -0
- data/spec/vcr/binnacle_client/events_invokes_the_events_api.yml +124 -0
- data/spec/vcr/binnacle_client/events_returns_a_collection_of_event_objects.yml +124 -0
- data/spec/vcr/binnacle_client/recents_invokes_the_events_api_recents.yml +83 -0
- data/spec/vcr/binnacle_client/recents_returns_a_collection_of_event_objects.yml +83 -0
- data/spec/vcr/binnacle_client/report_exception_invokes_the_events_api_signal.yml +121 -0
- data/spec/vcr/binnacle_client/signal_asynch_invokes_the_events_api_signal.yml +74 -0
- data/spec/vcr/binnacle_client/signal_invokes_the_events_api_signal.yml +74 -0
- data/spec/vcr/binnacle_client_ready_/returns_true_if_a_connection_has_been_successfully_established.yml +42 -0
- data/spec/vcr/binnacle_command/tail_command_with_n_flag_returns_recent_events.yml +81 -0
- data/spec/vcr/binnacle_connection/initialize_fails_with_incorrect_credentials.yml +40 -0
- data/spec/vcr/binnacle_connection/initialize_retrieves_available_endpoints_upon_successful_connection.yml +42 -0
- data/spec/vcr/binnacle_http_logger/_htt_party_adapter_should_log__ge_t_requests.yml +122 -0
- data/spec/vcr/binnacle_http_logger/_http_adapter_should_log__ge_t_requests.yml +165 -0
- data/spec/vcr/binnacle_http_logger/_http_client_adapter_should_log__ge_t_requests.yml +274 -0
- data/spec/vcr/binnacle_http_logger/ethon_adapter_should_log__ge_t_requests.yml +87 -0
- data/spec/vcr/binnacle_http_logger/excon_adapter_should_log__ge_t_requests.yml +204 -0
- data/spec/vcr/binnacle_http_logger/faraday_adapter_should_log__ge_t_requests.yml +200 -0
- data/spec/vcr/binnacle_http_logger/net_http_adapter_should_log__ge_t_requests.yml +827 -0
- data/spec/vcr/binnacle_http_logger/open_uri_adapter_should_log__ge_t_requests.yml +751 -0
- data/spec/vcr/binnacle_http_logger/patron_adapter_should_log__ge_t_requests.yml +124 -0
- data/spec/vcr/binnacle_http_logger/typhoeus_adapter_should_log__ge_t_requests.yml +124 -0
- data/spec/vcr/binnacle_logging/logging_allows_passing_other_parameters_using_a_hash.yml +119 -0
- data/spec/vcr/binnacle_logging/logging_invokes_the_events_api_signal.yml +75 -0
- data/spec/vcr/binnacle_logging/logging_respects_the_logger_severity.yml +81 -0
- data/vendor/assets/javascripts/atmosphere/atmosphere.js +3487 -0
- data/vendor/assets/javascripts/base64/base64.js +61 -0
- data/vendor/assets/javascripts/binnacle.js +5 -0
- data/vendor/assets/javascripts/binnacle/binnacle.js +9090 -0
- data/vendor/assets/javascripts/firebase/firebase-app-externs.js +261 -0
- data/vendor/assets/javascripts/firebase/firebase-app.js +35 -0
- data/vendor/assets/javascripts/firebase/firebase-auth-externs.js +1300 -0
- data/vendor/assets/javascripts/firebase/firebase-auth.js +241 -0
- data/vendor/assets/javascripts/firebase/firebase-database-externs.js +1700 -0
- data/vendor/assets/javascripts/firebase/firebase-database.js +260 -0
- data/vendor/assets/javascripts/firebase/firebase-messaging-externs.js +164 -0
- data/vendor/assets/javascripts/firebase/firebase-messaging.js +35 -0
- data/vendor/assets/javascripts/firebase/firebase-storage-externs.js +663 -0
- data/vendor/assets/javascripts/firebase/firebase-storage.js +52 -0
- data/vendor/assets/javascripts/firebase/firebase.js +611 -0
- data/vendor/assets/javascripts/moment/locale/af.js +73 -0
- data/vendor/assets/javascripts/moment/locale/ar-dz.js +59 -0
- data/vendor/assets/javascripts/moment/locale/ar-kw.js +59 -0
- data/vendor/assets/javascripts/moment/locale/ar-ly.js +126 -0
- data/vendor/assets/javascripts/moment/locale/ar-ma.js +60 -0
- data/vendor/assets/javascripts/moment/locale/ar-sa.js +105 -0
- data/vendor/assets/javascripts/moment/locale/ar-tn.js +59 -0
- data/vendor/assets/javascripts/moment/locale/ar.js +142 -0
- data/vendor/assets/javascripts/moment/locale/az.js +105 -0
- data/vendor/assets/javascripts/moment/locale/be.js +134 -0
- data/vendor/assets/javascripts/moment/locale/bg.js +90 -0
- data/vendor/assets/javascripts/moment/locale/bn.js +119 -0
- data/vendor/assets/javascripts/moment/locale/bo.js +119 -0
- data/vendor/assets/javascripts/moment/locale/br.js +108 -0
- data/vendor/assets/javascripts/moment/locale/bs.js +143 -0
- data/vendor/assets/javascripts/moment/locale/ca.js +88 -0
- data/vendor/assets/javascripts/moment/locale/cs.js +172 -0
- data/vendor/assets/javascripts/moment/locale/cv.js +63 -0
- data/vendor/assets/javascripts/moment/locale/cy.js +81 -0
- data/vendor/assets/javascripts/moment/locale/da.js +60 -0
- data/vendor/assets/javascripts/moment/locale/de-at.js +79 -0
- data/vendor/assets/javascripts/moment/locale/de-ch.js +78 -0
- data/vendor/assets/javascripts/moment/locale/de.js +78 -0
- data/vendor/assets/javascripts/moment/locale/dv.js +100 -0
- data/vendor/assets/javascripts/moment/locale/el.js +100 -0
- data/vendor/assets/javascripts/moment/locale/en-au.js +67 -0
- data/vendor/assets/javascripts/moment/locale/en-ca.js +63 -0
- data/vendor/assets/javascripts/moment/locale/en-gb.js +67 -0
- data/vendor/assets/javascripts/moment/locale/en-ie.js +67 -0
- data/vendor/assets/javascripts/moment/locale/en-nz.js +67 -0
- data/vendor/assets/javascripts/moment/locale/eo.js +73 -0
- data/vendor/assets/javascripts/moment/locale/es-do.js +82 -0
- data/vendor/assets/javascripts/moment/locale/es.js +83 -0
- data/vendor/assets/javascripts/moment/locale/et.js +80 -0
- data/vendor/assets/javascripts/moment/locale/eu.js +66 -0
- data/vendor/assets/javascripts/moment/locale/fa.js +107 -0
- data/vendor/assets/javascripts/moment/locale/fi.js +107 -0
- data/vendor/assets/javascripts/moment/locale/fo.js +60 -0
- data/vendor/assets/javascripts/moment/locale/fr-ca.js +74 -0
- data/vendor/assets/javascripts/moment/locale/fr-ch.js +78 -0
- data/vendor/assets/javascripts/moment/locale/fr.js +83 -0
- data/vendor/assets/javascripts/moment/locale/fy.js +75 -0
- data/vendor/assets/javascripts/moment/locale/gd.js +76 -0
- data/vendor/assets/javascripts/moment/locale/gl.js +77 -0
- data/vendor/assets/javascripts/moment/locale/gom-latn.js +122 -0
- data/vendor/assets/javascripts/moment/locale/he.js +99 -0
- data/vendor/assets/javascripts/moment/locale/hi.js +124 -0
- data/vendor/assets/javascripts/moment/locale/hr.js +145 -0
- data/vendor/assets/javascripts/moment/locale/hu.js +109 -0
- data/vendor/assets/javascripts/moment/locale/hy-am.js +95 -0
- data/vendor/assets/javascripts/moment/locale/id.js +83 -0
- data/vendor/assets/javascripts/moment/locale/is.js +127 -0
- data/vendor/assets/javascripts/moment/locale/it.js +70 -0
- data/vendor/assets/javascripts/moment/locale/ja.js +80 -0
- data/vendor/assets/javascripts/moment/locale/jv.js +83 -0
- data/vendor/assets/javascripts/moment/locale/ka.js +89 -0
- data/vendor/assets/javascripts/moment/locale/kk.js +87 -0
- data/vendor/assets/javascripts/moment/locale/km.js +58 -0
- data/vendor/assets/javascripts/moment/locale/kn.js +126 -0
- data/vendor/assets/javascripts/moment/locale/ko.js +69 -0
- data/vendor/assets/javascripts/moment/locale/ky.js +88 -0
- data/vendor/assets/javascripts/moment/locale/lb.js +137 -0
- data/vendor/assets/javascripts/moment/locale/lo.js +70 -0
- data/vendor/assets/javascripts/moment/locale/lt.js +117 -0
- data/vendor/assets/javascripts/moment/locale/lv.js +97 -0
- data/vendor/assets/javascripts/moment/locale/me.js +111 -0
- data/vendor/assets/javascripts/moment/locale/mi.js +64 -0
- data/vendor/assets/javascripts/moment/locale/mk.js +90 -0
- data/vendor/assets/javascripts/moment/locale/ml.js +81 -0
- data/vendor/assets/javascripts/moment/locale/mr.js +159 -0
- data/vendor/assets/javascripts/moment/locale/ms-my.js +83 -0
- data/vendor/assets/javascripts/moment/locale/ms.js +82 -0
- data/vendor/assets/javascripts/moment/locale/my.js +96 -0
- data/vendor/assets/javascripts/moment/locale/nb.js +63 -0
- data/vendor/assets/javascripts/moment/locale/ne.js +123 -0
- data/vendor/assets/javascripts/moment/locale/nl-be.js +88 -0
- data/vendor/assets/javascripts/moment/locale/nl.js +88 -0
- data/vendor/assets/javascripts/moment/locale/nn.js +60 -0
- data/vendor/assets/javascripts/moment/locale/pa-in.js +124 -0
- data/vendor/assets/javascripts/moment/locale/pl.js +107 -0
- data/vendor/assets/javascripts/moment/locale/pt-br.js +61 -0
- data/vendor/assets/javascripts/moment/locale/pt.js +65 -0
- data/vendor/assets/javascripts/moment/locale/ro.js +75 -0
- data/vendor/assets/javascripts/moment/locale/ru.js +183 -0
- data/vendor/assets/javascripts/moment/locale/sd.js +98 -0
- data/vendor/assets/javascripts/moment/locale/se.js +61 -0
- data/vendor/assets/javascripts/moment/locale/si.js +71 -0
- data/vendor/assets/javascripts/moment/locale/sk.js +150 -0
- data/vendor/assets/javascripts/moment/locale/sl.js +162 -0
- data/vendor/assets/javascripts/moment/locale/sq.js +70 -0
- data/vendor/assets/javascripts/moment/locale/sr-cyrl.js +110 -0
- data/vendor/assets/javascripts/moment/locale/sr.js +110 -0
- data/vendor/assets/javascripts/moment/locale/ss.js +89 -0
- data/vendor/assets/javascripts/moment/locale/sv.js +69 -0
- data/vendor/assets/javascripts/moment/locale/sw.js +59 -0
- data/vendor/assets/javascripts/moment/locale/ta.js +130 -0
- data/vendor/assets/javascripts/moment/locale/te.js +89 -0
- data/vendor/assets/javascripts/moment/locale/tet.js +68 -0
- data/vendor/assets/javascripts/moment/locale/th.js +67 -0
- data/vendor/assets/javascripts/moment/locale/tl-ph.js +62 -0
- data/vendor/assets/javascripts/moment/locale/tlh.js +120 -0
- data/vendor/assets/javascripts/moment/locale/tr.js +90 -0
- data/vendor/assets/javascripts/moment/locale/tzl.js +91 -0
- data/vendor/assets/javascripts/moment/locale/tzm-latn.js +58 -0
- data/vendor/assets/javascripts/moment/locale/tzm.js +58 -0
- data/vendor/assets/javascripts/moment/locale/uk.js +151 -0
- data/vendor/assets/javascripts/moment/locale/ur.js +99 -0
- data/vendor/assets/javascripts/moment/locale/uz-latn.js +58 -0
- data/vendor/assets/javascripts/moment/locale/uz.js +58 -0
- data/vendor/assets/javascripts/moment/locale/vi.js +79 -0
- data/vendor/assets/javascripts/moment/locale/x-pseudo.js +68 -0
- data/vendor/assets/javascripts/moment/locale/yo.js +60 -0
- data/vendor/assets/javascripts/moment/locale/zh-cn.js +111 -0
- data/vendor/assets/javascripts/moment/locale/zh-hk.js +105 -0
- data/vendor/assets/javascripts/moment/locale/zh-tw.js +104 -0
- data/vendor/assets/javascripts/moment/min/locales.js +9252 -0
- data/vendor/assets/javascripts/moment/min/moment-with-locales.js +13700 -0
- data/vendor/assets/javascripts/moment/min/moment.min.js +7 -0
- data/vendor/assets/javascripts/moment/min/tests.js +78265 -0
- data/vendor/assets/javascripts/moment/moment.js +4463 -0
- data/vendor/assets/javascripts/moment/src/lib/create/check-overflow.js +34 -0
- data/vendor/assets/javascripts/moment/src/lib/create/date-from-array.js +21 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-anything.js +110 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-array.js +140 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-object.js +16 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-string-and-array.js +50 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-string-and-format.js +113 -0
- data/vendor/assets/javascripts/moment/src/lib/create/from-string.js +202 -0
- data/vendor/assets/javascripts/moment/src/lib/create/local.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/create/parsing-flags.js +26 -0
- data/vendor/assets/javascripts/moment/src/lib/create/utc.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/create/valid.js +49 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/abs.js +18 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/add-subtract.js +21 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/as.js +61 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/bubble.js +61 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/constructor.js +44 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/create.js +122 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/duration.js +16 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/get.js +25 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/humanize.js +85 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/iso-string.js +56 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/prototype.js +50 -0
- data/vendor/assets/javascripts/moment/src/lib/duration/valid.js +35 -0
- data/vendor/assets/javascripts/moment/src/lib/format/format.js +92 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/base-config.js +44 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/calendar.js +15 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/constructor.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/en.js +15 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/formats.js +23 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/invalid.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/lists.js +93 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/locale.js +39 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/locales.js +186 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/ordinal.js +7 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/pre-post-format.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/prototype.js +69 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/relative.js +30 -0
- data/vendor/assets/javascripts/moment/src/lib/locale/set.js +49 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/add-subtract.js +55 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/calendar.js +26 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/clone.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/compare.js +59 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/constructor.js +77 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/creation-data.js +9 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/diff.js +62 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/format.js +57 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/from.js +17 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/get-set.js +55 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/locale.js +34 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/min-max.js +63 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/moment.js +28 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/now.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/prototype.js +150 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/start-end-of.js +59 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/to-type.js +34 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/to.js +17 -0
- data/vendor/assets/javascripts/moment/src/lib/moment/valid.js +15 -0
- data/vendor/assets/javascripts/moment/src/lib/parse/regex.js +54 -0
- data/vendor/assets/javascripts/moment/src/lib/parse/token.js +33 -0
- data/vendor/assets/javascripts/moment/src/lib/units/aliases.js +30 -0
- data/vendor/assets/javascripts/moment/src/lib/units/constants.js +9 -0
- data/vendor/assets/javascripts/moment/src/lib/units/day-of-month.js +39 -0
- data/vendor/assets/javascripts/moment/src/lib/units/day-of-week.js +364 -0
- data/vendor/assets/javascripts/moment/src/lib/units/day-of-year.js +36 -0
- data/vendor/assets/javascripts/moment/src/lib/units/hour.js +144 -0
- data/vendor/assets/javascripts/moment/src/lib/units/millisecond.js +69 -0
- data/vendor/assets/javascripts/moment/src/lib/units/minute.js +29 -0
- data/vendor/assets/javascripts/moment/src/lib/units/month.js +283 -0
- data/vendor/assets/javascripts/moment/src/lib/units/offset.js +235 -0
- data/vendor/assets/javascripts/moment/src/lib/units/priorities.js +16 -0
- data/vendor/assets/javascripts/moment/src/lib/units/quarter.js +32 -0
- data/vendor/assets/javascripts/moment/src/lib/units/second.js +29 -0
- data/vendor/assets/javascripts/moment/src/lib/units/timestamp.js +20 -0
- data/vendor/assets/javascripts/moment/src/lib/units/timezone.js +16 -0
- data/vendor/assets/javascripts/moment/src/lib/units/units.js +20 -0
- data/vendor/assets/javascripts/moment/src/lib/units/week-calendar-utils.js +65 -0
- data/vendor/assets/javascripts/moment/src/lib/units/week-year.js +107 -0
- data/vendor/assets/javascripts/moment/src/lib/units/week.js +67 -0
- data/vendor/assets/javascripts/moment/src/lib/units/year.js +75 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/abs-ceil.js +7 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/abs-floor.js +8 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/abs-round.js +7 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/compare-arrays.js +16 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/defaults.js +10 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/deprecate.js +55 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/extend.js +19 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/has-own-prop.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/hooks.js +13 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/index-of.js +18 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-array.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-date.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-function.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-number.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-object-empty.js +8 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-object.js +5 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/is-undefined.js +3 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/keys.js +19 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/map.js +7 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/some.js +19 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/to-int.js +12 -0
- data/vendor/assets/javascripts/moment/src/lib/utils/zero-fill.js +7 -0
- data/vendor/assets/javascripts/moment/src/locale/af.js +63 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-dz.js +50 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-kw.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-ly.js +112 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-ma.js +51 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-sa.js +95 -0
- data/vendor/assets/javascripts/moment/src/locale/ar-tn.js +50 -0
- data/vendor/assets/javascripts/moment/src/locale/ar.js +128 -0
- data/vendor/assets/javascripts/moment/src/locale/az.js +96 -0
- data/vendor/assets/javascripts/moment/src/locale/be.js +125 -0
- data/vendor/assets/javascripts/moment/src/locale/bg.js +81 -0
- data/vendor/assets/javascripts/moment/src/locale/bn.js +109 -0
- data/vendor/assets/javascripts/moment/src/locale/bo.js +110 -0
- data/vendor/assets/javascripts/moment/src/locale/br.js +99 -0
- data/vendor/assets/javascripts/moment/src/locale/bs.js +133 -0
- data/vendor/assets/javascripts/moment/src/locale/ca.js +79 -0
- data/vendor/assets/javascripts/moment/src/locale/cs.js +163 -0
- data/vendor/assets/javascripts/moment/src/locale/cv.js +53 -0
- data/vendor/assets/javascripts/moment/src/locale/cy.js +72 -0
- data/vendor/assets/javascripts/moment/src/locale/da.js +50 -0
- data/vendor/assets/javascripts/moment/src/locale/de-at.js +69 -0
- data/vendor/assets/javascripts/moment/src/locale/de-ch.js +68 -0
- data/vendor/assets/javascripts/moment/src/locale/de.js +68 -0
- data/vendor/assets/javascripts/moment/src/locale/dv.js +89 -0
- data/vendor/assets/javascripts/moment/src/locale/el.js +88 -0
- data/vendor/assets/javascripts/moment/src/locale/en-au.js +58 -0
- data/vendor/assets/javascripts/moment/src/locale/en-ca.js +53 -0
- data/vendor/assets/javascripts/moment/src/locale/en-gb.js +58 -0
- data/vendor/assets/javascripts/moment/src/locale/en-ie.js +58 -0
- data/vendor/assets/javascripts/moment/src/locale/en-nz.js +57 -0
- data/vendor/assets/javascripts/moment/src/locale/eo.js +64 -0
- data/vendor/assets/javascripts/moment/src/locale/es-do.js +73 -0
- data/vendor/assets/javascripts/moment/src/locale/es.js +74 -0
- data/vendor/assets/javascripts/moment/src/locale/et.js +71 -0
- data/vendor/assets/javascripts/moment/src/locale/eu.js +57 -0
- data/vendor/assets/javascripts/moment/src/locale/fa.js +97 -0
- data/vendor/assets/javascripts/moment/src/locale/fi.js +98 -0
- data/vendor/assets/javascripts/moment/src/locale/fo.js +51 -0
- data/vendor/assets/javascripts/moment/src/locale/fr-ca.js +65 -0
- data/vendor/assets/javascripts/moment/src/locale/fr-ch.js +69 -0
- data/vendor/assets/javascripts/moment/src/locale/fr.js +74 -0
- data/vendor/assets/javascripts/moment/src/locale/fy.js +66 -0
- data/vendor/assets/javascripts/moment/src/locale/gd.js +67 -0
- data/vendor/assets/javascripts/moment/src/locale/gl.js +68 -0
- data/vendor/assets/javascripts/moment/src/locale/gom-latn.js +112 -0
- data/vendor/assets/javascripts/moment/src/locale/he.js +90 -0
- data/vendor/assets/javascripts/moment/src/locale/hi.js +115 -0
- data/vendor/assets/javascripts/moment/src/locale/hr.js +135 -0
- data/vendor/assets/javascripts/moment/src/locale/hu.js +100 -0
- data/vendor/assets/javascripts/moment/src/locale/hy-am.js +86 -0
- data/vendor/assets/javascripts/moment/src/locale/id.js +74 -0
- data/vendor/assets/javascripts/moment/src/locale/is.js +118 -0
- data/vendor/assets/javascripts/moment/src/locale/it.js +61 -0
- data/vendor/assets/javascripts/moment/src/locale/ja.js +71 -0
- data/vendor/assets/javascripts/moment/src/locale/jv.js +73 -0
- data/vendor/assets/javascripts/moment/src/locale/ka.js +80 -0
- data/vendor/assets/javascripts/moment/src/locale/kk.js +77 -0
- data/vendor/assets/javascripts/moment/src/locale/km.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/kn.js +116 -0
- data/vendor/assets/javascripts/moment/src/locale/ko.js +60 -0
- data/vendor/assets/javascripts/moment/src/locale/ky.js +78 -0
- data/vendor/assets/javascripts/moment/src/locale/lb.js +128 -0
- data/vendor/assets/javascripts/moment/src/locale/lo.js +61 -0
- data/vendor/assets/javascripts/moment/src/locale/lt.js +108 -0
- data/vendor/assets/javascripts/moment/src/locale/lv.js +88 -0
- data/vendor/assets/javascripts/moment/src/locale/me.js +101 -0
- data/vendor/assets/javascripts/moment/src/locale/mi.js +54 -0
- data/vendor/assets/javascripts/moment/src/locale/mk.js +81 -0
- data/vendor/assets/javascripts/moment/src/locale/ml.js +72 -0
- data/vendor/assets/javascripts/moment/src/locale/mr.js +150 -0
- data/vendor/assets/javascripts/moment/src/locale/ms-my.js +74 -0
- data/vendor/assets/javascripts/moment/src/locale/ms.js +73 -0
- data/vendor/assets/javascripts/moment/src/locale/my.js +86 -0
- data/vendor/assets/javascripts/moment/src/locale/nb.js +54 -0
- data/vendor/assets/javascripts/moment/src/locale/ne.js +114 -0
- data/vendor/assets/javascripts/moment/src/locale/nl-be.js +79 -0
- data/vendor/assets/javascripts/moment/src/locale/nl.js +79 -0
- data/vendor/assets/javascripts/moment/src/locale/nn.js +51 -0
- data/vendor/assets/javascripts/moment/src/locale/pa-in.js +115 -0
- data/vendor/assets/javascripts/moment/src/locale/pl.js +97 -0
- data/vendor/assets/javascripts/moment/src/locale/pt-br.js +52 -0
- data/vendor/assets/javascripts/moment/src/locale/pt.js +56 -0
- data/vendor/assets/javascripts/moment/src/locale/ro.js +66 -0
- data/vendor/assets/javascripts/moment/src/locale/ru.js +173 -0
- data/vendor/assets/javascripts/moment/src/locale/sd.js +88 -0
- data/vendor/assets/javascripts/moment/src/locale/se.js +51 -0
- data/vendor/assets/javascripts/moment/src/locale/si.js +61 -0
- data/vendor/assets/javascripts/moment/src/locale/sk.js +141 -0
- data/vendor/assets/javascripts/moment/src/locale/sl.js +152 -0
- data/vendor/assets/javascripts/moment/src/locale/sq.js +61 -0
- data/vendor/assets/javascripts/moment/src/locale/sr-cyrl.js +100 -0
- data/vendor/assets/javascripts/moment/src/locale/sr.js +100 -0
- data/vendor/assets/javascripts/moment/src/locale/ss.js +80 -0
- data/vendor/assets/javascripts/moment/src/locale/sv.js +60 -0
- data/vendor/assets/javascripts/moment/src/locale/sw.js +50 -0
- data/vendor/assets/javascripts/moment/src/locale/ta.js +120 -0
- data/vendor/assets/javascripts/moment/src/locale/te.js +79 -0
- data/vendor/assets/javascripts/moment/src/locale/tet.js +58 -0
- data/vendor/assets/javascripts/moment/src/locale/th.js +57 -0
- data/vendor/assets/javascripts/moment/src/locale/tl-ph.js +53 -0
- data/vendor/assets/javascripts/moment/src/locale/tlh.js +110 -0
- data/vendor/assets/javascripts/moment/src/locale/tr.js +81 -0
- data/vendor/assets/javascripts/moment/src/locale/tzl.js +82 -0
- data/vendor/assets/javascripts/moment/src/locale/tzm-latn.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/tzm.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/uk.js +142 -0
- data/vendor/assets/javascripts/moment/src/locale/ur.js +89 -0
- data/vendor/assets/javascripts/moment/src/locale/uz-latn.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/uz.js +49 -0
- data/vendor/assets/javascripts/moment/src/locale/vi.js +70 -0
- data/vendor/assets/javascripts/moment/src/locale/x-pseudo.js +58 -0
- data/vendor/assets/javascripts/moment/src/locale/yo.js +50 -0
- data/vendor/assets/javascripts/moment/src/locale/zh-cn.js +102 -0
- data/vendor/assets/javascripts/moment/src/locale/zh-hk.js +95 -0
- data/vendor/assets/javascripts/moment/src/locale/zh-tw.js +94 -0
- data/vendor/assets/javascripts/moment/src/moment.js +82 -0
- data/vendor/assets/javascripts/moment/templates/default.js +5 -0
- data/vendor/assets/javascripts/moment/templates/locale-header.js +6 -0
- data/vendor/assets/javascripts/moment/templates/test-header.js +6 -0
- metadata +943 -0
@@ -0,0 +1,241 @@
|
|
1
|
+
/*! @license Firebase v3.7.1
|
2
|
+
Build: 3.7.1-rc.1
|
3
|
+
Terms: https://firebase.google.com/terms/ */
|
4
|
+
(function(){var h,aa=aa||{},l=this,ba=function(){},m=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
|
5
|
+
!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},ca=function(a){return null===a},da=function(a){return"array"==m(a)},ea=function(a){var b=m(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"string"==typeof a},fa=function(a){return"number"==typeof a},q=function(a){return"function"==m(a)},ga=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ha=function(a,b,
|
6
|
+
c){return a.call.apply(a.bind,arguments)},ia=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},r=function(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ha:ia;return r.apply(null,arguments)},ja=function(a,b){var c=Array.prototype.slice.call(arguments,
|
7
|
+
1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}},ka=Date.now||function(){return+new Date},t=function(a,b){function c(){}c.prototype=b.prototype;a.pd=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Hf=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(u,Error);u.prototype.name="CustomError";var la=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},ma=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},na=/&/g,oa=/</g,pa=/>/g,qa=/"/g,ra=/'/g,sa=/\x00/g,ta=/[\x00&<>"']/,v=function(a,b){return-1!=a.indexOf(b)},ua=function(a,b){return a<b?-1:a>b?1:0};var va=function(a,b){b.unshift(a);u.call(this,la.apply(null,b));b.shift()};t(va,u);va.prototype.name="AssertionError";
|
8
|
+
var wa=function(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),f=d;else a&&(e+=": "+a,f=b);throw new va(""+e,f||[]);},w=function(a,b,c){a||wa("",null,b,Array.prototype.slice.call(arguments,2))},xa=function(a,b){throw new va("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},ya=function(a,b,c){fa(a)||wa("Expected number but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,2));return a},za=function(a,b,c){p(a)||wa("Expected string but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,
|
9
|
+
2))},Aa=function(a,b,c){q(a)||wa("Expected function but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,2))};var Ba=Array.prototype.indexOf?function(a,b,c){w(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},x=Array.prototype.forEach?function(a,b,c){w(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ca=function(a,b){for(var c=p(a)?
|
10
|
+
a.split(""):a,d=a.length-1;0<=d;--d)d in c&&b.call(void 0,c[d],d,a)},Da=Array.prototype.map?function(a,b,c){w(null!=a.length);return Array.prototype.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Ea=Array.prototype.some?function(a,b,c){w(null!=a.length);return Array.prototype.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},
|
11
|
+
Ga=function(a){var b;a:{b=Fa;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Ha=function(a,b){return 0<=Ba(a,b)},Ja=function(a,b){b=Ba(a,b);var c;(c=0<=b)&&Ia(a,b);return c},Ia=function(a,b){w(null!=a.length);return 1==Array.prototype.splice.call(a,b,1).length},Ka=function(a,b){var c=0;Ca(a,function(d,e){b.call(void 0,d,e,a)&&Ia(a,e)&&c++})},La=function(a){return Array.prototype.concat.apply([],arguments)},
|
12
|
+
Ma=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var Na=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},Oa=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},Pa=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},Qa=function(a){for(var b in a)return!1;return!0},Ra=function(a,b){for(var c in a)if(!(c in b)||a[c]!==b[c])return!1;for(c in b)if(!(c in a))return!1;return!0},Sa=function(a){var b={},c;for(c in a)b[c]=a[c];return b},Ta="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),
|
13
|
+
Ua=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Ta.length;f++)c=Ta[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var Va;a:{var Wa=l.navigator;if(Wa){var Ya=Wa.userAgent;if(Ya){Va=Ya;break a}}Va=""}var y=function(a){return v(Va,a)};var Za=function(a){Za[" "](a);return a};Za[" "]=ba;var ab=function(a,b){var c=$a;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var bb=y("Opera"),z=y("Trident")||y("MSIE"),cb=y("Edge"),db=cb||z,eb=y("Gecko")&&!(v(Va.toLowerCase(),"webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),fb=v(Va.toLowerCase(),"webkit")&&!y("Edge"),gb=function(){var a=l.document;return a?a.documentMode:void 0},hb;
|
14
|
+
a:{var ib="",jb=function(){var a=Va;if(eb)return/rv\:([^\);]+)(\)|;)/.exec(a);if(cb)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(fb)return/WebKit\/(\S+)/.exec(a);if(bb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();jb&&(ib=jb?jb[1]:"");if(z){var kb=gb();if(null!=kb&&kb>parseFloat(ib)){hb=String(kb);break a}}hb=ib}
|
15
|
+
var lb=hb,$a={},B=function(a){return ab(a,function(){for(var b=0,c=ma(String(lb)).split("."),d=ma(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",k=d[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];if(0==g[0].length&&0==k[0].length)break;b=ua(0==g[1].length?0:parseInt(g[1],10),0==k[1].length?0:parseInt(k[1],10))||ua(0==g[2].length,0==k[2].length)||ua(g[2],k[2]);g=g[3];k=k[3]}while(0==b)}return 0<=b})},mb;var nb=l.document;
|
16
|
+
mb=nb&&z?gb()||("CSS1Compat"==nb.compatMode?parseInt(lb,10):5):void 0;var ob=function(a){return Da(a,function(a){a=a.toString(16);return 1<a.length?a:"0"+a}).join("")};var pb=null,qb=null,sb=function(a){var b="";rb(a,function(a){b+=String.fromCharCode(a)});return b},rb=function(a,b){function c(b){for(;d<a.length;){var c=a.charAt(d++),e=qb[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}tb();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),k=c(64);if(64===k&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=k&&b(g<<6&192|k))}},tb=function(){if(!pb){pb={};qb={};for(var a=0;65>a;a++)pb[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),
|
17
|
+
qb[pb[a]]=a,62<=a&&(qb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}};var ub=function(){this.za=-1};var xb=function(a,b){this.za=64;this.Wb=l.Uint8Array?new Uint8Array(this.za):Array(this.za);this.Ac=this.$a=0;this.h=[];this.Ze=a;this.Ld=b;this.Af=l.Int32Array?new Int32Array(64):Array(64);void 0!==vb||(vb=l.Int32Array?new Int32Array(wb):wb);this.reset()},vb;t(xb,ub);for(var yb=[],zb=0;63>zb;zb++)yb[zb]=0;var Ab=La(128,yb);xb.prototype.reset=function(){this.Ac=this.$a=0;this.h=l.Int32Array?new Int32Array(this.Ld):Ma(this.Ld)};
|
18
|
+
var Bb=function(a){var b=a.Wb;w(b.length==a.za);for(var c=a.Af,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){var e=c[b-15]|0,d=c[b-2]|0,f=(c[b-16]|0)+((e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)|0,g=(c[b-7]|0)+((d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10)|0;c[b]=f+g|0}for(var d=a.h[0]|0,e=a.h[1]|0,k=a.h[2]|0,n=a.h[3]|0,A=a.h[4]|0,Xa=a.h[5]|0,Gb=a.h[6]|0,f=a.h[7]|0,b=0;64>b;b++)var gh=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&k^e&k)|0,g=A&Xa^~A&Gb,f=f+((A>>>6|
|
19
|
+
A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))|0,g=g+(vb[b]|0)|0,g=f+(g+(c[b]|0)|0)|0,f=Gb,Gb=Xa,Xa=A,A=n+g|0,n=k,k=e,e=d,d=g+gh|0;a.h[0]=a.h[0]+d|0;a.h[1]=a.h[1]+e|0;a.h[2]=a.h[2]+k|0;a.h[3]=a.h[3]+n|0;a.h[4]=a.h[4]+A|0;a.h[5]=a.h[5]+Xa|0;a.h[6]=a.h[6]+Gb|0;a.h[7]=a.h[7]+f|0};
|
20
|
+
xb.prototype.update=function(a,b){void 0===b&&(b=a.length);var c=0,d=this.$a;if(p(a))for(;c<b;)this.Wb[d++]=a.charCodeAt(c++),d==this.za&&(Bb(this),d=0);else if(ea(a))for(;c<b;){var e=a[c++];if(!("number"==typeof e&&0<=e&&255>=e&&e==(e|0)))throw Error("message must be a byte array");this.Wb[d++]=e;d==this.za&&(Bb(this),d=0)}else throw Error("message must be string or array");this.$a=d;this.Ac+=b};
|
21
|
+
xb.prototype.digest=function(){var a=[],b=8*this.Ac;56>this.$a?this.update(Ab,56-this.$a):this.update(Ab,this.za-(this.$a-56));for(var c=63;56<=c;c--)this.Wb[c]=b&255,b/=256;Bb(this);for(c=b=0;c<this.Ze;c++)for(var d=24;0<=d;d-=8)a[b++]=this.h[c]>>d&255;return a};
|
22
|
+
var wb=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,
|
23
|
+
4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var Db=function(){xb.call(this,8,Cb)};t(Db,xb);var Cb=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];var Eb=!z||9<=Number(mb),Fb=z&&!B("9");!fb||B("528");eb&&B("1.9b")||z&&B("8")||bb&&B("9.5")||fb&&B("528");eb&&!B("8")||z&&B("9");var Hb=function(){this.Ba=this.Ba;this.nc=this.nc};Hb.prototype.Ba=!1;Hb.prototype.isDisposed=function(){return this.Ba};Hb.prototype.Wa=function(){if(this.nc)for(;this.nc.length;)this.nc.shift()()};var Ib=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.gb=!1;this.Wd=!0};Ib.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Wd=!1};var Jb=function(a,b){Ib.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.Xa=this.state=null;a&&this.init(a,b)};t(Jb,Ib);
|
24
|
+
Jb.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(eb){var e;a:{try{Za(b.nodeName);e=!0;break a}catch(f){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;null===d?(this.offsetX=fb||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=fb||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:
|
25
|
+
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);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.Xa=
|
26
|
+
a;a.defaultPrevented&&this.preventDefault()};Jb.prototype.preventDefault=function(){Jb.pd.preventDefault.call(this);var a=this.Xa;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Fb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Jb.prototype.Ee=function(){return this.Xa};var Kb="closure_listenable_"+(1E6*Math.random()|0),Lb=0;var Mb=function(a,b,c,d,e){this.listener=a;this.rc=null;this.src=b;this.type=c;this.capture=!!d;this.dc=e;this.key=++Lb;this.lb=this.Vb=!1},Nb=function(a){a.lb=!0;a.listener=null;a.rc=null;a.src=null;a.dc=null};var Ob=function(a){this.src=a;this.D={};this.Rb=0};Ob.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.D[f];a||(a=this.D[f]=[],this.Rb++);var g=Pb(a,b,d,e);-1<g?(b=a[g],c||(b.Vb=!1)):(b=new Mb(b,this.src,f,!!d,e),b.Vb=c,a.push(b));return b};Ob.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.D))return!1;var e=this.D[a];b=Pb(e,b,c,d);return-1<b?(Nb(e[b]),Ia(e,b),0==e.length&&(delete this.D[a],this.Rb--),!0):!1};
|
27
|
+
var Qb=function(a,b){var c=b.type;c in a.D&&Ja(a.D[c],b)&&(Nb(b),0==a.D[c].length&&(delete a.D[c],a.Rb--))};Ob.prototype.Oc=function(a,b,c,d){a=this.D[a.toString()];var e=-1;a&&(e=Pb(a,b,c,d));return-1<e?a[e]:null};var Pb=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.lb&&f.listener==b&&f.capture==!!c&&f.dc==d)return e}return-1};var Rb="closure_lm_"+(1E6*Math.random()|0),Sb={},Tb=0,Ub=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)Ub(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?a.listen(b,c,d,e):Wb(a,b,c,!1,d,e)},Wb=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=!!e,k=Xb(a);k||(a[Rb]=k=new Ob(a));c=k.add(b,c,d,e,f);if(!c.rc){d=Yb();c.rc=d;d.src=a;d.listener=c;if(a.addEventListener)a.addEventListener(b.toString(),d,g);else if(a.attachEvent)a.attachEvent(Zb(b.toString()),d);else throw Error("addEventListener and attachEvent are unavailable.");
|
28
|
+
Tb++}},Yb=function(){var a=$b,b=Eb?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b},ac=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)ac(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?bc(a,b,c,d,e):Wb(a,b,c,!0,d,e)},cc=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)cc(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?a.aa.remove(String(b),c,d,e):a&&(a=Xb(a))&&(b=a.Oc(b,c,!!d,e))&&dc(b)},dc=function(a){if(!fa(a)&&a&&!a.lb){var b=a.src;if(b&&
|
29
|
+
b[Kb])Qb(b.aa,a);else{var c=a.type,d=a.rc;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(Zb(c),d);Tb--;(c=Xb(b))?(Qb(c,a),0==c.Rb&&(c.src=null,b[Rb]=null)):Nb(a)}}},Zb=function(a){return a in Sb?Sb[a]:Sb[a]="on"+a},fc=function(a,b,c,d){var e=!0;if(a=Xb(a))if(b=a.D[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.lb&&(f=ec(f,d),e=e&&!1!==f)}return e},ec=function(a,b){var c=a.listener,d=a.dc||a.src;a.Vb&&dc(a);return c.call(d,
|
30
|
+
b)},$b=function(a,b){if(a.lb)return!0;if(!Eb){if(!b)a:{b=["window","event"];for(var c=l,d;d=b.shift();)if(null!=c[d])c=c[d];else{b=null;break a}b=c}d=b;b=new Jb(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(g){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.currentTarget;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;!b.gb&&0<=e;e--){b.currentTarget=d[e];var f=fc(d[e],a,!0,b),c=c&&f}for(e=0;!b.gb&&e<d.length;e++)b.currentTarget=
|
31
|
+
d[e],f=fc(d[e],a,!1,b),c=c&&f}return c}return ec(a,new Jb(b,this))},Xb=function(a){a=a[Rb];return a instanceof Ob?a:null},gc="__closure_events_fn_"+(1E9*Math.random()>>>0),Vb=function(a){w(a,"Listener can not be null.");if(q(a))return a;w(a.handleEvent,"An object listener must have handleEvent method.");a[gc]||(a[gc]=function(b){return a.handleEvent(b)});return a[gc]};var hc=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/;var jc=function(){this.xc="";this.me=ic};jc.prototype.hc=!0;jc.prototype.bc=function(){return this.xc};jc.prototype.toString=function(){return"Const{"+this.xc+"}"};var kc=function(a){if(a instanceof jc&&a.constructor===jc&&a.me===ic)return a.xc;xa("expected object of type Const, got '"+a+"'");return"type_error:Const"},ic={},lc=function(a){var b=new jc;b.xc=a;return b};lc("");var nc=function(){this.qc="";this.ne=mc};nc.prototype.hc=!0;nc.prototype.bc=function(){return this.qc};nc.prototype.toString=function(){return"TrustedResourceUrl{"+this.qc+"}"};var mc={};var pc=function(){this.ma="";this.le=oc};pc.prototype.hc=!0;pc.prototype.bc=function(){return this.ma};pc.prototype.toString=function(){return"SafeUrl{"+this.ma+"}"};
|
32
|
+
var qc=function(a){if(a instanceof pc&&a.constructor===pc&&a.le===oc)return a.ma;xa("expected object of type SafeUrl, got '"+a+"' of type "+m(a));return"type_error:SafeUrl"},rc=/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/i,tc=function(a){if(a instanceof pc)return a;a=a.hc?a.bc():String(a);rc.test(a)||(a="about:invalid#zClosurez");return sc(a)},oc={},sc=function(a){var b=new pc;b.ma=a;return b};sc("about:blank");var vc=function(){this.ma="";this.ke=uc};vc.prototype.hc=!0;vc.prototype.bc=function(){return this.ma};vc.prototype.toString=function(){return"SafeHtml{"+this.ma+"}"};var wc=function(a){if(a instanceof vc&&a.constructor===vc&&a.ke===uc)return a.ma;xa("expected object of type SafeHtml, got '"+a+"' of type "+m(a));return"type_error:SafeHtml"},uc={};vc.prototype.Pe=function(a){this.ma=a;return this};var xc="StopIteration"in l?l.StopIteration:{message:"StopIteration",stack:""},yc=function(){};yc.prototype.next=function(){throw xc;};yc.prototype.oe=function(){return this};var zc=function(a,b){this.ba={};this.w=[];this.sb=this.o=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};zc.prototype.X=function(){Ac(this);for(var a=[],b=0;b<this.w.length;b++)a.push(this.ba[this.w[b]]);return a};zc.prototype.ka=function(){Ac(this);return this.w.concat()};zc.prototype.ub=function(a){return Bc(this.ba,a)};
|
33
|
+
zc.prototype.remove=function(a){return Bc(this.ba,a)?(delete this.ba[a],this.o--,this.sb++,this.w.length>2*this.o&&Ac(this),!0):!1};var Ac=function(a){if(a.o!=a.w.length){for(var b=0,c=0;b<a.w.length;){var d=a.w[b];Bc(a.ba,d)&&(a.w[c++]=d);b++}a.w.length=c}if(a.o!=a.w.length){for(var e={},c=b=0;b<a.w.length;)d=a.w[b],Bc(e,d)||(a.w[c++]=d,e[d]=1),b++;a.w.length=c}};h=zc.prototype;h.get=function(a,b){return Bc(this.ba,a)?this.ba[a]:b};
|
34
|
+
h.set=function(a,b){Bc(this.ba,a)||(this.o++,this.w.push(a),this.sb++);this.ba[a]=b};h.addAll=function(a){var b;a instanceof zc?(b=a.ka(),a=a.X()):(b=Pa(a),a=Oa(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.ka(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new zc(this)};
|
35
|
+
h.oe=function(a){Ac(this);var b=0,c=this.sb,d=this,e=new yc;e.next=function(){if(c!=d.sb)throw Error("The map has changed since the iterator was created");if(b>=d.w.length)throw xc;var e=d.w[b++];return a?e:d.ba[e]};return e};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Cc=function(a){if(a.X&&"function"==typeof a.X)return a.X();if(p(a))return a.split("");if(ea(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Oa(a)},Dc=function(a){if(a.ka&&"function"==typeof a.ka)return a.ka();if(!a.X||"function"!=typeof a.X){if(ea(a)||p(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return Pa(a)}},Ec=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);else if(ea(a)||p(a))x(a,b,void 0);else for(var c=Dc(a),d=Cc(a),e=
|
36
|
+
d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)};var Fc=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Fc.prototype.Cd=null;var Gc=0;Fc.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Gc++;d||ka();this.Bb=a;this.We=b;delete this.Cd};Fc.prototype.$d=function(a){this.Bb=a};var Hc=function(a){this.Xe=a;this.Id=this.Jc=this.Bb=this.s=null},Ic=function(a,b){this.name=a;this.value=b};Ic.prototype.toString=function(){return this.name};var Jc=new Ic("SEVERE",1E3),Kc=new Ic("CONFIG",700),Lc=new Ic("FINE",500);Hc.prototype.getParent=function(){return this.s};Hc.prototype.$d=function(a){this.Bb=a};var Mc=function(a){if(a.Bb)return a.Bb;if(a.s)return Mc(a.s);xa("Root logger has no level set.");return null};
|
37
|
+
Hc.prototype.log=function(a,b,c){if(a.value>=Mc(this).value)for(q(b)&&(b=b()),a=new Fc(a,String(b),this.Xe),c&&(a.Cd=c),c="log:"+a.We,l.console&&(l.console.timeStamp?l.console.timeStamp(c):l.console.markTimeline&&l.console.markTimeline(c)),l.msWriteProfilerMark&&l.msWriteProfilerMark(c),c=this;c;){var d=c,e=a;if(d.Id)for(var f=0;b=d.Id[f];f++)b(e);c=c.getParent()}};
|
38
|
+
var Nc={},Oc=null,Pc=function(a){Oc||(Oc=new Hc(""),Nc[""]=Oc,Oc.$d(Kc));var b;if(!(b=Nc[a])){b=new Hc(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Pc(a.substr(0,c));c.Jc||(c.Jc={});c.Jc[d]=b;b.s=c;Nc[a]=b}return b};var C=function(a,b){a&&a.log(Lc,b,void 0)};var Sc=function(a){var b=[];Qc(new Rc,a,b);return b.join("")},Rc=function(){this.tc=void 0},Qc=function(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(da(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),e=d[f],Qc(a,a.tc?a.tc.call(d,String(f),e):e,c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");f="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(e=b[d],"function"!=typeof e&&(c.push(f),
|
39
|
+
Tc(d,c),c.push(":"),Qc(a,a.tc?a.tc.call(b,d,e):e,c),f=","));c.push("}");return}}switch(typeof b){case "string":Tc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}},Uc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Vc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,
|
40
|
+
Tc=function(a,b){b.push('"',a.replace(Vc,function(a){var b=Uc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Uc[a]=b);return b}),'"')};var Wc=function(){};Wc.prototype.td=null;var Xc=function(a){return a.td||(a.td=a.Uc())};var Yc,Zc=function(){};t(Zc,Wc);Zc.prototype.Xb=function(){var a=$c(this);return a?new ActiveXObject(a):new XMLHttpRequest};Zc.prototype.Uc=function(){var a={};$c(this)&&(a[0]=!0,a[1]=!0);return a};
|
41
|
+
var $c=function(a){if(!a.Kd&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Kd=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Kd};Yc=new Zc;var ad=function(){};t(ad,Wc);ad.prototype.Xb=function(){var a=new XMLHttpRequest;if("withCredentials"in a)return a;if("undefined"!=typeof XDomainRequest)return new bd;throw Error("Unsupported browser");};ad.prototype.Uc=function(){return{}};
|
42
|
+
var bd=function(){this.qa=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseText="";this.status=-1;this.statusText=this.responseXML=null;this.qa.onload=r(this.Ge,this);this.qa.onerror=r(this.Hd,this);this.qa.onprogress=r(this.He,this);this.qa.ontimeout=r(this.Ie,this)};h=bd.prototype;h.open=function(a,b,c){if(null!=c&&!c)throw Error("Only async requests are supported.");this.qa.open(a,b)};
|
43
|
+
h.send=function(a){if(a)if("string"==typeof a)this.qa.send(a);else throw Error("Only string data is supported");else this.qa.send()};h.abort=function(){this.qa.abort()};h.setRequestHeader=function(){};h.Ge=function(){this.status=200;this.responseText=this.qa.responseText;cd(this,4)};h.Hd=function(){this.status=500;this.responseText="";cd(this,4)};h.Ie=function(){this.Hd()};h.He=function(){this.status=200;cd(this,1)};var cd=function(a,b){a.readyState=b;if(a.onreadystatechange)a.onreadystatechange()};!eb&&!z||z&&9<=Number(mb)||eb&&B("1.9.1");z&&B("9");var ed=function(a,b){Na(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:dd.hasOwnProperty(d)?a.setAttribute(dd[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})},dd={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"};var fd=function(a,b,c){this.Te=c;this.ue=a;this.jf=b;this.mc=0;this.ec=null};fd.prototype.get=function(){var a;0<this.mc?(this.mc--,a=this.ec,this.ec=a.next,a.next=null):a=this.ue();return a};fd.prototype.put=function(a){this.jf(a);this.mc<this.Te&&(this.mc++,a.next=this.ec,this.ec=a)};var gd=function(a){l.setTimeout(function(){throw a;},0)},hd,id=function(){var a=l.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!y("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,
|
44
|
+
a=r(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!y("Trident")&&!y("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.wd;c.wd=null;a()}};return function(a){d.next={wd:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?
|
45
|
+
function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){l.setTimeout(a,0)}};var jd=function(){this.Dc=this.Ra=null},ld=new fd(function(){return new kd},function(a){a.reset()},100);jd.prototype.add=function(a,b){var c=ld.get();c.set(a,b);this.Dc?this.Dc.next=c:(w(!this.Ra),this.Ra=c);this.Dc=c};jd.prototype.remove=function(){var a=null;this.Ra&&(a=this.Ra,this.Ra=this.Ra.next,this.Ra||(this.Dc=null),a.next=null);return a};var kd=function(){this.next=this.scope=this.Nc=null};kd.prototype.set=function(a,b){this.Nc=a;this.scope=b;this.next=null};
|
46
|
+
kd.prototype.reset=function(){this.next=this.scope=this.Nc=null};var qd=function(a,b){md||nd();od||(md(),od=!0);pd.add(a,b)},md,nd=function(){if(-1!=String(l.Promise).indexOf("[native code]")){var a=l.Promise.resolve(void 0);md=function(){a.then(rd)}}else md=function(){var a=rd;!q(l.setImmediate)||l.Window&&l.Window.prototype&&!y("Edge")&&l.Window.prototype.setImmediate==l.setImmediate?(hd||(hd=id()),hd(a)):l.setImmediate(a)}},od=!1,pd=new jd,rd=function(){for(var a;a=pd.remove();){try{a.Nc.call(a.scope)}catch(b){gd(b)}ld.put(a)}od=!1};var sd=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},td=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var D=function(a,b){this.M=0;this.na=void 0;this.Ua=this.ja=this.s=null;this.cc=this.Mc=!1;if(a!=ba)try{var c=this;a.call(b,function(a){ud(c,2,a)},function(a){if(!(a instanceof vd))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(e){}ud(c,3,a)})}catch(d){ud(this,3,d)}},wd=function(){this.next=this.context=this.bb=this.Ja=this.child=null;this.tb=!1};wd.prototype.reset=function(){this.context=this.bb=this.Ja=this.child=null;this.tb=!1};
|
47
|
+
var xd=new fd(function(){return new wd},function(a){a.reset()},100),yd=function(a,b,c){var d=xd.get();d.Ja=a;d.bb=b;d.context=c;return d},E=function(a){if(a instanceof D)return a;var b=new D(ba);ud(b,2,a);return b},F=function(a){return new D(function(b,c){c(a)})},Ad=function(a,b,c){zd(a,b,c,null)||qd(ja(b,a))},Bd=function(a){return new D(function(b){var c=a.length,d=[];if(c)for(var e=function(a,e,f){c--;d[a]=e?{Ce:!0,value:f}:{Ce:!1,reason:f};0==c&&b(d)},f=0,g;f<a.length;f++)g=a[f],Ad(g,ja(e,f,!0),
|
48
|
+
ja(e,f,!1));else b(d)})};D.prototype.then=function(a,b,c){null!=a&&Aa(a,"opt_onFulfilled should be a function.");null!=b&&Aa(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return Cd(this,q(a)?a:null,q(b)?b:null,c)};sd(D);var Ed=function(a,b){b=yd(b,b,void 0);b.tb=!0;Dd(a,b);return a};D.prototype.f=function(a,b){return Cd(this,null,a,b)};D.prototype.cancel=function(a){0==this.M&&qd(function(){var b=new vd(a);Fd(this,b)},this)};
|
49
|
+
var Fd=function(a,b){if(0==a.M)if(a.s){var c=a.s;if(c.ja){for(var d=0,e=null,f=null,g=c.ja;g&&(g.tb||(d++,g.child==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(0==c.M&&1==d?Fd(c,b):(f?(d=f,w(c.ja),w(null!=d),d.next==c.Ua&&(c.Ua=d),d.next=d.next.next):Gd(c),Hd(c,e,3,b)))}a.s=null}else ud(a,3,b)},Dd=function(a,b){a.ja||2!=a.M&&3!=a.M||Id(a);w(null!=b.Ja);a.Ua?a.Ua.next=b:a.ja=b;a.Ua=b},Cd=function(a,b,c,d){var e=yd(null,null,null);e.child=new D(function(a,g){e.Ja=b?function(c){try{var e=b.call(d,c);a(e)}catch(A){g(A)}}:
|
50
|
+
a;e.bb=c?function(b){try{var e=c.call(d,b);void 0===e&&b instanceof vd?g(b):a(e)}catch(A){g(A)}}:g});e.child.s=a;Dd(a,e);return e.child};D.prototype.xf=function(a){w(1==this.M);this.M=0;ud(this,2,a)};D.prototype.yf=function(a){w(1==this.M);this.M=0;ud(this,3,a)};
|
51
|
+
var ud=function(a,b,c){0==a.M&&(a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself")),a.M=1,zd(c,a.xf,a.yf,a)||(a.na=c,a.M=b,a.s=null,Id(a),3!=b||c instanceof vd||Jd(a,c)))},zd=function(a,b,c,d){if(a instanceof D)return null!=b&&Aa(b,"opt_onFulfilled should be a function."),null!=c&&Aa(c,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"),Dd(a,yd(b||ba,c||null,d)),!0;if(td(a))return a.then(b,c,d),!0;if(ga(a))try{var e=a.then;if(q(e))return Kd(a,
|
52
|
+
e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1},Kd=function(a,b,c,d,e){var f=!1,g=function(a){f||(f=!0,c.call(e,a))},k=function(a){f||(f=!0,d.call(e,a))};try{b.call(a,g,k)}catch(n){k(n)}},Id=function(a){a.Mc||(a.Mc=!0,qd(a.xe,a))},Gd=function(a){var b=null;a.ja&&(b=a.ja,a.ja=b.next,b.next=null);a.ja||(a.Ua=null);null!=b&&w(null!=b.Ja);return b};D.prototype.xe=function(){for(var a;a=Gd(this);)Hd(this,a,this.M,this.na);this.Mc=!1};
|
53
|
+
var Hd=function(a,b,c,d){if(3==c&&b.bb&&!b.tb)for(;a&&a.cc;a=a.s)a.cc=!1;if(b.child)b.child.s=null,Ld(b,c,d);else try{b.tb?b.Ja.call(b.context):Ld(b,c,d)}catch(e){Md.call(null,e)}xd.put(b)},Ld=function(a,b,c){2==b?a.Ja.call(a.context,c):a.bb&&a.bb.call(a.context,c)},Jd=function(a,b){a.cc=!0;qd(function(){a.cc&&Md.call(null,b)})},Md=gd,vd=function(a){u.call(this,a)};t(vd,u);vd.prototype.name="cancel";/*
|
54
|
+
Portions of this code are from MochiKit, received by
|
55
|
+
The Closure Authors under the MIT license. All other code is Copyright
|
56
|
+
2005-2009 The Closure Authors. All Rights Reserved.
|
57
|
+
*/
|
58
|
+
var Nd=function(a,b){this.uc=[];this.Qd=a;this.zd=b||null;this.wb=this.Ya=!1;this.na=void 0;this.md=this.sd=this.Hc=!1;this.Bc=0;this.s=null;this.Ic=0};Nd.prototype.cancel=function(a){if(this.Ya)this.na instanceof Nd&&this.na.cancel();else{if(this.s){var b=this.s;delete this.s;a?b.cancel(a):(b.Ic--,0>=b.Ic&&b.cancel())}this.Qd?this.Qd.call(this.zd,this):this.md=!0;this.Ya||Od(this,new Pd)}};Nd.prototype.xd=function(a,b){this.Hc=!1;Qd(this,a,b)};
|
59
|
+
var Qd=function(a,b,c){a.Ya=!0;a.na=c;a.wb=!b;Rd(a)},Td=function(a){if(a.Ya){if(!a.md)throw new Sd;a.md=!1}};Nd.prototype.callback=function(a){Td(this);Ud(a);Qd(this,!0,a)};
|
60
|
+
var Od=function(a,b){Td(a);Ud(b);Qd(a,!1,b)},Ud=function(a){w(!(a instanceof Nd),"An execution sequence may not be initiated with a blocking Deferred.")},Yd=function(a){var b=Vd("https://apis.google.com/js/client.js?onload="+Wd);Xd(b,null,a,void 0)},Xd=function(a,b,c,d){w(!a.sd,"Blocking Deferreds can not be re-used");a.uc.push([b,c,d]);a.Ya&&Rd(a)};Nd.prototype.then=function(a,b,c){var d,e,f=new D(function(a,b){d=a;e=b});Xd(this,d,function(a){a instanceof Pd?f.cancel():e(a)});return f.then(a,b,c)};
|
61
|
+
sd(Nd);
|
62
|
+
var Zd=function(a){return Ea(a.uc,function(a){return q(a[1])})},Rd=function(a){if(a.Bc&&a.Ya&&Zd(a)){var b=a.Bc,c=$d[b];c&&(l.clearTimeout(c.xb),delete $d[b]);a.Bc=0}a.s&&(a.s.Ic--,delete a.s);for(var b=a.na,d=c=!1;a.uc.length&&!a.Hc;){var e=a.uc.shift(),f=e[0],g=e[1],e=e[2];if(f=a.wb?g:f)try{var k=f.call(e||a.zd,b);void 0!==k&&(a.wb=a.wb&&(k==b||k instanceof Error),a.na=b=k);if(td(b)||"function"===typeof l.Promise&&b instanceof l.Promise)d=!0,a.Hc=!0}catch(n){b=n,a.wb=!0,Zd(a)||(c=!0)}}a.na=b;d&&
|
63
|
+
(k=r(a.xd,a,!0),d=r(a.xd,a,!1),b instanceof Nd?(Xd(b,k,d),b.sd=!0):b.then(k,d));c&&(b=new ae(b),$d[b.xb]=b,a.Bc=b.xb)},Sd=function(){u.call(this)};t(Sd,u);Sd.prototype.message="Deferred has already fired";Sd.prototype.name="AlreadyCalledError";var Pd=function(){u.call(this)};t(Pd,u);Pd.prototype.message="Deferred was canceled";Pd.prototype.name="CanceledError";var ae=function(a){this.xb=l.setTimeout(r(this.wf,this),0);this.O=a};
|
64
|
+
ae.prototype.wf=function(){w($d[this.xb],"Cannot throw an error that is not scheduled.");delete $d[this.xb];throw this.O;};var $d={};var Vd=function(a){var b=new nc;b.qc=a;return be(b)},be=function(a){var b={},c=b.document||document,d;a instanceof nc&&a.constructor===nc&&a.ne===mc?d=a.qc:(xa("expected object of type TrustedResourceUrl, got '"+a+"' of type "+m(a)),d="type_error:TrustedResourceUrl");var e=document.createElement("SCRIPT");a={Xd:e,Qb:void 0};var f=new Nd(ce,a),g=null,k=null!=b.timeout?b.timeout:5E3;0<k&&(g=window.setTimeout(function(){de(e,!0);Od(f,new ee(1,"Timeout reached for loading script "+d))},k),a.Qb=g);e.onload=
|
65
|
+
e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(de(e,b.If||!1,g),f.callback(null))};e.onerror=function(){de(e,!0,g);Od(f,new ee(0,"Error while loading script "+d))};a=b.attributes||{};Ua(a,{type:"text/javascript",charset:"UTF-8",src:d});ed(e,a);fe(c).appendChild(e);return f},fe=function(a){var b;return(b=(a||document).getElementsByTagName("HEAD"))&&0!=b.length?b[0]:a.documentElement},ce=function(){if(this&&this.Xd){var a=this.Xd;a&&"SCRIPT"==a.tagName&&
|
66
|
+
de(a,!0,this.Qb)}},de=function(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ba;a.onerror=ba;a.onreadystatechange=ba;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)},ee=function(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);u.call(this,c);this.code=a};t(ee,u);var ge=function(){Hb.call(this);this.aa=new Ob(this);this.pe=this;this.$c=null};t(ge,Hb);ge.prototype[Kb]=!0;h=ge.prototype;h.addEventListener=function(a,b,c,d){Ub(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){cc(this,a,b,c,d)};
|
67
|
+
h.dispatchEvent=function(a){he(this);var b,c=this.$c;if(c){b=[];for(var d=1;c;c=c.$c)b.push(c),w(1E3>++d,"infinite loop")}c=this.pe;d=a.type||a;if(p(a))a=new Ib(a,c);else if(a instanceof Ib)a.target=a.target||c;else{var e=a;a=new Ib(d,c);Ua(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.gb&&0<=g;g--)f=a.currentTarget=b[g],e=ie(f,d,!0,a)&&e;a.gb||(f=a.currentTarget=c,e=ie(f,d,!0,a)&&e,a.gb||(e=ie(f,d,!1,a)&&e));if(b)for(g=0;!a.gb&&g<b.length;g++)f=a.currentTarget=b[g],e=ie(f,d,!1,a)&&e;return e};
|
68
|
+
h.Wa=function(){ge.pd.Wa.call(this);if(this.aa){var a=this.aa,b=0,c;for(c in a.D){for(var d=a.D[c],e=0;e<d.length;e++)++b,Nb(d[e]);delete a.D[c];a.Rb--}}this.$c=null};h.listen=function(a,b,c,d){he(this);return this.aa.add(String(a),b,!1,c,d)};
|
69
|
+
var bc=function(a,b,c,d,e){a.aa.add(String(b),c,!0,d,e)},ie=function(a,b,c,d){b=a.aa.D[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.lb&&g.capture==c){var k=g.listener,n=g.dc||g.src;g.Vb&&Qb(a.aa,g);e=!1!==k.call(n,d)&&e}}return e&&0!=d.Wd};ge.prototype.Oc=function(a,b,c,d){return this.aa.Oc(String(a),b,c,d)};var he=function(a){w(a.aa,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var je=function(a,b,c){if(q(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)},ke=function(a){var b=null;return(new D(function(c,d){b=je(function(){c(void 0)},a);-1==b&&d(Error("Failed to schedule timer."))})).f(function(a){l.clearTimeout(b);throw a;})};var le=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/,me=function(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e,f=null;0<=d?(e=a[c].substring(0,d),f=a[c].substring(d+1)):e=a[c];b(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}}};var G=function(a){ge.call(this);this.headers=new zc;this.Fc=a||null;this.ra=!1;this.Ec=this.b=null;this.Ab=this.Od=this.kc="";this.Fa=this.Sc=this.ic=this.Lc=!1;this.ob=0;this.zc=null;this.Vd="";this.Cc=this.ef=this.je=!1};t(G,ge);var ne=G.prototype,oe=Pc("goog.net.XhrIo");ne.T=oe;var pe=/^https?$/i,qe=["POST","PUT"];
|
70
|
+
G.prototype.send=function(a,b,c,d){if(this.b)throw Error("[goog.net.XhrIo] Object is active with another request="+this.kc+"; newUri="+a);b=b?b.toUpperCase():"GET";this.kc=a;this.Ab="";this.Od=b;this.Lc=!1;this.ra=!0;this.b=this.Fc?this.Fc.Xb():Yc.Xb();this.Ec=this.Fc?Xc(this.Fc):Xc(Yc);this.b.onreadystatechange=r(this.Sd,this);this.ef&&"onprogress"in this.b&&(this.b.onprogress=r(function(a){this.Rd(a,!0)},this),this.b.upload&&(this.b.upload.onprogress=r(this.Rd,this)));try{C(this.T,re(this,"Opening Xhr")),
|
71
|
+
this.Sc=!0,this.b.open(b,String(a),!0),this.Sc=!1}catch(f){C(this.T,re(this,"Error opening Xhr: "+f.message));this.O(5,f);return}a=c||"";var e=this.headers.clone();d&&Ec(d,function(a,b){e.set(b,a)});d=Ga(e.ka());c=l.FormData&&a instanceof l.FormData;!Ha(qe,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(a,b){this.b.setRequestHeader(b,a)},this);this.Vd&&(this.b.responseType=this.Vd);"withCredentials"in this.b&&this.b.withCredentials!==this.je&&(this.b.withCredentials=
|
72
|
+
this.je);try{se(this),0<this.ob&&(this.Cc=te(this.b),C(this.T,re(this,"Will abort after "+this.ob+"ms if incomplete, xhr2 "+this.Cc)),this.Cc?(this.b.timeout=this.ob,this.b.ontimeout=r(this.Qb,this)):this.zc=je(this.Qb,this.ob,this)),C(this.T,re(this,"Sending request")),this.ic=!0,this.b.send(a),this.ic=!1}catch(f){C(this.T,re(this,"Send error: "+f.message)),this.O(5,f)}};var te=function(a){return z&&B(9)&&fa(a.timeout)&&void 0!==a.ontimeout},Fa=function(a){return"content-type"==a.toLowerCase()};
|
73
|
+
G.prototype.Qb=function(){"undefined"!=typeof aa&&this.b&&(this.Ab="Timed out after "+this.ob+"ms, aborting",C(this.T,re(this,this.Ab)),this.dispatchEvent("timeout"),this.abort(8))};G.prototype.O=function(a,b){this.ra=!1;this.b&&(this.Fa=!0,this.b.abort(),this.Fa=!1);this.Ab=b;ue(this);ve(this)};var ue=function(a){a.Lc||(a.Lc=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
|
74
|
+
G.prototype.abort=function(){this.b&&this.ra&&(C(this.T,re(this,"Aborting")),this.ra=!1,this.Fa=!0,this.b.abort(),this.Fa=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ve(this))};G.prototype.Wa=function(){this.b&&(this.ra&&(this.ra=!1,this.Fa=!0,this.b.abort(),this.Fa=!1),ve(this,!0));G.pd.Wa.call(this)};G.prototype.Sd=function(){this.isDisposed()||(this.Sc||this.ic||this.Fa?we(this):this.af())};G.prototype.af=function(){we(this)};
|
75
|
+
var we=function(a){if(a.ra&&"undefined"!=typeof aa)if(a.Ec[1]&&4==xe(a)&&2==ye(a))C(a.T,re(a,"Local request error detected and ignored"));else if(a.ic&&4==xe(a))je(a.Sd,0,a);else if(a.dispatchEvent("readystatechange"),4==xe(a)){C(a.T,re(a,"Request complete"));a.ra=!1;try{var b=ye(a),c;a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.kc).match(le)[1]||null;if(!f&&l.self&&l.self.location)var g=l.self.location.protocol,
|
76
|
+
f=g.substr(0,g.length-1);e=!pe.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var k;try{k=2<xe(a)?a.b.statusText:""}catch(n){C(a.T,"Can not get status: "+n.message),k=""}a.Ab=k+" ["+ye(a)+"]";ue(a)}}finally{ve(a)}}};G.prototype.Rd=function(a,b){w("progress"===a.type,"goog.net.EventType.PROGRESS is of the same type as raw XHR progress.");this.dispatchEvent(ze(a,"progress"));this.dispatchEvent(ze(a,b?"downloadprogress":"uploadprogress"))};
|
77
|
+
var ze=function(a,b){return{type:b,lengthComputable:a.lengthComputable,loaded:a.loaded,total:a.total}},ve=function(a,b){if(a.b){se(a);var c=a.b,d=a.Ec[0]?ba:null;a.b=null;a.Ec=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(a=a.T)&&a.log(Jc,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},se=function(a){a.b&&a.Cc&&(a.b.ontimeout=null);fa(a.zc)&&(l.clearTimeout(a.zc),a.zc=null)},xe=function(a){return a.b?a.b.readyState:0},ye=function(a){try{return 2<xe(a)?
|
78
|
+
a.b.status:-1}catch(b){return-1}},Ae=function(a){try{return a.b?a.b.responseText:""}catch(b){return C(a.T,"Can not get responseText: "+b.message),""}},re=function(a,b){return b+" ["+a.Od+" "+a.kc+" "+ye(a)+"]"};var Be=function(a,b){this.$=this.Pa=this.da="";this.eb=null;this.Ea=this.ta="";this.R=this.Se=!1;var c;a instanceof Be?(this.R=void 0!==b?b:a.R,Ce(this,a.da),c=a.Pa,H(this),this.Pa=c,De(this,a.$),Ee(this,a.eb),Fe(this,a.ta),Ge(this,a.V.clone()),a=a.Ea,H(this),this.Ea=a):a&&(c=String(a).match(le))?(this.R=!!b,Ce(this,c[1]||"",!0),a=c[2]||"",H(this),this.Pa=He(a),De(this,c[3]||"",!0),Ee(this,c[4]),Fe(this,c[5]||"",!0),Ge(this,c[6]||"",!0),a=c[7]||"",H(this),this.Ea=He(a)):(this.R=!!b,this.V=new I(null,
|
79
|
+
0,this.R))};Be.prototype.toString=function(){var a=[],b=this.da;b&&a.push(Ie(b,Je,!0),":");var c=this.$;if(c||"file"==b)a.push("//"),(b=this.Pa)&&a.push(Ie(b,Je,!0),"@"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.eb,null!=c&&a.push(":",String(c));if(c=this.ta)this.$&&"/"!=c.charAt(0)&&a.push("/"),a.push(Ie(c,"/"==c.charAt(0)?Ke:Le,!0));(c=this.V.toString())&&a.push("?",c);(c=this.Ea)&&a.push("#",Ie(c,Me));return a.join("")};
|
80
|
+
Be.prototype.resolve=function(a){var b=this.clone(),c=!!a.da;c?Ce(b,a.da):c=!!a.Pa;if(c){var d=a.Pa;H(b);b.Pa=d}else c=!!a.$;c?De(b,a.$):c=null!=a.eb;d=a.ta;if(c)Ee(b,a.eb);else if(c=!!a.ta){if("/"!=d.charAt(0))if(this.$&&!this.ta)d="/"+d;else{var e=b.ta.lastIndexOf("/");-1!=e&&(d=b.ta.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(v(e,"./")||v(e,"/.")){for(var d=0==e.lastIndexOf("/",0),e=e.split("/"),f=[],g=0;g<e.length;){var k=e[g++];"."==k?d&&g==e.length&&f.push(""):".."==k?((1<f.length||
|
81
|
+
1==f.length&&""!=f[0])&&f.pop(),d&&g==e.length&&f.push("")):(f.push(k),d=!0)}d=f.join("/")}else d=e}c?Fe(b,d):c=""!==a.V.toString();c?Ge(b,a.V.clone()):c=!!a.Ea;c&&(a=a.Ea,H(b),b.Ea=a);return b};Be.prototype.clone=function(){return new Be(this)};
|
82
|
+
var Ce=function(a,b,c){H(a);a.da=c?He(b,!0):b;a.da&&(a.da=a.da.replace(/:$/,""))},De=function(a,b,c){H(a);a.$=c?He(b,!0):b},Ee=function(a,b){H(a);if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.eb=b}else a.eb=null},Fe=function(a,b,c){H(a);a.ta=c?He(b,!0):b},Ge=function(a,b,c){H(a);b instanceof I?(a.V=b,a.V.ld(a.R)):(c||(b=Ie(b,Ne)),a.V=new I(b,0,a.R))},J=function(a,b,c){H(a);a.V.set(b,c)},Oe=function(a,b){return a.V.get(b)},Pe=function(a,b){H(a);a.V.remove(b)},H=function(a){if(a.Se)throw Error("Tried to modify a read-only Uri");
|
83
|
+
};Be.prototype.ld=function(a){this.R=a;this.V&&this.V.ld(a);return this};
|
84
|
+
var Qe=function(a){return a instanceof Be?a.clone():new Be(a,void 0)},Re=function(a,b){var c=new Be(null,void 0);Ce(c,"https");a&&De(c,a);b&&Fe(c,b);return c},He=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},Ie=function(a,b,c){return p(a)?(a=encodeURI(a).replace(b,Se),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},Se=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},Je=/[#\/\?@]/g,Le=/[\#\?:]/g,Ke=/[\#\?]/g,Ne=/[\#\?@]/g,
|
85
|
+
Me=/#/g,I=function(a,b,c){this.o=this.l=null;this.N=a||null;this.R=!!c},Te=function(a){a.l||(a.l=new zc,a.o=0,a.N&&me(a.N,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))},Ve=function(a){var b=Dc(a);if("undefined"==typeof b)throw Error("Keys are undefined");var c=new I(null,0,void 0);a=Cc(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];da(f)?Ue(c,e,f):c.add(e,f)}return c};h=I.prototype;
|
86
|
+
h.add=function(a,b){Te(this);this.N=null;a=this.P(a);var c=this.l.get(a);c||this.l.set(a,c=[]);c.push(b);this.o=ya(this.o)+1;return this};h.remove=function(a){Te(this);a=this.P(a);return this.l.ub(a)?(this.N=null,this.o=ya(this.o)-this.l.get(a).length,this.l.remove(a)):!1};h.ub=function(a){Te(this);a=this.P(a);return this.l.ub(a)};h.ka=function(){Te(this);for(var a=this.l.X(),b=this.l.ka(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};
|
87
|
+
h.X=function(a){Te(this);var b=[];if(p(a))this.ub(a)&&(b=La(b,this.l.get(this.P(a))));else{a=this.l.X();for(var c=0;c<a.length;c++)b=La(b,a[c])}return b};h.set=function(a,b){Te(this);this.N=null;a=this.P(a);this.ub(a)&&(this.o=ya(this.o)-this.l.get(a).length);this.l.set(a,[b]);this.o=ya(this.o)+1;return this};h.get=function(a,b){a=a?this.X(a):[];return 0<a.length?String(a[0]):b};var Ue=function(a,b,c){a.remove(b);0<c.length&&(a.N=null,a.l.set(a.P(b),Ma(c)),a.o=ya(a.o)+c.length)};
|
88
|
+
I.prototype.toString=function(){if(this.N)return this.N;if(!this.l)return"";for(var a=[],b=this.l.ka(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.X(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.N=a.join("&")};I.prototype.clone=function(){var a=new I;a.N=this.N;this.l&&(a.l=this.l.clone(),a.o=this.o);return a};I.prototype.P=function(a){a=String(a);this.R&&(a=a.toLowerCase());return a};
|
89
|
+
I.prototype.ld=function(a){a&&!this.R&&(Te(this),this.N=null,this.l.forEach(function(a,c){var b=c.toLowerCase();c!=b&&(this.remove(c),Ue(this,b,a))},this));this.R=a};var We=function(){var a=K();return z&&!!mb&&11==mb||/Edge\/\d+/.test(a)},Xe=function(){return l.window&&l.window.location.href||""},Ye=function(a,b){b=b||l.window;var c="about:blank";a&&(c=qc(tc(a)));b.location.href=c},Ze=function(a,b){var c=[],d;for(d in a)d in b?typeof a[d]!=typeof b[d]?c.push(d):da(a[d])?Ra(a[d],b[d])||c.push(d):"object"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<Ze(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c},af=function(){var a;
|
90
|
+
a=K();a="Chrome"!=$e(a)?null:(a=a.match(/\sChrome\/(\d+)/i))&&2==a.length?parseInt(a[1],10):null;return a&&30>a?!1:!z||!mb||9<mb},bf=function(a){a=(a||K()).toLowerCase();return a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)?!0:!1},cf=function(a){a=a||l.window;try{a.close()}catch(b){}},df=function(a,b,c){var d=Math.floor(1E9*Math.random()).toString();b=b||500;c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-
|
91
|
+
b)/2;b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1};c=K().toLowerCase();d&&(b.target=d,v(c,"crios/")&&(b.target="_blank"));"Firefox"==$e(K())&&(a=a||"http://localhost",b.scrollbars=!0);var g;c=a||"about:blank";(d=b)||(d={});a=window;b=c instanceof pc?c:tc("undefined"!=typeof c.href?c.href:String(c));c=d.target||c.target;e=[];for(g in d)switch(g){case "width":case "height":case "top":case "left":e.push(g+"="+d[g]);break;case "target":case "noreferrer":break;
|
92
|
+
default:e.push(g+"="+(d[g]?1:0))}g=e.join(",");(y("iPhone")&&!y("iPod")&&!y("iPad")||y("iPad")||y("iPod"))&&a.navigator&&a.navigator.standalone&&c&&"_self"!=c?(g=a.document.createElement("A"),"undefined"!=typeof HTMLAnchorElement&&"undefined"!=typeof Location&&"undefined"!=typeof Element&&(e=g&&(g instanceof HTMLAnchorElement||!(g instanceof Location||g instanceof Element)),f=ga(g)?g.constructor.displayName||g.constructor.name||Object.prototype.toString.call(g):void 0===g?"undefined":null===g?"null":
|
93
|
+
typeof g,w(e,"Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s",f)),b=b instanceof pc?b:tc(b),g.href=qc(b),g.setAttribute("target",c),d.noreferrer&&g.setAttribute("rel","noreferrer"),d=document.createEvent("MouseEvent"),d.initMouseEvent("click",!0,!0,a,1),g.dispatchEvent(d),g={}):d.noreferrer?(g=a.open("",c,g),d=qc(b),g&&(db&&v(d,";")&&(d="'"+d.replace(/'/g,"%27")+"'"),g.opener=null,a=lc("b/12014412, meta tag with sanitized URL"),ta.test(d)&&(-1!=d.indexOf("&")&&(d=d.replace(na,
|
94
|
+
"&")),-1!=d.indexOf("<")&&(d=d.replace(oa,"<")),-1!=d.indexOf(">")&&(d=d.replace(pa,">")),-1!=d.indexOf('"')&&(d=d.replace(qa,""")),-1!=d.indexOf("'")&&(d=d.replace(ra,"'")),-1!=d.indexOf("\x00")&&(d=d.replace(sa,"�"))),d='<META HTTP-EQUIV="refresh" content="0; url='+d+'">',za(kc(a),"must provide justification"),w(!/^[\s\xa0]*$/.test(kc(a)),"must provide non-empty justification"),g.document.write(wc((new vc).Pe(d))),g.document.close())):g=a.open(qc(b),c,g);if(g)try{g.focus()}catch(k){}return g},
|
95
|
+
ef=function(a){return new D(function(b){var c=function(){ke(2E3).then(function(){if(!a||a.closed)b();else return c()})};return c()})},ff=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gf=function(){var a=null;return(new D(function(b){"complete"==l.document.readyState?b():(a=function(){b()},ac(window,"load",a))})).f(function(b){cc(window,"load",a);throw b;})},jf=function(){return hf(void 0)?gf().then(function(){return new D(function(a,b){var c=l.document,d=setTimeout(function(){b(Error("Cordova framework is not ready."))},
|
96
|
+
1E3);c.addEventListener("deviceready",function(){clearTimeout(d);a()},!1)})}):F(Error("Cordova must run in an Android or iOS file scheme."))},hf=function(a){a=a||K();return!("file:"!==kf()||!a.toLowerCase().match(/iphone|ipad|ipod|android/))},lf=function(){var a=l.window;try{return!(!a||a==a.top)}catch(b){return!1}},L=function(){return firebase.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":firebase.INTERNAL.hasOwnProperty("node")?"Node":"Browser"},mf=function(){var a=L();return"ReactNative"===
|
97
|
+
a||"Node"===a},$e=function(a){var b=a.toLowerCase();if(v(b,"opera/")||v(b,"opr/")||v(b,"opios/"))return"Opera";if(v(b,"iemobile"))return"IEMobile";if(v(b,"msie")||v(b,"trident/"))return"IE";if(v(b,"edge/"))return"Edge";if(v(b,"firefox/"))return"Firefox";if(v(b,"silk/"))return"Silk";if(v(b,"blackberry"))return"Blackberry";if(v(b,"webos"))return"Webos";if(!v(b,"safari/")||v(b,"chrome/")||v(b,"crios/")||v(b,"android"))if(!v(b,"chrome/")&&!v(b,"crios/")||v(b,"edge/")){if(v(b,"android"))return"Android";
|
98
|
+
if((a=a.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==a.length)return a[1]}else return"Chrome";else return"Safari";return"Other"},nf=function(a){var b=L();return("Browser"===b?$e(K()):b)+"/JsCore/"+a},K=function(){return l.navigator&&l.navigator.userAgent||""},M=function(a,b){a=a.split(".");b=b||l;for(var c=0;c<a.length&&"object"==typeof b&&null!=b;c++)b=b[a[c]];c!=a.length&&(b=void 0);return b},qf=function(){var a;if(a=(of()||"chrome-extension:"===kf()||hf()&&!1)&&!mf())a:{try{var b=l.localStorage,
|
99
|
+
c=pf();if(b){b.setItem(c,"1");b.removeItem(c);a=We()?!!l.indexedDB:!0;break a}}catch(d){}a=!1}return a},of=function(){return"http:"===kf()||"https:"===kf()},kf=function(){return l.location&&l.location.protocol||null},rf=function(a){a=a||K();return bf(a)||"Firefox"==$e(a)?!1:!0},sf=function(a){return"undefined"===typeof a?null:Sc(a)},tf=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b},uf=function(a){if(null!==a)return JSON.parse(a)},pf=function(a){return a?
|
100
|
+
a:""+Math.floor(1E9*Math.random()).toString()},vf=function(a){a=a||K();return"Safari"==$e(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0},wf=function(){var a=l.___jsl;if(a&&a.H)for(var b in a.H)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)for(var c=0;c<a.CP.length;c++)a.CP[c]=null},xf=function(){return l.navigator&&"boolean"===typeof l.navigator.onLine?l.navigator.onLine:!0},yf=function(a,b,c,d){if(a>b)throw Error("Short delay should be less than long delay!");
|
101
|
+
this.tf=a;this.Ve=b;a=c||K();d=d||L();this.Re=bf(a)||"ReactNative"===d};yf.prototype.get=function(){return this.Re?this.Ve:this.tf};
|
102
|
+
var zf=function(){var a=l.document;return a&&"undefined"!==typeof a.visibilityState?"visible"==a.visibilityState:!0},Af=function(){var a=l.document,b=null;return zf()||!a?E():(new D(function(c){b=function(){zf()&&(a.removeEventListener("visibilitychange",b,!1),c())};a.addEventListener("visibilitychange",b,!1)})).f(function(c){a.removeEventListener("visibilitychange",b,!1);throw c;})};var Bf;try{var Cf={};Object.defineProperty(Cf,"abcd",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(Cf,"abcd",{configurable:!0,enumerable:!0,value:2});Bf=2==Cf.abcd}catch(a){Bf=!1}
|
103
|
+
var N=function(a,b,c){Bf?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c},Df=function(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&N(a,c,b[c])},Ef=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},Ff=function(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0;c<b.length;c++){var d=a[b[c]];if(void 0===d||null===d||""===d)return!1}return!0},Gf=function(a){var b=a;if("object"==typeof a&&null!=a){var b="length"in a?[]:{},c;for(c in a)N(b,c,
|
104
|
+
Gf(a[c]))}return b};var Hf="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),If=["client_id","response_type","scope","redirect_uri","state"],Jf={Df:{Fb:500,Eb:600,providerId:"facebook.com",hd:If},Ef:{Fb:500,Eb:620,providerId:"github.com",hd:If},Ff:{Fb:515,Eb:680,providerId:"google.com",hd:If},Gf:{Fb:485,Eb:705,providerId:"twitter.com",hd:Hf}},Kf=function(a){for(var b in Jf)if(Jf[b].providerId==a)return Jf[b];return null};var O=function(a,b){this.code="auth/"+a;this.message=b||Lf[a]||""};t(O,Error);O.prototype.C=function(){return{code:this.code,message:this.message}};O.prototype.toJSON=function(){return this.C()};
|
105
|
+
var Mf=function(a){var b=a&&a.code;return b?new O(b.substring(5),a.message):null},Lf={"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.","cordova-not-ready":"Cordova framework is not ready.",
|
106
|
+
"cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.",
|
107
|
+
"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-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-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.",
|
108
|
+
"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.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.",
|
109
|
+
"invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","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.",
|
110
|
+
"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.","missing-iframe-start":"An internal error has occurred.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.",
|
111
|
+
"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.",
|
112
|
+
"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.",
|
113
|
+
"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.","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.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.",
|
114
|
+
"too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.",
|
115
|
+
"web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};var P=function(a,b,c,d,e){this.ga=a;this.F=b||null;this.qb=c||null;this.kd=d||null;this.O=e||null;if(this.qb||this.O){if(this.qb&&this.O)throw new O("invalid-auth-event");if(this.qb&&!this.kd)throw new O("invalid-auth-event");}else throw new O("invalid-auth-event");};P.prototype.ac=function(){return this.kd};P.prototype.getError=function(){return this.O};P.prototype.C=function(){return{type:this.ga,eventId:this.F,urlResponse:this.qb,sessionId:this.kd,error:this.O&&this.O.C()}};
|
116
|
+
var Nf=function(a){a=a||{};return a.type?new P(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&Mf(a.error)):null};var Of=function(a){var b="unauthorized-domain",c=void 0,d=Qe(a);a=d.$;d=d.da;"chrome-extension"==d?c=la("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=la("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=
|
117
|
+
"operation-not-supported-in-this-environment";O.call(this,b,c)};t(Of,O);var Pf=function(a){this.Ue=a.sub;ka();this.Yb=a.email||null};var Qf=function(a,b){if(b.idToken||b.accessToken)b.idToken&&N(this,"idToken",b.idToken),b.accessToken&&N(this,"accessToken",b.accessToken);else if(b.oauthToken&&b.oauthTokenSecret)N(this,"accessToken",b.oauthToken),N(this,"secret",b.oauthTokenSecret);else throw new O("internal-error","failed to construct a credential");N(this,"provider",a)};Qf.prototype.$b=function(a){return Rf(a,Sf(this))};Qf.prototype.Pd=function(a,b){var c=Sf(this);c.idToken=b;return Tf(a,c)};
|
118
|
+
var Sf=function(a){var b={};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.provider;return{postBody:Ve(b).toString(),requestUri:"http://localhost"}};Qf.prototype.C=function(){var a={provider:this.provider};this.idToken&&(a.oauthIdToken=this.idToken);this.accessToken&&(a.oauthAccessToken=this.accessToken);this.secret&&(a.oauthTokenSecret=this.secret);return a};
|
119
|
+
var Uf=function(a,b){this.hf=b||[];Df(this,{providerId:a,isOAuthProvider:!0});this.yd={}};Uf.prototype.setCustomParameters=function(a){this.yd=Sa(a);return this};var Q=function(a){Uf.call(this,a,If);this.jd=[]};t(Q,Uf);Q.prototype.addScope=function(a){Ha(this.jd,a)||this.jd.push(a);return this};Q.prototype.Gd=function(){return Ma(this.jd)};
|
120
|
+
Q.prototype.credential=function(a,b){if(!a&&!b)throw new O("argument-error","credential failed: must provide the ID token and/or the access token.");return new Qf(this.providerId,{idToken:a||null,accessToken:b||null})};var Vf=function(){Q.call(this,"facebook.com")};t(Vf,Q);N(Vf,"PROVIDER_ID","facebook.com");var Wf=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");return(new Vf).credential(null,a)},Xf=function(){Q.call(this,"github.com")};
|
121
|
+
t(Xf,Q);N(Xf,"PROVIDER_ID","github.com");var Yf=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");return(new Xf).credential(null,a)},Zf=function(){Q.call(this,"google.com");this.addScope("profile")};t(Zf,Q);N(Zf,"PROVIDER_ID","google.com");var $f=function(a,b){return(new Zf).credential(a,b)},ag=function(){Uf.call(this,"twitter.com",Hf)};t(ag,Uf);N(ag,"PROVIDER_ID","twitter.com");
|
122
|
+
var bg=function(a,b){if(!a||!b)throw new O("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Qf("twitter.com",{oauthToken:a,oauthTokenSecret:b})},cg=function(a,b){this.Yb=a;this.ad=b;N(this,"provider","password")};cg.prototype.$b=function(a){return R(a,dg,{email:this.Yb,password:this.ad})};cg.prototype.Pd=function(a,b){return R(a,eg,{idToken:b,email:this.Yb,password:this.ad})};cg.prototype.C=function(){return{email:this.Yb,password:this.ad}};
|
123
|
+
var fg=function(){Df(this,{providerId:"password",isOAuthProvider:!1})};Df(fg,{PROVIDER_ID:"password"});
|
124
|
+
var gg=function(a){var b=a&&a.providerId;if(!b||"password"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret;a=a&&a.oauthIdToken;try{switch(b){case "google.com":return $f(a,c);case "facebook.com":return Wf(c);case "github.com":return Yf(c);case "twitter.com":return bg(c,d);default:return(new Q(b)).credential(a,c)}}catch(e){return null}},hg=function(a){if(!a.isOAuthProvider)throw new O("invalid-oauth-provider");};var ig=function(a,b,c,d){O.call(this,a,d);N(this,"email",b);N(this,"credential",c)};t(ig,O);ig.prototype.C=function(){var a={code:this.code,message:this.message,email:this.email},b=this.credential&&this.credential.C();b&&(Ua(a,b),a.providerId=b.provider,delete a.provider);return a};ig.prototype.toJSON=function(){return this.C()};var jg=function(a){if(a.code){var b=a.code||"";0==b.indexOf("auth/")&&(b=b.substring(5));return a.email?new ig(b,a.email,gg(a),a.message):new O(b,a.message||void 0)}return null};var kg=function(a){this.Cf=a};t(kg,Wc);kg.prototype.Xb=function(){return new this.Cf};kg.prototype.Uc=function(){return{}};
|
125
|
+
var S=function(a,b,c){var d;d="Node"==L();d=l.XMLHttpRequest||d&&firebase.INTERNAL.node&&firebase.INTERNAL.node.XMLHttpRequest;if(!d)throw new O("internal-error","The XMLHttpRequest compatibility library was not found.");this.j=a;a=b||{};this.pf=a.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token";this.qf=a.secureTokenTimeout||lg;this.Yd=Sa(a.secureTokenHeaders||mg);this.Ae=a.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/";this.Be=a.firebaseTimeout||
|
126
|
+
ng;this.Ed=Sa(a.firebaseHeaders||og);c&&(this.Ed["X-Client-Version"]=c,this.Yd["X-Client-Version"]=c);this.te=new ad;this.Bf=new kg(d)},pg,lg=new yf(3E4,6E4),mg={"Content-Type":"application/x-www-form-urlencoded"},ng=new yf(3E4,6E4),og={"Content-Type":"application/json"},rg=function(a,b,c,d,e,f,g){xf()?(af()?a=r(a.sf,a):(pg||(pg=new D(function(a,b){qg(a,b)})),a=r(a.rf,a)),a(b,c,d,e,f,g)):c&&c(null)};
|
127
|
+
S.prototype.sf=function(a,b,c,d,e,f){var g="Node"==L(),k=mf()?g?new G(this.Bf):new G:new G(this.te),n;f&&(k.ob=Math.max(0,f),n=setTimeout(function(){k.dispatchEvent("timeout")},f));k.listen("complete",function(){n&&clearTimeout(n);var a=null;try{a=JSON.parse(Ae(this))||null}catch(Xa){a=null}b&&b(a)});bc(k,"ready",function(){n&&clearTimeout(n);this.Ba||(this.Ba=!0,this.Wa())});bc(k,"timeout",function(){n&&clearTimeout(n);this.Ba||(this.Ba=!0,this.Wa());b&&b(null)});k.send(a,c,d,e)};
|
128
|
+
var Wd="__fcb"+Math.floor(1E6*Math.random()).toString(),qg=function(a,b){((window.gapi||{}).client||{}).request?a():(l[Wd]=function(){((window.gapi||{}).client||{}).request?a():b(Error("CORS_UNSUPPORTED"))},Yd(function(){b(Error("CORS_UNSUPPORTED"))}))};
|
129
|
+
S.prototype.rf=function(a,b,c,d,e){var f=this;pg.then(function(){window.gapi.client.setApiKey(f.j);var g=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:"none",callback:function(a){window.gapi.auth.setToken(g);b&&b(a)}})}).f(function(a){b&&b({error:{message:a&&a.message||"CORS_UNSUPPORTED"}})})};
|
130
|
+
var tg=function(a,b){return new D(function(c,d){"refresh_token"==b.grant_type&&b.refresh_token||"authorization_code"==b.grant_type&&b.code?rg(a,a.pf+"?key="+encodeURIComponent(a.j),function(a){a?a.error?d(sg(a)):a.access_token&&a.refresh_token?c(a):d(new O("internal-error")):d(new O("network-request-failed"))},"POST",Ve(b).toString(),a.Yd,a.qf.get()):d(new O("internal-error"))})},ug=function(a,b,c,d,e){var f=Qe(a.Ae+b);J(f,"key",a.j);e&&J(f,"cb",ka().toString());var g="GET"==c;if(g)for(var k in d)d.hasOwnProperty(k)&&
|
131
|
+
J(f,k,d[k]);return new D(function(b,e){rg(a,f.toString(),function(a){a?a.error?e(sg(a)):b(a):e(new O("network-request-failed"))},c,g?void 0:Sc(tf(d)),a.Ed,a.Be.get())})},vg=function(a){if(!hc.test(a.email))throw new O("invalid-email");},wg=function(a){"email"in a&&vg(a)},yg=function(a,b){return R(a,xg,{identifier:b,continueUri:of()?Xe():"http://localhost"}).then(function(a){return a.allProviders||[]})},Ag=function(a){return R(a,zg,{}).then(function(a){return a.authorizedDomains||[]})},Bg=function(a){if(!a.idToken)throw new O("internal-error");
|
132
|
+
};S.prototype.signInAnonymously=function(){return R(this,Cg,{})};S.prototype.updateEmail=function(a,b){return R(this,Dg,{idToken:a,email:b})};S.prototype.updatePassword=function(a,b){return R(this,eg,{idToken:a,password:b})};var Eg={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};S.prototype.updateProfile=function(a,b){var c={idToken:a},d=[];Na(Eg,function(a,f){var e=b[f];null===e?d.push(a):f in b&&(c[f]=e)});d.length&&(c.deleteAttribute=d);return R(this,Dg,c)};
|
133
|
+
S.prototype.sendPasswordResetEmail=function(a){return R(this,Fg,{requestType:"PASSWORD_RESET",email:a})};S.prototype.sendEmailVerification=function(a){return R(this,Gg,{requestType:"VERIFY_EMAIL",idToken:a})};
|
134
|
+
var Ig=function(a,b,c){return R(a,Hg,{idToken:b,deleteProvider:c})},Jg=function(a){if(!a.requestUri||!a.sessionId&&!a.postBody)throw new O("internal-error");},Kg=function(a){var b=null;a.needConfirmation?(a.code="account-exists-with-different-credential",b=jg(a)):"FEDERATED_USER_ID_ALREADY_LINKED"==a.errorMessage?(a.code="credential-already-in-use",b=jg(a)):"EMAIL_EXISTS"==a.errorMessage&&(a.code="email-already-in-use",b=jg(a));if(b)throw b;if(!a.idToken)throw new O("internal-error");},Rf=function(a,
|
135
|
+
b){b.returnIdpCredential=!0;return R(a,Lg,b)},Tf=function(a,b){b.returnIdpCredential=!0;return R(a,Mg,b)},Ng=function(a){if(!a.oobCode)throw new O("invalid-action-code");};S.prototype.confirmPasswordReset=function(a,b){return R(this,Og,{oobCode:a,newPassword:b})};S.prototype.checkActionCode=function(a){return R(this,Pg,{oobCode:a})};S.prototype.applyActionCode=function(a){return R(this,Qg,{oobCode:a})};
|
136
|
+
var Qg={endpoint:"setAccountInfo",K:Ng,nb:"email"},Pg={endpoint:"resetPassword",K:Ng,va:function(a){if(!a.email||!a.requestType)throw new O("internal-error");}},Rg={endpoint:"signupNewUser",K:function(a){vg(a);if(!a.password)throw new O("weak-password");},va:Bg,wa:!0},xg={endpoint:"createAuthUri"},Sg={endpoint:"deleteAccount",mb:["idToken"]},Hg={endpoint:"setAccountInfo",mb:["idToken","deleteProvider"],K:function(a){if(!da(a.deleteProvider))throw new O("internal-error");}},Tg={endpoint:"getAccountInfo"},
|
137
|
+
Gg={endpoint:"getOobConfirmationCode",mb:["idToken","requestType"],K:function(a){if("VERIFY_EMAIL"!=a.requestType)throw new O("internal-error");},nb:"email"},Fg={endpoint:"getOobConfirmationCode",mb:["requestType"],K:function(a){if("PASSWORD_RESET"!=a.requestType)throw new O("internal-error");vg(a)},nb:"email"},zg={se:!0,endpoint:"getProjectConfig",Le:"GET"},Og={endpoint:"resetPassword",K:Ng,nb:"email"},Dg={endpoint:"setAccountInfo",mb:["idToken"],K:wg,wa:!0},eg={endpoint:"setAccountInfo",mb:["idToken"],
|
138
|
+
K:function(a){wg(a);if(!a.password)throw new O("weak-password");},va:Bg,wa:!0},Cg={endpoint:"signupNewUser",va:Bg,wa:!0},Lg={endpoint:"verifyAssertion",K:Jg,va:Kg,wa:!0},Mg={endpoint:"verifyAssertion",K:function(a){Jg(a);if(!a.idToken)throw new O("internal-error");},va:Kg,wa:!0},Ug={endpoint:"verifyCustomToken",K:function(a){if(!a.token)throw new O("invalid-custom-token");},va:Bg,wa:!0},dg={endpoint:"verifyPassword",K:function(a){vg(a);if(!a.password)throw new O("wrong-password");},va:Bg,wa:!0},R=
|
139
|
+
function(a,b,c){if(!Ff(c,b.mb))return F(new O("internal-error"));var d=b.Le||"POST",e;return E(c).then(b.K).then(function(){b.wa&&(c.returnSecureToken=!0);return ug(a,b.endpoint,d,c,b.se||!1)}).then(function(a){return e=a}).then(b.va).then(function(){if(!b.nb)return e;if(!(b.nb in e))throw new O("internal-error");return e[b.nb]})},sg=function(a){var b,c;c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||"";var d={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(c=d[c]?
|
140
|
+
new O(d[c]):null)return c;c=a.error&&a.error.message||"";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",
|
141
|
+
FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",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",
|
142
|
+
CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled"};b=(b=c.match(/^[^\s]+\s*:\s*(.*)$/))&&1<b.length?b[1]:void 0;for(var e in d)if(0===c.indexOf(e))return new O(d[e],b);!b&&a&&(b=sf(a));return new O("internal-error",b)};var Vg=function(a){this.U=a};Vg.prototype.value=function(){return this.U};Vg.prototype.ae=function(a){this.U.style=a;return this};var Wg=function(a){this.U=a||{}};Wg.prototype.value=function(){return this.U};Wg.prototype.ae=function(a){this.U.style=a;return this};var Yg=function(a){this.zf=a;this.gc=null;this.Zc=Xg(this)},Zg=function(a){var b=new Wg;b.U.where=document.body;b.U.url=a.zf;b.U.messageHandlersFilter=M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER");b.U.attributes=b.U.attributes||{};(new Vg(b.U.attributes)).ae({position:"absolute",top:"-100px",width:"1px",height:"1px"});b.U.dontclear=!0;return b},Xg=function(a){return $g().then(function(){return new D(function(b,c){M("gapi.iframes.getContext")().open(Zg(a).value(),function(d){a.gc=d;a.gc.restyle({setHideOnLeave:!1});
|
143
|
+
var e=setTimeout(function(){c(Error("Network Error"))},ah.get()),f=function(){clearTimeout(e);b()};d.ping(f).then(f,function(){c(Error("Network Error"))})})})})};Yg.prototype.sendMessage=function(a){var b=this;return this.Zc.then(function(){return new D(function(c){b.gc.send(a.type,a,c,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})};
|
144
|
+
var bh=function(a,b){a.Zc.then(function(){a.gc.register("authEvent",b,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})},ch=new yf(3E4,6E4),ah=new yf(5E3,15E3),$g=function(){return new D(function(a,b){if(xf()){var c=function(){wf();M("gapi.load")("gapi.iframes",{callback:a,ontimeout:function(){wf();b(Error("Network Error"))},timeout:ch.get()})};if(M("gapi.iframes.Iframe"))a();else if(M("gapi.load"))c();else{var d="__iframefcb"+Math.floor(1E6*Math.random()).toString();l[d]=function(){M("gapi.load")?
|
145
|
+
c():b(Error("Network Error"))};E(Vd("https://apis.google.com/js/api.js?onload="+d)).f(function(){b(Error("Network Error"))})}}else b(Error("Network Error"))})};var dh=function(a,b,c){this.v=a;this.j=b;this.B=c;this.Qa=null;this.Sb=Re(this.v,"/__/auth/iframe");J(this.Sb,"apiKey",this.j);J(this.Sb,"appName",this.B)};dh.prototype.setVersion=function(a){this.Qa=a;return this};dh.prototype.toString=function(){this.Qa?J(this.Sb,"v",this.Qa):Pe(this.Sb,"v");return this.Sb.toString()};var eh=function(a,b,c,d,e){this.v=a;this.j=b;this.B=c;this.re=d;this.Qa=this.F=this.fd=null;this.Ib=e};eh.prototype.setVersion=function(a){this.Qa=a;return this};
|
146
|
+
eh.prototype.toString=function(){var a=Re(this.v,"/__/auth/handler");J(a,"apiKey",this.j);J(a,"appName",this.B);J(a,"authType",this.re);if(this.Ib.isOAuthProvider){J(a,"providerId",this.Ib.providerId);var b=this.Ib,c=tf(b.yd),d;for(d in c)c[d]=c[d].toString();b=b.hf;c=Sa(c);for(d=0;d<b.length;d++){var e=b[d];e in c&&delete c[e]}Qa(c)||J(a,"customParameters",sf(c))}"function"===typeof this.Ib.Gd&&(b=this.Ib.Gd(),b.length&&J(a,"scopes",b.join(",")));this.fd?J(a,"redirectUrl",this.fd):Pe(a,"redirectUrl");
|
147
|
+
this.F?J(a,"eventId",this.F):Pe(a,"eventId");this.Qa?J(a,"v",this.Qa):Pe(a,"v");if(this.Tb)for(var f in this.Tb)this.Tb.hasOwnProperty(f)&&!Oe(a,f)&&J(a,f,this.Tb[f]);return a.toString()};
|
148
|
+
var fh=function(a,b,c,d){this.v=a;this.j=b;this.B=c;this.De=(this.Aa=d||null)?nf(this.Aa):null;d=this.Aa;this.Me=(new dh(a,b,c)).setVersion(d).toString();this.ia=[];this.g=new S(b,null,this.De);this.jc=this.sa=null},hh=function(a){var b=Xe();return Ag(a).then(function(a){a:{for(var c=Qe(b),e=c.da,c=c.$,f=0;f<a.length;f++){var g;var k=a[f];g=c;var n=e;0==k.indexOf("chrome-extension://")?g=Qe(k).$==g&&"chrome-extension"==n:"http"!=n&&"https"!=n?g=!1:ff.test(k)?g=g==k:(k=k.split(".").join("\\."),g=(new RegExp("^(.+\\."+
|
149
|
+
k+"|"+k+")$","i")).test(g));if(g){a=!0;break a}}a=!1}if(!a)throw new Of(Xe());})};h=fh.prototype;h.zb=function(){if(this.jc)return this.jc;var a=this;return this.jc=gf().then(function(){a.fc=new Yg(a.Me);ih(a)})};h.Nb=function(a,b,c){var d=new O("popup-closed-by-user"),e=new O("web-storage-unsupported"),f=this,g=!1;return this.Ga().then(function(){jh(f).then(function(c){c||(a&&cf(a),b(e),g=!0)})}).f(function(){}).then(function(){if(!g)return ef(a)}).then(function(){if(!g)return ke(c).then(function(){b(d)})})};
|
150
|
+
h.be=function(){var a=K();return!rf(a)&&!vf(a)};h.Jd=function(){return!1};h.Gb=function(a,b,c,d,e,f,g){if(!a)return F(new O("popup-blocked"));if(g&&!rf())return this.Ga().f(function(b){cf(a);e(b)}),d(),E();this.sa||(this.sa=hh(this.g));var k=this;return this.sa.then(function(){var b=k.Ga().f(function(b){cf(a);e(b);throw b;});d();return b}).then(function(){hg(c);if(!g){var d=kh(k.v,k.j,k.B,b,c,null,f,k.Aa);Ye(d,a)}}).f(function(a){"auth/network-request-failed"==a.code&&(k.sa=null);throw a;})};
|
151
|
+
h.Hb=function(a,b,c){this.sa||(this.sa=hh(this.g));var d=this;return this.sa.then(function(){hg(b);var e=kh(d.v,d.j,d.B,a,b,Xe(),c,d.Aa);Ye(e)})};h.Ga=function(){var a=this;return this.zb().then(function(){return a.fc.Zc}).f(function(){a.sa=null;throw new O("network-request-failed");})};h.ee=function(){return!0};
|
152
|
+
var kh=function(a,b,c,d,e,f,g,k,n){a=new eh(a,b,c,d,e);a.fd=f;a.F=g;f=a.setVersion(k);f.Tb=Sa(n||null);return f.toString()},ih=function(a){if(!a.fc)throw Error("IfcHandler must be initialized!");bh(a.fc,function(b){var c={};if(b&&b.authEvent){var d=!1;b=Nf(b.authEvent);for(c=0;c<a.ia.length;c++)d=a.ia[c](b)||d;c={};c.status=d?"ACK":"ERROR";return E(c)}c.status="ERROR";return E(c)})},jh=function(a){var b={type:"webStorageSupport"};return a.zb().then(function(){return a.fc.sendMessage(b)}).then(function(a){if(a&&
|
153
|
+
a.length&&"undefined"!==typeof a[0].webStorageSupport)return a[0].webStorageSupport;throw Error();})};fh.prototype.Sa=function(a){this.ia.push(a)};fh.prototype.Lb=function(a){Ka(this.ia,function(b){return b==a})};var lh=function(a){this.A=a||firebase.INTERNAL.reactNative&&firebase.INTERNAL.reactNative.AsyncStorage;if(!this.A)throw new O("internal-error","The React Native compatibility library was not found.");};h=lh.prototype;h.get=function(a){return E(this.A.getItem(a)).then(function(a){return a&&uf(a)})};h.set=function(a,b){return E(this.A.setItem(a,sf(b)))};h.remove=function(a){return E(this.A.removeItem(a))};h.Ta=function(){};h.Na=function(){};var mh=function(){this.A={}};h=mh.prototype;h.get=function(a){return E(this.A[a])};h.set=function(a,b){this.A[a]=b;return E()};h.remove=function(a){delete this.A[a];return E()};h.Ta=function(){};h.Na=function(){};var oh=function(){if(!nh()){if("Node"==L())throw new O("internal-error","The LocalStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.A=l.localStorage||firebase.INTERNAL.node.localStorage},nh=function(){var a="Node"==L(),a=l.localStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.localStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=oh.prototype;
|
154
|
+
h.get=function(a){var b=this;return E().then(function(){var c=b.A.getItem(a);return uf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=sf(b);null===d?c.remove(a):c.A.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.A.removeItem(a)})};h.Ta=function(a){l.window&&Ub(l.window,"storage",a)};h.Na=function(a){l.window&&cc(l.window,"storage",a)};var ph=function(){this.A={}};h=ph.prototype;h.get=function(){return E(null)};h.set=function(){return E()};h.remove=function(){return E()};h.Ta=function(){};h.Na=function(){};var rh=function(){if(!qh()){if("Node"==L())throw new O("internal-error","The SessionStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.A=l.sessionStorage||firebase.INTERNAL.node.sessionStorage},qh=function(){var a="Node"==L(),a=l.sessionStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.sessionStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=rh.prototype;
|
155
|
+
h.get=function(a){var b=this;return E().then(function(){var c=b.A.getItem(a);return uf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=sf(b);null===d?c.remove(a):c.A.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.A.removeItem(a)})};h.Ta=function(){};h.Na=function(){};var sh=function(a,b,c,d,e,f){if(!window.indexedDB)throw new O("web-storage-unsupported");this.ve=a;this.Yc=b;this.Kc=c;this.ie=d;this.sb=e;this.Y={};this.Ob=[];this.Cb=0;this.Ne=f||l.indexedDB},th,uh=function(a){return new D(function(b,c){var d=a.Ne.open(a.ve,a.sb);d.onerror=function(a){c(Error(a.target.errorCode))};d.onupgradeneeded=function(b){b=b.target.result;try{b.createObjectStore(a.Yc,{keyPath:a.Kc})}catch(f){c(f)}};d.onsuccess=function(a){b(a.target.result)}})},vh=function(a){a.Md||(a.Md=
|
156
|
+
uh(a));return a.Md},wh=function(a,b){return b.objectStore(a.Yc)},xh=function(a,b,c){return b.transaction([a.Yc],c?"readwrite":"readonly")},yh=function(a){return new D(function(b,c){a.onsuccess=function(a){a&&a.target?b(a.target.result):b()};a.onerror=function(a){c(Error(a.target.errorCode))}})};h=sh.prototype;
|
157
|
+
h.set=function(a,b){var c=!1,d,e=this;return Ed(vh(this).then(function(b){d=b;b=wh(e,xh(e,d,!0));return yh(b.get(a))}).then(function(f){var g=wh(e,xh(e,d,!0));if(f)return f.value=b,yh(g.put(f));e.Cb++;c=!0;f={};f[e.Kc]=a;f[e.ie]=b;return yh(g.add(f))}).then(function(){e.Y[a]=b}),function(){c&&e.Cb--})};h.get=function(a){var b=this;return vh(this).then(function(c){return yh(wh(b,xh(b,c,!1)).get(a))}).then(function(a){return a&&a.value})};
|
158
|
+
h.remove=function(a){var b=!1,c=this;return Ed(vh(this).then(function(d){b=!0;c.Cb++;return yh(wh(c,xh(c,d,!0))["delete"](a))}).then(function(){delete c.Y[a]}),function(){b&&c.Cb--})};
|
159
|
+
h.vf=function(){var a=this;return vh(this).then(function(b){var c=wh(a,xh(a,b,!1));return c.getAll?yh(c.getAll()):new D(function(a,b){var d=[],e=c.openCursor();e.onsuccess=function(b){(b=b.target.result)?(d.push(b.value),b["continue"]()):a(d)};e.onerror=function(a){b(Error(a.target.errorCode))}})}).then(function(b){var c={},d=[];if(0==a.Cb){for(d=0;d<b.length;d++)c[b[d][a.Kc]]=b[d][a.ie];d=Ze(a.Y,c);a.Y=c}return d})};h.Ta=function(a){0==this.Ob.length&&this.nd();this.Ob.push(a)};
|
160
|
+
h.Na=function(a){Ka(this.Ob,function(b){return b==a});0==this.Ob.length&&this.wc()};h.nd=function(){var a=this;this.wc();var b=function(){a.bd=ke(800).then(r(a.vf,a)).then(function(b){0<b.length&&x(a.Ob,function(a){a(b)})}).then(b).f(function(a){"STOP_EVENT"!=a.message&&b()});return a.bd};b()};h.wc=function(){this.bd&&this.bd.cancel("STOP_EVENT")};var Ch=function(){this.Bd={Browser:zh,Node:Ah,ReactNative:Bh}[L()]},Dh,zh={I:oh,qd:rh},Ah={I:oh,qd:rh},Bh={I:lh,qd:ph};var Eh=function(a){var b={},c=a.email,d=a.newEmail;a=a.requestType;if(!c||!a)throw Error("Invalid provider user info!");b.fromEmail=d||null;b.email=c;N(this,"operation",a);N(this,"data",Gf(b))};var Fh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "),T=function(a,b){return{name:a||"",fa:"a valid string",optional:!!b,ha:p}},Gh=function(a){return{name:a||"",fa:"a valid object",optional:!1,ha:ga}},Hh=function(a,b){return{name:a||"",fa:"a function",optional:!!b,ha:q}},Ih=function(){return{name:"",fa:"null",optional:!1,ha:ca}},Jh=function(){return{name:"credential",fa:"a valid credential",optional:!1,ha:function(a){return!(!a||!a.$b)}}},Kh=function(){return{name:"authProvider",
|
161
|
+
fa:"a valid Auth provider",optional:!1,ha:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty("isOAuthProvider"))}}},Lh=function(a,b,c,d){return{name:c||"",fa:a.fa+" or "+b.fa,optional:!!d,ha:function(c){return a.ha(c)||b.ha(c)}}};var Mh=function(a,b,c,d,e,f){this.bf=a;this.kf=b;this.Fe=c;this.lc=d;this.rd=e;this.lf=!!f;this.cb=null;this.Ha=this.lc;if(this.rd<this.lc)throw Error("Proactive refresh lower bound greater than upper bound!");};Mh.prototype.start=function(){this.Ha=this.lc;Nh(this,!0)};
|
162
|
+
var Oh=function(a,b){if(b)return a.Ha=a.lc,a.Fe();b=a.Ha;a.Ha*=2;a.Ha>a.rd&&(a.Ha=a.rd);return b},Nh=function(a,b){a.stop();a.cb=ke(Oh(a,b)).then(function(){return a.lf?E():Af()}).then(function(){return a.bf()}).then(function(){Nh(a,!0)}).f(function(b){a.kf(b)&&Nh(a,!1)})};Mh.prototype.stop=function(){this.cb&&(this.cb.cancel(),this.cb=null)};var U=function(a,b){for(var c in b){var d=b[c].name;a[d]=Ph(d,a[c],b[c].a)}},V=function(a,b,c,d){a[b]=Ph(b,c,d)},Ph=function(a,b,c){if(!c)return b;var d=Qh(a);a=function(){var a=Array.prototype.slice.call(arguments),e;a:{e=Array.prototype.slice.call(a);var k;k=0;for(var n=!1,A=0;A<c.length;A++)if(c[A].optional)n=!0;else{if(n)throw new O("internal-error","Argument validator encountered a required argument after an optional argument.");k++}n=c.length;if(e.length<k||n<e.length)e="Expected "+(k==n?1==
|
163
|
+
k?"1 argument":k+" arguments":k+"-"+n+" arguments")+" but got "+e.length+".";else{for(k=0;k<e.length;k++)if(n=c[k].optional&&void 0===e[k],!c[k].ha(e[k])&&!n){e=c[k];if(0>k||k>=Fh.length)throw new O("internal-error","Argument validator received an unsupported number of arguments.");e=Fh[k]+" argument "+(e.name?'"'+e.name+'" ':"")+"must be "+e.fa+".";break a}e=null}}if(e)throw new O("argument-error",d+" failed: "+e);return b.apply(this,a)};for(var e in b)a[e]=b[e];for(e in b.prototype)a.prototype[e]=
|
164
|
+
b.prototype[e];return a},Qh=function(a){a=a.split(".");return a[a.length-1]};var Rh=function(a,b,c,d){this.Ye=a;this.Zd=b;this.mf=c;this.Mb=d;this.S={};Dh||(Dh=new Ch);a=Dh;try{var e;We()?(th||(th=new sh("firebaseLocalStorageDb","firebaseLocalStorage","fbase_key","value",1)),e=th):e=new a.Bd.I;this.La=e}catch(f){this.La=new mh,this.Mb=!0}try{this.yc=new a.Bd.qd}catch(f){this.yc=new mh}this.od=r(this.ce,this);this.Y={}},Sh,Th=function(){Sh||(Sh=new Rh("firebase",":",!vf(K())&&lf()?!0:!1,rf()));return Sh};h=Rh.prototype;
|
165
|
+
h.P=function(a,b){return this.Ye+this.Zd+a.name+(b?this.Zd+b:"")};h.get=function(a,b){return(a.I?this.La:this.yc).get(this.P(a,b))};h.remove=function(a,b){b=this.P(a,b);a.I&&!this.Mb&&(this.Y[b]=null);return(a.I?this.La:this.yc).remove(b)};h.set=function(a,b,c){var d=this.P(a,c),e=this,f=a.I?this.La:this.yc;return f.set(d,b).then(function(){return f.get(d)}).then(function(b){a.I&&!this.Mb&&(e.Y[d]=b)})};
|
166
|
+
h.addListener=function(a,b,c){a=this.P(a,b);this.Mb||(this.Y[a]=l.localStorage.getItem(a));Qa(this.S)&&this.nd();this.S[a]||(this.S[a]=[]);this.S[a].push(c)};h.removeListener=function(a,b,c){a=this.P(a,b);this.S[a]&&(Ka(this.S[a],function(a){return a==c}),0==this.S[a].length&&delete this.S[a]);Qa(this.S)&&this.wc()};h.nd=function(){this.La.Ta(this.od);this.Mb||We()||Uh(this)};
|
167
|
+
var Uh=function(a){Vh(a);a.Xc=setInterval(function(){for(var b in a.S){var c=l.localStorage.getItem(b),d=a.Y[b];c!=d&&(a.Y[b]=c,c=new Jb({type:"storage",key:b,target:window,oldValue:d,newValue:c,df:!0}),a.ce(c))}},1E3)},Vh=function(a){a.Xc&&(clearInterval(a.Xc),a.Xc=null)};Rh.prototype.wc=function(){this.La.Na(this.od);Vh(this)};
|
168
|
+
Rh.prototype.ce=function(a){if(a&&a.Ee){var b=a.Xa.key;"undefined"!==typeof a.Xa.df?this.La.Na(this.od):Vh(this);if(this.mf){var c=l.localStorage.getItem(b);a=a.Xa.newValue;a!=c&&(a?l.localStorage.setItem(b,a):a||l.localStorage.removeItem(b))}this.Y[b]=l.localStorage.getItem(b);this.ud(b)}else x(a,r(this.ud,this))};Rh.prototype.ud=function(a){this.S[a]&&x(this.S[a],function(a){a()})};var Wh=function(a,b){this.u=a;this.i=b||Th()},Xh={name:"authEvent",I:!0},Yh=function(a){return a.i.get(Xh,a.u).then(function(a){return Nf(a)})};Wh.prototype.Sa=function(a){this.i.addListener(Xh,this.u,a)};Wh.prototype.Lb=function(a){this.i.removeListener(Xh,this.u,a)};var Zh=function(a){this.i=a||Th()},$h={name:"sessionId",I:!1};Zh.prototype.ac=function(a){return this.i.get($h,a)};var ai=function(a,b,c,d,e,f){this.v=a;this.j=b;this.B=c;this.Aa=d||null;this.de=b+":"+c;this.nf=new Zh;this.Fd=new Wh(this.de);this.Tc=null;this.ia=[];this.Qe=e||500;this.ff=f||2E3;this.yb=this.oc=null},bi=function(a){return new O("invalid-cordova-configuration",a)};
|
169
|
+
ai.prototype.Ga=function(){return this.Vc?this.Vc:this.Vc=jf().then(function(){if("function"!==typeof M("universalLinks.subscribe",l))throw bi("cordova-universal-links-plugin is not installed");if("undefined"===typeof M("BuildInfo.packageName",l))throw bi("cordova-plugin-buildinfo is not installed");if("function"!==typeof M("cordova.plugins.browsertab.openUrl",l))throw bi("cordova-plugin-browsertab is not installed");if("function"!==typeof M("cordova.InAppBrowser.open",l))throw bi("cordova-plugin-inappbrowser is not installed");
|
170
|
+
},function(){throw new O("cordova-not-ready");})};var ci=function(){for(var a=20,b=[];0<a;)b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),a--;return b.join("")},di=function(a){var b=new Db;b.update(a);return ob(b.digest())};h=ai.prototype;h.Nb=function(a,b){b(new O("operation-not-supported-in-this-environment"));return E()};h.Gb=function(){return F(new O("operation-not-supported-in-this-environment"))};h.ee=function(){return!1};h.be=function(){return!0};
|
171
|
+
h.Jd=function(){return!0};
|
172
|
+
h.Hb=function(a,b,c){if(this.oc)return F(new O("redirect-operation-pending"));var d=this,e=l.document,f=null,g=null,k=null,n=null;return this.oc=Ed(E().then(function(){hg(b);return ei(d)}).then(function(){return fi(d,a,b,c)}).then(function(){return(new D(function(a,b){g=function(){var b=M("cordova.plugins.browsertab.close",l);a();"function"===typeof b&&b();d.yb&&"function"===typeof d.yb.close&&(d.yb.close(),d.yb=null);return!1};d.Sa(g);k=function(){f||(f=ke(d.ff).then(function(){b(new O("redirect-cancelled-by-user"))}))};n=
|
173
|
+
function(){zf()&&k()};e.addEventListener("resume",k,!1);K().toLowerCase().match(/android/)||e.addEventListener("visibilitychange",n,!1)})).f(function(a){return gi(d).then(function(){throw a;})})}),function(){k&&e.removeEventListener("resume",k,!1);n&&e.removeEventListener("visibilitychange",n,!1);f&&f.cancel();g&&d.Lb(g);d.oc=null})};
|
174
|
+
var fi=function(a,b,c,d){var e=ci(),f=new P(b,d,null,e,new O("no-auth-event")),g=M("BuildInfo.packageName",l);if("string"!==typeof g)throw new O("invalid-cordova-configuration");var k=M("BuildInfo.displayName",l),n={};if(K().toLowerCase().match(/iphone|ipad|ipod/))n.ibi=g;else if(K().toLowerCase().match(/android/))n.apn=g;else return F(new O("operation-not-supported-in-this-environment"));k&&(n.appDisplayName=k);e=di(e);n.sessionId=e;var A=kh(a.v,a.j,a.B,b,c,null,d,a.Aa,n);return a.Ga().then(function(){var b=
|
175
|
+
a.de;return a.nf.i.set(Xh,f.C(),b)}).then(function(){var b=M("cordova.plugins.browsertab.isAvailable",l);if("function"!==typeof b)throw new O("invalid-cordova-configuration");var c=null;b(function(b){if(b){c=M("cordova.plugins.browsertab.openUrl",l);if("function"!==typeof c)throw new O("invalid-cordova-configuration");c(A)}else{c=M("cordova.InAppBrowser.open",l);if("function"!==typeof c)throw new O("invalid-cordova-configuration");b=c;var d;d=K();d=!(!d.match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!d.match(/(iPad|iPhone|iPod).*OS 8_\d/i));
|
176
|
+
a.yb=b(A,d?"_blank":"_system","location=yes")}})})},hi=function(a,b){for(var c=0;c<a.ia.length;c++)try{a.ia[c](b)}catch(d){}},ei=function(a){a.Tc||(a.Tc=a.Ga().then(function(){return new D(function(b){var c=function(d){b(d);a.Lb(c);return!1};a.Sa(c);ii(a)})}));return a.Tc},gi=function(a){var b=null;return Yh(a.Fd).then(function(c){b=c;c=a.Fd;return c.i.remove(Xh,c.u)}).then(function(){return b})},ii=function(a){var b=M("universalLinks.subscribe",l);if("function"!==typeof b)throw new O("invalid-cordova-configuration");
|
177
|
+
var c=new P("unknown",null,null,null,new O("no-auth-event")),d=!1,e=ke(a.Qe).then(function(){return gi(a).then(function(){d||hi(a,c)})}),f=function(b){d=!0;e&&e.cancel();gi(a).then(function(d){var e=c;if(d&&b&&b.url){var e=null,f;f=b.url;var g=Qe(f),k=Oe(g,"link"),n=Oe(Qe(k),"link"),g=Oe(g,"deep_link_id");f=Oe(Qe(g),"link")||g||n||k||f;-1!=f.indexOf("/__/auth/callback")&&(e=Qe(f),e=uf(Oe(e,"firebaseError")||null),e=(e="object"===typeof e?Mf(e):null)?new P(d.ga,d.F,null,null,e):new P(d.ga,d.F,f,d.ac()));
|
178
|
+
e=e||c}hi(a,e)})},g=l.handleOpenURL;l.handleOpenURL=function(a){0==a.indexOf(M("BuildInfo.packageName",l)+"://")&&f({url:a});if("function"===typeof g)try{g(a)}catch(n){console.error(n)}};b(null,f)};ai.prototype.Sa=function(a){this.ia.push(a);ei(this).f(function(){})};ai.prototype.Lb=function(a){Ka(this.ia,function(b){return b==a})};var ji=function(a){this.u=a;this.i=Th()},ki={name:"pendingRedirect",I:!1},li=function(a){return a.i.set(ki,"pending",a.u)},mi=function(a){return a.i.remove(ki,a.u)},ni=function(a){return a.i.get(ki,a.u).then(function(a){return"pending"==a})};var W=function(a,b,c){this.v=a;this.j=b;this.B=c;this.Pb=[];this.ab=!1;this.Gc=r(this.Qc,this);this.hb=new oi(this);this.Td=new pi(this);this.Db=new ji(this.j+":"+this.B);this.pb={};this.pb.unknown=this.hb;this.pb.signInViaRedirect=this.hb;this.pb.linkViaRedirect=this.hb;this.pb.signInViaPopup=this.Td;this.pb.linkViaPopup=this.Td;this.G=qi(this.v,this.j,this.B)},qi=function(a,b,c){var d=firebase.SDK_VERSION||null;return hf()?new ai(a,b,c,d):new fh(a,b,c,d)};
|
179
|
+
W.prototype.reset=function(){this.ab=!1;this.G.Lb(this.Gc);this.G=qi(this.v,this.j,this.B)};W.prototype.zb=function(){var a=this;this.ab||(this.ab=!0,this.G.Sa(this.Gc));var b=this.G;return this.G.Ga().f(function(c){a.G==b&&a.reset();throw c;})};var ti=function(a){a.G.be()&&a.zb().f(function(b){var c=new P("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));ri(b)&&a.Qc(c)});a.G.Jd()||si(a.hb)};
|
180
|
+
W.prototype.subscribe=function(a){Ha(this.Pb,a)||this.Pb.push(a);if(!this.ab){var b=this;ni(this.Db).then(function(a){a?mi(b.Db).then(function(){b.zb().f(function(a){var c=new P("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));ri(a)&&b.Qc(c)})}):ti(b)}).f(function(){ti(b)})}};W.prototype.unsubscribe=function(a){Ka(this.Pb,function(b){return b==a})};
|
181
|
+
W.prototype.Qc=function(a){if(!a)throw new O("invalid-auth-event");for(var b=!1,c=0;c<this.Pb.length;c++){var d=this.Pb[c];if(d.vd(a.ga,a.F)){(b=this.pb[a.ga])&&b.Ud(a,d);b=!0;break}}si(this.hb);return b};var ui=new yf(2E3,1E4),vi=new yf(3E4,6E4);W.prototype.getRedirectResult=function(){return this.hb.getRedirectResult()};W.prototype.Gb=function(a,b,c,d,e){var f=this;return this.G.Gb(a,b,c,function(){f.ab||(f.ab=!0,f.G.Sa(f.Gc))},function(){f.reset()},d,e)};
|
182
|
+
var ri=function(a){return a&&"auth/cordova-not-ready"==a.code?!0:!1};W.prototype.Hb=function(a,b,c){var d=this,e;return li(this.Db).then(function(){return d.G.Hb(a,b,c).f(function(a){if(ri(a))throw new O("operation-not-supported-in-this-environment");e=a;return mi(d.Db).then(function(){throw e;})}).then(function(){return d.G.ee()?new D(function(){}):mi(d.Db).then(function(){return d.getRedirectResult()}).then(function(){}).f(function(){})})})};
|
183
|
+
W.prototype.Nb=function(a,b,c,d){return this.G.Nb(c,function(c){a.Oa(b,null,c,d)},ui.get())};var wi={},xi=function(a,b,c){var d=b+":"+c;wi[d]||(wi[d]=new W(a,b,c));return wi[d]},oi=function(a){this.i=a;this.kb=null;this.Kb=[];this.Jb=[];this.ib=null;this.ed=!1};oi.prototype.reset=function(){this.kb=null;this.ib&&(this.ib.cancel(),this.ib=null)};
|
184
|
+
oi.prototype.Ud=function(a,b){if(!a)return F(new O("invalid-auth-event"));this.reset();this.ed=!0;var c=a.ga,d=a.F,e=a.getError()&&"auth/web-storage-unsupported"==a.getError().code,f=a.getError()&&"auth/operation-not-supported-in-this-environment"==a.getError().code;"unknown"!=c||e||f?a=a.O?this.cd(a,b):b.vb(c,d)?this.dd(a,b):F(new O("invalid-auth-event")):(yi(this,!1,null,null),a=E());return a};var si=function(a){a.ed||(a.ed=!0,yi(a,!1,null,null))};
|
185
|
+
oi.prototype.cd=function(a){yi(this,!0,null,a.getError());return E()};oi.prototype.dd=function(a,b){var c=this,d=a.ga;b=b.vb(d,a.F);var e=a.qb;a=a.ac();var f="signInViaRedirect"==d||"linkViaRedirect"==d;return b(e,a).then(function(a){yi(c,f,a,null)}).f(function(a){yi(c,f,null,a)})};
|
186
|
+
var zi=function(a,b){a.kb=function(){return F(b)};if(a.Jb.length)for(var c=0;c<a.Jb.length;c++)a.Jb[c](b)},Ai=function(a,b){a.kb=function(){return E(b)};if(a.Kb.length)for(var c=0;c<a.Kb.length;c++)a.Kb[c](b)},yi=function(a,b,c,d){b?d?zi(a,d):Ai(a,c):Ai(a,{user:null});a.Kb=[];a.Jb=[]};oi.prototype.getRedirectResult=function(){var a=this;return new D(function(b,c){a.kb?a.kb().then(b,c):(a.Kb.push(b),a.Jb.push(c),Bi(a))})};
|
187
|
+
var Bi=function(a){var b=new O("timeout");a.ib&&a.ib.cancel();a.ib=ke(vi.get()).then(function(){a.kb||yi(a,!0,null,b)})},pi=function(a){this.i=a};pi.prototype.Ud=function(a,b){if(!a)return F(new O("invalid-auth-event"));var c=a.ga,d=a.F;return a.O?this.cd(a,b):b.vb(c,d)?this.dd(a,b):F(new O("invalid-auth-event"))};pi.prototype.cd=function(a,b){b.Oa(a.ga,null,a.getError(),a.F);return E()};
|
188
|
+
pi.prototype.dd=function(a,b){var c=a.F,d=a.ga,e=b.vb(d,c),f=a.qb;a=a.ac();return e(f,a).then(function(a){b.Oa(d,a,null,c)}).f(function(a){b.Oa(d,null,a,c)})};var Ci=function(a){this.g=a;this.xa=this.W=null;this.Ca=0};Ci.prototype.C=function(){return{apiKey:this.g.j,refreshToken:this.W,accessToken:this.xa,expirationTime:this.Ca}};
|
189
|
+
var Ei=function(a,b){var c=b.idToken,d=b.refreshToken;b=Di(b.expiresIn);a.xa=c;a.Ca=b;a.W=d},Di=function(a){return ka()+1E3*parseInt(a,10)},Fi=function(a,b){return tg(a.g,b).then(function(b){a.xa=b.access_token;a.Ca=Di(b.expires_in);a.W=b.refresh_token;return{accessToken:a.xa,expirationTime:a.Ca,refreshToken:a.W}}).f(function(b){"auth/user-token-expired"==b.code&&(a.W=null);throw b;})};
|
190
|
+
Ci.prototype.getToken=function(a){a=!!a;return this.xa&&!this.W?F(new O("user-token-expired")):a||!this.xa||ka()>this.Ca-3E4?this.W?Fi(this,{grant_type:"refresh_token",refresh_token:this.W}):E(null):E({accessToken:this.xa,expirationTime:this.Ca,refreshToken:this.W})};var Gi=function(a,b,c,d,e){Df(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,providerId:b})},Hi=function(a,b){Ib.call(this,a);for(var c in b)this[c]=b[c]};t(Hi,Ib);
|
191
|
+
var X=function(a,b,c){this.Z=[];this.j=a.apiKey;this.B=a.appName;this.v=a.authDomain||null;a=firebase.SDK_VERSION?nf(firebase.SDK_VERSION):null;this.g=new S(this.j,null,a);this.ea=new Ci(this.g);Ii(this,b.idToken);Ei(this.ea,b);N(this,"refreshToken",this.ea.W);Ji(this,c||{});ge.call(this);this.pc=!1;this.v&&qf()&&(this.m=xi(this.v,this.j,this.B));this.vc=[];this.oa=null;this.fb=Ki(this);this.rb=r(this.Rc,this)};t(X,ge);X.prototype.Rc=function(){this.fb.cb&&(this.fb.stop(),this.fb.start())};
|
192
|
+
var Ki=function(a){return new Mh(function(){return a.getToken(!0)},function(a){return a&&"auth/network-request-failed"==a.code?!0:!1},function(){var b=a.ea.Ca-ka()-3E5;return 0<b?b:0},3E4,96E4,!1)},Li=function(a){a.Ad||a.fb.cb||(a.fb.start(),cc(a,"tokenChanged",a.rb),Ub(a,"tokenChanged",a.rb))},Mi=function(a){cc(a,"tokenChanged",a.rb);a.fb.stop()},Ii=function(a,b){a.Nd=b;N(a,"_lat",b)},Ni=function(a,b){Ka(a.vc,function(a){return a==b})},Oi=function(a){for(var b=[],c=0;c<a.vc.length;c++)b.push(a.vc[c](a));
|
193
|
+
return Bd(b).then(function(){return a})},Pi=function(a){a.m&&!a.pc&&(a.pc=!0,a.m.subscribe(a))},Ji=function(a,b){Df(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,isAnonymous:b.isAnonymous||!1,providerData:[]})};N(X.prototype,"providerId","firebase");
|
194
|
+
var Qi=function(){},Ri=function(a){return E().then(function(){if(a.Ad)throw new O("app-deleted");})},Si=function(a){return Da(a.providerData,function(a){return a.providerId})},Ui=function(a,b){b&&(Ti(a,b.providerId),a.providerData.push(b))},Ti=function(a,b){Ka(a.providerData,function(a){return a.providerId==b})},Vi=function(a,b,c){("uid"!=b||c)&&a.hasOwnProperty(b)&&N(a,b,c)};
|
195
|
+
X.prototype.copy=function(a){var b=this;b!=a&&(Df(this,{uid:a.uid,displayName:a.displayName,photoURL:a.photoURL,email:a.email,emailVerified:a.emailVerified,isAnonymous:a.isAnonymous,providerData:[]}),x(a.providerData,function(a){Ui(b,a)}),this.ea=a.ea,N(this,"refreshToken",this.ea.W))};X.prototype.reload=function(){var a=this;return this.c(Ri(this).then(function(){return Wi(a).then(function(){return Oi(a)}).then(Qi)}))};
|
196
|
+
var Wi=function(a){return a.getToken().then(function(b){var c=a.isAnonymous;return Xi(a,b).then(function(){c||Vi(a,"isAnonymous",!1);return b})})};X.prototype.getToken=function(a){var b=this;return this.c(Ri(this).then(function(){return b.ea.getToken(a)}).then(function(a){if(!a)throw new O("internal-error");a.accessToken!=b.Nd&&(Ii(b,a.accessToken),b.Ia());Vi(b,"refreshToken",a.refreshToken);return a.accessToken}))};
|
197
|
+
var Yi=function(a,b){b.idToken&&a.Nd!=b.idToken&&(Ei(a.ea,b),a.Ia(),Ii(a,b.idToken),Vi(a,"refreshToken",a.ea.W))};X.prototype.Ia=function(){this.dispatchEvent(new Hi("tokenChanged"))};var Xi=function(a,b){return R(a.g,Tg,{idToken:b}).then(r(a.cf,a))};
|
198
|
+
X.prototype.cf=function(a){a=a.users;if(!a||!a.length)throw new O("internal-error");a=a[0];Ji(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified});for(var b=Zi(a),c=0;c<b.length;c++)Ui(this,b[c]);Vi(this,"isAnonymous",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length))};
|
199
|
+
var Zi=function(a){return(a=a.providerUserInfo)&&a.length?Da(a,function(a){return new Gi(a.rawId,a.providerId,a.email,a.displayName,a.photoUrl)}):[]};
|
200
|
+
X.prototype.reauthenticate=function(a){var b=this;return this.c(a.$b(this.g).then(function(a){var c;a:{var e=a.idToken.split(".");if(3==e.length){for(var e=e[1],f=(4-e.length%4)%4,g=0;g<f;g++)e+=".";try{var k=JSON.parse(sb(e));if(k.sub&&k.iss&&k.aud&&k.exp){c=new Pf(k);break a}}catch(n){}}c=null}if(!c||b.uid!=c.Ue)throw new O("user-mismatch");Yi(b,a);b.oa=null;return b.reload()}),!0)};
|
201
|
+
var $i=function(a,b){return Wi(a).then(function(){if(Ha(Si(a),b))return Oi(a).then(function(){throw new O("provider-already-linked");})})};h=X.prototype;h.link=function(a){var b=this;return this.c($i(this,a.provider).then(function(){return b.getToken()}).then(function(c){return a.Pd(b.g,c)}).then(r(this.Dd,this)))};h.Dd=function(a){Yi(this,a);var b=this;return this.reload().then(function(){return b})};
|
202
|
+
h.updateEmail=function(a){var b=this;return this.c(this.getToken().then(function(c){return b.g.updateEmail(c,a)}).then(function(a){Yi(b,a);return b.reload()}))};h.updatePassword=function(a){var b=this;return this.c(this.getToken().then(function(c){return b.g.updatePassword(c,a)}).then(function(a){Yi(b,a);return b.reload()}))};
|
203
|
+
h.updateProfile=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return Ri(this);var b=this;return this.c(this.getToken().then(function(c){return b.g.updateProfile(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(a){Yi(b,a);Vi(b,"displayName",a.displayName||null);Vi(b,"photoURL",a.photoUrl||null);return Oi(b)}).then(Qi))};
|
204
|
+
h.unlink=function(a){var b=this;return this.c(Wi(this).then(function(c){return Ha(Si(b),a)?Ig(b.g,c,[a]).then(function(a){var c={};x(a.providerUserInfo||[],function(a){c[a.providerId]=!0});x(Si(b),function(a){c[a]||Ti(b,a)});return Oi(b)}):Oi(b).then(function(){throw new O("no-such-provider");})}))};
|
205
|
+
h["delete"]=function(){var a=this;return this.c(this.getToken().then(function(b){return R(a.g,Sg,{idToken:b})}).then(function(){a.dispatchEvent(new Hi("userDeleted"))})).then(function(){for(var b=0;b<a.Z.length;b++)a.Z[b].cancel("app-deleted");a.Z=[];a.Ad=!0;Mi(a);N(a,"refreshToken",null);a.m&&a.m.unsubscribe(a)})};h.vd=function(a,b){return"linkViaPopup"==a&&(this.la||null)==b&&this.ca||"linkViaRedirect"==a&&(this.sc||null)==b?!0:!1};
|
206
|
+
h.Oa=function(a,b,c,d){"linkViaPopup"==a&&d==(this.la||null)&&(c&&this.Ka?this.Ka(c):b&&!c&&this.ca&&this.ca(b),this.J&&(this.J.cancel(),this.J=null),delete this.ca,delete this.Ka)};h.vb=function(a,b){return"linkViaPopup"==a&&b==(this.la||null)||"linkViaRedirect"==a&&(this.sc||null)==b?r(this.ye,this):null};h.Zb=function(){return pf(this.uid+":::")};
|
207
|
+
h.linkWithPopup=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));if(this.oa)return F(this.oa);var b=this,c=Kf(a.providerId),d=this.Zb(),e=null;(!rf()||lf())&&this.v&&a.isOAuthProvider&&(e=kh(this.v,this.j,this.B,"linkViaPopup",a,null,d,firebase.SDK_VERSION||null));var f=df(e,c&&c.Fb,c&&c.Eb),c=$i(this,a.providerId).then(function(){return Oi(b)}).then(function(){aj(b);return b.getToken()}).then(function(){return b.m.Gb(f,"linkViaPopup",a,d,!!e)}).then(function(){return new D(function(a,
|
208
|
+
c){b.Oa("linkViaPopup",null,new O("cancelled-popup-request"),b.la||null);b.ca=a;b.Ka=c;b.la=d;b.J=b.m.Nb(b,"linkViaPopup",f,d)})}).then(function(a){f&&cf(f);return a}).f(function(a){f&&cf(f);throw a;});return this.c(c)};
|
209
|
+
h.linkWithRedirect=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));if(this.oa)return F(this.oa);var b=this,c=null,d=this.Zb(),e=$i(this,a.providerId).then(function(){aj(b);return b.getToken()}).then(function(){b.sc=d;return Oi(b)}).then(function(a){b.Ma&&(a=b.Ma,a=a.i.set(bj,b.C(),a.u));return a}).then(function(){return b.m.Hb("linkViaRedirect",a,d)}).f(function(a){c=a;if(b.Ma)return cj(b.Ma);throw c;}).then(function(){if(c)throw c;});return this.c(e)};
|
210
|
+
var aj=function(a){if(!a.m||!a.pc){if(a.m&&!a.pc)throw new O("internal-error");throw new O("auth-domain-config-required");}};X.prototype.ye=function(a,b){var c=this;this.J&&(this.J.cancel(),this.J=null);var d=null,e=this.getToken().then(function(d){return Tf(c.g,{requestUri:a,sessionId:b,idToken:d})}).then(function(a){d=gg(a);return c.Dd(a)}).then(function(a){return{user:a,credential:d}});return this.c(e)};
|
211
|
+
X.prototype.sendEmailVerification=function(){var a=this;return this.c(this.getToken().then(function(b){return a.g.sendEmailVerification(b)}).then(function(b){if(a.email!=b)return a.reload()}).then(function(){}))};X.prototype.c=function(a,b){var c=this,d=dj(this,a,b);this.Z.push(d);Ed(d,function(){Ja(c.Z,d)});return d};
|
212
|
+
var dj=function(a,b,c){return a.oa&&!c?(b.cancel(),F(a.oa)):b.f(function(b){!b||"auth/user-disabled"!=b.code&&"auth/user-token-expired"!=b.code||(a.oa||a.dispatchEvent(new Hi("userInvalidated")),a.oa=b);throw b;})};X.prototype.toJSON=function(){return this.C()};
|
213
|
+
X.prototype.C=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.j,appName:this.B,authDomain:this.v,stsTokenManager:this.ea.C(),redirectEventId:this.sc||null};x(this.providerData,function(b){a.providerData.push(Ef(b))});return a};
|
214
|
+
var ej=function(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken&&a.stsTokenManager.expirationTime)c.idToken=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null,c.expiresIn=(a.stsTokenManager.expirationTime-ka())/1E3;else return null;var d=new X(b,c,a);a.providerData&&x(a.providerData,function(a){if(a){var b={};Df(b,a);Ui(d,b)}});a.redirectEventId&&(d.sc=a.redirectEventId);
|
215
|
+
return d},fj=function(a,b,c){var d=new X(a,b);c&&(d.Ma=c);return d.reload().then(function(){return d})};var gj=function(a){this.u=a;this.i=Th()},bj={name:"redirectUser",I:!1},cj=function(a){return a.i.remove(bj,a.u)},hj=function(a,b){return a.i.get(bj,a.u).then(function(a){a&&b&&(a.authDomain=b);return ej(a||{})})};var ij=function(a){this.u=a;this.i=Th()},jj={name:"authUser",I:!0},kj=function(a,b){return a.i.set(jj,b.C(),a.u)},lj=function(a){return a.i.remove(jj,a.u)},mj=function(a,b){return a.i.get(jj,a.u).then(function(a){a&&b&&(a.authDomain=b);return ej(a||{})})};var rj=function(a){this.Va=!1;N(this,"app",a);if(Y(this).options&&Y(this).options.apiKey)a=firebase.SDK_VERSION?nf(firebase.SDK_VERSION):null,this.g=new S(Y(this).options&&Y(this).options.apiKey,null,a);else throw new O("invalid-api-key");this.Z=[];this.ya=[];this.$e=firebase.INTERNAL.createSubscribe(r(this.Oe,this));nj(this,null);this.pa=new ij(Y(this).options.apiKey+":"+Y(this).name);this.jb=new gj(Y(this).options.apiKey+":"+Y(this).name);this.Ub=this.c(oj(this));this.ua=this.c(pj(this));this.Wc=
|
216
|
+
!1;this.Pc=r(this.uf,this);this.he=r(this.Za,this);this.rb=r(this.Rc,this);this.fe=r(this.Je,this);this.ge=r(this.Ke,this);qj(this);this.INTERNAL={};this.INTERNAL["delete"]=r(this["delete"],this);this.Da=0};rj.prototype.toJSON=function(){return{apiKey:Y(this).options.apiKey,authDomain:Y(this).options.authDomain,appName:Y(this).name,currentUser:Z(this)&&Z(this).C()}};
|
217
|
+
var sj=function(a){return a.we||F(new O("auth-domain-config-required"))},qj=function(a){var b=Y(a).options.authDomain,c=Y(a).options.apiKey;b&&qf()&&(a.we=a.Ub.then(function(){if(!a.Va)return a.m=xi(b,c,Y(a).name),a.m.subscribe(a),Z(a)&&Pi(Z(a)),a.gd&&(Pi(a.gd),a.gd=null),a.m}))};h=rj.prototype;h.vd=function(a,b){switch(a){case "unknown":case "signInViaRedirect":return!0;case "signInViaPopup":return this.la==b&&!!this.ca;default:return!1}};
|
218
|
+
h.Oa=function(a,b,c,d){"signInViaPopup"==a&&this.la==d&&(c&&this.Ka?this.Ka(c):b&&!c&&this.ca&&this.ca(b),this.J&&(this.J.cancel(),this.J=null),delete this.ca,delete this.Ka)};h.vb=function(a,b){return"signInViaRedirect"==a||"signInViaPopup"==a&&this.la==b&&this.ca?r(this.ze,this):null};
|
219
|
+
h.ze=function(a,b){var c=this;a={requestUri:a,sessionId:b};this.J&&(this.J.cancel(),this.J=null);var d=null,e=Rf(c.g,a).then(function(a){d=gg(a);return a});a=c.Ub.then(function(){return e}).then(function(a){return tj(c,a)}).then(function(){return{user:Z(c),credential:d}});return this.c(a)};h.Zb=function(){return pf()};
|
220
|
+
h.signInWithPopup=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=Kf(a.providerId),d=this.Zb(),e=null;(!rf()||lf())&&Y(this).options.authDomain&&a.isOAuthProvider&&(e=kh(Y(this).options.authDomain,Y(this).options.apiKey,Y(this).name,"signInViaPopup",a,null,d,firebase.SDK_VERSION||null));var f=df(e,c&&c.Fb,c&&c.Eb),c=sj(this).then(function(b){return b.Gb(f,"signInViaPopup",a,d,!!e)}).then(function(){return new D(function(a,c){b.Oa("signInViaPopup",null,
|
221
|
+
new O("cancelled-popup-request"),b.la);b.ca=a;b.Ka=c;b.la=d;b.J=b.m.Nb(b,"signInViaPopup",f,d)})}).then(function(a){f&&cf(f);return a}).f(function(a){f&&cf(f);throw a;});return this.c(c)};h.signInWithRedirect=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=sj(this).then(function(){return b.m.Hb("signInViaRedirect",a)});return this.c(c)};
|
222
|
+
h.getRedirectResult=function(){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var a=this,b=sj(this).then(function(){return a.m.getRedirectResult()});return this.c(b)};
|
223
|
+
var tj=function(a,b){var c={};c.apiKey=Y(a).options.apiKey;c.authDomain=Y(a).options.authDomain;c.appName=Y(a).name;return a.Ub.then(function(){return fj(c,b,a.jb)}).then(function(b){if(Z(a)&&b.uid==Z(a).uid)return Z(a).copy(b),a.Za(b);nj(a,b);Pi(b);return a.Za(b)}).then(function(){a.Ia()})},nj=function(a,b){Z(a)&&(Ni(Z(a),a.he),cc(Z(a),"tokenChanged",a.rb),cc(Z(a),"userDeleted",a.fe),cc(Z(a),"userInvalidated",a.ge),Mi(Z(a)));b&&(b.vc.push(a.he),Ub(b,"tokenChanged",a.rb),Ub(b,"userDeleted",a.fe),
|
224
|
+
Ub(b,"userInvalidated",a.ge),0<a.Da&&Li(b));N(a,"currentUser",b)};rj.prototype.signOut=function(){var a=this,b=this.ua.then(function(){if(!Z(a))return E();nj(a,null);return lj(a.pa).then(function(){a.Ia()})});return this.c(b)};
|
225
|
+
var uj=function(a){var b=hj(a.jb,Y(a).options.authDomain).then(function(b){if(a.gd=b)b.Ma=a.jb;return cj(a.jb)});return a.c(b)},oj=function(a){var b=Y(a).options.authDomain,c=uj(a).then(function(){return mj(a.pa,b)}).then(function(b){return b?(b.Ma=a.jb,b.reload().then(function(){return kj(a.pa,b).then(function(){return b})}).f(function(c){return"auth/network-request-failed"==c.code?b:lj(a.pa)})):null}).then(function(b){nj(a,b||null)});return a.c(c)},pj=function(a){return a.Ub.then(function(){return a.getRedirectResult()}).f(function(){}).then(function(){if(!a.Va)return a.Pc()}).f(function(){}).then(function(){if(!a.Va){a.Wc=
|
226
|
+
!0;var b=a.pa;b.i.addListener(jj,b.u,a.Pc)}})};h=rj.prototype;h.uf=function(){var a=this;return mj(this.pa,Y(this).options.authDomain).then(function(b){if(!a.Va){var c;if(c=Z(a)&&b){c=Z(a).uid;var d=b.uid;c=void 0===c||null===c||""===c||void 0===d||null===d||""===d?!1:c==d}if(c)return Z(a).copy(b),Z(a).getToken();if(Z(a)||b)nj(a,b),b&&(Pi(b),b.Ma=a.jb),a.m&&a.m.subscribe(a),a.Ia()}})};h.Za=function(a){return kj(this.pa,a)};h.Rc=function(){this.Ia();this.Za(Z(this))};h.Je=function(){this.signOut()};
|
227
|
+
h.Ke=function(){this.signOut()};var vj=function(a,b){return a.c(b.then(function(b){return tj(a,b)}).then(function(){return Z(a)}))};h=rj.prototype;h.Oe=function(a){var b=this;this.addAuthTokenListener(function(){a.next(Z(b))})};h.onAuthStateChanged=function(a,b,c){var d=this;this.Wc&&firebase.Promise.resolve().then(function(){q(a)?a(Z(d)):q(a.next)&&a.next(Z(d))});return this.$e(a,b,c)};
|
228
|
+
h.getToken=function(a){var b=this,c=this.ua.then(function(){return Z(b)?Z(b).getToken(a).then(function(a){return{accessToken:a}}):null});return this.c(c)};h.signInWithCustomToken=function(a){var b=this;return this.ua.then(function(){return vj(b,R(b.g,Ug,{token:a}))}).then(function(a){Vi(a,"isAnonymous",!1);return b.Za(a)}).then(function(){return Z(b)})};h.signInWithEmailAndPassword=function(a,b){var c=this;return this.ua.then(function(){return vj(c,R(c.g,dg,{email:a,password:b}))})};
|
229
|
+
h.createUserWithEmailAndPassword=function(a,b){var c=this;return this.ua.then(function(){return vj(c,R(c.g,Rg,{email:a,password:b}))})};h.signInWithCredential=function(a){var b=this;return this.ua.then(function(){return vj(b,a.$b(b.g))})};h.signInAnonymously=function(){var a=Z(this),b=this;return a&&a.isAnonymous?E(a):this.ua.then(function(){return vj(b,b.g.signInAnonymously())}).then(function(a){Vi(a,"isAnonymous",!0);return b.Za(a)}).then(function(){return Z(b)})};
|
230
|
+
var Y=function(a){return a.app},Z=function(a){return a.currentUser};h=rj.prototype;h.getUid=function(){return Z(this)&&Z(this).uid||null};h.Ia=function(){if(this.Wc)for(var a=0;a<this.ya.length;a++)if(this.ya[a])this.ya[a](Z(this)&&Z(this)._lat||null)};h.qe=function(a){this.addAuthTokenListener(a);this.Da++;0<this.Da&&Z(this)&&Li(Z(this))};h.gf=function(a){var b=this;x(this.ya,function(c){c==a&&b.Da--});0>this.Da&&(this.Da=0);0==this.Da&&Z(this)&&Mi(Z(this));this.removeAuthTokenListener(a)};
|
231
|
+
h.addAuthTokenListener=function(a){var b=this;this.ya.push(a);this.c(this.ua.then(function(){b.Va||Ha(b.ya,a)&&a(Z(b)&&Z(b)._lat||null)}))};h.removeAuthTokenListener=function(a){Ka(this.ya,function(b){return b==a})};h["delete"]=function(){this.Va=!0;for(var a=0;a<this.Z.length;a++)this.Z[a].cancel("app-deleted");this.Z=[];this.pa&&(a=this.pa,a.i.removeListener(jj,a.u,this.Pc));this.m&&this.m.unsubscribe(this);return firebase.Promise.resolve()};
|
232
|
+
h.c=function(a){var b=this;this.Z.push(a);Ed(a,function(){Ja(b.Z,a)});return a};h.fetchProvidersForEmail=function(a){return this.c(yg(this.g,a))};h.verifyPasswordResetCode=function(a){return this.checkActionCode(a).then(function(a){return a.data.email})};h.confirmPasswordReset=function(a,b){return this.c(this.g.confirmPasswordReset(a,b).then(function(){}))};h.checkActionCode=function(a){return this.c(this.g.checkActionCode(a).then(function(a){return new Eh(a)}))};h.applyActionCode=function(a){return this.c(this.g.applyActionCode(a).then(function(){}))};
|
233
|
+
h.sendPasswordResetEmail=function(a){return this.c(this.g.sendPasswordResetEmail(a).then(function(){}))};U(rj.prototype,{applyActionCode:{name:"applyActionCode",a:[T("code")]},checkActionCode:{name:"checkActionCode",a:[T("code")]},confirmPasswordReset:{name:"confirmPasswordReset",a:[T("code"),T("newPassword")]},createUserWithEmailAndPassword:{name:"createUserWithEmailAndPassword",a:[T("email"),T("password")]},fetchProvidersForEmail:{name:"fetchProvidersForEmail",a:[T("email")]},getRedirectResult:{name:"getRedirectResult",a:[]},onAuthStateChanged:{name:"onAuthStateChanged",a:[Lh(Gh(),Hh(),"nextOrObserver"),
|
234
|
+
Hh("opt_error",!0),Hh("opt_completed",!0)]},sendPasswordResetEmail:{name:"sendPasswordResetEmail",a:[T("email")]},signInAnonymously:{name:"signInAnonymously",a:[]},signInWithCredential:{name:"signInWithCredential",a:[Jh()]},signInWithCustomToken:{name:"signInWithCustomToken",a:[T("token")]},signInWithEmailAndPassword:{name:"signInWithEmailAndPassword",a:[T("email"),T("password")]},signInWithPopup:{name:"signInWithPopup",a:[Kh()]},signInWithRedirect:{name:"signInWithRedirect",a:[Kh()]},signOut:{name:"signOut",
|
235
|
+
a:[]},toJSON:{name:"toJSON",a:[T(null,!0)]},verifyPasswordResetCode:{name:"verifyPasswordResetCode",a:[T("code")]}});
|
236
|
+
U(X.prototype,{"delete":{name:"delete",a:[]},getToken:{name:"getToken",a:[{name:"opt_forceRefresh",fa:"a boolean",optional:!0,ha:function(a){return"boolean"==typeof a}}]},link:{name:"link",a:[Jh()]},linkWithPopup:{name:"linkWithPopup",a:[Kh()]},linkWithRedirect:{name:"linkWithRedirect",a:[Kh()]},reauthenticate:{name:"reauthenticate",a:[Jh()]},reload:{name:"reload",a:[]},sendEmailVerification:{name:"sendEmailVerification",a:[]},toJSON:{name:"toJSON",a:[T(null,!0)]},unlink:{name:"unlink",a:[T("provider")]},
|
237
|
+
updateEmail:{name:"updateEmail",a:[T("email")]},updatePassword:{name:"updatePassword",a:[T("password")]},updateProfile:{name:"updateProfile",a:[Gh("profile")]}});U(D.prototype,{f:{name:"catch"},then:{name:"then"}});V(fg,"credential",function(a,b){return new cg(a,b)},[T("email"),T("password")]);U(Vf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Vf,"credential",Wf,[Lh(T(),Gh(),"token")]);
|
238
|
+
U(Xf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Xf,"credential",Yf,[Lh(T(),Gh(),"token")]);U(Zf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Zf,"credential",$f,[Lh(T(),Ih(),"idToken",!0),Lh(T(),Ih(),"accessToken",!0)]);U(ag.prototype,{setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});
|
239
|
+
V(ag,"credential",bg,[Lh(T(),Gh(),"token"),T("secret",!0)]);U(O.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});U(ig.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});U(Of.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});
|
240
|
+
(function(){if("undefined"!==typeof firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerService){var a={Auth:rj,Error:O};V(a,"EmailAuthProvider",fg,[]);V(a,"FacebookAuthProvider",Vf,[]);V(a,"GithubAuthProvider",Xf,[]);V(a,"GoogleAuthProvider",Zf,[]);V(a,"TwitterAuthProvider",ag,[]);firebase.INTERNAL.registerService("auth",function(a,c){a=new rj(a);c({INTERNAL:{getUid:r(a.getUid,a),getToken:r(a.getToken,a),addAuthTokenListener:r(a.qe,a),removeAuthTokenListener:r(a.gf,a)}});return a},a,function(a,
|
241
|
+
c){if("create"===a)try{c.auth()}catch(d){}});firebase.INTERNAL.extendNamespace({User:X})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");})();}).call(this);
|
@@ -0,0 +1,1700 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview Firebase Database API.
|
3
|
+
* Version: 3.7.1
|
4
|
+
*
|
5
|
+
* Copyright 2017 Google Inc. All Rights Reserved.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
*
|
19
|
+
* @externs
|
20
|
+
*/
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Gets the {@link firebase.database.Database `Database`} service for the
|
24
|
+
* default app or a given app.
|
25
|
+
*
|
26
|
+
* `firebase.database()` can be called with no arguments to access the default
|
27
|
+
* app's {@link firebase.database.Database `Database`} service or as
|
28
|
+
* `firebase.database(app)` to access the
|
29
|
+
* {@link firebase.database.Database `Database`} service associated with a
|
30
|
+
* specific app.
|
31
|
+
*
|
32
|
+
* `firebase.database` is also a namespace that can be used to access global
|
33
|
+
* constants and methods associated with the `Database` service.
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* // Get the Database service for the default app
|
37
|
+
* var defaultDatabase = firebase.database();
|
38
|
+
*
|
39
|
+
* @example
|
40
|
+
* // Get the Database service for a specific app
|
41
|
+
* var otherDatabase = firebase.database(app);
|
42
|
+
*
|
43
|
+
* @namespace
|
44
|
+
* @param {!firebase.app.App=} app Optional app whose Database service to
|
45
|
+
* return. If not provided, the default Database service will be returned.
|
46
|
+
* @return {!firebase.database.Database} The default Database service if no app
|
47
|
+
* is provided or the Database service associated with the provided app.
|
48
|
+
*/
|
49
|
+
firebase.database = function(app) {};
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Gets the {@link firebase.database.Database `Database`} service for the
|
53
|
+
* current app.
|
54
|
+
*
|
55
|
+
* @example
|
56
|
+
* var database = app.database();
|
57
|
+
* // The above is shorthand for:
|
58
|
+
* // var database = firebase.database(app);
|
59
|
+
*
|
60
|
+
* @return {!firebase.database.Database}
|
61
|
+
*/
|
62
|
+
firebase.app.App.prototype.database = function() {};
|
63
|
+
|
64
|
+
/**
|
65
|
+
* The Firebase Database service interface.
|
66
|
+
*
|
67
|
+
* Do not call this constructor directly. Instead, use
|
68
|
+
* {@link firebase.database `firebase.database()`}.
|
69
|
+
*
|
70
|
+
* See
|
71
|
+
* {@link
|
72
|
+
* https://firebase.google.com/docs/database/web/start/
|
73
|
+
* Installation & Setup in JavaScript}
|
74
|
+
* for a full guide on how to use the Firebase Database service.
|
75
|
+
*
|
76
|
+
* @interface
|
77
|
+
*/
|
78
|
+
firebase.database.Database = function() {};
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Logs debugging information to the console.
|
82
|
+
*
|
83
|
+
* @example
|
84
|
+
* // Enable logging
|
85
|
+
* firebase.database.enableLogging(true);
|
86
|
+
*
|
87
|
+
* @example
|
88
|
+
* // Disable logging
|
89
|
+
* firebase.database.enableLogging(false);
|
90
|
+
*
|
91
|
+
* @example
|
92
|
+
* // Enable logging across page refreshes
|
93
|
+
* firebase.database.enableLogging(true, true);
|
94
|
+
*
|
95
|
+
* @example
|
96
|
+
* // Provide custom logger which prefixes log statements with "[FIREBASE]"
|
97
|
+
* firebase.database.enableLogging(function(message) {
|
98
|
+
* console.log("[FIREBASE]", message);
|
99
|
+
* });
|
100
|
+
*
|
101
|
+
* @param {(boolean|function(string))=} logger Enables logging if `true`;
|
102
|
+
* disables logging if `false`. You can also provide a custom logger function
|
103
|
+
* to control how things get logged.
|
104
|
+
* @param {boolean=} persistent Remembers the logging state between page
|
105
|
+
* refreshes if `true`.
|
106
|
+
*/
|
107
|
+
firebase.database.enableLogging = function(logger, persistent) {};
|
108
|
+
|
109
|
+
/**
|
110
|
+
* @namespace
|
111
|
+
*/
|
112
|
+
firebase.database.ServerValue = {}
|
113
|
+
|
114
|
+
/**
|
115
|
+
* A placeholder value for auto-populating the current timestamp (time
|
116
|
+
* since the Unix epoch, in milliseconds) as determined by the Firebase
|
117
|
+
* servers.
|
118
|
+
*
|
119
|
+
* @example
|
120
|
+
* var sessionsRef = firebase.database().ref("sessions");
|
121
|
+
* sessionsRef.push({
|
122
|
+
* startedAt: firebase.database.ServerValue.TIMESTAMP
|
123
|
+
* });
|
124
|
+
*
|
125
|
+
* @const {!Object}
|
126
|
+
*/
|
127
|
+
firebase.database.ServerValue.TIMESTAMP;
|
128
|
+
|
129
|
+
/**
|
130
|
+
* The {@link firebase.app.App app} associated with the `Database` service
|
131
|
+
* instance.
|
132
|
+
*
|
133
|
+
* @example
|
134
|
+
* var app = database.app;
|
135
|
+
*
|
136
|
+
* @type {!firebase.app.App}
|
137
|
+
*/
|
138
|
+
firebase.database.Database.prototype.app;
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Returns a `Reference` representing the location in the Database
|
142
|
+
* corresponding to the provided path. If no path is provided, the `Reference`
|
143
|
+
* will point to the root of the Database.
|
144
|
+
*
|
145
|
+
* @example
|
146
|
+
* // Get a reference to the root of the Database
|
147
|
+
* var rootRef = firebase.database().ref();
|
148
|
+
*
|
149
|
+
* @example
|
150
|
+
* // Get a reference to the /users/ada node
|
151
|
+
* var adaRef = firebase.database().ref("users/ada");
|
152
|
+
* // The above is shorthand for the following operations:
|
153
|
+
* //var rootRef = firebase.database().ref();
|
154
|
+
* //var adaRef = rootRef.child("users/ada");
|
155
|
+
*
|
156
|
+
* @param {string=} path Optional path representing the location the returned
|
157
|
+
* `Reference` will point. If not provided, the returned `Reference` will
|
158
|
+
* point to the root of the Database.
|
159
|
+
* @return {!firebase.database.Reference} If a path is provided, a `Reference`
|
160
|
+
* pointing to the provided path. Otherwise, a `Reference` pointing to the
|
161
|
+
* root of the Database.
|
162
|
+
*/
|
163
|
+
firebase.database.Database.prototype.ref = function(path) {};
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Returns a `Reference` representing the location in the Database
|
167
|
+
* corresponding to the provided Firebase URL.
|
168
|
+
*
|
169
|
+
* An exception is thrown if the URL is not a valid Firebase Database URL or it
|
170
|
+
* has a different domain than the current `Database` instance.
|
171
|
+
*
|
172
|
+
* Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored
|
173
|
+
* and are not applied to the returned `Reference`.
|
174
|
+
*
|
175
|
+
* @example
|
176
|
+
* // Get a reference to the root of the Database
|
177
|
+
* var rootRef = firebase.database().ref("https://<DATABASE_NAME>.firebaseio.com");
|
178
|
+
*
|
179
|
+
* @example
|
180
|
+
* // Get a reference to the /users/ada node
|
181
|
+
* var adaRef = firebase.database().ref("https://<DATABASE_NAME>.firebaseio.com/users/ada");
|
182
|
+
*
|
183
|
+
* @param {string} url The Firebase URL at which the returned `Reference` will
|
184
|
+
* point.
|
185
|
+
* @return {!firebase.database.Reference} A `Reference` pointing to the provided
|
186
|
+
* Firebase URL.
|
187
|
+
*/
|
188
|
+
firebase.database.Database.prototype.refFromURL = function(url) {};
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Disconnects from the server (all Database operations will be completed
|
192
|
+
* offline).
|
193
|
+
*
|
194
|
+
* The client automatically maintains a persistent connection to the Database
|
195
|
+
* server, which will remain active indefinitely and reconnect when
|
196
|
+
* disconnected. However, the `goOffline()` and `goOnline()` methods may be used
|
197
|
+
* to control the client connection in cases where a persistent connection is
|
198
|
+
* undesirable.
|
199
|
+
*
|
200
|
+
* While offline, the client will no longer receive data updates from the
|
201
|
+
* Database. However, all Database operations performed locally will continue to
|
202
|
+
* immediately fire events, allowing your application to continue behaving
|
203
|
+
* normally. Additionally, each operation performed locally will automatically
|
204
|
+
* be queued and retried upon reconnection to the Database server.
|
205
|
+
*
|
206
|
+
* To reconnect to the Database and begin receiving remote events, see
|
207
|
+
* `goOnline()`.
|
208
|
+
*
|
209
|
+
* @example
|
210
|
+
* firebase.database().goOffline();
|
211
|
+
*/
|
212
|
+
firebase.database.Database.prototype.goOffline = function() {};
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Reconnects to the server and synchronizes the offline Database state
|
216
|
+
* with the server state.
|
217
|
+
*
|
218
|
+
* This method should be used after disabling the active connection with
|
219
|
+
* `goOffline()`. Once reconnected, the client will transmit the proper data
|
220
|
+
* and fire the appropriate events so that your client "catches up"
|
221
|
+
* automatically.
|
222
|
+
*
|
223
|
+
* @example
|
224
|
+
* firebase.database().goOnline();
|
225
|
+
*/
|
226
|
+
firebase.database.Database.prototype.goOnline = function() {};
|
227
|
+
|
228
|
+
/**
|
229
|
+
* A `Reference` represents a specific location in your Database and can be used
|
230
|
+
* for reading or writing data to that Database location.
|
231
|
+
*
|
232
|
+
* You can reference the root or child location in your Database by calling
|
233
|
+
* `firebase.database().ref()` or `firebase.database().ref("child/path")`.
|
234
|
+
*
|
235
|
+
* Writing is done with the `set()` method and reading can be done with the
|
236
|
+
* `on()` method. See
|
237
|
+
* {@link
|
238
|
+
* https://firebase.google.com/docs/database/web/read-and-write
|
239
|
+
* Read and Write Data on the Web}
|
240
|
+
*
|
241
|
+
* @interface
|
242
|
+
* @extends {firebase.database.Query}
|
243
|
+
*/
|
244
|
+
firebase.database.Reference = function() {};
|
245
|
+
|
246
|
+
/**
|
247
|
+
* The last part of the `Reference`'s path.
|
248
|
+
*
|
249
|
+
* For example, `"ada"` is the key for
|
250
|
+
* `https://<DATABASE_NAME>.firebaseio.com/users/ada`.
|
251
|
+
*
|
252
|
+
* The key of a root `Reference` is `null`.
|
253
|
+
*
|
254
|
+
* @example
|
255
|
+
* // The key of a root reference is null
|
256
|
+
* var rootRef = firebase.database().ref();
|
257
|
+
* var key = rootRef.key; // key === null
|
258
|
+
*
|
259
|
+
* @example
|
260
|
+
* // The key of any non-root reference is the last token in the path
|
261
|
+
* var adaRef = firebase.database().ref("users/ada");
|
262
|
+
* var key = adaRef.key; // key === "ada"
|
263
|
+
* key = adaRef.child("name/last").key; // key === "last"
|
264
|
+
*
|
265
|
+
* @type {string|null}
|
266
|
+
*/
|
267
|
+
firebase.database.Reference.prototype.key;
|
268
|
+
|
269
|
+
|
270
|
+
/**
|
271
|
+
* Gets a `Reference` for the location at the specified relative path.
|
272
|
+
*
|
273
|
+
* The relative path can either be a simple child name (for example, "ada") or
|
274
|
+
* a deeper slash-separated path (for example, "ada/name/first").
|
275
|
+
*
|
276
|
+
* @example
|
277
|
+
* var usersRef = firebase.database().ref('users');
|
278
|
+
* var adaRef = usersRef.child('ada');
|
279
|
+
* var adaFirstNameRef = adaRef.child('name/first');
|
280
|
+
* var path = adaFirstNameRef.toString();
|
281
|
+
* // path is now 'https://sample-app.firebaseio.com/users/ada/name/first'
|
282
|
+
*
|
283
|
+
* @param {string} path A relative path from this location to the desired child
|
284
|
+
* location.
|
285
|
+
* @return {!firebase.database.Reference} The specified child location.
|
286
|
+
*/
|
287
|
+
firebase.database.Reference.prototype.child = function(path) {};
|
288
|
+
|
289
|
+
|
290
|
+
/**
|
291
|
+
* The parent location of a `Reference`.
|
292
|
+
*
|
293
|
+
* The parent of a root `Reference` is `null`.
|
294
|
+
*
|
295
|
+
* @example
|
296
|
+
* // The parent of a root reference is null
|
297
|
+
* var rootRef = firebase.database().ref();
|
298
|
+
* parent = rootRef.parent; // parent === null
|
299
|
+
*
|
300
|
+
* @example
|
301
|
+
* // The parent of any non-root reference is the parent location
|
302
|
+
* var usersRef = firebase.database().ref("users");
|
303
|
+
* var adaRef = firebase.database().ref("users/ada");
|
304
|
+
* // usersRef and adaRef.parent represent the same location
|
305
|
+
*
|
306
|
+
* @type {?firebase.database.Reference}
|
307
|
+
*/
|
308
|
+
firebase.database.Reference.prototype.parent;
|
309
|
+
|
310
|
+
|
311
|
+
/**
|
312
|
+
* The root `Reference` of the Database.
|
313
|
+
*
|
314
|
+
* @example
|
315
|
+
* // The root of a root reference is itself
|
316
|
+
* var rootRef = firebase.database().ref();
|
317
|
+
* // rootRef and rootRef.root represent the same location
|
318
|
+
*
|
319
|
+
* @example
|
320
|
+
* // The root of any non-root reference is the root location
|
321
|
+
* var adaRef = firebase.database().ref("users/ada");
|
322
|
+
* // rootRef and adaRef.root represent the same location
|
323
|
+
*
|
324
|
+
* @type {!firebase.database.Reference}
|
325
|
+
*/
|
326
|
+
firebase.database.Reference.prototype.root;
|
327
|
+
|
328
|
+
|
329
|
+
/**
|
330
|
+
* Writes data to this Database location.
|
331
|
+
*
|
332
|
+
* This will overwrite any data at this location and all child locations.
|
333
|
+
*
|
334
|
+
* The effect of the write will be visible immediately, and the corresponding
|
335
|
+
* events ("value", "child_added", etc.) will be triggered. Synchronization of
|
336
|
+
* the data to the Firebase servers will also be started, and the returned
|
337
|
+
* Promise will resolve when complete. If provided, the `onComplete` callback
|
338
|
+
* will be called asynchronously after synchronization has finished.
|
339
|
+
*
|
340
|
+
* Passing `null` for the new value is equivalent to calling `remove()`; namely,
|
341
|
+
* all data at this location and all child locations will be deleted.
|
342
|
+
*
|
343
|
+
* `set()` will remove any priority stored at this location, so if priority is
|
344
|
+
* meant to be preserved, you need to use `setWithPriority()` instead.
|
345
|
+
*
|
346
|
+
* Note that modifying data with `set()` will cancel any pending transactions
|
347
|
+
* at that location, so extreme care should be taken if mixing `set()` and
|
348
|
+
* `transaction()` to modify the same data.
|
349
|
+
*
|
350
|
+
* A single `set()` will generate a single "value" event at the location where
|
351
|
+
* the `set()` was performed.
|
352
|
+
*
|
353
|
+
* @example
|
354
|
+
* var adaNameRef = firebase.database().ref('users/ada/name');
|
355
|
+
* adaNameRef.child('first').set('Ada');
|
356
|
+
* adaNameRef.child('last').set('Lovelace');
|
357
|
+
* // We've written 'Ada' to the Database location storing Ada's first name,
|
358
|
+
* // and 'Lovelace' to the location storing her last name.
|
359
|
+
*
|
360
|
+
* @example
|
361
|
+
* adaNameRef.set({ first: 'Ada', last: 'Lovelace' });
|
362
|
+
* // Exact same effect as the previous example, except we've written
|
363
|
+
* // Ada's first and last name simultaneously.
|
364
|
+
*
|
365
|
+
* @example
|
366
|
+
* adaNameRef.set({ first: 'Ada', last: 'Lovelace' })
|
367
|
+
* .then(function() {
|
368
|
+
* console.log('Synchronization succeeded');
|
369
|
+
* })
|
370
|
+
* .catch(function(error) {
|
371
|
+
* console.log('Synchronization failed');
|
372
|
+
* });
|
373
|
+
* // Same as the previous example, except we will also log a message
|
374
|
+
* // when the data has finished synchronizing.
|
375
|
+
*
|
376
|
+
* @param {*} value The value to be written (string, number, boolean, object,
|
377
|
+
* array, or null).
|
378
|
+
* @param {function(?Error)=} onComplete Callback called when write to server is
|
379
|
+
* complete.
|
380
|
+
* @return {!firebase.Promise<void>} Resolves when write to server is complete.
|
381
|
+
*/
|
382
|
+
firebase.database.Reference.prototype.set = function(value, onComplete) {};
|
383
|
+
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Writes multiple values to the Database at once.
|
387
|
+
*
|
388
|
+
* The `values` argument contains multiple property-value pairs that will be
|
389
|
+
* written to the Database together. Each child property can either be a simple
|
390
|
+
* property (for example, "name") or a relative path (for example,
|
391
|
+
* "name/first") from the current location to the data to update.
|
392
|
+
*
|
393
|
+
* As opposed to the `set()` method, `update()` can be use to selectively update
|
394
|
+
* only the referenced properties at the current location (instead of replacing
|
395
|
+
* all the child properties at the current location).
|
396
|
+
*
|
397
|
+
* The effect of the write will be visible immediately, and the corresponding
|
398
|
+
* events ('value', 'child_added', etc.) will be triggered. Synchronization of
|
399
|
+
* the data to the Firebase servers will also be started, and the returned
|
400
|
+
* Promise will resolve when complete. If provided, the `onComplete` callback
|
401
|
+
* will be called asynchronously after synchronization has finished.
|
402
|
+
*
|
403
|
+
* A single `update()` will generate a single "value" event at the location
|
404
|
+
* where the `update()` was performed, regardless of how many children were
|
405
|
+
* modified.
|
406
|
+
*
|
407
|
+
* Note that modifying data with `update()` will cancel any pending
|
408
|
+
* transactions at that location, so extreme care should be taken if mixing
|
409
|
+
* `update()` and `transaction()` to modify the same data.
|
410
|
+
*
|
411
|
+
* Passing `null` to `update()` will remove the data at this location.
|
412
|
+
*
|
413
|
+
* See
|
414
|
+
* {@link
|
415
|
+
* https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html
|
416
|
+
* Introducing multi-location updates and more}.
|
417
|
+
*
|
418
|
+
* @example
|
419
|
+
* var adaNameRef = firebase.database().ref('users/ada/name');
|
420
|
+
* // Modify the 'first' and 'last' properties, but leave other data at
|
421
|
+
* // adaNameRef unchanged.
|
422
|
+
* adaNameRef.update({ first: 'Ada', last: 'Lovelace' });
|
423
|
+
*
|
424
|
+
* @param {!Object} values Object containing multiple values.
|
425
|
+
* @param {function(?Error)=} onComplete Callback called when write to server is
|
426
|
+
* complete.
|
427
|
+
* @return {!firebase.Promise<void>} Resolves when update on server is complete.
|
428
|
+
*/
|
429
|
+
firebase.database.Reference.prototype.update = function(values, onComplete) {};
|
430
|
+
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Writes data the Database location. Like `set()` but also specifies the
|
434
|
+
* priority for that data.
|
435
|
+
*
|
436
|
+
* Applications need not use priority but can order collections by
|
437
|
+
* ordinary properties (see
|
438
|
+
* {@link
|
439
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data
|
440
|
+
* Sorting and filtering data}).
|
441
|
+
*
|
442
|
+
* @param {*} newVal
|
443
|
+
* @param {string|number|null} newPriority
|
444
|
+
* @param {function(?Error)=} onComplete
|
445
|
+
* @return {!firebase.Promise<void>}
|
446
|
+
*/
|
447
|
+
firebase.database.Reference.prototype.setWithPriority =
|
448
|
+
function(newVal, newPriority, onComplete) {};
|
449
|
+
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Removes the data at this Database location.
|
453
|
+
*
|
454
|
+
* Any data at child locations will also be deleted.
|
455
|
+
*
|
456
|
+
* The effect of the remove will be visible immediately and the corresponding
|
457
|
+
* event 'value' will be triggered. Synchronization of the remove to the
|
458
|
+
* Firebase servers will also be started, and the returned Promise will resolve
|
459
|
+
* when complete. If provided, the onComplete callback will be called
|
460
|
+
* asynchronously after synchronization has finished.
|
461
|
+
*
|
462
|
+
* @example
|
463
|
+
* var adaRef = firebase.database().ref('users/ada');
|
464
|
+
* adaRef.remove()
|
465
|
+
* .then(function() {
|
466
|
+
* console.log("Remove succeeded.")
|
467
|
+
* })
|
468
|
+
* .catch(function(error) {
|
469
|
+
* console.log("Remove failed: " + error.message)
|
470
|
+
* });
|
471
|
+
*
|
472
|
+
* @param {function(?Error)=} onComplete Callback called when write to server is
|
473
|
+
* complete.
|
474
|
+
* @return {!firebase.Promise<void>} Resolves when remove on server is complete.
|
475
|
+
*/
|
476
|
+
firebase.database.Reference.prototype.remove = function(onComplete) {};
|
477
|
+
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Atomically modifies the data at this location.
|
481
|
+
*
|
482
|
+
* Atomically modify the data at this location. Unlike a normal `set()`, which
|
483
|
+
* just overwrites the data regardless of its previous value, `transaction()` is
|
484
|
+
* used to modify the existing value to a new value, ensuring there are no
|
485
|
+
* conflicts with other clients writing to the same location at the same time.
|
486
|
+
*
|
487
|
+
* To accomplish this, you pass `transaction()` an update function which is used
|
488
|
+
* to transform the current value into a new value. If another client writes to
|
489
|
+
* the location before your new value is successfully written, your update
|
490
|
+
* function will be called again with the new current value, and the write will
|
491
|
+
* be retried. This will happen repeatedly until your write succeeds without
|
492
|
+
* conflict or you abort the transaction by not returning a value from your
|
493
|
+
* update function.
|
494
|
+
*
|
495
|
+
* Note: Modifying data with `set()` will cancel any pending transactions at
|
496
|
+
* that location, so extreme care should be taken if mixing `set()` and
|
497
|
+
* `transaction()` to update the same data.
|
498
|
+
*
|
499
|
+
* Note: When using transactions with Security and Firebase Rules in place, be
|
500
|
+
* aware that a client needs `.read` access in addition to `.write` access in
|
501
|
+
* order to perform a transaction. This is because the client-side nature of
|
502
|
+
* transactions requires the client to read the data in order to transactionally
|
503
|
+
* update it.
|
504
|
+
*
|
505
|
+
* @example
|
506
|
+
* // Increment Ada's rank by 1.
|
507
|
+
* var adaRankRef = firebase.database().ref('users/ada/rank');
|
508
|
+
* adaRankRef.transaction(function(currentRank) {
|
509
|
+
* // If users/ada/rank has never been set, currentRank will be `null`.
|
510
|
+
* return currentRank + 1;
|
511
|
+
* });
|
512
|
+
*
|
513
|
+
* @example
|
514
|
+
* // Try to create a user for ada, but only if the user id 'ada' isn't
|
515
|
+
* // already taken
|
516
|
+
* var adaRef = firebase.database().ref('users/ada');
|
517
|
+
* adaRef.transaction(function(currentData) {
|
518
|
+
* if (currentData === null) {
|
519
|
+
* return { name: { first: 'Ada', last: 'Lovelace' } };
|
520
|
+
* } else {
|
521
|
+
* console.log('User ada already exists.');
|
522
|
+
* return; // Abort the transaction.
|
523
|
+
* }
|
524
|
+
* }, function(error, committed, snapshot) {
|
525
|
+
* if (error) {
|
526
|
+
* console.log('Transaction failed abnormally!', error);
|
527
|
+
* } else if (!committed) {
|
528
|
+
* console.log('We aborted the transaction (because ada already exists).');
|
529
|
+
* } else {
|
530
|
+
* console.log('User ada added!');
|
531
|
+
* }
|
532
|
+
* console.log("Ada's data: ", snapshot.val());
|
533
|
+
* });
|
534
|
+
*
|
535
|
+
*
|
536
|
+
* @param {function(*): *} transactionUpdate A developer-supplied function which
|
537
|
+
* will be passed the current data stored at this location (as a JavaScript
|
538
|
+
* object). The function should return the new value it would like written (as
|
539
|
+
* a JavaScript object). If `undefined` is returned (i.e. you return with no
|
540
|
+
* arguments) the transaction will be aborted and the data at this location
|
541
|
+
* will not be modified.
|
542
|
+
* @param {(function(?Error, boolean,
|
543
|
+
* ?firebase.database.DataSnapshot))=} onComplete A callback
|
544
|
+
* function that will be called when the transaction completes. The callback
|
545
|
+
* is passed three arguments: a possibly-null `Error`, a `boolean` indicating
|
546
|
+
* whether the transaction was committed, and a `DataSnapshot` indicating the
|
547
|
+
* final result. If the transaction failed abnormally, the first argument will
|
548
|
+
* be an `Error` object indicating the failure cause. If the transaction
|
549
|
+
* finished normally, but no data was committed because no data was returned
|
550
|
+
* from `transactionUpdate`, then second argument will be false. If the
|
551
|
+
* transaction completed and committed data to Firebase, the second argument
|
552
|
+
* will be true. Regardless, the third argument will be a `DataSnapshot`
|
553
|
+
* containing the resulting data in this location.
|
554
|
+
* @param {boolean=} applyLocally By default, events are raised each time the
|
555
|
+
* transaction update function runs. So if it is run multiple times, you may
|
556
|
+
* see intermediate states. You can set this to false to suppress these
|
557
|
+
* intermediate states and instead wait until the transaction has completed
|
558
|
+
* before events are raised.
|
559
|
+
* @return {!firebase.Promise<{
|
560
|
+
* committed: boolean,
|
561
|
+
* snapshot: ?firebase.database.DataSnapshot
|
562
|
+
* }>} Returns a Promise that can optionally be used instead of the onComplete
|
563
|
+
* callback to handle success and failure.
|
564
|
+
*/
|
565
|
+
firebase.database.Reference.prototype.transaction =
|
566
|
+
function(transactionUpdate, onComplete, applyLocally) {};
|
567
|
+
|
568
|
+
|
569
|
+
/**
|
570
|
+
* Sets a priority for the data at this Database location.
|
571
|
+
*
|
572
|
+
* Applications need not use priority but can order collections by
|
573
|
+
* ordinary properties (see
|
574
|
+
* {@link
|
575
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data
|
576
|
+
* Sorting and filtering data}).
|
577
|
+
*
|
578
|
+
* @param {string|number|null} priority
|
579
|
+
* @param {function(?Error)} onComplete
|
580
|
+
* @return {!firebase.Promise<void>}
|
581
|
+
*/
|
582
|
+
firebase.database.Reference.prototype.setPriority =
|
583
|
+
function(priority, onComplete) {};
|
584
|
+
|
585
|
+
|
586
|
+
/**
|
587
|
+
* @interface
|
588
|
+
* @extends {firebase.database.Reference}
|
589
|
+
* @extends {firebase.Thenable<void>}
|
590
|
+
*/
|
591
|
+
firebase.database.ThenableReference = function() {};
|
592
|
+
|
593
|
+
|
594
|
+
/**
|
595
|
+
* Generates a new child location using a unique key and returns its
|
596
|
+
* `Reference`.
|
597
|
+
*
|
598
|
+
* This is the most common pattern for adding data to a collection of items.
|
599
|
+
*
|
600
|
+
* If you provide a value to `push()`, the value will be written to the
|
601
|
+
* generated location. If you don't pass a value, nothing will be written to the
|
602
|
+
* Database and the child will remain empty (but you can use the `Reference`
|
603
|
+
* elsewhere).
|
604
|
+
*
|
605
|
+
* The unique key generated by `push()` are ordered by the current time, so the
|
606
|
+
* resulting list of items will be chronologically sorted. The keys are also
|
607
|
+
* designed to be unguessable (they contain 72 random bits of entropy).
|
608
|
+
*
|
609
|
+
*
|
610
|
+
* See
|
611
|
+
* {@link
|
612
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data
|
613
|
+
* Append to a list of data}
|
614
|
+
* </br>See
|
615
|
+
* {@link
|
616
|
+
* https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html
|
617
|
+
* The 2^120 Ways to Ensure Unique Identifiers}
|
618
|
+
*
|
619
|
+
* @example
|
620
|
+
* var messageListRef = firebase.database().ref('message_list');
|
621
|
+
* var newMessageRef = messageListRef.push();
|
622
|
+
* newMessageRef.set({
|
623
|
+
* 'user_id': 'ada',
|
624
|
+
* 'text': 'The Analytical Engine weaves algebraical patterns just as the Jacquard loom weaves flowers and leaves.'
|
625
|
+
* });
|
626
|
+
* // We've appended a new message to the message_list location.
|
627
|
+
* var path = newMessageRef.toString();
|
628
|
+
* // path will be something like
|
629
|
+
* // 'https://sample-app.firebaseio.com/message_list/-IKo28nwJLH0Nc5XeFmj'
|
630
|
+
*
|
631
|
+
* @param {*=} value Optional value to be written at the generated location.
|
632
|
+
* @param {function(?Error)=} onComplete Callback called when write to server is
|
633
|
+
* complete.
|
634
|
+
* @return {!firebase.database.ThenableReference} Combined `Promise` and
|
635
|
+
* `Reference`; resolves when write is complete, but can be used immediately
|
636
|
+
* as the `Reference` to the child location.
|
637
|
+
*/
|
638
|
+
firebase.database.Reference.prototype.push = function(value, onComplete) {};
|
639
|
+
|
640
|
+
|
641
|
+
/**
|
642
|
+
* Returns an `OnDisconnect` object - see
|
643
|
+
* {@link
|
644
|
+
* https://firebase.google.com/docs/database/web/offline-capabilities
|
645
|
+
* Enabling Offline Capabilities in JavaScript} for more information on how
|
646
|
+
* to use it.
|
647
|
+
*
|
648
|
+
* @return {!firebase.database.OnDisconnect}
|
649
|
+
*/
|
650
|
+
firebase.database.Reference.prototype.onDisconnect = function() {};
|
651
|
+
|
652
|
+
|
653
|
+
/**
|
654
|
+
* A `Query` sorts and filters the data at a Database location so only a subset
|
655
|
+
* of the child data is included. This can be used to order a collection of
|
656
|
+
* data by some attribute (for example, height of dinosaurs) as well as to
|
657
|
+
* restrict a large list of items (for example, chat messages) down to a number
|
658
|
+
* suitable for synchronizing to the client. Queries are created by chaining
|
659
|
+
* together one or more of the filter methods defined here.
|
660
|
+
*
|
661
|
+
* Just as with a `Reference`, you can receive data from a `Query` by using the
|
662
|
+
* `on()` method. You will only receive events and `DataSnapshot`s for the
|
663
|
+
* subset of the data that matches your query.
|
664
|
+
*
|
665
|
+
* Read our documentation on
|
666
|
+
* {@link
|
667
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data
|
668
|
+
* Sorting and filtering data} for more information.
|
669
|
+
*
|
670
|
+
* @interface
|
671
|
+
*/
|
672
|
+
firebase.database.Query = function() {}
|
673
|
+
|
674
|
+
|
675
|
+
/**
|
676
|
+
* Returns a `Reference` to the `Query`'s location.
|
677
|
+
*
|
678
|
+
* @type {!firebase.database.Reference}
|
679
|
+
*/
|
680
|
+
firebase.database.Query.prototype.ref;
|
681
|
+
|
682
|
+
|
683
|
+
/**
|
684
|
+
* Returns whether or not the current and provided queries represent the same
|
685
|
+
* location, have the same query parameters, and are from the same instance of
|
686
|
+
* `firebase.app.App`.
|
687
|
+
*
|
688
|
+
* Two `Reference` objects are equivalent if they represent the same location
|
689
|
+
* and are from the same instance of `firebase.app.App`.
|
690
|
+
*
|
691
|
+
* Two `Query` objects are equivalent if they represent the same location, have
|
692
|
+
* the same query parameters, and are from the same instance of
|
693
|
+
* `firebase.app.App`. Equivalent queries share the same sort order, limits, and
|
694
|
+
* starting and ending points.
|
695
|
+
*
|
696
|
+
* @example
|
697
|
+
* var rootRef = firebase.database.ref();
|
698
|
+
* var usersRef = rootRef.child("users");
|
699
|
+
*
|
700
|
+
* usersRef.isEqual(rootRef); // false
|
701
|
+
* usersRef.isEqual(rootRef.child("users")); // true
|
702
|
+
* usersRef.parent.isEqual(rootRef); // true
|
703
|
+
*
|
704
|
+
* @example
|
705
|
+
* var rootRef = firebase.database.ref();
|
706
|
+
* var usersRef = rootRef.child("users");
|
707
|
+
* var usersQuery = usersRef.limitToLast(10);
|
708
|
+
*
|
709
|
+
* usersQuery.isEqual(usersRef); // false
|
710
|
+
* usersQuery.isEqual(usersRef.limitToLast(10)); // true
|
711
|
+
* usersQuery.isEqual(rootRef.limitToLast(10)); // false
|
712
|
+
* usersQuery.isEqual(usersRef.orderByKey().limitToLast(10)); // false
|
713
|
+
*
|
714
|
+
* @param {firebase.database.Query} other The query to compare against.
|
715
|
+
* @return {boolean} Whether or not the current and provided queries are
|
716
|
+
* equivalent.
|
717
|
+
*/
|
718
|
+
firebase.database.Query.prototype.isEqual = function(other) {};
|
719
|
+
|
720
|
+
|
721
|
+
/**
|
722
|
+
* Listens for data changes at a particular location.
|
723
|
+
*
|
724
|
+
* This is the primary way to read data from a Database. Your callback
|
725
|
+
* will be triggered for the initial data and again whenever the data changes.
|
726
|
+
* Use `off( )` to stop receiving updates. See
|
727
|
+
* {@link https://firebase.google.com/docs/database/web/retrieve-data
|
728
|
+
* Retrieve Data on the Web}
|
729
|
+
* for more details.
|
730
|
+
*
|
731
|
+
* <h4>value event</h4>
|
732
|
+
*
|
733
|
+
* This event will trigger once with the initial data stored at this location,
|
734
|
+
* and then trigger again each time the data changes. The `DataSnapshot` passed
|
735
|
+
* to the callback will be for the location at which `on()` was called. It
|
736
|
+
* won't trigger until the entire contents has been synchronized. If the
|
737
|
+
* location has no data, it will be triggered with an empty `DataSnapshot`
|
738
|
+
* (`val()` will return `null`).
|
739
|
+
*
|
740
|
+
* <h4>child_added event</h4>
|
741
|
+
*
|
742
|
+
* This event will be triggered once for each initial child at this location,
|
743
|
+
* and it will be triggered again every time a new child is added. The
|
744
|
+
* `DataSnapshot` passed into the callback will reflect the data for the
|
745
|
+
* relevant child. For ordering purposes, it is passed a second argument which
|
746
|
+
* is a string containing the key of the previous sibling child by sort order,
|
747
|
+
* or `null` if it is the first child.
|
748
|
+
*
|
749
|
+
* <h4>child_removed event</h4>
|
750
|
+
*
|
751
|
+
* This event will be triggered once every time a child is removed. The
|
752
|
+
* `DataSnapshot` passed into the callback will be the old data for the child
|
753
|
+
* that was removed. A child will get removed when either:
|
754
|
+
*
|
755
|
+
* - a client explicitly calls `remove()` on that child or one of its ancestors
|
756
|
+
* - a client calls `set(null)` on that child or one of its ancestors
|
757
|
+
* - that child has all of its children removed
|
758
|
+
* - there is a query in effect which now filters out the child (because it's
|
759
|
+
* sort order changed or the max limit was hit)
|
760
|
+
*
|
761
|
+
* <h4>child_changed event</h4>
|
762
|
+
*
|
763
|
+
* This event will be triggered when the data stored in a child (or any of its
|
764
|
+
* descendants) changes. Note that a single `child_changed` event may represent
|
765
|
+
* multiple changes to the child. The `DataSnapshot` passed to the callback will
|
766
|
+
* contain the new child contents. For ordering purposes, the callback is also
|
767
|
+
* passed a second argument which is a string containing the key of the previous
|
768
|
+
* sibling child by sort order, or `null` if it is the first child.
|
769
|
+
*
|
770
|
+
* <h4>child_moved event</h4>
|
771
|
+
*
|
772
|
+
* This event will be triggered when a child's sort order changes such that its
|
773
|
+
* position relative to its siblings changes. The `DataSnapshot` passed to the
|
774
|
+
* callback will be for the data of the child that has moved. It is also passed
|
775
|
+
* a second argument which is a string containing the key of the previous
|
776
|
+
* sibling child by sort order, or `null` if it is the first child.
|
777
|
+
*
|
778
|
+
* @example <caption>Handle a new value:</caption>
|
779
|
+
* ref.on('value', function(dataSnapshot) {
|
780
|
+
* ...
|
781
|
+
* });
|
782
|
+
*
|
783
|
+
* @example <caption>Handle a new child:</caption>
|
784
|
+
* ref.on('child_added', function(childSnapshot, prevChildKey) {
|
785
|
+
* ...
|
786
|
+
* });
|
787
|
+
*
|
788
|
+
* @example <caption>Handle child removal:</caption>
|
789
|
+
* ref.on('child_removed', function(oldChildSnapshot) {
|
790
|
+
* ...
|
791
|
+
* });
|
792
|
+
*
|
793
|
+
* @example <caption>Handle child data changes:</caption>
|
794
|
+
* ref.on('child_changed', function(childSnapshot, prevChildKey) {
|
795
|
+
* ...
|
796
|
+
* });
|
797
|
+
*
|
798
|
+
* @example <caption>Handle child ordering changes:</caption>
|
799
|
+
* ref.on('child_moved', function(childSnapshot, prevChildKey) {
|
800
|
+
* ...
|
801
|
+
* });
|
802
|
+
*
|
803
|
+
* @param {string} eventType One of the following strings: "value",
|
804
|
+
* "child_added", "child_changed", "child_removed", or "child_moved."
|
805
|
+
* @param {!function(firebase.database.DataSnapshot, string=)} callback A
|
806
|
+
* callback that fires when the specified event occurs. The callback will be
|
807
|
+
* passed a DataSnapshot. For ordering purposes, "child_added",
|
808
|
+
* "child_changed", and "child_moved" will also be passed a string containing
|
809
|
+
* the key of the previous child, by sort order, or `null` if it is the
|
810
|
+
* first child.
|
811
|
+
* @param {(function(Error)|Object)=} cancelCallbackOrContext An optional
|
812
|
+
* callback that will be notified if your event subscription is ever canceled
|
813
|
+
* because your client does not have permission to read this data (or it had
|
814
|
+
* permission but has now lost it). This callback will be passed an `Error`
|
815
|
+
* object indicating why the failure occurred.
|
816
|
+
* @param {Object=} context If provided, this object will be used as `this`
|
817
|
+
* when calling your callback(s).
|
818
|
+
* @return {!function(firebase.database.DataSnapshot, string=)} The provided
|
819
|
+
* callback function is returned unmodified. This is just for convenience if
|
820
|
+
* you want to pass an inline function to `on()` but store the callback
|
821
|
+
* function for later passing to `off()`.
|
822
|
+
*/
|
823
|
+
firebase.database.Query.prototype.on =
|
824
|
+
function(eventType, callback, cancelCallbackOrContext, context) {};
|
825
|
+
|
826
|
+
|
827
|
+
/**
|
828
|
+
* Detaches a callback previously attached with `on()`.
|
829
|
+
*
|
830
|
+
* Detach a callback previously attached with `on()`. Note that if `on()` was
|
831
|
+
* called multiple times with the same eventType and callback, the callback
|
832
|
+
* will be called multiple times for each event, and `off()` must be called
|
833
|
+
* multiple times to remove the callback. Calling `off()` on a parent listener
|
834
|
+
* will not automatically remove listeners registered on child nodes, `off()`
|
835
|
+
* must also be called on any child listeners to remove the callback.
|
836
|
+
*
|
837
|
+
* If a callback is not specified, all callbacks for the specified eventType
|
838
|
+
* will be removed. Similarly, if no eventType or callback is specified, all
|
839
|
+
* callbacks for the `Reference` will be removed.
|
840
|
+
*
|
841
|
+
* @example
|
842
|
+
* var onValueChange = function(dataSnapshot) { ... };
|
843
|
+
* ref.on('value', onValueChange);
|
844
|
+
* ref.child('meta-data').on('child_added', onChildAdded);
|
845
|
+
* // Sometime later...
|
846
|
+
* ref.off('value', onValueChange);
|
847
|
+
*
|
848
|
+
* // You must also call off() for any child listeners on ref
|
849
|
+
* // to cancel those callbacks
|
850
|
+
* ref.child('meta-data').off('child_added', onValueAdded);
|
851
|
+
*
|
852
|
+
* @example
|
853
|
+
* // Or you can save a line of code by using an inline function
|
854
|
+
* // and on()'s return value.
|
855
|
+
* var onValueChange = ref.on('value', function(dataSnapshot) { ... });
|
856
|
+
* // Sometime later...
|
857
|
+
* ref.off('value', onValueChange);
|
858
|
+
*
|
859
|
+
* @param {string=} eventType One of the following strings: "value",
|
860
|
+
* "child_added", "child_changed", "child_removed", or "child_moved."
|
861
|
+
* @param {function(!firebase.database.DataSnapshot, ?string=)=} callback The
|
862
|
+
* callback function that was passed to `on()`.
|
863
|
+
* @param {Object=} context The context that was passed to `on()`.
|
864
|
+
*/
|
865
|
+
firebase.database.Query.prototype.off =
|
866
|
+
function(eventType, callback, context) {};
|
867
|
+
|
868
|
+
|
869
|
+
/**
|
870
|
+
* Listens for exactly one event of the specified event type, and then stops
|
871
|
+
* listening.
|
872
|
+
*
|
873
|
+
* This is equivalent to calling {@link firebase.database.Query#on `on()`}, and
|
874
|
+
* then calling {@link firebase.database.Query#off `off()`} inside the callback
|
875
|
+
* function. See {@link firebase.database.Query#on `on()`} for details on the
|
876
|
+
* event types.
|
877
|
+
*
|
878
|
+
* @example
|
879
|
+
* // Basic usage of .once() to read the data located at ref.
|
880
|
+
* ref.once('value')
|
881
|
+
* .then(function(dataSnapshot) {
|
882
|
+
* // handle read data.
|
883
|
+
* });
|
884
|
+
*
|
885
|
+
* @param {string} eventType One of the following strings: "value",
|
886
|
+
* "child_added", "child_changed", "child_removed", or "child_moved."
|
887
|
+
* @param {function(!firebase.database.DataSnapshot, string=)=} successCallback A
|
888
|
+
* callback that fires when the specified event occurs. The callback will be
|
889
|
+
* passed a DataSnapshot. For ordering purposes, "child_added",
|
890
|
+
* "child_changed", and "child_moved" will also be passed a string containing
|
891
|
+
* the key of the previous child by sort order, or `null` if it is the
|
892
|
+
* first child.
|
893
|
+
* @param {(function(Error)|Object)=} failureCallbackOrContext An optional
|
894
|
+
* callback that will be notified if your client does not have permission to
|
895
|
+
* read the data. This callback will be passed an `Error` object indicating
|
896
|
+
* why the failure occurred.
|
897
|
+
* @param {Object=} context If provided, this object will be used as `this`
|
898
|
+
* when calling your callback(s).
|
899
|
+
* @return {!firebase.Promise<*>}
|
900
|
+
*/
|
901
|
+
firebase.database.Query.prototype.once =
|
902
|
+
function(eventType, successCallback, failureCallbackOrContext, context) {};
|
903
|
+
|
904
|
+
|
905
|
+
/**
|
906
|
+
* Generates a new `Query` limited to the first specific number of children.
|
907
|
+
*
|
908
|
+
* The `limitToFirst()` method is used to set a maximum number of children to be
|
909
|
+
* synced for a given callback. If we set a limit of 100, we will initially only
|
910
|
+
* receive up to 100 `child_added` events. If we have fewer than 100 messages
|
911
|
+
* stored in our Database, a `child_added` event will fire for each message.
|
912
|
+
* However, if we have over 100 messages, we will only receive a `child_added`
|
913
|
+
* event for the first 100 ordered messages. As items change, we will receive
|
914
|
+
* `child_removed` events for each item that drops out of the active list so
|
915
|
+
* that the total number stays at 100.
|
916
|
+
*
|
917
|
+
* You can read more about `limitToFirst()` in
|
918
|
+
* {@link
|
919
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#filtering_data
|
920
|
+
* Filtering data}.
|
921
|
+
*
|
922
|
+
* @example
|
923
|
+
* // Find the two shortest dinosaurs.
|
924
|
+
* var ref = firebase.database().ref("dinosaurs");
|
925
|
+
* ref.orderByChild("height").limitToFirst(2).on("child_added", function(snapshot) {
|
926
|
+
* // This will be called exactly two times (unless there are less than two
|
927
|
+
* // dinosaurs in the Database).
|
928
|
+
*
|
929
|
+
* // It will also get fired again if one of the first two dinosaurs is
|
930
|
+
* // removed from the data set, as a new dinosaur will now be the second
|
931
|
+
* // shortest.
|
932
|
+
* console.log(snapshot.key);
|
933
|
+
* });
|
934
|
+
*
|
935
|
+
* @param {number} limit The maximum number of nodes to include in this query.
|
936
|
+
* @return {!firebase.database.Query}
|
937
|
+
*/
|
938
|
+
firebase.database.Query.prototype.limitToFirst = function(limit) {};
|
939
|
+
|
940
|
+
|
941
|
+
/**
|
942
|
+
* Generates a new `Query` object limited to the last specific number of
|
943
|
+
* children.
|
944
|
+
*
|
945
|
+
* The `limitToLast()` method is used to set a maximum number of children to be
|
946
|
+
* synced for a given callback. If we set a limit of 100, we will initially only
|
947
|
+
* receive up to 100 `child_added` events. If we have fewer than 100 messages
|
948
|
+
* stored in our Database, a `child_added` event will fire for each message.
|
949
|
+
* However, if we have over 100 messages, we will only receive a `child_added`
|
950
|
+
* event for the last 100 ordered messages. As items change, we will receive
|
951
|
+
* `child_removed` events for each item that drops out of the active list so
|
952
|
+
* that the total number stays at 100.
|
953
|
+
*
|
954
|
+
* You can read more about `limitToLast()` in
|
955
|
+
* {@link
|
956
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#filtering_data
|
957
|
+
* Filtering data}.
|
958
|
+
*
|
959
|
+
* @example
|
960
|
+
* // Find the two heaviest dinosaurs.
|
961
|
+
* var ref = firebase.database().ref("dinosaurs");
|
962
|
+
* ref.orderByChild("weight").limitToLast(2).on("child_added", function(snapshot) {
|
963
|
+
* // This callback will be triggered exactly two times, unless there are
|
964
|
+
* // fewer than two dinosaurs stored in the Database. It will also get fired
|
965
|
+
* // for every new, heavier dinosaur that gets added to the data set.
|
966
|
+
* console.log(snapshot.key);
|
967
|
+
* });
|
968
|
+
*
|
969
|
+
* @param {number} limit The maximum number of nodes to include in this query.
|
970
|
+
* @return {!firebase.database.Query}
|
971
|
+
*/
|
972
|
+
firebase.database.Query.prototype.limitToLast = function(limit) {};
|
973
|
+
|
974
|
+
|
975
|
+
/**
|
976
|
+
* Generates a new `Query` object ordered by the specified child key.
|
977
|
+
*
|
978
|
+
* Queries can only order by one key at a time. Calling `orderByChild()`
|
979
|
+
* multiple times on the same query is an error.
|
980
|
+
*
|
981
|
+
* Firebase queries allow you to order your data by any child key on the fly.
|
982
|
+
* However, if you know in advance what your indexes will be, you can define
|
983
|
+
* them via the .indexOn rule in your Security Rules for better performance. See
|
984
|
+
* the {@link https://firebase.google.com/docs/database/security/indexing-data
|
985
|
+
* .indexOn} rule for more information.
|
986
|
+
*
|
987
|
+
* You can read more about `orderByChild()` in
|
988
|
+
* {@link
|
989
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sort_data
|
990
|
+
* Sort data}.
|
991
|
+
*
|
992
|
+
* @example
|
993
|
+
* var ref = firebase.database().ref("dinosaurs");
|
994
|
+
* ref.orderByChild("height").on("child_added", function(snapshot) {
|
995
|
+
* console.log(snapshot.key + " was " + snapshot.val().height + " m tall");
|
996
|
+
* });
|
997
|
+
*
|
998
|
+
* @param {string} path
|
999
|
+
* @return {!firebase.database.Query}
|
1000
|
+
*/
|
1001
|
+
firebase.database.Query.prototype.orderByChild = function(path) {};
|
1002
|
+
|
1003
|
+
|
1004
|
+
/**
|
1005
|
+
* Generates a new `Query` object ordered by key.
|
1006
|
+
*
|
1007
|
+
* Sorts the results of a query by their (ascending) key values.
|
1008
|
+
*
|
1009
|
+
* You can read more about `orderByKey()` in
|
1010
|
+
* {@link
|
1011
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sort_data
|
1012
|
+
* Sort data}.
|
1013
|
+
*
|
1014
|
+
* @example
|
1015
|
+
* var ref = firebase.database().ref("dinosaurs");
|
1016
|
+
* ref.orderByKey().on("child_added", function(snapshot) {
|
1017
|
+
* console.log(snapshot.key);
|
1018
|
+
* });
|
1019
|
+
*
|
1020
|
+
* @return {!firebase.database.Query}
|
1021
|
+
*/
|
1022
|
+
firebase.database.Query.prototype.orderByKey = function() {};
|
1023
|
+
|
1024
|
+
|
1025
|
+
/**
|
1026
|
+
* Generates a new `Query` object ordered by priority.
|
1027
|
+
*
|
1028
|
+
* Applications need not use priority but can order collections by
|
1029
|
+
* ordinary properties (see
|
1030
|
+
* {@link
|
1031
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sort_data
|
1032
|
+
* Sort data} for alternatives to priority.
|
1033
|
+
*
|
1034
|
+
* @return {!firebase.database.Query}
|
1035
|
+
*/
|
1036
|
+
firebase.database.Query.prototype.orderByPriority = function() {};
|
1037
|
+
|
1038
|
+
|
1039
|
+
/**
|
1040
|
+
* Generates a new `Query` object ordered by value.
|
1041
|
+
*
|
1042
|
+
* If the children of a query are all scalar values (string, number, or
|
1043
|
+
* boolean), you can order the results by their (ascending) values.
|
1044
|
+
*
|
1045
|
+
* You can read more about `orderByValue()` in
|
1046
|
+
* {@link
|
1047
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sort_data
|
1048
|
+
* Sort data}.
|
1049
|
+
*
|
1050
|
+
* @example
|
1051
|
+
* var scoresRef = firebase.database().ref("scores");
|
1052
|
+
* scoresRef.orderByValue().limitToLast(3).on("value", function(snapshot) {
|
1053
|
+
* snapshot.forEach(function(data) {
|
1054
|
+
* console.log("The " + data.key + " score is " + data.val());
|
1055
|
+
* });
|
1056
|
+
* });
|
1057
|
+
*
|
1058
|
+
* @return {!firebase.database.Query}
|
1059
|
+
*/
|
1060
|
+
firebase.database.Query.prototype.orderByValue = function() {};
|
1061
|
+
|
1062
|
+
|
1063
|
+
/**
|
1064
|
+
* Creates a `Query` with the specified starting point.
|
1065
|
+
*
|
1066
|
+
* Using `startAt()`, `endAt()`, and `equalTo()` allows you to choose arbitrary
|
1067
|
+
* starting and ending points for your queries.
|
1068
|
+
*
|
1069
|
+
* The starting point is inclusive, so children with exactly the specified value
|
1070
|
+
* will be included in the query. The optional key argument can be used to
|
1071
|
+
* further limit the range of the query. If it is specified, then children that
|
1072
|
+
* have exactly the specified value must also have a key name greater than or
|
1073
|
+
* equal to the specified key.
|
1074
|
+
*
|
1075
|
+
* You can read more about `startAt()` in
|
1076
|
+
* {@link
|
1077
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#filtering_data
|
1078
|
+
* Filtering data}.
|
1079
|
+
*
|
1080
|
+
* @example
|
1081
|
+
* // Find all dinosaurs that are at least three meters tall.
|
1082
|
+
* var ref = firebase.database().ref("dinosaurs");
|
1083
|
+
* ref.orderByChild("height").startAt(3).on("child_added", function(snapshot) {
|
1084
|
+
* console.log(snapshot.key)
|
1085
|
+
* });
|
1086
|
+
*
|
1087
|
+
* @param {number|string|boolean|null} value The value to start at. The argument
|
1088
|
+
* type depends on which `orderBy*()` function was used in this query.
|
1089
|
+
* Specify a value that matches the `orderBy*()` type. When used in
|
1090
|
+
* combination with `orderByKey()`, the value must be a string.
|
1091
|
+
* @param {string=} key The child key to start at. This argument is only allowed
|
1092
|
+
* if ordering by child, value, or priority.
|
1093
|
+
* @return {!firebase.database.Query}
|
1094
|
+
*/
|
1095
|
+
firebase.database.Query.prototype.startAt = function(value, key) {};
|
1096
|
+
|
1097
|
+
|
1098
|
+
/**
|
1099
|
+
* Creates a `Query` with the specified ending point.
|
1100
|
+
*
|
1101
|
+
* Using `startAt()`, `endAt()`, and `equalTo()` allows you to choose arbitrary
|
1102
|
+
* starting and ending points for your queries.
|
1103
|
+
*
|
1104
|
+
* The ending point is inclusive, so children with exactly the specified value
|
1105
|
+
* will be included in the query. The optional key argument can be used to
|
1106
|
+
* further limit the range of the query. If it is specified, then children that
|
1107
|
+
* have exactly the specified value must also have a key name less than or equal
|
1108
|
+
* to the specified key.
|
1109
|
+
*
|
1110
|
+
* You can read more about `endAt()` in
|
1111
|
+
* {@link
|
1112
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#filtering_data
|
1113
|
+
* Filtering data}.
|
1114
|
+
*
|
1115
|
+
* @example
|
1116
|
+
* // Find all dinosaurs whose names come before Pterodactyl lexicographically.
|
1117
|
+
* var ref = firebase.database().ref("dinosaurs");
|
1118
|
+
* ref.orderByKey().endAt("pterodactyl").on("child_added", function(snapshot) {
|
1119
|
+
* console.log(snapshot.key);
|
1120
|
+
* });
|
1121
|
+
*
|
1122
|
+
* @param {number|string|boolean|null} value The value to end at. The argument
|
1123
|
+
* type depends on which `orderBy*()` function was used in this query.
|
1124
|
+
* Specify a value that matches the `orderBy*()` type. When used in
|
1125
|
+
* combination with `orderByKey()`, the value must be a string.
|
1126
|
+
* @param {string=} key The child key to end at, among the children with the
|
1127
|
+
* previously specified priority. This argument is only allowed if ordering by
|
1128
|
+
* child, value, or priority.
|
1129
|
+
* @return {!firebase.database.Query}
|
1130
|
+
*/
|
1131
|
+
firebase.database.Query.prototype.endAt = function(value, key) {};
|
1132
|
+
|
1133
|
+
|
1134
|
+
/**
|
1135
|
+
* Creates a `Query` that includes children that match the specified value.
|
1136
|
+
*
|
1137
|
+
* Using `startAt()`, `endAt()`, and `equalTo()` allows us to choose arbitrary
|
1138
|
+
* starting and ending points for our queries.
|
1139
|
+
*
|
1140
|
+
* The optional key argument can be used to further limit the range of the
|
1141
|
+
* query. If it is specified, then children that have exactly the specified
|
1142
|
+
* value must also have exactly the specified key as their key name. This can be
|
1143
|
+
* used to filter result sets with many matches for the same value.
|
1144
|
+
*
|
1145
|
+
* You can read more about `equalTo()` in
|
1146
|
+
* {@link
|
1147
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#filtering_data
|
1148
|
+
* Filtering data}.
|
1149
|
+
*
|
1150
|
+
* @example
|
1151
|
+
* // Find all dinosaurs whose height is exactly 25 meters.
|
1152
|
+
* var ref = firebase.database().ref("dinosaurs");
|
1153
|
+
* ref.orderByChild("height").equalTo(25).on("child_added", function(snapshot) {
|
1154
|
+
* console.log(snapshot.key);
|
1155
|
+
* });
|
1156
|
+
*
|
1157
|
+
* @param {number|string|boolean|null} value The value to match for. The
|
1158
|
+
* argument type depends on which `orderBy*()` function was used in this
|
1159
|
+
* query. Specify a value that matches the `orderBy*()` type. When used in
|
1160
|
+
* combination with `orderByKey()`, the value must be a string.
|
1161
|
+
* @param {string=} key The child key to start at, among the children with the
|
1162
|
+
* previously specified priority. This argument is only allowed if ordering by
|
1163
|
+
* child, value, or priority.
|
1164
|
+
* @return {!firebase.database.Query}
|
1165
|
+
*/
|
1166
|
+
firebase.database.Query.prototype.equalTo = function(value, key) {};
|
1167
|
+
|
1168
|
+
|
1169
|
+
/**
|
1170
|
+
* Gets the absolute URL for this location.
|
1171
|
+
*
|
1172
|
+
* The `toString()` method returns a URL that is ready to be put into a browser,
|
1173
|
+
* curl command, or a `firebase.database().refFromURL()` call. Since all of
|
1174
|
+
* those expect the URL to be url-encoded, `toString()` returns an encoded URL.
|
1175
|
+
*
|
1176
|
+
* Append '.json' to the returned URL when typed into a browser to download
|
1177
|
+
* JSON-formatted data. If the location is secured (that is, not publicly
|
1178
|
+
* readable), you will get a permission-denied error.
|
1179
|
+
*
|
1180
|
+
* @example
|
1181
|
+
* // Calling toString() on a root Firebase reference returns the URL where its
|
1182
|
+
* // data is stored within the Database:
|
1183
|
+
* var rootRef = firebase.database().ref();
|
1184
|
+
* var rootUrl = rootRef.toString();
|
1185
|
+
* // rootUrl === "https://sample-app.firebaseio.com/".
|
1186
|
+
*
|
1187
|
+
* // Calling toString() at a deeper Firebase reference returns the URL of that
|
1188
|
+
* // deep path within the Database:
|
1189
|
+
* var adaRef = rootRef.child('users/ada');
|
1190
|
+
* var adaURL = adaRef.toString();
|
1191
|
+
* // adaURL === "https://sample-app.firebaseio.com/users/ada".
|
1192
|
+
*
|
1193
|
+
* @return {string} The absolute URL for this location.
|
1194
|
+
* @override
|
1195
|
+
*/
|
1196
|
+
firebase.database.Query.prototype.toString = function() {};
|
1197
|
+
|
1198
|
+
|
1199
|
+
/**
|
1200
|
+
* Returns a JSON-serializable representation of this object.
|
1201
|
+
*
|
1202
|
+
* @return {!Object} A JSON-serializable representation of this object.
|
1203
|
+
*/
|
1204
|
+
firebase.database.Query.prototype.toJSON = function() {};
|
1205
|
+
|
1206
|
+
|
1207
|
+
/**
|
1208
|
+
* A `DataSnapshot` contains data from a Database location.
|
1209
|
+
*
|
1210
|
+
* Any time you read data from the Database, you receive the data as a
|
1211
|
+
* `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach
|
1212
|
+
* with `on()` or `once()`. You can extract the contents of the snapshot as a
|
1213
|
+
* JavaScript object by calling the `val()` method. Alternatively, you can
|
1214
|
+
* traverse into the snapshot by calling `child()` to return child snapshots
|
1215
|
+
* (which you could then call `val()` on).
|
1216
|
+
*
|
1217
|
+
* A `DataSnapshot` is an efficiently generated, immutable copy of the data at
|
1218
|
+
* a Database location. It cannot be modified and will never change (to modify
|
1219
|
+
* data, you always call the `set()` method on a `Reference` directly).
|
1220
|
+
*
|
1221
|
+
* @interface
|
1222
|
+
*/
|
1223
|
+
firebase.database.DataSnapshot = function() {};
|
1224
|
+
|
1225
|
+
|
1226
|
+
/**
|
1227
|
+
* Extracts a JavaScript value from a `DataSnapshot`.
|
1228
|
+
*
|
1229
|
+
* Depending on the data in a `DataSnapshot`, the `val()` method may return a
|
1230
|
+
* scalar type (string, number, or boolean), an array, or an object. It may also
|
1231
|
+
* return null, indicating that the `DataSnapshot` is empty (contains no data).
|
1232
|
+
*
|
1233
|
+
* @example
|
1234
|
+
* // Write and then read back a string from the Database.
|
1235
|
+
* ref.set("hello")
|
1236
|
+
* .then(function() {
|
1237
|
+
* return ref.once("value");
|
1238
|
+
* })
|
1239
|
+
* .then(function(snapshot) {
|
1240
|
+
* var data = snapshot.val(); // data === "hello"
|
1241
|
+
* });
|
1242
|
+
*
|
1243
|
+
* @example
|
1244
|
+
* // Write and then read back a JavaScript object from the Database.
|
1245
|
+
* ref.set({ name: "Ada", age: 36 })
|
1246
|
+
* .then(function() {
|
1247
|
+
* return ref.once("value");
|
1248
|
+
* })
|
1249
|
+
* .then(function(snapshot) {
|
1250
|
+
* var data = snapshot.val();
|
1251
|
+
* // data is { "name": "Ada", "age": 36 }
|
1252
|
+
* // data.name === "Ada"
|
1253
|
+
* // data.age === 36
|
1254
|
+
* });
|
1255
|
+
*
|
1256
|
+
* @return {*} The DataSnapshot's contents as a JavaScript value (Object,
|
1257
|
+
* Array, string, number, boolean, or `null`).
|
1258
|
+
*/
|
1259
|
+
firebase.database.DataSnapshot.prototype.val = function() {};
|
1260
|
+
|
1261
|
+
|
1262
|
+
/**
|
1263
|
+
* Exports the entire contents of the DataSnapshot as a JavaScript object.
|
1264
|
+
*
|
1265
|
+
* The `exportVal()` method is similar to `val()`, except priority information
|
1266
|
+
* is included (if available), making it suitable for backing up your data.
|
1267
|
+
*
|
1268
|
+
* @return {*} The DataSnapshot's contents as a JavaScript value (Object,
|
1269
|
+
* Array, string, number, boolean, or `null`).
|
1270
|
+
*/
|
1271
|
+
firebase.database.DataSnapshot.prototype.exportVal = function() {};
|
1272
|
+
|
1273
|
+
|
1274
|
+
/**
|
1275
|
+
* Returns true if this `DataSnapshot` contains any data. It is slightly more
|
1276
|
+
* efficient than using `snapshot.val() !== null`.
|
1277
|
+
*
|
1278
|
+
* @example
|
1279
|
+
* // Assume we have the following data in the Database:
|
1280
|
+
* {
|
1281
|
+
* "name": {
|
1282
|
+
* "first": "Ada",
|
1283
|
+
* "last": "Lovelace"
|
1284
|
+
* }
|
1285
|
+
* }
|
1286
|
+
*
|
1287
|
+
* // Test for the existence of certain keys within a DataSnapshot
|
1288
|
+
* var ref = firebase.database().ref("users/ada");
|
1289
|
+
* ref.once("value")
|
1290
|
+
* .then(function(snapshot) {
|
1291
|
+
* var a = snapshot.exists(); // true
|
1292
|
+
* var b = snapshot.child("name").exists(); // true
|
1293
|
+
* var c = snapshot.child("name/first").exists(); // true
|
1294
|
+
* var d = snapshot.child("name/middle").exists(); // false
|
1295
|
+
* });
|
1296
|
+
*
|
1297
|
+
* @return {boolean}
|
1298
|
+
*/
|
1299
|
+
firebase.database.DataSnapshot.prototype.exists = function() {};
|
1300
|
+
|
1301
|
+
|
1302
|
+
/**
|
1303
|
+
* Gets another `DataSnapshot` for the location at the specified relative path.
|
1304
|
+
*
|
1305
|
+
* Passing a relative path to the `child()` method of a DataSnapshot returns
|
1306
|
+
* another `DataSnapshot` for the location at the specified relative path. The
|
1307
|
+
* relative path can either be a simple child name (for example, "ada") or a
|
1308
|
+
* deeper, slash-separated path (for example, "ada/name/first"). If the child
|
1309
|
+
* location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot`
|
1310
|
+
* whose value is `null`) is returned.
|
1311
|
+
*
|
1312
|
+
* @example
|
1313
|
+
* // Assume we have the following data in the Database:
|
1314
|
+
* {
|
1315
|
+
* "name": {
|
1316
|
+
* "first": "Ada",
|
1317
|
+
* "last": "Lovelace"
|
1318
|
+
* }
|
1319
|
+
* }
|
1320
|
+
*
|
1321
|
+
* // Test for the existence of certain keys within a DataSnapshot
|
1322
|
+
* var ref = firebase.database().ref("users/ada");
|
1323
|
+
* ref.once("value")
|
1324
|
+
* .then(function(snapshot) {
|
1325
|
+
* var name = snapshot.child("name").val(); // {first:"Ada",last:"Lovelace"}
|
1326
|
+
* var firstName = snapshot.child("name/first").val(); // "Ada"
|
1327
|
+
* var lastName = snapshot.child("name").child("last").val(); // "Lovelace"
|
1328
|
+
* var age = snapshot.child("age").val(); // null
|
1329
|
+
* });
|
1330
|
+
*
|
1331
|
+
* @param {string} path A relative path to the location of child data.
|
1332
|
+
* @return {!firebase.database.DataSnapshot}
|
1333
|
+
*/
|
1334
|
+
firebase.database.DataSnapshot.prototype.child = function(path) {};
|
1335
|
+
|
1336
|
+
|
1337
|
+
/**
|
1338
|
+
* Returns true if the specified child path has (non-null) data.
|
1339
|
+
*
|
1340
|
+
* @example
|
1341
|
+
* // Assume we have the following data in the Database:
|
1342
|
+
* {
|
1343
|
+
* "name": {
|
1344
|
+
* "first": "Ada",
|
1345
|
+
* "last": "Lovelace"
|
1346
|
+
* }
|
1347
|
+
* }
|
1348
|
+
*
|
1349
|
+
* // Determine which child keys in DataSnapshot have data.
|
1350
|
+
* var ref = firebase.database().ref("users/ada");
|
1351
|
+
* ref.once("value")
|
1352
|
+
* .then(function(snapshot) {
|
1353
|
+
* var hasName = snapshot.hasChild("name"); // true
|
1354
|
+
* var hasAge = snapshot.hasChild("age"); // false
|
1355
|
+
* });
|
1356
|
+
*
|
1357
|
+
* @param {string} path A relative path to the location of a potential child.
|
1358
|
+
* @return {boolean} `true` if data exists at the specified child path; else
|
1359
|
+
* `false`.
|
1360
|
+
*/
|
1361
|
+
firebase.database.DataSnapshot.prototype.hasChild = function(path) {};
|
1362
|
+
|
1363
|
+
|
1364
|
+
/**
|
1365
|
+
* Gets the priority value of the data in this `DataSnapshot`.
|
1366
|
+
*
|
1367
|
+
* Applications need not use priority but can order collections by
|
1368
|
+
* ordinary properties (see
|
1369
|
+
* {@link
|
1370
|
+
* https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data
|
1371
|
+
* Sorting and filtering data}).
|
1372
|
+
*
|
1373
|
+
* @return {string|number|null}
|
1374
|
+
*/
|
1375
|
+
firebase.database.DataSnapshot.prototype.getPriority = function() {};
|
1376
|
+
|
1377
|
+
|
1378
|
+
/**
|
1379
|
+
* Enumerates the top-level children in the `DataSnapshot`.
|
1380
|
+
*
|
1381
|
+
* Because of the way JavaScript objects work, the ordering of data in the
|
1382
|
+
* JavaScript object returned by `val()` is not guaranteed to match the ordering
|
1383
|
+
* on the server nor the ordering of `child_added` events. That is where
|
1384
|
+
* `forEach()` comes in handy. It guarantees the children of a `DataSnapshot`
|
1385
|
+
* will be iterated in their query order.
|
1386
|
+
*
|
1387
|
+
* If no explicit `orderBy*()` method is used, results are returned
|
1388
|
+
* ordered by key (unless priorities are used, in which case, results are
|
1389
|
+
* returned by priority).
|
1390
|
+
*
|
1391
|
+
* @example
|
1392
|
+
*
|
1393
|
+
* // Assume we have the following data in the Database:
|
1394
|
+
* {
|
1395
|
+
* "users": {
|
1396
|
+
* "ada": {
|
1397
|
+
* "first": "Ada",
|
1398
|
+
* "last": "Lovelace"
|
1399
|
+
* },
|
1400
|
+
* "alan": {
|
1401
|
+
* "first": "Alan",
|
1402
|
+
* "last": "Turing"
|
1403
|
+
* }
|
1404
|
+
* }
|
1405
|
+
* }
|
1406
|
+
*
|
1407
|
+
* // Loop through users in order with the forEach() method. The callback
|
1408
|
+
* // provided to forEach() will be called synchronously with a DataSnapshot
|
1409
|
+
* // for each child:
|
1410
|
+
* var query = firebase.database().ref("users").orderByKey();
|
1411
|
+
* query.once("value")
|
1412
|
+
* .then(function(snapshot) {
|
1413
|
+
* snapshot.forEach(function(childSnapshot) {
|
1414
|
+
* // key will be "ada" the first time and "alan" the second time
|
1415
|
+
* var key = childSnapshot.key;
|
1416
|
+
* // childData will be the actual contents of the child
|
1417
|
+
* var childData = childSnapshot.val();
|
1418
|
+
* });
|
1419
|
+
* });
|
1420
|
+
*
|
1421
|
+
* @example
|
1422
|
+
* // You can cancel the enumeration at any point by having your callback
|
1423
|
+
* // function return true. For example, the following code sample will only
|
1424
|
+
* // fire the callback function one time:
|
1425
|
+
* var query = firebase.database().ref("users").orderByKey();
|
1426
|
+
* query.once("value")
|
1427
|
+
* .then(function(snapshot) {
|
1428
|
+
* snapshot.forEach(function(childSnapshot) {
|
1429
|
+
* var key = childSnapshot.key; // "ada"
|
1430
|
+
*
|
1431
|
+
* // Cancel enumeration
|
1432
|
+
* return true;
|
1433
|
+
* });
|
1434
|
+
* });
|
1435
|
+
*
|
1436
|
+
* @param {function(!firebase.database.DataSnapshot): boolean} action A function
|
1437
|
+
* that will be called for each child DataSnapshot. The callback can return
|
1438
|
+
* true to cancel further enumeration.
|
1439
|
+
* @return {boolean} true if enumeration was canceled due to your callback
|
1440
|
+
* returning true.
|
1441
|
+
*/
|
1442
|
+
firebase.database.DataSnapshot.prototype.forEach = function(action) {};
|
1443
|
+
|
1444
|
+
|
1445
|
+
/**
|
1446
|
+
* Returns whether or not the `DataSnapshot` has any non-`null` child
|
1447
|
+
* properties.
|
1448
|
+
*
|
1449
|
+
* You can use `hasChildren()` to determine if a `DataSnapshot` has any
|
1450
|
+
* children. If it does, you can enumerate them using `forEach()`. If it
|
1451
|
+
* doesn't, then either this snapshot contains a primitive value (which can be
|
1452
|
+
* retrieved with `val()`) or it is empty (in which case, `val()` will return
|
1453
|
+
* `null`).
|
1454
|
+
*
|
1455
|
+
* @example
|
1456
|
+
* // Assume we have the following data in the Database:
|
1457
|
+
* {
|
1458
|
+
* "name": {
|
1459
|
+
* "first": "Ada",
|
1460
|
+
* "last": "Lovelace"
|
1461
|
+
* }
|
1462
|
+
* }
|
1463
|
+
*
|
1464
|
+
* var ref = firebase.database().ref("users/ada");
|
1465
|
+
* ref.once("value")
|
1466
|
+
* .then(function(snapshot) {
|
1467
|
+
* var a = snapshot.hasChildren(); // true
|
1468
|
+
* var b = snapshot.child("name").hasChildren(); // true
|
1469
|
+
* var c = snapshot.child("name/first").hasChildren(); // false
|
1470
|
+
* });
|
1471
|
+
*
|
1472
|
+
* @return {boolean} true if this snapshot has any children; else false.
|
1473
|
+
*/
|
1474
|
+
firebase.database.DataSnapshot.prototype.hasChildren = function() {};
|
1475
|
+
|
1476
|
+
|
1477
|
+
/**
|
1478
|
+
* The key (last part of the path) of the location of this `DataSnapshot`.
|
1479
|
+
*
|
1480
|
+
* The last token in a Database location is considered its key. For example,
|
1481
|
+
* "ada" is the key for the /users/ada/ node. Accessing the key on any
|
1482
|
+
* `DataSnapshot` will return the key for the location that generated it.
|
1483
|
+
* However, accessing the key on the root URL of a Database will return `null`.
|
1484
|
+
*
|
1485
|
+
* @example
|
1486
|
+
* // Assume we have the following data in the Database:
|
1487
|
+
* {
|
1488
|
+
* "name": {
|
1489
|
+
* "first": "Ada",
|
1490
|
+
* "last": "Lovelace"
|
1491
|
+
* }
|
1492
|
+
* }
|
1493
|
+
*
|
1494
|
+
* var ref = firebase.database().ref("users/ada");
|
1495
|
+
* ref.once("value")
|
1496
|
+
* .then(function(snapshot) {
|
1497
|
+
* var key = snapshot.key; // "ada"
|
1498
|
+
* var childKey = snapshot.child("name/last").key; // "last"
|
1499
|
+
* });
|
1500
|
+
*
|
1501
|
+
* @example
|
1502
|
+
* var rootRef = firebase.database().ref();
|
1503
|
+
* rootRef.once("value")
|
1504
|
+
* .then(function(snapshot) {
|
1505
|
+
* var key = snapshot.key; // null
|
1506
|
+
* var childKey = snapshot.child("users/ada").key; // "ada"
|
1507
|
+
* });
|
1508
|
+
*
|
1509
|
+
* @type {string|null}
|
1510
|
+
*/
|
1511
|
+
firebase.database.DataSnapshot.prototype.key;
|
1512
|
+
|
1513
|
+
|
1514
|
+
/**
|
1515
|
+
* Returns the number of child properties of this `DataSnapshot`.
|
1516
|
+
*
|
1517
|
+
* @example
|
1518
|
+
* // Assume we have the following data in the Database:
|
1519
|
+
* {
|
1520
|
+
* "name": {
|
1521
|
+
* "first": "Ada",
|
1522
|
+
* "last": "Lovelace"
|
1523
|
+
* }
|
1524
|
+
* }
|
1525
|
+
*
|
1526
|
+
* var ref = firebase.database().ref("users/ada");
|
1527
|
+
* ref.once("value")
|
1528
|
+
* .then(function(snapshot) {
|
1529
|
+
* var a = snapshot.numChildren(); // 1 ("name")
|
1530
|
+
* var b = snapshot.child("name").numChildren(); // 2 ("first", "last")
|
1531
|
+
* var c = snapshot.child("name/first").numChildren(); // 0
|
1532
|
+
* });
|
1533
|
+
*
|
1534
|
+
* @return {number}
|
1535
|
+
*/
|
1536
|
+
firebase.database.DataSnapshot.prototype.numChildren = function() {};
|
1537
|
+
|
1538
|
+
|
1539
|
+
/**
|
1540
|
+
* The `Reference` for the location that generated this `DataSnapshot`.
|
1541
|
+
*
|
1542
|
+
* @type {!firebase.database.Reference}
|
1543
|
+
*/
|
1544
|
+
firebase.database.DataSnapshot.prototype.ref;
|
1545
|
+
|
1546
|
+
|
1547
|
+
/**
|
1548
|
+
* Returns a JSON-serializable representation of this object.
|
1549
|
+
*
|
1550
|
+
* @return {?Object} A JSON-serializable representation of this object.
|
1551
|
+
*/
|
1552
|
+
firebase.database.DataSnapshot.prototype.toJSON = function() {};
|
1553
|
+
|
1554
|
+
|
1555
|
+
/**
|
1556
|
+
* The `onDisconnect` class allows you to write or clear data when your client
|
1557
|
+
* disconnects from the Database server. These updates occur whether your
|
1558
|
+
* client disconnects cleanly or not, so you can rely on them to clean up data
|
1559
|
+
* even if a connection is dropped or a client crashes.
|
1560
|
+
*
|
1561
|
+
* The `onDisconnect` class is most commonly used to manage presence in
|
1562
|
+
* applications where it is useful to detect how many clients are connected and
|
1563
|
+
* when other clients disconnect. See
|
1564
|
+
* {@link
|
1565
|
+
* https://firebase.google.com/docs/database/web/offline-capabilities
|
1566
|
+
* Enabling Offline Capabilities in JavaScript} for more information.
|
1567
|
+
*
|
1568
|
+
* To avoid problems when a connection is dropped before the requests can be
|
1569
|
+
* transferred to the Database server, these functions should be called before
|
1570
|
+
* writing any data.
|
1571
|
+
*
|
1572
|
+
* Note that `onDisconnect` operations are only triggered once. If you want an
|
1573
|
+
* operation to occur each time a disconnect occurs, you'll need to re-establish
|
1574
|
+
* the `onDisconnect` operations each time you reconnect.
|
1575
|
+
*
|
1576
|
+
* @interface
|
1577
|
+
*/
|
1578
|
+
firebase.database.OnDisconnect = function() {};
|
1579
|
+
|
1580
|
+
|
1581
|
+
/**
|
1582
|
+
* Cancels all previously queued `onDisconnect()` set or update events for this
|
1583
|
+
* location and all children.
|
1584
|
+
*
|
1585
|
+
* If a write has been queued for this location via a `set()` or `update()` at a
|
1586
|
+
* parent location, the write at this location will be canceled, though writes
|
1587
|
+
* to sibling locations will still occur.
|
1588
|
+
*
|
1589
|
+
* @example
|
1590
|
+
* var ref = firebase.database().ref("onlineState");
|
1591
|
+
* ref.onDisconnect().set(false);
|
1592
|
+
* // ... sometime later
|
1593
|
+
* ref.onDisconnect().cancel();
|
1594
|
+
*
|
1595
|
+
* @param {function(?Error)=} onComplete An optional callback function that will
|
1596
|
+
* be called when synchronization to the server has completed. The callback
|
1597
|
+
* will be passed a single parameter: null for success, or an Error object
|
1598
|
+
* indicating a failure.
|
1599
|
+
* @return {!firebase.Promise<void>} Resolves when synchronization to the server
|
1600
|
+
* is complete.
|
1601
|
+
*/
|
1602
|
+
firebase.database.OnDisconnect.prototype.cancel = function(onComplete) {};
|
1603
|
+
|
1604
|
+
|
1605
|
+
/**
|
1606
|
+
* Ensures the data at this location is deleted when the client is disconnected
|
1607
|
+
* (due to closing the browser, navigating to a new page, or network issues).
|
1608
|
+
*
|
1609
|
+
* @param {function(?Error)=} onComplete An optional callback function that will
|
1610
|
+
* be called when synchronization to the server has completed. The callback
|
1611
|
+
* will be passed a single parameter: null for success, or an Error object
|
1612
|
+
* indicating a failure.
|
1613
|
+
* @return {!firebase.Promise<void>} Resolves when synchronization to the server
|
1614
|
+
* is complete.
|
1615
|
+
*/
|
1616
|
+
firebase.database.OnDisconnect.prototype.remove = function(onComplete) {};
|
1617
|
+
|
1618
|
+
/**
|
1619
|
+
* Ensures the data at this location is set to the specified value when the
|
1620
|
+
* client is disconnected (due to closing the browser, navigating to a new page,
|
1621
|
+
* or network issues).
|
1622
|
+
*
|
1623
|
+
* `set()` is especially useful for implementing "presence" systems, where a
|
1624
|
+
* value should be changed or cleared when a user disconnects so that they
|
1625
|
+
* appear "offline" to other users. See
|
1626
|
+
* {@link
|
1627
|
+
* https://firebase.google.com/docs/database/web/offline-capabilities
|
1628
|
+
* Enabling Offline Capabilities in JavaScript} for more information.
|
1629
|
+
*
|
1630
|
+
* Note that `onDisconnect` operations are only triggered once. If you want an
|
1631
|
+
* operation to occur each time a disconnect occurs, you'll need to re-establish
|
1632
|
+
* the `onDisconnect` operations each time.
|
1633
|
+
*
|
1634
|
+
* @example
|
1635
|
+
* var ref = firebase.database().ref("users/ada/status");
|
1636
|
+
* ref.onDisconnect().set("I disconnected!");
|
1637
|
+
*
|
1638
|
+
* @param {*} value The value to be written to this location on
|
1639
|
+
* disconnect (can be an object, array, string, number, boolean, or null).
|
1640
|
+
* @param {function(?Error)=} onComplete An optional callback function that
|
1641
|
+
* will be called when synchronization to the Database server has completed.
|
1642
|
+
* The callback will be passed a single parameter: null for success, or an
|
1643
|
+
* `Error` object indicating a failure.
|
1644
|
+
* @return {!firebase.Promise<void>} Resolves when synchronization to the
|
1645
|
+
* Database is complete.
|
1646
|
+
*/
|
1647
|
+
firebase.database.OnDisconnect.prototype.set = function(value, onComplete) {};
|
1648
|
+
|
1649
|
+
|
1650
|
+
/**
|
1651
|
+
* Ensures the data at this location is set to the specified value and priority
|
1652
|
+
* when the client is disconnected (due to closing the browser, navigating to a
|
1653
|
+
* new page, or network issues).
|
1654
|
+
*
|
1655
|
+
* @param {*} value
|
1656
|
+
* @param {number|string|null} priority
|
1657
|
+
* @param {function(?Error)=} onComplete
|
1658
|
+
* @return {!firebase.Promise<void>}
|
1659
|
+
*/
|
1660
|
+
firebase.database.OnDisconnect.prototype.setWithPriority =
|
1661
|
+
function(value, priority, onComplete) {};
|
1662
|
+
|
1663
|
+
|
1664
|
+
/**
|
1665
|
+
* Writes multiple values at this location when the client is disconnected (due
|
1666
|
+
* to closing the browser, navigating to a new page, or network issues).
|
1667
|
+
*
|
1668
|
+
* The `values` argument contains multiple property-value pairs that will be
|
1669
|
+
* written to the Database together. Each child property can either be a simple
|
1670
|
+
* property (for example, "name") or a relative path (for example, "name/first")
|
1671
|
+
* from the current location to the data to update.
|
1672
|
+
*
|
1673
|
+
* As opposed to the `set()` method, `update()` can be use to selectively update
|
1674
|
+
* only the referenced properties at the current location (instead of replacing
|
1675
|
+
* all the child properties at the current location).
|
1676
|
+
*
|
1677
|
+
* See more examples using the connected version of
|
1678
|
+
* {@link firebase.database.Reference#update `update()`}.
|
1679
|
+
*
|
1680
|
+
* @example
|
1681
|
+
* var ref = firebase.database().ref("users/ada");
|
1682
|
+
* ref.update({
|
1683
|
+
* onlineState: true,
|
1684
|
+
* status: "I'm online."
|
1685
|
+
* });
|
1686
|
+
* ref.onDisconnect().update({
|
1687
|
+
* onlineState: false,
|
1688
|
+
* status: "I'm offline."
|
1689
|
+
* });
|
1690
|
+
*
|
1691
|
+
* @param {!Object} values Object containing multiple values.
|
1692
|
+
* @param {function(?Error)=} onComplete An optional callback function that will
|
1693
|
+
* be called when synchronization to the server has completed. The
|
1694
|
+
* callback will be passed a single parameter: null for success, or an Error
|
1695
|
+
* object indicating a failure.
|
1696
|
+
* @return {!firebase.Promise<void>} Resolves when synchronization to the
|
1697
|
+
* Database is complete.
|
1698
|
+
*/
|
1699
|
+
firebase.database.OnDisconnect.prototype.update =
|
1700
|
+
function(values, onComplete) {};
|