Disqus Comment System - Version 3.0.12

Version Description

  • Disabled browser autocomplete for site configuration form
  • Fixed an issue where admin JavaScript bundle was missing for sites with WP_DEBUG enabled
  • Implemented a dsq_can_load filter for custom control of when Disqus loads
Download this release

Release Info

Developer ryanv12
Plugin Icon Disqus Comment System
Version 3.0.12
Comparing to
See all releases

Code changes from version 3.0.11 to 3.0.12

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes, rya
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
4
  Requires at least: 4.4
5
  Tested up to: 4.9.4
6
- Stable tag: 3.0.11
7
  Requires PHP: 5.4
8
 
9
  Disqus is the web's most popular comment system. Use Disqus to increase engagement, retain readers, and grow your audience.
@@ -122,6 +122,12 @@ Go to [https://disqus.com/help/wordpress](https://disqus.com/help/wordpress)
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
125
  = 3.0.11 =
126
 
127
  * Improved UX on updating the site configuration manually
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
4
  Requires at least: 4.4
5
  Tested up to: 4.9.4
6
+ Stable tag: 3.0.12
7
  Requires PHP: 5.4
8
 
9
  Disqus is the web's most popular comment system. Use Disqus to increase engagement, retain readers, and grow your audience.
122
 
123
  == Changelog ==
124
 
125
+ = 3.0.12 =
126
+
127
+ * Disabled browser autocomplete for site configuration form
128
+ * Fixed an issue where admin JavaScript bundle was missing for sites with WP_DEBUG enabled
129
+ * Implemented a dsq_can_load filter for custom control of when Disqus loads
130
+
131
  = 3.0.11 =
132
 
133
  * Improved UX on updating the site configuration manually
admin/bundles/js/en.disqus-admin.bundle.3.0.12.js ADDED
@@ -0,0 +1,27694 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function(modules) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = {};
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__(moduleId) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if(installedModules[moduleId]) {
10
+ /******/ return installedModules[moduleId].exports;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules[moduleId] = {
14
+ /******/ i: moduleId,
15
+ /******/ l: false,
16
+ /******/ exports: {}
17
+ /******/ };
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module.l = true;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module.exports;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__.m = modules;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__.c = installedModules;
35
+ /******/
36
+ /******/ // define getter function for harmony exports
37
+ /******/ __webpack_require__.d = function(exports, name, getter) {
38
+ /******/ if(!__webpack_require__.o(exports, name)) {
39
+ /******/ Object.defineProperty(exports, name, {
40
+ /******/ configurable: false,
41
+ /******/ enumerable: true,
42
+ /******/ get: getter
43
+ /******/ });
44
+ /******/ }
45
+ /******/ };
46
+ /******/
47
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
48
+ /******/ __webpack_require__.n = function(module) {
49
+ /******/ var getter = module && module.__esModule ?
50
+ /******/ function getDefault() { return module['default']; } :
51
+ /******/ function getModuleExports() { return module; };
52
+ /******/ __webpack_require__.d(getter, 'a', getter);
53
+ /******/ return getter;
54
+ /******/ };
55
+ /******/
56
+ /******/ // Object.prototype.hasOwnProperty.call
57
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
+ /******/
59
+ /******/ // __webpack_public_path__
60
+ /******/ __webpack_require__.p = "";
61
+ /******/
62
+ /******/ // Load entry module and return exports
63
+ /******/ return __webpack_require__(__webpack_require__.s = 38);
64
+ /******/ })
65
+ /************************************************************************/
66
+ /******/ ([
67
+ /* 0 */
68
+ /***/ (function(module, exports) {
69
+
70
+ // shim for using process in browser
71
+ var process = module.exports = {};
72
+
73
+ // cached from whatever global is present so that test runners that stub it
74
+ // don't break things. But we need to wrap it in a try catch in case it is
75
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
76
+ // function because try/catches deoptimize in certain engines.
77
+
78
+ var cachedSetTimeout;
79
+ var cachedClearTimeout;
80
+
81
+ function defaultSetTimout() {
82
+ throw new Error('setTimeout has not been defined');
83
+ }
84
+ function defaultClearTimeout () {
85
+ throw new Error('clearTimeout has not been defined');
86
+ }
87
+ (function () {
88
+ try {
89
+ if (typeof setTimeout === 'function') {
90
+ cachedSetTimeout = setTimeout;
91
+ } else {
92
+ cachedSetTimeout = defaultSetTimout;
93
+ }
94
+ } catch (e) {
95
+ cachedSetTimeout = defaultSetTimout;
96
+ }
97
+ try {
98
+ if (typeof clearTimeout === 'function') {
99
+ cachedClearTimeout = clearTimeout;
100
+ } else {
101
+ cachedClearTimeout = defaultClearTimeout;
102
+ }
103
+ } catch (e) {
104
+ cachedClearTimeout = defaultClearTimeout;
105
+ }
106
+ } ())
107
+ function runTimeout(fun) {
108
+ if (cachedSetTimeout === setTimeout) {
109
+ //normal enviroments in sane situations
110
+ return setTimeout(fun, 0);
111
+ }
112
+ // if setTimeout wasn't available but was latter defined
113
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
114
+ cachedSetTimeout = setTimeout;
115
+ return setTimeout(fun, 0);
116
+ }
117
+ try {
118
+ // when when somebody has screwed with setTimeout but no I.E. maddness
119
+ return cachedSetTimeout(fun, 0);
120
+ } catch(e){
121
+ try {
122
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
123
+ return cachedSetTimeout.call(null, fun, 0);
124
+ } catch(e){
125
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
126
+ return cachedSetTimeout.call(this, fun, 0);
127
+ }
128
+ }
129
+
130
+
131
+ }
132
+ function runClearTimeout(marker) {
133
+ if (cachedClearTimeout === clearTimeout) {
134
+ //normal enviroments in sane situations
135
+ return clearTimeout(marker);
136
+ }
137
+ // if clearTimeout wasn't available but was latter defined
138
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
139
+ cachedClearTimeout = clearTimeout;
140
+ return clearTimeout(marker);
141
+ }
142
+ try {
143
+ // when when somebody has screwed with setTimeout but no I.E. maddness
144
+ return cachedClearTimeout(marker);
145
+ } catch (e){
146
+ try {
147
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
148
+ return cachedClearTimeout.call(null, marker);
149
+ } catch (e){
150
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
151
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
152
+ return cachedClearTimeout.call(this, marker);
153
+ }
154
+ }
155
+
156
+
157
+
158
+ }
159
+ var queue = [];
160
+ var draining = false;
161
+ var currentQueue;
162
+ var queueIndex = -1;
163
+
164
+ function cleanUpNextTick() {
165
+ if (!draining || !currentQueue) {
166
+ return;
167
+ }
168
+ draining = false;
169
+ if (currentQueue.length) {
170
+ queue = currentQueue.concat(queue);
171
+ } else {
172
+ queueIndex = -1;
173
+ }
174
+ if (queue.length) {
175
+ drainQueue();
176
+ }
177
+ }
178
+
179
+ function drainQueue() {
180
+ if (draining) {
181
+ return;
182
+ }
183
+ var timeout = runTimeout(cleanUpNextTick);
184
+ draining = true;
185
+
186
+ var len = queue.length;
187
+ while(len) {
188
+ currentQueue = queue;
189
+ queue = [];
190
+ while (++queueIndex < len) {
191
+ if (currentQueue) {
192
+ currentQueue[queueIndex].run();
193
+ }
194
+ }
195
+ queueIndex = -1;
196
+ len = queue.length;
197
+ }
198
+ currentQueue = null;
199
+ draining = false;
200
+ runClearTimeout(timeout);
201
+ }
202
+
203
+ process.nextTick = function (fun) {
204
+ var args = new Array(arguments.length - 1);
205
+ if (arguments.length > 1) {
206
+ for (var i = 1; i < arguments.length; i++) {
207
+ args[i - 1] = arguments[i];
208
+ }
209
+ }
210
+ queue.push(new Item(fun, args));
211
+ if (queue.length === 1 && !draining) {
212
+ runTimeout(drainQueue);
213
+ }
214
+ };
215
+
216
+ // v8 likes predictible objects
217
+ function Item(fun, array) {
218
+ this.fun = fun;
219
+ this.array = array;
220
+ }
221
+ Item.prototype.run = function () {
222
+ this.fun.apply(null, this.array);
223
+ };
224
+ process.title = 'browser';
225
+ process.browser = true;
226
+ process.env = {};
227
+ process.argv = [];
228
+ process.version = ''; // empty string to avoid regexp issues
229
+ process.versions = {};
230
+
231
+ function noop() {}
232
+
233
+ process.on = noop;
234
+ process.addListener = noop;
235
+ process.once = noop;
236
+ process.off = noop;
237
+ process.removeListener = noop;
238
+ process.removeAllListeners = noop;
239
+ process.emit = noop;
240
+ process.prependListener = noop;
241
+ process.prependOnceListener = noop;
242
+
243
+ process.listeners = function (name) { return [] }
244
+
245
+ process.binding = function (name) {
246
+ throw new Error('process.binding is not supported');
247
+ };
248
+
249
+ process.cwd = function () { return '/' };
250
+ process.chdir = function (dir) {
251
+ throw new Error('process.chdir is not supported');
252
+ };
253
+ process.umask = function() { return 0; };
254
+
255
+
256
+ /***/ }),
257
+ /* 1 */
258
+ /***/ (function(module, exports, __webpack_require__) {
259
+
260
+ "use strict";
261
+ /* WEBPACK VAR INJECTION */(function(process) {
262
+
263
+ if (process.env.NODE_ENV === 'production') {
264
+ module.exports = __webpack_require__(40);
265
+ } else {
266
+ module.exports = __webpack_require__(41);
267
+ }
268
+
269
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
270
+
271
+ /***/ }),
272
+ /* 2 */
273
+ /***/ (function(module, exports, __webpack_require__) {
274
+
275
+ "use strict";
276
+
277
+
278
+ /**
279
+ * Copyright (c) 2013-present, Facebook, Inc.
280
+ *
281
+ * This source code is licensed under the MIT license found in the
282
+ * LICENSE file in the root directory of this source tree.
283
+ *
284
+ *
285
+ */
286
+
287
+ function makeEmptyFunction(arg) {
288
+ return function () {
289
+ return arg;
290
+ };
291
+ }
292
+
293
+ /**
294
+ * This function accepts and discards inputs; it has no side effects. This is
295
+ * primarily useful idiomatically for overridable function endpoints which
296
+ * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
297
+ */
298
+ var emptyFunction = function emptyFunction() {};
299
+
300
+ emptyFunction.thatReturns = makeEmptyFunction;
301
+ emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
302
+ emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
303
+ emptyFunction.thatReturnsNull = makeEmptyFunction(null);
304
+ emptyFunction.thatReturnsThis = function () {
305
+ return this;
306
+ };
307
+ emptyFunction.thatReturnsArgument = function (arg) {
308
+ return arg;
309
+ };
310
+
311
+ module.exports = emptyFunction;
312
+
313
+ /***/ }),
314
+ /* 3 */
315
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
316
+
317
+ "use strict";
318
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
319
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(51);
320
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(27);
321
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(57);
322
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; });
323
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; });
324
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; });
325
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; });
326
+
327
+
328
+
329
+
330
+
331
+
332
+ /***/ }),
333
+ /* 4 */
334
+ /***/ (function(module, exports, __webpack_require__) {
335
+
336
+ "use strict";
337
+
338
+ Object.defineProperty(exports, "__esModule", { value: true });
339
+ var actions_1 = __webpack_require__(10);
340
+ var WordPressCommentExporter_1 = __webpack_require__(86);
341
+ var WordPressRestApi_1 = __webpack_require__(18);
342
+ var UPDATABLE_FIELDS = [
343
+ 'disqus_forum_url',
344
+ 'disqus_public_key',
345
+ 'disqus_secret_key',
346
+ 'disqus_admin_access_token',
347
+ 'disqus_sso_button',
348
+ 'disqus_sso_enabled',
349
+ 'disqus_sync_token',
350
+ ];
351
+ exports.UPDATABLE_FIELDS = UPDATABLE_FIELDS;
352
+ var valueFromInput = function (element) {
353
+ var isCheckbox = element.type === 'checkbox';
354
+ var value;
355
+ if (isCheckbox)
356
+ value = element.checked ? '1' : '';
357
+ else
358
+ value = element.value;
359
+ return value;
360
+ };
361
+ var mapDispatchToProps = function (dispatch) {
362
+ var handleClearMessage = function (event) {
363
+ dispatch(actions_1.setMessageAction(null));
364
+ };
365
+ return {
366
+ onCopyText: function (elementId) {
367
+ try {
368
+ var element = window.document.getElementById(elementId);
369
+ if (element) {
370
+ element.select();
371
+ window.document.execCommand('copy');
372
+ }
373
+ }
374
+ catch (err) {
375
+ // Continue
376
+ }
377
+ },
378
+ onInputChange: function (key, event) {
379
+ var value = valueFromInput(event.currentTarget);
380
+ dispatch(actions_1.updateLocalOptionAction(key, value));
381
+ },
382
+ onSubmitExportCommentsForm: function (event) {
383
+ event.preventDefault();
384
+ var exporter = new WordPressCommentExporter_1.default(dispatch);
385
+ exporter.startExportPosts();
386
+ },
387
+ onSubmitSiteForm: function (event) {
388
+ event.preventDefault();
389
+ var fields = UPDATABLE_FIELDS.reduce(function (previousValue, currentIdKey) {
390
+ if (currentIdKey in event.currentTarget.elements) {
391
+ var currentField = event.currentTarget.elements.namedItem(currentIdKey);
392
+ var currentInputElement = currentField;
393
+ var value = valueFromInput(currentInputElement);
394
+ return Object.assign((_a = {},
395
+ _a[currentInputElement.name] = value,
396
+ _a), previousValue);
397
+ }
398
+ return previousValue;
399
+ var _a;
400
+ }, {});
401
+ WordPressRestApi_1.WordPressRestApi.instance.pluginRestPost('settings', fields, function (response) {
402
+ if (!response)
403
+ return;
404
+ if (response.code !== 'OK') {
405
+ dispatch(actions_1.setMessageAction({
406
+ onDismiss: handleClearMessage,
407
+ text: response.message,
408
+ type: 'error',
409
+ }));
410
+ return;
411
+ }
412
+ dispatch(actions_1.updateAdminOptionsAction(response.data));
413
+ dispatch(actions_1.setMessageAction({
414
+ onDismiss: handleClearMessage,
415
+ text: "Changes saved successfully.",
416
+ type: 'success',
417
+ }));
418
+ dispatch(actions_1.toggleValueAction('isSiteFormLocked'));
419
+ });
420
+ },
421
+ onSubmitSyncConfigForm: function (event) {
422
+ event.preventDefault();
423
+ var endpoint = event.currentTarget.name;
424
+ WordPressRestApi_1.WordPressRestApi.instance.pluginRestPost(endpoint, null, function (response) {
425
+ if (!response)
426
+ return;
427
+ if (response.code !== 'OK') {
428
+ dispatch(actions_1.setMessageAction({
429
+ onDismiss: handleClearMessage,
430
+ text: response.message,
431
+ type: 'error',
432
+ }));
433
+ return;
434
+ }
435
+ dispatch(actions_1.updateSyncStatusAction(response.data));
436
+ dispatch(actions_1.setMessageAction({
437
+ onDismiss: handleClearMessage,
438
+ text: "Changes saved successfully.",
439
+ type: 'success',
440
+ }));
441
+ });
442
+ },
443
+ onToggleState: function (key) {
444
+ dispatch(actions_1.toggleValueAction(key));
445
+ },
446
+ onUpdateInstallationState: function (newState) {
447
+ dispatch(actions_1.changeInstallStateAction(newState));
448
+ },
449
+ };
450
+ };
451
+ exports.default = mapDispatchToProps;
452
+
453
+
454
+ /***/ }),
455
+ /* 5 */
456
+ /***/ (function(module, exports, __webpack_require__) {
457
+
458
+ "use strict";
459
+
460
+ Object.defineProperty(exports, "__esModule", { value: true });
461
+ var mapStateToProps = function (state) {
462
+ return {
463
+ data: state,
464
+ };
465
+ };
466
+ exports.default = mapStateToProps;
467
+
468
+
469
+ /***/ }),
470
+ /* 6 */
471
+ /***/ (function(module, exports, __webpack_require__) {
472
+
473
+ "use strict";
474
+ /*
475
+ object-assign
476
+ (c) Sindre Sorhus
477
+ @license MIT
478
+ */
479
+
480
+
481
+ /* eslint-disable no-unused-vars */
482
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
483
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
484
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
485
+
486
+ function toObject(val) {
487
+ if (val === null || val === undefined) {
488
+ throw new TypeError('Object.assign cannot be called with null or undefined');
489
+ }
490
+
491
+ return Object(val);
492
+ }
493
+
494
+ function shouldUseNative() {
495
+ try {
496
+ if (!Object.assign) {
497
+ return false;
498
+ }
499
+
500
+ // Detect buggy property enumeration order in older V8 versions.
501
+
502
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
503
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
504
+ test1[5] = 'de';
505
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
506
+ return false;
507
+ }
508
+
509
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
510
+ var test2 = {};
511
+ for (var i = 0; i < 10; i++) {
512
+ test2['_' + String.fromCharCode(i)] = i;
513
+ }
514
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
515
+ return test2[n];
516
+ });
517
+ if (order2.join('') !== '0123456789') {
518
+ return false;
519
+ }
520
+
521
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
522
+ var test3 = {};
523
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
524
+ test3[letter] = letter;
525
+ });
526
+ if (Object.keys(Object.assign({}, test3)).join('') !==
527
+ 'abcdefghijklmnopqrst') {
528
+ return false;
529
+ }
530
+
531
+ return true;
532
+ } catch (err) {
533
+ // We don't expect any of the above to throw, but better to be safe.
534
+ return false;
535
+ }
536
+ }
537
+
538
+ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
539
+ var from;
540
+ var to = toObject(target);
541
+ var symbols;
542
+
543
+ for (var s = 1; s < arguments.length; s++) {
544
+ from = Object(arguments[s]);
545
+
546
+ for (var key in from) {
547
+ if (hasOwnProperty.call(from, key)) {
548
+ to[key] = from[key];
549
+ }
550
+ }
551
+
552
+ if (getOwnPropertySymbols) {
553
+ symbols = getOwnPropertySymbols(from);
554
+ for (var i = 0; i < symbols.length; i++) {
555
+ if (propIsEnumerable.call(from, symbols[i])) {
556
+ to[symbols[i]] = from[symbols[i]];
557
+ }
558
+ }
559
+ }
560
+ }
561
+
562
+ return to;
563
+ };
564
+
565
+
566
+ /***/ }),
567
+ /* 7 */
568
+ /***/ (function(module, exports, __webpack_require__) {
569
+
570
+ "use strict";
571
+ /* WEBPACK VAR INJECTION */(function(process) {/**
572
+ * Copyright (c) 2013-present, Facebook, Inc.
573
+ *
574
+ * This source code is licensed under the MIT license found in the
575
+ * LICENSE file in the root directory of this source tree.
576
+ *
577
+ */
578
+
579
+
580
+
581
+ /**
582
+ * Use invariant() to assert state which your program assumes to be true.
583
+ *
584
+ * Provide sprintf-style format (only %s is supported) and arguments
585
+ * to provide information about what broke and what you were
586
+ * expecting.
587
+ *
588
+ * The invariant message will be stripped in production, but the invariant
589
+ * will remain to ensure logic does not differ in production.
590
+ */
591
+
592
+ var validateFormat = function validateFormat(format) {};
593
+
594
+ if (process.env.NODE_ENV !== 'production') {
595
+ validateFormat = function validateFormat(format) {
596
+ if (format === undefined) {
597
+ throw new Error('invariant requires an error message argument');
598
+ }
599
+ };
600
+ }
601
+
602
+ function invariant(condition, format, a, b, c, d, e, f) {
603
+ validateFormat(format);
604
+
605
+ if (!condition) {
606
+ var error;
607
+ if (format === undefined) {
608
+ error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
609
+ } else {
610
+ var args = [a, b, c, d, e, f];
611
+ var argIndex = 0;
612
+ error = new Error(format.replace(/%s/g, function () {
613
+ return args[argIndex++];
614
+ }));
615
+ error.name = 'Invariant Violation';
616
+ }
617
+
618
+ error.framesToPop = 1; // we don't care about invariant's own frame
619
+ throw error;
620
+ }
621
+ }
622
+
623
+ module.exports = invariant;
624
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
625
+
626
+ /***/ }),
627
+ /* 8 */
628
+ /***/ (function(module, exports, __webpack_require__) {
629
+
630
+ "use strict";
631
+ /* WEBPACK VAR INJECTION */(function(process) {/**
632
+ * Copyright (c) 2013-present, Facebook, Inc.
633
+ *
634
+ * This source code is licensed under the MIT license found in the
635
+ * LICENSE file in the root directory of this source tree.
636
+ *
637
+ */
638
+
639
+
640
+
641
+ var emptyObject = {};
642
+
643
+ if (process.env.NODE_ENV !== 'production') {
644
+ Object.freeze(emptyObject);
645
+ }
646
+
647
+ module.exports = emptyObject;
648
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
649
+
650
+ /***/ }),
651
+ /* 9 */
652
+ /***/ (function(module, exports, __webpack_require__) {
653
+
654
+ "use strict";
655
+ /* WEBPACK VAR INJECTION */(function(process) {/**
656
+ * Copyright (c) 2014-present, Facebook, Inc.
657
+ *
658
+ * This source code is licensed under the MIT license found in the
659
+ * LICENSE file in the root directory of this source tree.
660
+ *
661
+ */
662
+
663
+
664
+
665
+ var emptyFunction = __webpack_require__(2);
666
+
667
+ /**
668
+ * Similar to invariant but only logs a warning if the condition is not met.
669
+ * This can be used to log issues in development environments in critical
670
+ * paths. Removing the logging code for production environments will keep the
671
+ * same logic and follow the same code paths.
672
+ */
673
+
674
+ var warning = emptyFunction;
675
+
676
+ if (process.env.NODE_ENV !== 'production') {
677
+ var printWarning = function printWarning(format) {
678
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
679
+ args[_key - 1] = arguments[_key];
680
+ }
681
+
682
+ var argIndex = 0;
683
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
684
+ return args[argIndex++];
685
+ });
686
+ if (typeof console !== 'undefined') {
687
+ console.error(message);
688
+ }
689
+ try {
690
+ // --- Welcome to debugging React ---
691
+ // This error was thrown as a convenience so that you can use this stack
692
+ // to find the callsite that caused this warning to fire.
693
+ throw new Error(message);
694
+ } catch (x) {}
695
+ };
696
+
697
+ warning = function warning(condition, format) {
698
+ if (format === undefined) {
699
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
700
+ }
701
+
702
+ if (format.indexOf('Failed Composite propType: ') === 0) {
703
+ return; // Ignore CompositeComponent proptype check.
704
+ }
705
+
706
+ if (!condition) {
707
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
708
+ args[_key2 - 2] = arguments[_key2];
709
+ }
710
+
711
+ printWarning.apply(undefined, [format].concat(args));
712
+ }
713
+ };
714
+ }
715
+
716
+ module.exports = warning;
717
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
718
+
719
+ /***/ }),
720
+ /* 10 */
721
+ /***/ (function(module, exports, __webpack_require__) {
722
+
723
+ "use strict";
724
+
725
+ Object.defineProperty(exports, "__esModule", { value: true });
726
+ exports.UPDATE_ADMIN_OPTIONS = 'UPDATE_ADMIN_OPTIONS';
727
+ exports.UPDATE_SYNC_STATUS = 'UPDATE_SYNC_STATUS';
728
+ exports.TOGGLE_VALUE = 'TOGGLE_VALUE';
729
+ exports.SET_VALUE = 'SET_VALUE';
730
+ exports.UPDATE_LOCAL_OPTION = 'UPDATE_LOCAL_OPTION';
731
+ exports.SET_MESSAGE = 'SET_MESSAGE';
732
+ exports.CHANGE_INSTALL_STATE = 'CHANGE_INSTALL_STATE';
733
+ exports.CHANGE_TAB_STATE = 'CHANGE_TAB_STATE';
734
+ exports.UPDATE_EXPORT_POST_LOG = 'UPDATE_EXPORT_POST_LOG';
735
+ function updateAdminOptionsAction(data) {
736
+ return {
737
+ data: data,
738
+ type: exports.UPDATE_ADMIN_OPTIONS,
739
+ };
740
+ }
741
+ exports.updateAdminOptionsAction = updateAdminOptionsAction;
742
+ function updateLocalOptionAction(key, newValue) {
743
+ return {
744
+ data: (_a = {},
745
+ _a[key] = newValue,
746
+ _a),
747
+ type: exports.UPDATE_LOCAL_OPTION,
748
+ };
749
+ var _a;
750
+ }
751
+ exports.updateLocalOptionAction = updateLocalOptionAction;
752
+ function updateSyncStatusAction(data) {
753
+ return {
754
+ data: data,
755
+ type: exports.UPDATE_SYNC_STATUS,
756
+ };
757
+ }
758
+ exports.updateSyncStatusAction = updateSyncStatusAction;
759
+ function toggleValueAction(key) {
760
+ return {
761
+ data: key,
762
+ type: exports.TOGGLE_VALUE,
763
+ };
764
+ }
765
+ exports.toggleValueAction = toggleValueAction;
766
+ function setValueAction(key, newValue) {
767
+ return {
768
+ data: (_a = {},
769
+ _a[key] = newValue,
770
+ _a),
771
+ type: exports.SET_VALUE,
772
+ };
773
+ var _a;
774
+ }
775
+ exports.setValueAction = setValueAction;
776
+ function setMessageAction(message) {
777
+ return {
778
+ data: message,
779
+ type: exports.SET_MESSAGE,
780
+ };
781
+ }
782
+ exports.setMessageAction = setMessageAction;
783
+ function changeInstallStateAction(state) {
784
+ return {
785
+ data: state,
786
+ type: exports.CHANGE_INSTALL_STATE,
787
+ };
788
+ }
789
+ exports.changeInstallStateAction = changeInstallStateAction;
790
+ function changeTabStateAction(tab) {
791
+ return {
792
+ data: tab,
793
+ type: exports.CHANGE_TAB_STATE,
794
+ };
795
+ }
796
+ exports.changeTabStateAction = changeTabStateAction;
797
+ function updateExportPostLogAction(log) {
798
+ return {
799
+ data: log,
800
+ type: exports.UPDATE_EXPORT_POST_LOG,
801
+ };
802
+ }
803
+ exports.updateExportPostLogAction = updateExportPostLogAction;
804
+
805
+
806
+ /***/ }),
807
+ /* 11 */
808
+ /***/ (function(module, exports, __webpack_require__) {
809
+
810
+ "use strict";
811
+
812
+ var __extends = (this && this.__extends) || (function () {
813
+ var extendStatics = Object.setPrototypeOf ||
814
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
815
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
816
+ return function (d, b) {
817
+ extendStatics(d, b);
818
+ function __() { this.constructor = d; }
819
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
820
+ };
821
+ })();
822
+ Object.defineProperty(exports, "__esModule", { value: true });
823
+ var immutable_1 = __webpack_require__(17);
824
+ var AdminOptions_1 = __webpack_require__(84);
825
+ var SyncStatus_1 = __webpack_require__(85);
826
+ var InstallationState;
827
+ (function (InstallationState) {
828
+ InstallationState[InstallationState["none"] = 0] = "none";
829
+ InstallationState[InstallationState["noAccount"] = 1] = "noAccount";
830
+ InstallationState[InstallationState["hasAccount"] = 2] = "hasAccount";
831
+ InstallationState[InstallationState["noSite"] = 3] = "noSite";
832
+ InstallationState[InstallationState["hasSite"] = 4] = "hasSite";
833
+ InstallationState[InstallationState["installed"] = 5] = "installed";
834
+ })(InstallationState = exports.InstallationState || (exports.InstallationState = {}));
835
+ var ExportLogStaus;
836
+ (function (ExportLogStaus) {
837
+ ExportLogStaus[ExportLogStaus["pending"] = 0] = "pending";
838
+ ExportLogStaus[ExportLogStaus["complete"] = 1] = "complete";
839
+ ExportLogStaus[ExportLogStaus["failed"] = 2] = "failed";
840
+ })(ExportLogStaus = exports.ExportLogStaus || (exports.ExportLogStaus = {}));
841
+ var AdminState = /** @class */ (function (_super) {
842
+ __extends(AdminState, _super);
843
+ function AdminState(config) {
844
+ return _super.call(this, {
845
+ adminOptions: new AdminOptions_1.default(),
846
+ config: config,
847
+ exportLogs: immutable_1.Map(),
848
+ localAdminOptions: new AdminOptions_1.default(),
849
+ syncStatus: new SyncStatus_1.default(),
850
+ }) || this;
851
+ }
852
+ AdminState.prototype.set = function (key, value) {
853
+ return _super.prototype.set.call(this, key, value);
854
+ };
855
+ AdminState.prototype.with = function (values) {
856
+ return this.merge(values);
857
+ };
858
+ return AdminState;
859
+ }(immutable_1.Record({
860
+ activeTab: null,
861
+ adminOptions: null,
862
+ config: null,
863
+ exportLogs: null,
864
+ installationState: InstallationState.none,
865
+ isExportRunning: false,
866
+ isFetchingAdminOptions: false,
867
+ isFetchingSyncStatus: false,
868
+ isSiteFormLocked: true,
869
+ localAdminOptions: null,
870
+ message: null,
871
+ syncStatus: null,
872
+ })));
873
+ exports.default = AdminState;
874
+
875
+
876
+ /***/ }),
877
+ /* 12 */
878
+ /***/ (function(module, exports, __webpack_require__) {
879
+
880
+ "use strict";
881
+ /* WEBPACK VAR INJECTION */(function(process) {/**
882
+ * Copyright (c) 2013-present, Facebook, Inc.
883
+ *
884
+ * This source code is licensed under the MIT license found in the
885
+ * LICENSE file in the root directory of this source tree.
886
+ */
887
+
888
+
889
+
890
+ if (process.env.NODE_ENV !== 'production') {
891
+ var invariant = __webpack_require__(7);
892
+ var warning = __webpack_require__(9);
893
+ var ReactPropTypesSecret = __webpack_require__(13);
894
+ var loggedTypeFailures = {};
895
+ }
896
+
897
+ /**
898
+ * Assert that the values match with the type specs.
899
+ * Error messages are memorized and will only be shown once.
900
+ *
901
+ * @param {object} typeSpecs Map of name to a ReactPropType
902
+ * @param {object} values Runtime values that need to be type-checked
903
+ * @param {string} location e.g. "prop", "context", "child context"
904
+ * @param {string} componentName Name of the component for error messages.
905
+ * @param {?Function} getStack Returns the component stack.
906
+ * @private
907
+ */
908
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
909
+ if (process.env.NODE_ENV !== 'production') {
910
+ for (var typeSpecName in typeSpecs) {
911
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
912
+ var error;
913
+ // Prop type validation may throw. In case they do, we don't want to
914
+ // fail the render phase where it didn't fail before. So we log it.
915
+ // After these have been cleaned up, we'll let them throw.
916
+ try {
917
+ // This is intentionally an invariant that gets caught. It's the same
918
+ // behavior as without this statement except with a better message.
919
+ invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
920
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
921
+ } catch (ex) {
922
+ error = ex;
923
+ }
924
+ warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
925
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
926
+ // Only monitor this failure once because there tends to be a lot of the
927
+ // same error.
928
+ loggedTypeFailures[error.message] = true;
929
+
930
+ var stack = getStack ? getStack() : '';
931
+
932
+ warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
933
+ }
934
+ }
935
+ }
936
+ }
937
+ }
938
+
939
+ module.exports = checkPropTypes;
940
+
941
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
942
+
943
+ /***/ }),
944
+ /* 13 */
945
+ /***/ (function(module, exports, __webpack_require__) {
946
+
947
+ "use strict";
948
+ /**
949
+ * Copyright (c) 2013-present, Facebook, Inc.
950
+ *
951
+ * This source code is licensed under the MIT license found in the
952
+ * LICENSE file in the root directory of this source tree.
953
+ */
954
+
955
+
956
+
957
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
958
+
959
+ module.exports = ReactPropTypesSecret;
960
+
961
+
962
+ /***/ }),
963
+ /* 14 */
964
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
965
+
966
+ "use strict";
967
+ /* harmony export (immutable) */ __webpack_exports__["a"] = warning;
968
+ /**
969
+ * Prints a warning in the console if it exists.
970
+ *
971
+ * @param {String} message The warning message.
972
+ * @returns {void}
973
+ */
974
+ function warning(message) {
975
+ /* eslint-disable no-console */
976
+ if (typeof console !== 'undefined' && typeof console.error === 'function') {
977
+ console.error(message);
978
+ }
979
+ /* eslint-enable no-console */
980
+ try {
981
+ // This error was thrown as a convenience so that if you enable
982
+ // "break on all exceptions" in your console,
983
+ // it would pause the execution at this line.
984
+ throw new Error(message);
985
+ /* eslint-disable no-empty */
986
+ } catch (e) {}
987
+ /* eslint-enable no-empty */
988
+ }
989
+
990
+ /***/ }),
991
+ /* 15 */
992
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
993
+
994
+ "use strict";
995
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(60);
996
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(65);
997
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(67);
998
+
999
+
1000
+
1001
+
1002
+ /** `Object#toString` result references. */
1003
+ var objectTag = '[object Object]';
1004
+
1005
+ /** Used for built-in method references. */
1006
+ var funcProto = Function.prototype,
1007
+ objectProto = Object.prototype;
1008
+
1009
+ /** Used to resolve the decompiled source of functions. */
1010
+ var funcToString = funcProto.toString;
1011
+
1012
+ /** Used to check objects for own properties. */
1013
+ var hasOwnProperty = objectProto.hasOwnProperty;
1014
+
1015
+ /** Used to infer the `Object` constructor. */
1016
+ var objectCtorString = funcToString.call(Object);
1017
+
1018
+ /**
1019
+ * Checks if `value` is a plain object, that is, an object created by the
1020
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
1021
+ *
1022
+ * @static
1023
+ * @memberOf _
1024
+ * @since 0.8.0
1025
+ * @category Lang
1026
+ * @param {*} value The value to check.
1027
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1028
+ * @example
1029
+ *
1030
+ * function Foo() {
1031
+ * this.a = 1;
1032
+ * }
1033
+ *
1034
+ * _.isPlainObject(new Foo);
1035
+ * // => false
1036
+ *
1037
+ * _.isPlainObject([1, 2, 3]);
1038
+ * // => false
1039
+ *
1040
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
1041
+ * // => true
1042
+ *
1043
+ * _.isPlainObject(Object.create(null));
1044
+ * // => true
1045
+ */
1046
+ function isPlainObject(value) {
1047
+ if (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) {
1048
+ return false;
1049
+ }
1050
+ var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(value);
1051
+ if (proto === null) {
1052
+ return true;
1053
+ }
1054
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
1055
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
1056
+ funcToString.call(Ctor) == objectCtorString;
1057
+ }
1058
+
1059
+ /* harmony default export */ __webpack_exports__["a"] = (isPlainObject);
1060
+
1061
+
1062
+ /***/ }),
1063
+ /* 16 */
1064
+ /***/ (function(module, exports, __webpack_require__) {
1065
+
1066
+ "use strict";
1067
+
1068
+ Object.defineProperty(exports, "__esModule", { value: true });
1069
+ function getWordpressAdminUrl(name) {
1070
+ return window.DISQUS_WP.adminUrls[name];
1071
+ }
1072
+ exports.getWordpressAdminUrl = getWordpressAdminUrl;
1073
+ function getForumAdminUrl(shortname, path) {
1074
+ return "https://" + shortname + ".disqus.com/admin/" + path + "/";
1075
+ }
1076
+ exports.getForumAdminUrl = getForumAdminUrl;
1077
+
1078
+
1079
+ /***/ }),
1080
+ /* 17 */
1081
+ /***/ (function(module, exports, __webpack_require__) {
1082
+
1083
+ /**
1084
+ * Copyright (c) 2014-present, Facebook, Inc.
1085
+ *
1086
+ * This source code is licensed under the MIT license found in the
1087
+ * LICENSE file in the root directory of this source tree.
1088
+ */
1089
+
1090
+ (function (global, factory) {
1091
+ true ? module.exports = factory() :
1092
+ typeof define === 'function' && define.amd ? define(factory) :
1093
+ (global.Immutable = factory());
1094
+ }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;
1095
+
1096
+ function createClass(ctor, superClass) {
1097
+ if (superClass) {
1098
+ ctor.prototype = Object.create(superClass.prototype);
1099
+ }
1100
+ ctor.prototype.constructor = ctor;
1101
+ }
1102
+
1103
+ function Iterable(value) {
1104
+ return isIterable(value) ? value : Seq(value);
1105
+ }
1106
+
1107
+
1108
+ createClass(KeyedIterable, Iterable);
1109
+ function KeyedIterable(value) {
1110
+ return isKeyed(value) ? value : KeyedSeq(value);
1111
+ }
1112
+
1113
+
1114
+ createClass(IndexedIterable, Iterable);
1115
+ function IndexedIterable(value) {
1116
+ return isIndexed(value) ? value : IndexedSeq(value);
1117
+ }
1118
+
1119
+
1120
+ createClass(SetIterable, Iterable);
1121
+ function SetIterable(value) {
1122
+ return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
1123
+ }
1124
+
1125
+
1126
+
1127
+ function isIterable(maybeIterable) {
1128
+ return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
1129
+ }
1130
+
1131
+ function isKeyed(maybeKeyed) {
1132
+ return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
1133
+ }
1134
+
1135
+ function isIndexed(maybeIndexed) {
1136
+ return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
1137
+ }
1138
+
1139
+ function isAssociative(maybeAssociative) {
1140
+ return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
1141
+ }
1142
+
1143
+ function isOrdered(maybeOrdered) {
1144
+ return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
1145
+ }
1146
+
1147
+ Iterable.isIterable = isIterable;
1148
+ Iterable.isKeyed = isKeyed;
1149
+ Iterable.isIndexed = isIndexed;
1150
+ Iterable.isAssociative = isAssociative;
1151
+ Iterable.isOrdered = isOrdered;
1152
+
1153
+ Iterable.Keyed = KeyedIterable;
1154
+ Iterable.Indexed = IndexedIterable;
1155
+ Iterable.Set = SetIterable;
1156
+
1157
+
1158
+ var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
1159
+ var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
1160
+ var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
1161
+ var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
1162
+
1163
+ // Used for setting prototype methods that IE8 chokes on.
1164
+ var DELETE = 'delete';
1165
+
1166
+ // Constants describing the size of trie nodes.
1167
+ var SHIFT = 5; // Resulted in best performance after ______?
1168
+ var SIZE = 1 << SHIFT;
1169
+ var MASK = SIZE - 1;
1170
+
1171
+ // A consistent shared value representing "not set" which equals nothing other
1172
+ // than itself, and nothing that could be provided externally.
1173
+ var NOT_SET = {};
1174
+
1175
+ // Boolean references, Rough equivalent of `bool &`.
1176
+ var CHANGE_LENGTH = { value: false };
1177
+ var DID_ALTER = { value: false };
1178
+
1179
+ function MakeRef(ref) {
1180
+ ref.value = false;
1181
+ return ref;
1182
+ }
1183
+
1184
+ function SetRef(ref) {
1185
+ ref && (ref.value = true);
1186
+ }
1187
+
1188
+ // A function which returns a value representing an "owner" for transient writes
1189
+ // to tries. The return value will only ever equal itself, and will not equal
1190
+ // the return of any subsequent call of this function.
1191
+ function OwnerID() {}
1192
+
1193
+ // http://jsperf.com/copy-array-inline
1194
+ function arrCopy(arr, offset) {
1195
+ offset = offset || 0;
1196
+ var len = Math.max(0, arr.length - offset);
1197
+ var newArr = new Array(len);
1198
+ for (var ii = 0; ii < len; ii++) {
1199
+ newArr[ii] = arr[ii + offset];
1200
+ }
1201
+ return newArr;
1202
+ }
1203
+
1204
+ function ensureSize(iter) {
1205
+ if (iter.size === undefined) {
1206
+ iter.size = iter.__iterate(returnTrue);
1207
+ }
1208
+ return iter.size;
1209
+ }
1210
+
1211
+ function wrapIndex(iter, index) {
1212
+ // This implements "is array index" which the ECMAString spec defines as:
1213
+ //
1214
+ // A String property name P is an array index if and only if
1215
+ // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
1216
+ // to 2^32−1.
1217
+ //
1218
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
1219
+ if (typeof index !== 'number') {
1220
+ var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
1221
+ if ('' + uint32Index !== index || uint32Index === 4294967295) {
1222
+ return NaN;
1223
+ }
1224
+ index = uint32Index;
1225
+ }
1226
+ return index < 0 ? ensureSize(iter) + index : index;
1227
+ }
1228
+
1229
+ function returnTrue() {
1230
+ return true;
1231
+ }
1232
+
1233
+ function wholeSlice(begin, end, size) {
1234
+ return (begin === 0 || (size !== undefined && begin <= -size)) &&
1235
+ (end === undefined || (size !== undefined && end >= size));
1236
+ }
1237
+
1238
+ function resolveBegin(begin, size) {
1239
+ return resolveIndex(begin, size, 0);
1240
+ }
1241
+
1242
+ function resolveEnd(end, size) {
1243
+ return resolveIndex(end, size, size);
1244
+ }
1245
+
1246
+ function resolveIndex(index, size, defaultIndex) {
1247
+ return index === undefined ?
1248
+ defaultIndex :
1249
+ index < 0 ?
1250
+ Math.max(0, size + index) :
1251
+ size === undefined ?
1252
+ index :
1253
+ Math.min(size, index);
1254
+ }
1255
+
1256
+ /* global Symbol */
1257
+
1258
+ var ITERATE_KEYS = 0;
1259
+ var ITERATE_VALUES = 1;
1260
+ var ITERATE_ENTRIES = 2;
1261
+
1262
+ var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1263
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
1264
+
1265
+ var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
1266
+
1267
+
1268
+ function Iterator(next) {
1269
+ this.next = next;
1270
+ }
1271
+
1272
+ Iterator.prototype.toString = function() {
1273
+ return '[Iterator]';
1274
+ };
1275
+
1276
+
1277
+ Iterator.KEYS = ITERATE_KEYS;
1278
+ Iterator.VALUES = ITERATE_VALUES;
1279
+ Iterator.ENTRIES = ITERATE_ENTRIES;
1280
+
1281
+ Iterator.prototype.inspect =
1282
+ Iterator.prototype.toSource = function () { return this.toString(); }
1283
+ Iterator.prototype[ITERATOR_SYMBOL] = function () {
1284
+ return this;
1285
+ };
1286
+
1287
+
1288
+ function iteratorValue(type, k, v, iteratorResult) {
1289
+ var value = type === 0 ? k : type === 1 ? v : [k, v];
1290
+ iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {
1291
+ value: value, done: false
1292
+ });
1293
+ return iteratorResult;
1294
+ }
1295
+
1296
+ function iteratorDone() {
1297
+ return { value: undefined, done: true };
1298
+ }
1299
+
1300
+ function hasIterator(maybeIterable) {
1301
+ return !!getIteratorFn(maybeIterable);
1302
+ }
1303
+
1304
+ function isIterator(maybeIterator) {
1305
+ return maybeIterator && typeof maybeIterator.next === 'function';
1306
+ }
1307
+
1308
+ function getIterator(iterable) {
1309
+ var iteratorFn = getIteratorFn(iterable);
1310
+ return iteratorFn && iteratorFn.call(iterable);
1311
+ }
1312
+
1313
+ function getIteratorFn(iterable) {
1314
+ var iteratorFn = iterable && (
1315
+ (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
1316
+ iterable[FAUX_ITERATOR_SYMBOL]
1317
+ );
1318
+ if (typeof iteratorFn === 'function') {
1319
+ return iteratorFn;
1320
+ }
1321
+ }
1322
+
1323
+ function isArrayLike(value) {
1324
+ return value && typeof value.length === 'number';
1325
+ }
1326
+
1327
+ createClass(Seq, Iterable);
1328
+ function Seq(value) {
1329
+ return value === null || value === undefined ? emptySequence() :
1330
+ isIterable(value) ? value.toSeq() : seqFromValue(value);
1331
+ }
1332
+
1333
+ Seq.of = function(/*...values*/) {
1334
+ return Seq(arguments);
1335
+ };
1336
+
1337
+ Seq.prototype.toSeq = function() {
1338
+ return this;
1339
+ };
1340
+
1341
+ Seq.prototype.toString = function() {
1342
+ return this.__toString('Seq {', '}');
1343
+ };
1344
+
1345
+ Seq.prototype.cacheResult = function() {
1346
+ if (!this._cache && this.__iterateUncached) {
1347
+ this._cache = this.entrySeq().toArray();
1348
+ this.size = this._cache.length;
1349
+ }
1350
+ return this;
1351
+ };
1352
+
1353
+ // abstract __iterateUncached(fn, reverse)
1354
+
1355
+ Seq.prototype.__iterate = function(fn, reverse) {
1356
+ return seqIterate(this, fn, reverse, true);
1357
+ };
1358
+
1359
+ // abstract __iteratorUncached(type, reverse)
1360
+
1361
+ Seq.prototype.__iterator = function(type, reverse) {
1362
+ return seqIterator(this, type, reverse, true);
1363
+ };
1364
+
1365
+
1366
+
1367
+ createClass(KeyedSeq, Seq);
1368
+ function KeyedSeq(value) {
1369
+ return value === null || value === undefined ?
1370
+ emptySequence().toKeyedSeq() :
1371
+ isIterable(value) ?
1372
+ (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :
1373
+ keyedSeqFromValue(value);
1374
+ }
1375
+
1376
+ KeyedSeq.prototype.toKeyedSeq = function() {
1377
+ return this;
1378
+ };
1379
+
1380
+
1381
+
1382
+ createClass(IndexedSeq, Seq);
1383
+ function IndexedSeq(value) {
1384
+ return value === null || value === undefined ? emptySequence() :
1385
+ !isIterable(value) ? indexedSeqFromValue(value) :
1386
+ isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
1387
+ }
1388
+
1389
+ IndexedSeq.of = function(/*...values*/) {
1390
+ return IndexedSeq(arguments);
1391
+ };
1392
+
1393
+ IndexedSeq.prototype.toIndexedSeq = function() {
1394
+ return this;
1395
+ };
1396
+
1397
+ IndexedSeq.prototype.toString = function() {
1398
+ return this.__toString('Seq [', ']');
1399
+ };
1400
+
1401
+ IndexedSeq.prototype.__iterate = function(fn, reverse) {
1402
+ return seqIterate(this, fn, reverse, false);
1403
+ };
1404
+
1405
+ IndexedSeq.prototype.__iterator = function(type, reverse) {
1406
+ return seqIterator(this, type, reverse, false);
1407
+ };
1408
+
1409
+
1410
+
1411
+ createClass(SetSeq, Seq);
1412
+ function SetSeq(value) {
1413
+ return (
1414
+ value === null || value === undefined ? emptySequence() :
1415
+ !isIterable(value) ? indexedSeqFromValue(value) :
1416
+ isKeyed(value) ? value.entrySeq() : value
1417
+ ).toSetSeq();
1418
+ }
1419
+
1420
+ SetSeq.of = function(/*...values*/) {
1421
+ return SetSeq(arguments);
1422
+ };
1423
+
1424
+ SetSeq.prototype.toSetSeq = function() {
1425
+ return this;
1426
+ };
1427
+
1428
+
1429
+
1430
+ Seq.isSeq = isSeq;
1431
+ Seq.Keyed = KeyedSeq;
1432
+ Seq.Set = SetSeq;
1433
+ Seq.Indexed = IndexedSeq;
1434
+
1435
+ var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
1436
+
1437
+ Seq.prototype[IS_SEQ_SENTINEL] = true;
1438
+
1439
+
1440
+
1441
+ createClass(ArraySeq, IndexedSeq);
1442
+ function ArraySeq(array) {
1443
+ this._array = array;
1444
+ this.size = array.length;
1445
+ }
1446
+
1447
+ ArraySeq.prototype.get = function(index, notSetValue) {
1448
+ return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
1449
+ };
1450
+
1451
+ ArraySeq.prototype.__iterate = function(fn, reverse) {
1452
+ var array = this._array;
1453
+ var maxIndex = array.length - 1;
1454
+ for (var ii = 0; ii <= maxIndex; ii++) {
1455
+ if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
1456
+ return ii + 1;
1457
+ }
1458
+ }
1459
+ return ii;
1460
+ };
1461
+
1462
+ ArraySeq.prototype.__iterator = function(type, reverse) {
1463
+ var array = this._array;
1464
+ var maxIndex = array.length - 1;
1465
+ var ii = 0;
1466
+ return new Iterator(function()
1467
+ {return ii > maxIndex ?
1468
+ iteratorDone() :
1469
+ iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}
1470
+ );
1471
+ };
1472
+
1473
+
1474
+
1475
+ createClass(ObjectSeq, KeyedSeq);
1476
+ function ObjectSeq(object) {
1477
+ var keys = Object.keys(object);
1478
+ this._object = object;
1479
+ this._keys = keys;
1480
+ this.size = keys.length;
1481
+ }
1482
+
1483
+ ObjectSeq.prototype.get = function(key, notSetValue) {
1484
+ if (notSetValue !== undefined && !this.has(key)) {
1485
+ return notSetValue;
1486
+ }
1487
+ return this._object[key];
1488
+ };
1489
+
1490
+ ObjectSeq.prototype.has = function(key) {
1491
+ return this._object.hasOwnProperty(key);
1492
+ };
1493
+
1494
+ ObjectSeq.prototype.__iterate = function(fn, reverse) {
1495
+ var object = this._object;
1496
+ var keys = this._keys;
1497
+ var maxIndex = keys.length - 1;
1498
+ for (var ii = 0; ii <= maxIndex; ii++) {
1499
+ var key = keys[reverse ? maxIndex - ii : ii];
1500
+ if (fn(object[key], key, this) === false) {
1501
+ return ii + 1;
1502
+ }
1503
+ }
1504
+ return ii;
1505
+ };
1506
+
1507
+ ObjectSeq.prototype.__iterator = function(type, reverse) {
1508
+ var object = this._object;
1509
+ var keys = this._keys;
1510
+ var maxIndex = keys.length - 1;
1511
+ var ii = 0;
1512
+ return new Iterator(function() {
1513
+ var key = keys[reverse ? maxIndex - ii : ii];
1514
+ return ii++ > maxIndex ?
1515
+ iteratorDone() :
1516
+ iteratorValue(type, key, object[key]);
1517
+ });
1518
+ };
1519
+
1520
+ ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;
1521
+
1522
+
1523
+ createClass(IterableSeq, IndexedSeq);
1524
+ function IterableSeq(iterable) {
1525
+ this._iterable = iterable;
1526
+ this.size = iterable.length || iterable.size;
1527
+ }
1528
+
1529
+ IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
1530
+ if (reverse) {
1531
+ return this.cacheResult().__iterate(fn, reverse);
1532
+ }
1533
+ var iterable = this._iterable;
1534
+ var iterator = getIterator(iterable);
1535
+ var iterations = 0;
1536
+ if (isIterator(iterator)) {
1537
+ var step;
1538
+ while (!(step = iterator.next()).done) {
1539
+ if (fn(step.value, iterations++, this) === false) {
1540
+ break;
1541
+ }
1542
+ }
1543
+ }
1544
+ return iterations;
1545
+ };
1546
+
1547
+ IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
1548
+ if (reverse) {
1549
+ return this.cacheResult().__iterator(type, reverse);
1550
+ }
1551
+ var iterable = this._iterable;
1552
+ var iterator = getIterator(iterable);
1553
+ if (!isIterator(iterator)) {
1554
+ return new Iterator(iteratorDone);
1555
+ }
1556
+ var iterations = 0;
1557
+ return new Iterator(function() {
1558
+ var step = iterator.next();
1559
+ return step.done ? step : iteratorValue(type, iterations++, step.value);
1560
+ });
1561
+ };
1562
+
1563
+
1564
+
1565
+ createClass(IteratorSeq, IndexedSeq);
1566
+ function IteratorSeq(iterator) {
1567
+ this._iterator = iterator;
1568
+ this._iteratorCache = [];
1569
+ }
1570
+
1571
+ IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
1572
+ if (reverse) {
1573
+ return this.cacheResult().__iterate(fn, reverse);
1574
+ }
1575
+ var iterator = this._iterator;
1576
+ var cache = this._iteratorCache;
1577
+ var iterations = 0;
1578
+ while (iterations < cache.length) {
1579
+ if (fn(cache[iterations], iterations++, this) === false) {
1580
+ return iterations;
1581
+ }
1582
+ }
1583
+ var step;
1584
+ while (!(step = iterator.next()).done) {
1585
+ var val = step.value;
1586
+ cache[iterations] = val;
1587
+ if (fn(val, iterations++, this) === false) {
1588
+ break;
1589
+ }
1590
+ }
1591
+ return iterations;
1592
+ };
1593
+
1594
+ IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
1595
+ if (reverse) {
1596
+ return this.cacheResult().__iterator(type, reverse);
1597
+ }
1598
+ var iterator = this._iterator;
1599
+ var cache = this._iteratorCache;
1600
+ var iterations = 0;
1601
+ return new Iterator(function() {
1602
+ if (iterations >= cache.length) {
1603
+ var step = iterator.next();
1604
+ if (step.done) {
1605
+ return step;
1606
+ }
1607
+ cache[iterations] = step.value;
1608
+ }
1609
+ return iteratorValue(type, iterations, cache[iterations++]);
1610
+ });
1611
+ };
1612
+
1613
+
1614
+
1615
+
1616
+ // # pragma Helper functions
1617
+
1618
+ function isSeq(maybeSeq) {
1619
+ return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
1620
+ }
1621
+
1622
+ var EMPTY_SEQ;
1623
+
1624
+ function emptySequence() {
1625
+ return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
1626
+ }
1627
+
1628
+ function keyedSeqFromValue(value) {
1629
+ var seq =
1630
+ Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :
1631
+ isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :
1632
+ hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :
1633
+ typeof value === 'object' ? new ObjectSeq(value) :
1634
+ undefined;
1635
+ if (!seq) {
1636
+ throw new TypeError(
1637
+ 'Expected Array or iterable object of [k, v] entries, '+
1638
+ 'or keyed object: ' + value
1639
+ );
1640
+ }
1641
+ return seq;
1642
+ }
1643
+
1644
+ function indexedSeqFromValue(value) {
1645
+ var seq = maybeIndexedSeqFromValue(value);
1646
+ if (!seq) {
1647
+ throw new TypeError(
1648
+ 'Expected Array or iterable object of values: ' + value
1649
+ );
1650
+ }
1651
+ return seq;
1652
+ }
1653
+
1654
+ function seqFromValue(value) {
1655
+ var seq = maybeIndexedSeqFromValue(value) ||
1656
+ (typeof value === 'object' && new ObjectSeq(value));
1657
+ if (!seq) {
1658
+ throw new TypeError(
1659
+ 'Expected Array or iterable object of values, or keyed object: ' + value
1660
+ );
1661
+ }
1662
+ return seq;
1663
+ }
1664
+
1665
+ function maybeIndexedSeqFromValue(value) {
1666
+ return (
1667
+ isArrayLike(value) ? new ArraySeq(value) :
1668
+ isIterator(value) ? new IteratorSeq(value) :
1669
+ hasIterator(value) ? new IterableSeq(value) :
1670
+ undefined
1671
+ );
1672
+ }
1673
+
1674
+ function seqIterate(seq, fn, reverse, useKeys) {
1675
+ var cache = seq._cache;
1676
+ if (cache) {
1677
+ var maxIndex = cache.length - 1;
1678
+ for (var ii = 0; ii <= maxIndex; ii++) {
1679
+ var entry = cache[reverse ? maxIndex - ii : ii];
1680
+ if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
1681
+ return ii + 1;
1682
+ }
1683
+ }
1684
+ return ii;
1685
+ }
1686
+ return seq.__iterateUncached(fn, reverse);
1687
+ }
1688
+
1689
+ function seqIterator(seq, type, reverse, useKeys) {
1690
+ var cache = seq._cache;
1691
+ if (cache) {
1692
+ var maxIndex = cache.length - 1;
1693
+ var ii = 0;
1694
+ return new Iterator(function() {
1695
+ var entry = cache[reverse ? maxIndex - ii : ii];
1696
+ return ii++ > maxIndex ?
1697
+ iteratorDone() :
1698
+ iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
1699
+ });
1700
+ }
1701
+ return seq.__iteratorUncached(type, reverse);
1702
+ }
1703
+
1704
+ function fromJS(json, converter) {
1705
+ return converter ?
1706
+ fromJSWith(converter, json, '', {'': json}) :
1707
+ fromJSDefault(json);
1708
+ }
1709
+
1710
+ function fromJSWith(converter, json, key, parentJSON) {
1711
+ if (Array.isArray(json)) {
1712
+ return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
1713
+ }
1714
+ if (isPlainObj(json)) {
1715
+ return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
1716
+ }
1717
+ return json;
1718
+ }
1719
+
1720
+ function fromJSDefault(json) {
1721
+ if (Array.isArray(json)) {
1722
+ return IndexedSeq(json).map(fromJSDefault).toList();
1723
+ }
1724
+ if (isPlainObj(json)) {
1725
+ return KeyedSeq(json).map(fromJSDefault).toMap();
1726
+ }
1727
+ return json;
1728
+ }
1729
+
1730
+ function isPlainObj(value) {
1731
+ return value && (value.constructor === Object || value.constructor === undefined);
1732
+ }
1733
+
1734
+ /**
1735
+ * An extension of the "same-value" algorithm as [described for use by ES6 Map
1736
+ * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
1737
+ *
1738
+ * NaN is considered the same as NaN, however -0 and 0 are considered the same
1739
+ * value, which is different from the algorithm described by
1740
+ * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
1741
+ *
1742
+ * This is extended further to allow Objects to describe the values they
1743
+ * represent, by way of `valueOf` or `equals` (and `hashCode`).
1744
+ *
1745
+ * Note: because of this extension, the key equality of Immutable.Map and the
1746
+ * value equality of Immutable.Set will differ from ES6 Map and Set.
1747
+ *
1748
+ * ### Defining custom values
1749
+ *
1750
+ * The easiest way to describe the value an object represents is by implementing
1751
+ * `valueOf`. For example, `Date` represents a value by returning a unix
1752
+ * timestamp for `valueOf`:
1753
+ *
1754
+ * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
1755
+ * var date2 = new Date(1234567890000);
1756
+ * date1.valueOf(); // 1234567890000
1757
+ * assert( date1 !== date2 );
1758
+ * assert( Immutable.is( date1, date2 ) );
1759
+ *
1760
+ * Note: overriding `valueOf` may have other implications if you use this object
1761
+ * where JavaScript expects a primitive, such as implicit string coercion.
1762
+ *
1763
+ * For more complex types, especially collections, implementing `valueOf` may
1764
+ * not be performant. An alternative is to implement `equals` and `hashCode`.
1765
+ *
1766
+ * `equals` takes another object, presumably of similar type, and returns true
1767
+ * if the it is equal. Equality is symmetrical, so the same result should be
1768
+ * returned if this and the argument are flipped.
1769
+ *
1770
+ * assert( a.equals(b) === b.equals(a) );
1771
+ *
1772
+ * `hashCode` returns a 32bit integer number representing the object which will
1773
+ * be used to determine how to store the value object in a Map or Set. You must
1774
+ * provide both or neither methods, one must not exist without the other.
1775
+ *
1776
+ * Also, an important relationship between these methods must be upheld: if two
1777
+ * values are equal, they *must* return the same hashCode. If the values are not
1778
+ * equal, they might have the same hashCode; this is called a hash collision,
1779
+ * and while undesirable for performance reasons, it is acceptable.
1780
+ *
1781
+ * if (a.equals(b)) {
1782
+ * assert( a.hashCode() === b.hashCode() );
1783
+ * }
1784
+ *
1785
+ * All Immutable collections implement `equals` and `hashCode`.
1786
+ *
1787
+ */
1788
+ function is(valueA, valueB) {
1789
+ if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
1790
+ return true;
1791
+ }
1792
+ if (!valueA || !valueB) {
1793
+ return false;
1794
+ }
1795
+ if (typeof valueA.valueOf === 'function' &&
1796
+ typeof valueB.valueOf === 'function') {
1797
+ valueA = valueA.valueOf();
1798
+ valueB = valueB.valueOf();
1799
+ if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
1800
+ return true;
1801
+ }
1802
+ if (!valueA || !valueB) {
1803
+ return false;
1804
+ }
1805
+ }
1806
+ if (typeof valueA.equals === 'function' &&
1807
+ typeof valueB.equals === 'function' &&
1808
+ valueA.equals(valueB)) {
1809
+ return true;
1810
+ }
1811
+ return false;
1812
+ }
1813
+
1814
+ function deepEqual(a, b) {
1815
+ if (a === b) {
1816
+ return true;
1817
+ }
1818
+
1819
+ if (
1820
+ !isIterable(b) ||
1821
+ a.size !== undefined && b.size !== undefined && a.size !== b.size ||
1822
+ a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||
1823
+ isKeyed(a) !== isKeyed(b) ||
1824
+ isIndexed(a) !== isIndexed(b) ||
1825
+ isOrdered(a) !== isOrdered(b)
1826
+ ) {
1827
+ return false;
1828
+ }
1829
+
1830
+ if (a.size === 0 && b.size === 0) {
1831
+ return true;
1832
+ }
1833
+
1834
+ var notAssociative = !isAssociative(a);
1835
+
1836
+ if (isOrdered(a)) {
1837
+ var entries = a.entries();
1838
+ return b.every(function(v, k) {
1839
+ var entry = entries.next().value;
1840
+ return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
1841
+ }) && entries.next().done;
1842
+ }
1843
+
1844
+ var flipped = false;
1845
+
1846
+ if (a.size === undefined) {
1847
+ if (b.size === undefined) {
1848
+ if (typeof a.cacheResult === 'function') {
1849
+ a.cacheResult();
1850
+ }
1851
+ } else {
1852
+ flipped = true;
1853
+ var _ = a;
1854
+ a = b;
1855
+ b = _;
1856
+ }
1857
+ }
1858
+
1859
+ var allEqual = true;
1860
+ var bSize = b.__iterate(function(v, k) {
1861
+ if (notAssociative ? !a.has(v) :
1862
+ flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
1863
+ allEqual = false;
1864
+ return false;
1865
+ }
1866
+ });
1867
+
1868
+ return allEqual && a.size === bSize;
1869
+ }
1870
+
1871
+ createClass(Repeat, IndexedSeq);
1872
+
1873
+ function Repeat(value, times) {
1874
+ if (!(this instanceof Repeat)) {
1875
+ return new Repeat(value, times);
1876
+ }
1877
+ this._value = value;
1878
+ this.size = times === undefined ? Infinity : Math.max(0, times);
1879
+ if (this.size === 0) {
1880
+ if (EMPTY_REPEAT) {
1881
+ return EMPTY_REPEAT;
1882
+ }
1883
+ EMPTY_REPEAT = this;
1884
+ }
1885
+ }
1886
+
1887
+ Repeat.prototype.toString = function() {
1888
+ if (this.size === 0) {
1889
+ return 'Repeat []';
1890
+ }
1891
+ return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
1892
+ };
1893
+
1894
+ Repeat.prototype.get = function(index, notSetValue) {
1895
+ return this.has(index) ? this._value : notSetValue;
1896
+ };
1897
+
1898
+ Repeat.prototype.includes = function(searchValue) {
1899
+ return is(this._value, searchValue);
1900
+ };
1901
+
1902
+ Repeat.prototype.slice = function(begin, end) {
1903
+ var size = this.size;
1904
+ return wholeSlice(begin, end, size) ? this :
1905
+ new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
1906
+ };
1907
+
1908
+ Repeat.prototype.reverse = function() {
1909
+ return this;
1910
+ };
1911
+
1912
+ Repeat.prototype.indexOf = function(searchValue) {
1913
+ if (is(this._value, searchValue)) {
1914
+ return 0;
1915
+ }
1916
+ return -1;
1917
+ };
1918
+
1919
+ Repeat.prototype.lastIndexOf = function(searchValue) {
1920
+ if (is(this._value, searchValue)) {
1921
+ return this.size;
1922
+ }
1923
+ return -1;
1924
+ };
1925
+
1926
+ Repeat.prototype.__iterate = function(fn, reverse) {
1927
+ for (var ii = 0; ii < this.size; ii++) {
1928
+ if (fn(this._value, ii, this) === false) {
1929
+ return ii + 1;
1930
+ }
1931
+ }
1932
+ return ii;
1933
+ };
1934
+
1935
+ Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;
1936
+ var ii = 0;
1937
+ return new Iterator(function()
1938
+ {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}
1939
+ );
1940
+ };
1941
+
1942
+ Repeat.prototype.equals = function(other) {
1943
+ return other instanceof Repeat ?
1944
+ is(this._value, other._value) :
1945
+ deepEqual(other);
1946
+ };
1947
+
1948
+
1949
+ var EMPTY_REPEAT;
1950
+
1951
+ function invariant(condition, error) {
1952
+ if (!condition) throw new Error(error);
1953
+ }
1954
+
1955
+ createClass(Range, IndexedSeq);
1956
+
1957
+ function Range(start, end, step) {
1958
+ if (!(this instanceof Range)) {
1959
+ return new Range(start, end, step);
1960
+ }
1961
+ invariant(step !== 0, 'Cannot step a Range by 0');
1962
+ start = start || 0;
1963
+ if (end === undefined) {
1964
+ end = Infinity;
1965
+ }
1966
+ step = step === undefined ? 1 : Math.abs(step);
1967
+ if (end < start) {
1968
+ step = -step;
1969
+ }
1970
+ this._start = start;
1971
+ this._end = end;
1972
+ this._step = step;
1973
+ this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
1974
+ if (this.size === 0) {
1975
+ if (EMPTY_RANGE) {
1976
+ return EMPTY_RANGE;
1977
+ }
1978
+ EMPTY_RANGE = this;
1979
+ }
1980
+ }
1981
+
1982
+ Range.prototype.toString = function() {
1983
+ if (this.size === 0) {
1984
+ return 'Range []';
1985
+ }
1986
+ return 'Range [ ' +
1987
+ this._start + '...' + this._end +
1988
+ (this._step !== 1 ? ' by ' + this._step : '') +
1989
+ ' ]';
1990
+ };
1991
+
1992
+ Range.prototype.get = function(index, notSetValue) {
1993
+ return this.has(index) ?
1994
+ this._start + wrapIndex(this, index) * this._step :
1995
+ notSetValue;
1996
+ };
1997
+
1998
+ Range.prototype.includes = function(searchValue) {
1999
+ var possibleIndex = (searchValue - this._start) / this._step;
2000
+ return possibleIndex >= 0 &&
2001
+ possibleIndex < this.size &&
2002
+ possibleIndex === Math.floor(possibleIndex);
2003
+ };
2004
+
2005
+ Range.prototype.slice = function(begin, end) {
2006
+ if (wholeSlice(begin, end, this.size)) {
2007
+ return this;
2008
+ }
2009
+ begin = resolveBegin(begin, this.size);
2010
+ end = resolveEnd(end, this.size);
2011
+ if (end <= begin) {
2012
+ return new Range(0, 0);
2013
+ }
2014
+ return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
2015
+ };
2016
+
2017
+ Range.prototype.indexOf = function(searchValue) {
2018
+ var offsetValue = searchValue - this._start;
2019
+ if (offsetValue % this._step === 0) {
2020
+ var index = offsetValue / this._step;
2021
+ if (index >= 0 && index < this.size) {
2022
+ return index
2023
+ }
2024
+ }
2025
+ return -1;
2026
+ };
2027
+
2028
+ Range.prototype.lastIndexOf = function(searchValue) {
2029
+ return this.indexOf(searchValue);
2030
+ };
2031
+
2032
+ Range.prototype.__iterate = function(fn, reverse) {
2033
+ var maxIndex = this.size - 1;
2034
+ var step = this._step;
2035
+ var value = reverse ? this._start + maxIndex * step : this._start;
2036
+ for (var ii = 0; ii <= maxIndex; ii++) {
2037
+ if (fn(value, ii, this) === false) {
2038
+ return ii + 1;
2039
+ }
2040
+ value += reverse ? -step : step;
2041
+ }
2042
+ return ii;
2043
+ };
2044
+
2045
+ Range.prototype.__iterator = function(type, reverse) {
2046
+ var maxIndex = this.size - 1;
2047
+ var step = this._step;
2048
+ var value = reverse ? this._start + maxIndex * step : this._start;
2049
+ var ii = 0;
2050
+ return new Iterator(function() {
2051
+ var v = value;
2052
+ value += reverse ? -step : step;
2053
+ return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
2054
+ });
2055
+ };
2056
+
2057
+ Range.prototype.equals = function(other) {
2058
+ return other instanceof Range ?
2059
+ this._start === other._start &&
2060
+ this._end === other._end &&
2061
+ this._step === other._step :
2062
+ deepEqual(this, other);
2063
+ };
2064
+
2065
+
2066
+ var EMPTY_RANGE;
2067
+
2068
+ createClass(Collection, Iterable);
2069
+ function Collection() {
2070
+ throw TypeError('Abstract');
2071
+ }
2072
+
2073
+
2074
+ createClass(KeyedCollection, Collection);function KeyedCollection() {}
2075
+
2076
+ createClass(IndexedCollection, Collection);function IndexedCollection() {}
2077
+
2078
+ createClass(SetCollection, Collection);function SetCollection() {}
2079
+
2080
+
2081
+ Collection.Keyed = KeyedCollection;
2082
+ Collection.Indexed = IndexedCollection;
2083
+ Collection.Set = SetCollection;
2084
+
2085
+ var imul =
2086
+ typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?
2087
+ Math.imul :
2088
+ function imul(a, b) {
2089
+ a = a | 0; // int
2090
+ b = b | 0; // int
2091
+ var c = a & 0xffff;
2092
+ var d = b & 0xffff;
2093
+ // Shift by 0 fixes the sign on the high part.
2094
+ return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int
2095
+ };
2096
+
2097
+ // v8 has an optimization for storing 31-bit signed numbers.
2098
+ // Values which have either 00 or 11 as the high order bits qualify.
2099
+ // This function drops the highest order bit in a signed number, maintaining
2100
+ // the sign bit.
2101
+ function smi(i32) {
2102
+ return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);
2103
+ }
2104
+
2105
+ function hash(o) {
2106
+ if (o === false || o === null || o === undefined) {
2107
+ return 0;
2108
+ }
2109
+ if (typeof o.valueOf === 'function') {
2110
+ o = o.valueOf();
2111
+ if (o === false || o === null || o === undefined) {
2112
+ return 0;
2113
+ }
2114
+ }
2115
+ if (o === true) {
2116
+ return 1;
2117
+ }
2118
+ var type = typeof o;
2119
+ if (type === 'number') {
2120
+ if (o !== o || o === Infinity) {
2121
+ return 0;
2122
+ }
2123
+ var h = o | 0;
2124
+ if (h !== o) {
2125
+ h ^= o * 0xFFFFFFFF;
2126
+ }
2127
+ while (o > 0xFFFFFFFF) {
2128
+ o /= 0xFFFFFFFF;
2129
+ h ^= o;
2130
+ }
2131
+ return smi(h);
2132
+ }
2133
+ if (type === 'string') {
2134
+ return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
2135
+ }
2136
+ if (typeof o.hashCode === 'function') {
2137
+ return o.hashCode();
2138
+ }
2139
+ if (type === 'object') {
2140
+ return hashJSObj(o);
2141
+ }
2142
+ if (typeof o.toString === 'function') {
2143
+ return hashString(o.toString());
2144
+ }
2145
+ throw new Error('Value type ' + type + ' cannot be hashed.');
2146
+ }
2147
+
2148
+ function cachedHashString(string) {
2149
+ var hash = stringHashCache[string];
2150
+ if (hash === undefined) {
2151
+ hash = hashString(string);
2152
+ if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
2153
+ STRING_HASH_CACHE_SIZE = 0;
2154
+ stringHashCache = {};
2155
+ }
2156
+ STRING_HASH_CACHE_SIZE++;
2157
+ stringHashCache[string] = hash;
2158
+ }
2159
+ return hash;
2160
+ }
2161
+
2162
+ // http://jsperf.com/hashing-strings
2163
+ function hashString(string) {
2164
+ // This is the hash from JVM
2165
+ // The hash code for a string is computed as
2166
+ // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
2167
+ // where s[i] is the ith character of the string and n is the length of
2168
+ // the string. We "mod" the result to make it between 0 (inclusive) and 2^31
2169
+ // (exclusive) by dropping high bits.
2170
+ var hash = 0;
2171
+ for (var ii = 0; ii < string.length; ii++) {
2172
+ hash = 31 * hash + string.charCodeAt(ii) | 0;
2173
+ }
2174
+ return smi(hash);
2175
+ }
2176
+
2177
+ function hashJSObj(obj) {
2178
+ var hash;
2179
+ if (usingWeakMap) {
2180
+ hash = weakMap.get(obj);
2181
+ if (hash !== undefined) {
2182
+ return hash;
2183
+ }
2184
+ }
2185
+
2186
+ hash = obj[UID_HASH_KEY];
2187
+ if (hash !== undefined) {
2188
+ return hash;
2189
+ }
2190
+
2191
+ if (!canDefineProperty) {
2192
+ hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
2193
+ if (hash !== undefined) {
2194
+ return hash;
2195
+ }
2196
+
2197
+ hash = getIENodeHash(obj);
2198
+ if (hash !== undefined) {
2199
+ return hash;
2200
+ }
2201
+ }
2202
+
2203
+ hash = ++objHashUID;
2204
+ if (objHashUID & 0x40000000) {
2205
+ objHashUID = 0;
2206
+ }
2207
+
2208
+ if (usingWeakMap) {
2209
+ weakMap.set(obj, hash);
2210
+ } else if (isExtensible !== undefined && isExtensible(obj) === false) {
2211
+ throw new Error('Non-extensible objects are not allowed as keys.');
2212
+ } else if (canDefineProperty) {
2213
+ Object.defineProperty(obj, UID_HASH_KEY, {
2214
+ 'enumerable': false,
2215
+ 'configurable': false,
2216
+ 'writable': false,
2217
+ 'value': hash
2218
+ });
2219
+ } else if (obj.propertyIsEnumerable !== undefined &&
2220
+ obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
2221
+ // Since we can't define a non-enumerable property on the object
2222
+ // we'll hijack one of the less-used non-enumerable properties to
2223
+ // save our hash on it. Since this is a function it will not show up in
2224
+ // `JSON.stringify` which is what we want.
2225
+ obj.propertyIsEnumerable = function() {
2226
+ return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
2227
+ };
2228
+ obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
2229
+ } else if (obj.nodeType !== undefined) {
2230
+ // At this point we couldn't get the IE `uniqueID` to use as a hash
2231
+ // and we couldn't use a non-enumerable property to exploit the
2232
+ // dontEnum bug so we simply add the `UID_HASH_KEY` on the node
2233
+ // itself.
2234
+ obj[UID_HASH_KEY] = hash;
2235
+ } else {
2236
+ throw new Error('Unable to set a non-enumerable property on object.');
2237
+ }
2238
+
2239
+ return hash;
2240
+ }
2241
+
2242
+ // Get references to ES5 object methods.
2243
+ var isExtensible = Object.isExtensible;
2244
+
2245
+ // True if Object.defineProperty works as expected. IE8 fails this test.
2246
+ var canDefineProperty = (function() {
2247
+ try {
2248
+ Object.defineProperty({}, '@', {});
2249
+ return true;
2250
+ } catch (e) {
2251
+ return false;
2252
+ }
2253
+ }());
2254
+
2255
+ // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
2256
+ // and avoid memory leaks from the IE cloneNode bug.
2257
+ function getIENodeHash(node) {
2258
+ if (node && node.nodeType > 0) {
2259
+ switch (node.nodeType) {
2260
+ case 1: // Element
2261
+ return node.uniqueID;
2262
+ case 9: // Document
2263
+ return node.documentElement && node.documentElement.uniqueID;
2264
+ }
2265
+ }
2266
+ }
2267
+
2268
+ // If possible, use a WeakMap.
2269
+ var usingWeakMap = typeof WeakMap === 'function';
2270
+ var weakMap;
2271
+ if (usingWeakMap) {
2272
+ weakMap = new WeakMap();
2273
+ }
2274
+
2275
+ var objHashUID = 0;
2276
+
2277
+ var UID_HASH_KEY = '__immutablehash__';
2278
+ if (typeof Symbol === 'function') {
2279
+ UID_HASH_KEY = Symbol(UID_HASH_KEY);
2280
+ }
2281
+
2282
+ var STRING_HASH_CACHE_MIN_STRLEN = 16;
2283
+ var STRING_HASH_CACHE_MAX_SIZE = 255;
2284
+ var STRING_HASH_CACHE_SIZE = 0;
2285
+ var stringHashCache = {};
2286
+
2287
+ function assertNotInfinite(size) {
2288
+ invariant(
2289
+ size !== Infinity,
2290
+ 'Cannot perform this action with an infinite size.'
2291
+ );
2292
+ }
2293
+
2294
+ createClass(Map, KeyedCollection);
2295
+
2296
+ // @pragma Construction
2297
+
2298
+ function Map(value) {
2299
+ return value === null || value === undefined ? emptyMap() :
2300
+ isMap(value) && !isOrdered(value) ? value :
2301
+ emptyMap().withMutations(function(map ) {
2302
+ var iter = KeyedIterable(value);
2303
+ assertNotInfinite(iter.size);
2304
+ iter.forEach(function(v, k) {return map.set(k, v)});
2305
+ });
2306
+ }
2307
+
2308
+ Map.of = function() {var keyValues = SLICE$0.call(arguments, 0);
2309
+ return emptyMap().withMutations(function(map ) {
2310
+ for (var i = 0; i < keyValues.length; i += 2) {
2311
+ if (i + 1 >= keyValues.length) {
2312
+ throw new Error('Missing value for key: ' + keyValues[i]);
2313
+ }
2314
+ map.set(keyValues[i], keyValues[i + 1]);
2315
+ }
2316
+ });
2317
+ };
2318
+
2319
+ Map.prototype.toString = function() {
2320
+ return this.__toString('Map {', '}');
2321
+ };
2322
+
2323
+ // @pragma Access
2324
+
2325
+ Map.prototype.get = function(k, notSetValue) {
2326
+ return this._root ?
2327
+ this._root.get(0, undefined, k, notSetValue) :
2328
+ notSetValue;
2329
+ };
2330
+
2331
+ // @pragma Modification
2332
+
2333
+ Map.prototype.set = function(k, v) {
2334
+ return updateMap(this, k, v);
2335
+ };
2336
+
2337
+ Map.prototype.setIn = function(keyPath, v) {
2338
+ return this.updateIn(keyPath, NOT_SET, function() {return v});
2339
+ };
2340
+
2341
+ Map.prototype.remove = function(k) {
2342
+ return updateMap(this, k, NOT_SET);
2343
+ };
2344
+
2345
+ Map.prototype.deleteIn = function(keyPath) {
2346
+ return this.updateIn(keyPath, function() {return NOT_SET});
2347
+ };
2348
+
2349
+ Map.prototype.update = function(k, notSetValue, updater) {
2350
+ return arguments.length === 1 ?
2351
+ k(this) :
2352
+ this.updateIn([k], notSetValue, updater);
2353
+ };
2354
+
2355
+ Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
2356
+ if (!updater) {
2357
+ updater = notSetValue;
2358
+ notSetValue = undefined;
2359
+ }
2360
+ var updatedValue = updateInDeepMap(
2361
+ this,
2362
+ forceIterator(keyPath),
2363
+ notSetValue,
2364
+ updater
2365
+ );
2366
+ return updatedValue === NOT_SET ? undefined : updatedValue;
2367
+ };
2368
+
2369
+ Map.prototype.clear = function() {
2370
+ if (this.size === 0) {
2371
+ return this;
2372
+ }
2373
+ if (this.__ownerID) {
2374
+ this.size = 0;
2375
+ this._root = null;
2376
+ this.__hash = undefined;
2377
+ this.__altered = true;
2378
+ return this;
2379
+ }
2380
+ return emptyMap();
2381
+ };
2382
+
2383
+ // @pragma Composition
2384
+
2385
+ Map.prototype.merge = function(/*...iters*/) {
2386
+ return mergeIntoMapWith(this, undefined, arguments);
2387
+ };
2388
+
2389
+ Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
2390
+ return mergeIntoMapWith(this, merger, iters);
2391
+ };
2392
+
2393
+ Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
2394
+ return this.updateIn(
2395
+ keyPath,
2396
+ emptyMap(),
2397
+ function(m ) {return typeof m.merge === 'function' ?
2398
+ m.merge.apply(m, iters) :
2399
+ iters[iters.length - 1]}
2400
+ );
2401
+ };
2402
+
2403
+ Map.prototype.mergeDeep = function(/*...iters*/) {
2404
+ return mergeIntoMapWith(this, deepMerger, arguments);
2405
+ };
2406
+
2407
+ Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
2408
+ return mergeIntoMapWith(this, deepMergerWith(merger), iters);
2409
+ };
2410
+
2411
+ Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
2412
+ return this.updateIn(
2413
+ keyPath,
2414
+ emptyMap(),
2415
+ function(m ) {return typeof m.mergeDeep === 'function' ?
2416
+ m.mergeDeep.apply(m, iters) :
2417
+ iters[iters.length - 1]}
2418
+ );
2419
+ };
2420
+
2421
+ Map.prototype.sort = function(comparator) {
2422
+ // Late binding
2423
+ return OrderedMap(sortFactory(this, comparator));
2424
+ };
2425
+
2426
+ Map.prototype.sortBy = function(mapper, comparator) {
2427
+ // Late binding
2428
+ return OrderedMap(sortFactory(this, comparator, mapper));
2429
+ };
2430
+
2431
+ // @pragma Mutability
2432
+
2433
+ Map.prototype.withMutations = function(fn) {
2434
+ var mutable = this.asMutable();
2435
+ fn(mutable);
2436
+ return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
2437
+ };
2438
+
2439
+ Map.prototype.asMutable = function() {
2440
+ return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
2441
+ };
2442
+
2443
+ Map.prototype.asImmutable = function() {
2444
+ return this.__ensureOwner();
2445
+ };
2446
+
2447
+ Map.prototype.wasAltered = function() {
2448
+ return this.__altered;
2449
+ };
2450
+
2451
+ Map.prototype.__iterator = function(type, reverse) {
2452
+ return new MapIterator(this, type, reverse);
2453
+ };
2454
+
2455
+ Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;
2456
+ var iterations = 0;
2457
+ this._root && this._root.iterate(function(entry ) {
2458
+ iterations++;
2459
+ return fn(entry[1], entry[0], this$0);
2460
+ }, reverse);
2461
+ return iterations;
2462
+ };
2463
+
2464
+ Map.prototype.__ensureOwner = function(ownerID) {
2465
+ if (ownerID === this.__ownerID) {
2466
+ return this;
2467
+ }
2468
+ if (!ownerID) {
2469
+ this.__ownerID = ownerID;
2470
+ this.__altered = false;
2471
+ return this;
2472
+ }
2473
+ return makeMap(this.size, this._root, ownerID, this.__hash);
2474
+ };
2475
+
2476
+
2477
+ function isMap(maybeMap) {
2478
+ return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
2479
+ }
2480
+
2481
+ Map.isMap = isMap;
2482
+
2483
+ var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
2484
+
2485
+ var MapPrototype = Map.prototype;
2486
+ MapPrototype[IS_MAP_SENTINEL] = true;
2487
+ MapPrototype[DELETE] = MapPrototype.remove;
2488
+ MapPrototype.removeIn = MapPrototype.deleteIn;
2489
+
2490
+
2491
+ // #pragma Trie Nodes
2492
+
2493
+
2494
+
2495
+ function ArrayMapNode(ownerID, entries) {
2496
+ this.ownerID = ownerID;
2497
+ this.entries = entries;
2498
+ }
2499
+
2500
+ ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
2501
+ var entries = this.entries;
2502
+ for (var ii = 0, len = entries.length; ii < len; ii++) {
2503
+ if (is(key, entries[ii][0])) {
2504
+ return entries[ii][1];
2505
+ }
2506
+ }
2507
+ return notSetValue;
2508
+ };
2509
+
2510
+ ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2511
+ var removed = value === NOT_SET;
2512
+
2513
+ var entries = this.entries;
2514
+ var idx = 0;
2515
+ for (var len = entries.length; idx < len; idx++) {
2516
+ if (is(key, entries[idx][0])) {
2517
+ break;
2518
+ }
2519
+ }
2520
+ var exists = idx < len;
2521
+
2522
+ if (exists ? entries[idx][1] === value : removed) {
2523
+ return this;
2524
+ }
2525
+
2526
+ SetRef(didAlter);
2527
+ (removed || !exists) && SetRef(didChangeSize);
2528
+
2529
+ if (removed && entries.length === 1) {
2530
+ return; // undefined
2531
+ }
2532
+
2533
+ if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
2534
+ return createNodes(ownerID, entries, key, value);
2535
+ }
2536
+
2537
+ var isEditable = ownerID && ownerID === this.ownerID;
2538
+ var newEntries = isEditable ? entries : arrCopy(entries);
2539
+
2540
+ if (exists) {
2541
+ if (removed) {
2542
+ idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
2543
+ } else {
2544
+ newEntries[idx] = [key, value];
2545
+ }
2546
+ } else {
2547
+ newEntries.push([key, value]);
2548
+ }
2549
+
2550
+ if (isEditable) {
2551
+ this.entries = newEntries;
2552
+ return this;
2553
+ }
2554
+
2555
+ return new ArrayMapNode(ownerID, newEntries);
2556
+ };
2557
+
2558
+
2559
+
2560
+
2561
+ function BitmapIndexedNode(ownerID, bitmap, nodes) {
2562
+ this.ownerID = ownerID;
2563
+ this.bitmap = bitmap;
2564
+ this.nodes = nodes;
2565
+ }
2566
+
2567
+ BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
2568
+ if (keyHash === undefined) {
2569
+ keyHash = hash(key);
2570
+ }
2571
+ var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));
2572
+ var bitmap = this.bitmap;
2573
+ return (bitmap & bit) === 0 ? notSetValue :
2574
+ this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);
2575
+ };
2576
+
2577
+ BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2578
+ if (keyHash === undefined) {
2579
+ keyHash = hash(key);
2580
+ }
2581
+ var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
2582
+ var bit = 1 << keyHashFrag;
2583
+ var bitmap = this.bitmap;
2584
+ var exists = (bitmap & bit) !== 0;
2585
+
2586
+ if (!exists && value === NOT_SET) {
2587
+ return this;
2588
+ }
2589
+
2590
+ var idx = popCount(bitmap & (bit - 1));
2591
+ var nodes = this.nodes;
2592
+ var node = exists ? nodes[idx] : undefined;
2593
+ var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
2594
+
2595
+ if (newNode === node) {
2596
+ return this;
2597
+ }
2598
+
2599
+ if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
2600
+ return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
2601
+ }
2602
+
2603
+ if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
2604
+ return nodes[idx ^ 1];
2605
+ }
2606
+
2607
+ if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
2608
+ return newNode;
2609
+ }
2610
+
2611
+ var isEditable = ownerID && ownerID === this.ownerID;
2612
+ var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
2613
+ var newNodes = exists ? newNode ?
2614
+ setIn(nodes, idx, newNode, isEditable) :
2615
+ spliceOut(nodes, idx, isEditable) :
2616
+ spliceIn(nodes, idx, newNode, isEditable);
2617
+
2618
+ if (isEditable) {
2619
+ this.bitmap = newBitmap;
2620
+ this.nodes = newNodes;
2621
+ return this;
2622
+ }
2623
+
2624
+ return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
2625
+ };
2626
+
2627
+
2628
+
2629
+
2630
+ function HashArrayMapNode(ownerID, count, nodes) {
2631
+ this.ownerID = ownerID;
2632
+ this.count = count;
2633
+ this.nodes = nodes;
2634
+ }
2635
+
2636
+ HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
2637
+ if (keyHash === undefined) {
2638
+ keyHash = hash(key);
2639
+ }
2640
+ var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
2641
+ var node = this.nodes[idx];
2642
+ return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
2643
+ };
2644
+
2645
+ HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2646
+ if (keyHash === undefined) {
2647
+ keyHash = hash(key);
2648
+ }
2649
+ var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
2650
+ var removed = value === NOT_SET;
2651
+ var nodes = this.nodes;
2652
+ var node = nodes[idx];
2653
+
2654
+ if (removed && !node) {
2655
+ return this;
2656
+ }
2657
+
2658
+ var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
2659
+ if (newNode === node) {
2660
+ return this;
2661
+ }
2662
+
2663
+ var newCount = this.count;
2664
+ if (!node) {
2665
+ newCount++;
2666
+ } else if (!newNode) {
2667
+ newCount--;
2668
+ if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
2669
+ return packNodes(ownerID, nodes, newCount, idx);
2670
+ }
2671
+ }
2672
+
2673
+ var isEditable = ownerID && ownerID === this.ownerID;
2674
+ var newNodes = setIn(nodes, idx, newNode, isEditable);
2675
+
2676
+ if (isEditable) {
2677
+ this.count = newCount;
2678
+ this.nodes = newNodes;
2679
+ return this;
2680
+ }
2681
+
2682
+ return new HashArrayMapNode(ownerID, newCount, newNodes);
2683
+ };
2684
+
2685
+
2686
+
2687
+
2688
+ function HashCollisionNode(ownerID, keyHash, entries) {
2689
+ this.ownerID = ownerID;
2690
+ this.keyHash = keyHash;
2691
+ this.entries = entries;
2692
+ }
2693
+
2694
+ HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
2695
+ var entries = this.entries;
2696
+ for (var ii = 0, len = entries.length; ii < len; ii++) {
2697
+ if (is(key, entries[ii][0])) {
2698
+ return entries[ii][1];
2699
+ }
2700
+ }
2701
+ return notSetValue;
2702
+ };
2703
+
2704
+ HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2705
+ if (keyHash === undefined) {
2706
+ keyHash = hash(key);
2707
+ }
2708
+
2709
+ var removed = value === NOT_SET;
2710
+
2711
+ if (keyHash !== this.keyHash) {
2712
+ if (removed) {
2713
+ return this;
2714
+ }
2715
+ SetRef(didAlter);
2716
+ SetRef(didChangeSize);
2717
+ return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
2718
+ }
2719
+
2720
+ var entries = this.entries;
2721
+ var idx = 0;
2722
+ for (var len = entries.length; idx < len; idx++) {
2723
+ if (is(key, entries[idx][0])) {
2724
+ break;
2725
+ }
2726
+ }
2727
+ var exists = idx < len;
2728
+
2729
+ if (exists ? entries[idx][1] === value : removed) {
2730
+ return this;
2731
+ }
2732
+
2733
+ SetRef(didAlter);
2734
+ (removed || !exists) && SetRef(didChangeSize);
2735
+
2736
+ if (removed && len === 2) {
2737
+ return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
2738
+ }
2739
+
2740
+ var isEditable = ownerID && ownerID === this.ownerID;
2741
+ var newEntries = isEditable ? entries : arrCopy(entries);
2742
+
2743
+ if (exists) {
2744
+ if (removed) {
2745
+ idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
2746
+ } else {
2747
+ newEntries[idx] = [key, value];
2748
+ }
2749
+ } else {
2750
+ newEntries.push([key, value]);
2751
+ }
2752
+
2753
+ if (isEditable) {
2754
+ this.entries = newEntries;
2755
+ return this;
2756
+ }
2757
+
2758
+ return new HashCollisionNode(ownerID, this.keyHash, newEntries);
2759
+ };
2760
+
2761
+
2762
+
2763
+
2764
+ function ValueNode(ownerID, keyHash, entry) {
2765
+ this.ownerID = ownerID;
2766
+ this.keyHash = keyHash;
2767
+ this.entry = entry;
2768
+ }
2769
+
2770
+ ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
2771
+ return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
2772
+ };
2773
+
2774
+ ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2775
+ var removed = value === NOT_SET;
2776
+ var keyMatch = is(key, this.entry[0]);
2777
+ if (keyMatch ? value === this.entry[1] : removed) {
2778
+ return this;
2779
+ }
2780
+
2781
+ SetRef(didAlter);
2782
+
2783
+ if (removed) {
2784
+ SetRef(didChangeSize);
2785
+ return; // undefined
2786
+ }
2787
+
2788
+ if (keyMatch) {
2789
+ if (ownerID && ownerID === this.ownerID) {
2790
+ this.entry[1] = value;
2791
+ return this;
2792
+ }
2793
+ return new ValueNode(ownerID, this.keyHash, [key, value]);
2794
+ }
2795
+
2796
+ SetRef(didChangeSize);
2797
+ return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
2798
+ };
2799
+
2800
+
2801
+
2802
+ // #pragma Iterators
2803
+
2804
+ ArrayMapNode.prototype.iterate =
2805
+ HashCollisionNode.prototype.iterate = function (fn, reverse) {
2806
+ var entries = this.entries;
2807
+ for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
2808
+ if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
2809
+ return false;
2810
+ }
2811
+ }
2812
+ }
2813
+
2814
+ BitmapIndexedNode.prototype.iterate =
2815
+ HashArrayMapNode.prototype.iterate = function (fn, reverse) {
2816
+ var nodes = this.nodes;
2817
+ for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
2818
+ var node = nodes[reverse ? maxIndex - ii : ii];
2819
+ if (node && node.iterate(fn, reverse) === false) {
2820
+ return false;
2821
+ }
2822
+ }
2823
+ }
2824
+
2825
+ ValueNode.prototype.iterate = function (fn, reverse) {
2826
+ return fn(this.entry);
2827
+ }
2828
+
2829
+ createClass(MapIterator, Iterator);
2830
+
2831
+ function MapIterator(map, type, reverse) {
2832
+ this._type = type;
2833
+ this._reverse = reverse;
2834
+ this._stack = map._root && mapIteratorFrame(map._root);
2835
+ }
2836
+
2837
+ MapIterator.prototype.next = function() {
2838
+ var type = this._type;
2839
+ var stack = this._stack;
2840
+ while (stack) {
2841
+ var node = stack.node;
2842
+ var index = stack.index++;
2843
+ var maxIndex;
2844
+ if (node.entry) {
2845
+ if (index === 0) {
2846
+ return mapIteratorValue(type, node.entry);
2847
+ }
2848
+ } else if (node.entries) {
2849
+ maxIndex = node.entries.length - 1;
2850
+ if (index <= maxIndex) {
2851
+ return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
2852
+ }
2853
+ } else {
2854
+ maxIndex = node.nodes.length - 1;
2855
+ if (index <= maxIndex) {
2856
+ var subNode = node.nodes[this._reverse ? maxIndex - index : index];
2857
+ if (subNode) {
2858
+ if (subNode.entry) {
2859
+ return mapIteratorValue(type, subNode.entry);
2860
+ }
2861
+ stack = this._stack = mapIteratorFrame(subNode, stack);
2862
+ }
2863
+ continue;
2864
+ }
2865
+ }
2866
+ stack = this._stack = this._stack.__prev;
2867
+ }
2868
+ return iteratorDone();
2869
+ };
2870
+
2871
+
2872
+ function mapIteratorValue(type, entry) {
2873
+ return iteratorValue(type, entry[0], entry[1]);
2874
+ }
2875
+
2876
+ function mapIteratorFrame(node, prev) {
2877
+ return {
2878
+ node: node,
2879
+ index: 0,
2880
+ __prev: prev
2881
+ };
2882
+ }
2883
+
2884
+ function makeMap(size, root, ownerID, hash) {
2885
+ var map = Object.create(MapPrototype);
2886
+ map.size = size;
2887
+ map._root = root;
2888
+ map.__ownerID = ownerID;
2889
+ map.__hash = hash;
2890
+ map.__altered = false;
2891
+ return map;
2892
+ }
2893
+
2894
+ var EMPTY_MAP;
2895
+ function emptyMap() {
2896
+ return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
2897
+ }
2898
+
2899
+ function updateMap(map, k, v) {
2900
+ var newRoot;
2901
+ var newSize;
2902
+ if (!map._root) {
2903
+ if (v === NOT_SET) {
2904
+ return map;
2905
+ }
2906
+ newSize = 1;
2907
+ newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
2908
+ } else {
2909
+ var didChangeSize = MakeRef(CHANGE_LENGTH);
2910
+ var didAlter = MakeRef(DID_ALTER);
2911
+ newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
2912
+ if (!didAlter.value) {
2913
+ return map;
2914
+ }
2915
+ newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
2916
+ }
2917
+ if (map.__ownerID) {
2918
+ map.size = newSize;
2919
+ map._root = newRoot;
2920
+ map.__hash = undefined;
2921
+ map.__altered = true;
2922
+ return map;
2923
+ }
2924
+ return newRoot ? makeMap(newSize, newRoot) : emptyMap();
2925
+ }
2926
+
2927
+ function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
2928
+ if (!node) {
2929
+ if (value === NOT_SET) {
2930
+ return node;
2931
+ }
2932
+ SetRef(didAlter);
2933
+ SetRef(didChangeSize);
2934
+ return new ValueNode(ownerID, keyHash, [key, value]);
2935
+ }
2936
+ return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
2937
+ }
2938
+
2939
+ function isLeafNode(node) {
2940
+ return node.constructor === ValueNode || node.constructor === HashCollisionNode;
2941
+ }
2942
+
2943
+ function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
2944
+ if (node.keyHash === keyHash) {
2945
+ return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
2946
+ }
2947
+
2948
+ var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
2949
+ var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
2950
+
2951
+ var newNode;
2952
+ var nodes = idx1 === idx2 ?
2953
+ [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :
2954
+ ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);
2955
+
2956
+ return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
2957
+ }
2958
+
2959
+ function createNodes(ownerID, entries, key, value) {
2960
+ if (!ownerID) {
2961
+ ownerID = new OwnerID();
2962
+ }
2963
+ var node = new ValueNode(ownerID, hash(key), [key, value]);
2964
+ for (var ii = 0; ii < entries.length; ii++) {
2965
+ var entry = entries[ii];
2966
+ node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
2967
+ }
2968
+ return node;
2969
+ }
2970
+
2971
+ function packNodes(ownerID, nodes, count, excluding) {
2972
+ var bitmap = 0;
2973
+ var packedII = 0;
2974
+ var packedNodes = new Array(count);
2975
+ for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
2976
+ var node = nodes[ii];
2977
+ if (node !== undefined && ii !== excluding) {
2978
+ bitmap |= bit;
2979
+ packedNodes[packedII++] = node;
2980
+ }
2981
+ }
2982
+ return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
2983
+ }
2984
+
2985
+ function expandNodes(ownerID, nodes, bitmap, including, node) {
2986
+ var count = 0;
2987
+ var expandedNodes = new Array(SIZE);
2988
+ for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
2989
+ expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
2990
+ }
2991
+ expandedNodes[including] = node;
2992
+ return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
2993
+ }
2994
+
2995
+ function mergeIntoMapWith(map, merger, iterables) {
2996
+ var iters = [];
2997
+ for (var ii = 0; ii < iterables.length; ii++) {
2998
+ var value = iterables[ii];
2999
+ var iter = KeyedIterable(value);
3000
+ if (!isIterable(value)) {
3001
+ iter = iter.map(function(v ) {return fromJS(v)});
3002
+ }
3003
+ iters.push(iter);
3004
+ }
3005
+ return mergeIntoCollectionWith(map, merger, iters);
3006
+ }
3007
+
3008
+ function deepMerger(existing, value, key) {
3009
+ return existing && existing.mergeDeep && isIterable(value) ?
3010
+ existing.mergeDeep(value) :
3011
+ is(existing, value) ? existing : value;
3012
+ }
3013
+
3014
+ function deepMergerWith(merger) {
3015
+ return function(existing, value, key) {
3016
+ if (existing && existing.mergeDeepWith && isIterable(value)) {
3017
+ return existing.mergeDeepWith(merger, value);
3018
+ }
3019
+ var nextValue = merger(existing, value, key);
3020
+ return is(existing, nextValue) ? existing : nextValue;
3021
+ };
3022
+ }
3023
+
3024
+ function mergeIntoCollectionWith(collection, merger, iters) {
3025
+ iters = iters.filter(function(x ) {return x.size !== 0});
3026
+ if (iters.length === 0) {
3027
+ return collection;
3028
+ }
3029
+ if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
3030
+ return collection.constructor(iters[0]);
3031
+ }
3032
+ return collection.withMutations(function(collection ) {
3033
+ var mergeIntoMap = merger ?
3034
+ function(value, key) {
3035
+ collection.update(key, NOT_SET, function(existing )
3036
+ {return existing === NOT_SET ? value : merger(existing, value, key)}
3037
+ );
3038
+ } :
3039
+ function(value, key) {
3040
+ collection.set(key, value);
3041
+ }
3042
+ for (var ii = 0; ii < iters.length; ii++) {
3043
+ iters[ii].forEach(mergeIntoMap);
3044
+ }
3045
+ });
3046
+ }
3047
+
3048
+ function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
3049
+ var isNotSet = existing === NOT_SET;
3050
+ var step = keyPathIter.next();
3051
+ if (step.done) {
3052
+ var existingValue = isNotSet ? notSetValue : existing;
3053
+ var newValue = updater(existingValue);
3054
+ return newValue === existingValue ? existing : newValue;
3055
+ }
3056
+ invariant(
3057
+ isNotSet || (existing && existing.set),
3058
+ 'invalid keyPath'
3059
+ );
3060
+ var key = step.value;
3061
+ var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
3062
+ var nextUpdated = updateInDeepMap(
3063
+ nextExisting,
3064
+ keyPathIter,
3065
+ notSetValue,
3066
+ updater
3067
+ );
3068
+ return nextUpdated === nextExisting ? existing :
3069
+ nextUpdated === NOT_SET ? existing.remove(key) :
3070
+ (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
3071
+ }
3072
+
3073
+ function popCount(x) {
3074
+ x = x - ((x >> 1) & 0x55555555);
3075
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
3076
+ x = (x + (x >> 4)) & 0x0f0f0f0f;
3077
+ x = x + (x >> 8);
3078
+ x = x + (x >> 16);
3079
+ return x & 0x7f;
3080
+ }
3081
+
3082
+ function setIn(array, idx, val, canEdit) {
3083
+ var newArray = canEdit ? array : arrCopy(array);
3084
+ newArray[idx] = val;
3085
+ return newArray;
3086
+ }
3087
+
3088
+ function spliceIn(array, idx, val, canEdit) {
3089
+ var newLen = array.length + 1;
3090
+ if (canEdit && idx + 1 === newLen) {
3091
+ array[idx] = val;
3092
+ return array;
3093
+ }
3094
+ var newArray = new Array(newLen);
3095
+ var after = 0;
3096
+ for (var ii = 0; ii < newLen; ii++) {
3097
+ if (ii === idx) {
3098
+ newArray[ii] = val;
3099
+ after = -1;
3100
+ } else {
3101
+ newArray[ii] = array[ii + after];
3102
+ }
3103
+ }
3104
+ return newArray;
3105
+ }
3106
+
3107
+ function spliceOut(array, idx, canEdit) {
3108
+ var newLen = array.length - 1;
3109
+ if (canEdit && idx === newLen) {
3110
+ array.pop();
3111
+ return array;
3112
+ }
3113
+ var newArray = new Array(newLen);
3114
+ var after = 0;
3115
+ for (var ii = 0; ii < newLen; ii++) {
3116
+ if (ii === idx) {
3117
+ after = 1;
3118
+ }
3119
+ newArray[ii] = array[ii + after];
3120
+ }
3121
+ return newArray;
3122
+ }
3123
+
3124
+ var MAX_ARRAY_MAP_SIZE = SIZE / 4;
3125
+ var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
3126
+ var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
3127
+
3128
+ createClass(List, IndexedCollection);
3129
+
3130
+ // @pragma Construction
3131
+
3132
+ function List(value) {
3133
+ var empty = emptyList();
3134
+ if (value === null || value === undefined) {
3135
+ return empty;
3136
+ }
3137
+ if (isList(value)) {
3138
+ return value;
3139
+ }
3140
+ var iter = IndexedIterable(value);
3141
+ var size = iter.size;
3142
+ if (size === 0) {
3143
+ return empty;
3144
+ }
3145
+ assertNotInfinite(size);
3146
+ if (size > 0 && size < SIZE) {
3147
+ return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
3148
+ }
3149
+ return empty.withMutations(function(list ) {
3150
+ list.setSize(size);
3151
+ iter.forEach(function(v, i) {return list.set(i, v)});
3152
+ });
3153
+ }
3154
+
3155
+ List.of = function(/*...values*/) {
3156
+ return this(arguments);
3157
+ };
3158
+
3159
+ List.prototype.toString = function() {
3160
+ return this.__toString('List [', ']');
3161
+ };
3162
+
3163
+ // @pragma Access
3164
+
3165
+ List.prototype.get = function(index, notSetValue) {
3166
+ index = wrapIndex(this, index);
3167
+ if (index >= 0 && index < this.size) {
3168
+ index += this._origin;
3169
+ var node = listNodeFor(this, index);
3170
+ return node && node.array[index & MASK];
3171
+ }
3172
+ return notSetValue;
3173
+ };
3174
+
3175
+ // @pragma Modification
3176
+
3177
+ List.prototype.set = function(index, value) {
3178
+ return updateList(this, index, value);
3179
+ };
3180
+
3181
+ List.prototype.remove = function(index) {
3182
+ return !this.has(index) ? this :
3183
+ index === 0 ? this.shift() :
3184
+ index === this.size - 1 ? this.pop() :
3185
+ this.splice(index, 1);
3186
+ };
3187
+
3188
+ List.prototype.insert = function(index, value) {
3189
+ return this.splice(index, 0, value);
3190
+ };
3191
+
3192
+ List.prototype.clear = function() {
3193
+ if (this.size === 0) {
3194
+ return this;
3195
+ }
3196
+ if (this.__ownerID) {
3197
+ this.size = this._origin = this._capacity = 0;
3198
+ this._level = SHIFT;
3199
+ this._root = this._tail = null;
3200
+ this.__hash = undefined;
3201
+ this.__altered = true;
3202
+ return this;
3203
+ }
3204
+ return emptyList();
3205
+ };
3206
+
3207
+ List.prototype.push = function(/*...values*/) {
3208
+ var values = arguments;
3209
+ var oldSize = this.size;
3210
+ return this.withMutations(function(list ) {
3211
+ setListBounds(list, 0, oldSize + values.length);
3212
+ for (var ii = 0; ii < values.length; ii++) {
3213
+ list.set(oldSize + ii, values[ii]);
3214
+ }
3215
+ });
3216
+ };
3217
+
3218
+ List.prototype.pop = function() {
3219
+ return setListBounds(this, 0, -1);
3220
+ };
3221
+
3222
+ List.prototype.unshift = function(/*...values*/) {
3223
+ var values = arguments;
3224
+ return this.withMutations(function(list ) {
3225
+ setListBounds(list, -values.length);
3226
+ for (var ii = 0; ii < values.length; ii++) {
3227
+ list.set(ii, values[ii]);
3228
+ }
3229
+ });
3230
+ };
3231
+
3232
+ List.prototype.shift = function() {
3233
+ return setListBounds(this, 1);
3234
+ };
3235
+
3236
+ // @pragma Composition
3237
+
3238
+ List.prototype.merge = function(/*...iters*/) {
3239
+ return mergeIntoListWith(this, undefined, arguments);
3240
+ };
3241
+
3242
+ List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
3243
+ return mergeIntoListWith(this, merger, iters);
3244
+ };
3245
+
3246
+ List.prototype.mergeDeep = function(/*...iters*/) {
3247
+ return mergeIntoListWith(this, deepMerger, arguments);
3248
+ };
3249
+
3250
+ List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
3251
+ return mergeIntoListWith(this, deepMergerWith(merger), iters);
3252
+ };
3253
+
3254
+ List.prototype.setSize = function(size) {
3255
+ return setListBounds(this, 0, size);
3256
+ };
3257
+
3258
+ // @pragma Iteration
3259
+
3260
+ List.prototype.slice = function(begin, end) {
3261
+ var size = this.size;
3262
+ if (wholeSlice(begin, end, size)) {
3263
+ return this;
3264
+ }
3265
+ return setListBounds(
3266
+ this,
3267
+ resolveBegin(begin, size),
3268
+ resolveEnd(end, size)
3269
+ );
3270
+ };
3271
+
3272
+ List.prototype.__iterator = function(type, reverse) {
3273
+ var index = 0;
3274
+ var values = iterateList(this, reverse);
3275
+ return new Iterator(function() {
3276
+ var value = values();
3277
+ return value === DONE ?
3278
+ iteratorDone() :
3279
+ iteratorValue(type, index++, value);
3280
+ });
3281
+ };
3282
+
3283
+ List.prototype.__iterate = function(fn, reverse) {
3284
+ var index = 0;
3285
+ var values = iterateList(this, reverse);
3286
+ var value;
3287
+ while ((value = values()) !== DONE) {
3288
+ if (fn(value, index++, this) === false) {
3289
+ break;
3290
+ }
3291
+ }
3292
+ return index;
3293
+ };
3294
+
3295
+ List.prototype.__ensureOwner = function(ownerID) {
3296
+ if (ownerID === this.__ownerID) {
3297
+ return this;
3298
+ }
3299
+ if (!ownerID) {
3300
+ this.__ownerID = ownerID;
3301
+ return this;
3302
+ }
3303
+ return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
3304
+ };
3305
+
3306
+
3307
+ function isList(maybeList) {
3308
+ return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
3309
+ }
3310
+
3311
+ List.isList = isList;
3312
+
3313
+ var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
3314
+
3315
+ var ListPrototype = List.prototype;
3316
+ ListPrototype[IS_LIST_SENTINEL] = true;
3317
+ ListPrototype[DELETE] = ListPrototype.remove;
3318
+ ListPrototype.setIn = MapPrototype.setIn;
3319
+ ListPrototype.deleteIn =
3320
+ ListPrototype.removeIn = MapPrototype.removeIn;
3321
+ ListPrototype.update = MapPrototype.update;
3322
+ ListPrototype.updateIn = MapPrototype.updateIn;
3323
+ ListPrototype.mergeIn = MapPrototype.mergeIn;
3324
+ ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
3325
+ ListPrototype.withMutations = MapPrototype.withMutations;
3326
+ ListPrototype.asMutable = MapPrototype.asMutable;
3327
+ ListPrototype.asImmutable = MapPrototype.asImmutable;
3328
+ ListPrototype.wasAltered = MapPrototype.wasAltered;
3329
+
3330
+
3331
+
3332
+ function VNode(array, ownerID) {
3333
+ this.array = array;
3334
+ this.ownerID = ownerID;
3335
+ }
3336
+
3337
+ // TODO: seems like these methods are very similar
3338
+
3339
+ VNode.prototype.removeBefore = function(ownerID, level, index) {
3340
+ if (index === level ? 1 << level : 0 || this.array.length === 0) {
3341
+ return this;
3342
+ }
3343
+ var originIndex = (index >>> level) & MASK;
3344
+ if (originIndex >= this.array.length) {
3345
+ return new VNode([], ownerID);
3346
+ }
3347
+ var removingFirst = originIndex === 0;
3348
+ var newChild;
3349
+ if (level > 0) {
3350
+ var oldChild = this.array[originIndex];
3351
+ newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
3352
+ if (newChild === oldChild && removingFirst) {
3353
+ return this;
3354
+ }
3355
+ }
3356
+ if (removingFirst && !newChild) {
3357
+ return this;
3358
+ }
3359
+ var editable = editableVNode(this, ownerID);
3360
+ if (!removingFirst) {
3361
+ for (var ii = 0; ii < originIndex; ii++) {
3362
+ editable.array[ii] = undefined;
3363
+ }
3364
+ }
3365
+ if (newChild) {
3366
+ editable.array[originIndex] = newChild;
3367
+ }
3368
+ return editable;
3369
+ };
3370
+
3371
+ VNode.prototype.removeAfter = function(ownerID, level, index) {
3372
+ if (index === (level ? 1 << level : 0) || this.array.length === 0) {
3373
+ return this;
3374
+ }
3375
+ var sizeIndex = ((index - 1) >>> level) & MASK;
3376
+ if (sizeIndex >= this.array.length) {
3377
+ return this;
3378
+ }
3379
+
3380
+ var newChild;
3381
+ if (level > 0) {
3382
+ var oldChild = this.array[sizeIndex];
3383
+ newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
3384
+ if (newChild === oldChild && sizeIndex === this.array.length - 1) {
3385
+ return this;
3386
+ }
3387
+ }
3388
+
3389
+ var editable = editableVNode(this, ownerID);
3390
+ editable.array.splice(sizeIndex + 1);
3391
+ if (newChild) {
3392
+ editable.array[sizeIndex] = newChild;
3393
+ }
3394
+ return editable;
3395
+ };
3396
+
3397
+
3398
+
3399
+ var DONE = {};
3400
+
3401
+ function iterateList(list, reverse) {
3402
+ var left = list._origin;
3403
+ var right = list._capacity;
3404
+ var tailPos = getTailOffset(right);
3405
+ var tail = list._tail;
3406
+
3407
+ return iterateNodeOrLeaf(list._root, list._level, 0);
3408
+
3409
+ function iterateNodeOrLeaf(node, level, offset) {
3410
+ return level === 0 ?
3411
+ iterateLeaf(node, offset) :
3412
+ iterateNode(node, level, offset);
3413
+ }
3414
+
3415
+ function iterateLeaf(node, offset) {
3416
+ var array = offset === tailPos ? tail && tail.array : node && node.array;
3417
+ var from = offset > left ? 0 : left - offset;
3418
+ var to = right - offset;
3419
+ if (to > SIZE) {
3420
+ to = SIZE;
3421
+ }
3422
+ return function() {
3423
+ if (from === to) {
3424
+ return DONE;
3425
+ }
3426
+ var idx = reverse ? --to : from++;
3427
+ return array && array[idx];
3428
+ };
3429
+ }
3430
+
3431
+ function iterateNode(node, level, offset) {
3432
+ var values;
3433
+ var array = node && node.array;
3434
+ var from = offset > left ? 0 : (left - offset) >> level;
3435
+ var to = ((right - offset) >> level) + 1;
3436
+ if (to > SIZE) {
3437
+ to = SIZE;
3438
+ }
3439
+ return function() {
3440
+ do {
3441
+ if (values) {
3442
+ var value = values();
3443
+ if (value !== DONE) {
3444
+ return value;
3445
+ }
3446
+ values = null;
3447
+ }
3448
+ if (from === to) {
3449
+ return DONE;
3450
+ }
3451
+ var idx = reverse ? --to : from++;
3452
+ values = iterateNodeOrLeaf(
3453
+ array && array[idx], level - SHIFT, offset + (idx << level)
3454
+ );
3455
+ } while (true);
3456
+ };
3457
+ }
3458
+ }
3459
+
3460
+ function makeList(origin, capacity, level, root, tail, ownerID, hash) {
3461
+ var list = Object.create(ListPrototype);
3462
+ list.size = capacity - origin;
3463
+ list._origin = origin;
3464
+ list._capacity = capacity;
3465
+ list._level = level;
3466
+ list._root = root;
3467
+ list._tail = tail;
3468
+ list.__ownerID = ownerID;
3469
+ list.__hash = hash;
3470
+ list.__altered = false;
3471
+ return list;
3472
+ }
3473
+
3474
+ var EMPTY_LIST;
3475
+ function emptyList() {
3476
+ return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
3477
+ }
3478
+
3479
+ function updateList(list, index, value) {
3480
+ index = wrapIndex(list, index);
3481
+
3482
+ if (index !== index) {
3483
+ return list;
3484
+ }
3485
+
3486
+ if (index >= list.size || index < 0) {
3487
+ return list.withMutations(function(list ) {
3488
+ index < 0 ?
3489
+ setListBounds(list, index).set(0, value) :
3490
+ setListBounds(list, 0, index + 1).set(index, value)
3491
+ });
3492
+ }
3493
+
3494
+ index += list._origin;
3495
+
3496
+ var newTail = list._tail;
3497
+ var newRoot = list._root;
3498
+ var didAlter = MakeRef(DID_ALTER);
3499
+ if (index >= getTailOffset(list._capacity)) {
3500
+ newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
3501
+ } else {
3502
+ newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
3503
+ }
3504
+
3505
+ if (!didAlter.value) {
3506
+ return list;
3507
+ }
3508
+
3509
+ if (list.__ownerID) {
3510
+ list._root = newRoot;
3511
+ list._tail = newTail;
3512
+ list.__hash = undefined;
3513
+ list.__altered = true;
3514
+ return list;
3515
+ }
3516
+ return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
3517
+ }
3518
+
3519
+ function updateVNode(node, ownerID, level, index, value, didAlter) {
3520
+ var idx = (index >>> level) & MASK;
3521
+ var nodeHas = node && idx < node.array.length;
3522
+ if (!nodeHas && value === undefined) {
3523
+ return node;
3524
+ }
3525
+
3526
+ var newNode;
3527
+
3528
+ if (level > 0) {
3529
+ var lowerNode = node && node.array[idx];
3530
+ var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
3531
+ if (newLowerNode === lowerNode) {
3532
+ return node;
3533
+ }
3534
+ newNode = editableVNode(node, ownerID);
3535
+ newNode.array[idx] = newLowerNode;
3536
+ return newNode;
3537
+ }
3538
+
3539
+ if (nodeHas && node.array[idx] === value) {
3540
+ return node;
3541
+ }
3542
+
3543
+ SetRef(didAlter);
3544
+
3545
+ newNode = editableVNode(node, ownerID);
3546
+ if (value === undefined && idx === newNode.array.length - 1) {
3547
+ newNode.array.pop();
3548
+ } else {
3549
+ newNode.array[idx] = value;
3550
+ }
3551
+ return newNode;
3552
+ }
3553
+
3554
+ function editableVNode(node, ownerID) {
3555
+ if (ownerID && node && ownerID === node.ownerID) {
3556
+ return node;
3557
+ }
3558
+ return new VNode(node ? node.array.slice() : [], ownerID);
3559
+ }
3560
+
3561
+ function listNodeFor(list, rawIndex) {
3562
+ if (rawIndex >= getTailOffset(list._capacity)) {
3563
+ return list._tail;
3564
+ }
3565
+ if (rawIndex < 1 << (list._level + SHIFT)) {
3566
+ var node = list._root;
3567
+ var level = list._level;
3568
+ while (node && level > 0) {
3569
+ node = node.array[(rawIndex >>> level) & MASK];
3570
+ level -= SHIFT;
3571
+ }
3572
+ return node;
3573
+ }
3574
+ }
3575
+
3576
+ function setListBounds(list, begin, end) {
3577
+ // Sanitize begin & end using this shorthand for ToInt32(argument)
3578
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
3579
+ if (begin !== undefined) {
3580
+ begin = begin | 0;
3581
+ }
3582
+ if (end !== undefined) {
3583
+ end = end | 0;
3584
+ }
3585
+ var owner = list.__ownerID || new OwnerID();
3586
+ var oldOrigin = list._origin;
3587
+ var oldCapacity = list._capacity;
3588
+ var newOrigin = oldOrigin + begin;
3589
+ var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
3590
+ if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
3591
+ return list;
3592
+ }
3593
+
3594
+ // If it's going to end after it starts, it's empty.
3595
+ if (newOrigin >= newCapacity) {
3596
+ return list.clear();
3597
+ }
3598
+
3599
+ var newLevel = list._level;
3600
+ var newRoot = list._root;
3601
+
3602
+ // New origin might need creating a higher root.
3603
+ var offsetShift = 0;
3604
+ while (newOrigin + offsetShift < 0) {
3605
+ newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);
3606
+ newLevel += SHIFT;
3607
+ offsetShift += 1 << newLevel;
3608
+ }
3609
+ if (offsetShift) {
3610
+ newOrigin += offsetShift;
3611
+ oldOrigin += offsetShift;
3612
+ newCapacity += offsetShift;
3613
+ oldCapacity += offsetShift;
3614
+ }
3615
+
3616
+ var oldTailOffset = getTailOffset(oldCapacity);
3617
+ var newTailOffset = getTailOffset(newCapacity);
3618
+
3619
+ // New size might need creating a higher root.
3620
+ while (newTailOffset >= 1 << (newLevel + SHIFT)) {
3621
+ newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);
3622
+ newLevel += SHIFT;
3623
+ }
3624
+
3625
+ // Locate or create the new tail.
3626
+ var oldTail = list._tail;
3627
+ var newTail = newTailOffset < oldTailOffset ?
3628
+ listNodeFor(list, newCapacity - 1) :
3629
+ newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
3630
+
3631
+ // Merge Tail into tree.
3632
+ if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
3633
+ newRoot = editableVNode(newRoot, owner);
3634
+ var node = newRoot;
3635
+ for (var level = newLevel; level > SHIFT; level -= SHIFT) {
3636
+ var idx = (oldTailOffset >>> level) & MASK;
3637
+ node = node.array[idx] = editableVNode(node.array[idx], owner);
3638
+ }
3639
+ node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
3640
+ }
3641
+
3642
+ // If the size has been reduced, there's a chance the tail needs to be trimmed.
3643
+ if (newCapacity < oldCapacity) {
3644
+ newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
3645
+ }
3646
+
3647
+ // If the new origin is within the tail, then we do not need a root.
3648
+ if (newOrigin >= newTailOffset) {
3649
+ newOrigin -= newTailOffset;
3650
+ newCapacity -= newTailOffset;
3651
+ newLevel = SHIFT;
3652
+ newRoot = null;
3653
+ newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
3654
+
3655
+ // Otherwise, if the root has been trimmed, garbage collect.
3656
+ } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
3657
+ offsetShift = 0;
3658
+
3659
+ // Identify the new top root node of the subtree of the old root.
3660
+ while (newRoot) {
3661
+ var beginIndex = (newOrigin >>> newLevel) & MASK;
3662
+ if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {
3663
+ break;
3664
+ }
3665
+ if (beginIndex) {
3666
+ offsetShift += (1 << newLevel) * beginIndex;
3667
+ }
3668
+ newLevel -= SHIFT;
3669
+ newRoot = newRoot.array[beginIndex];
3670
+ }
3671
+
3672
+ // Trim the new sides of the new root.
3673
+ if (newRoot && newOrigin > oldOrigin) {
3674
+ newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
3675
+ }
3676
+ if (newRoot && newTailOffset < oldTailOffset) {
3677
+ newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
3678
+ }
3679
+ if (offsetShift) {
3680
+ newOrigin -= offsetShift;
3681
+ newCapacity -= offsetShift;
3682
+ }
3683
+ }
3684
+
3685
+ if (list.__ownerID) {
3686
+ list.size = newCapacity - newOrigin;
3687
+ list._origin = newOrigin;
3688
+ list._capacity = newCapacity;
3689
+ list._level = newLevel;
3690
+ list._root = newRoot;
3691
+ list._tail = newTail;
3692
+ list.__hash = undefined;
3693
+ list.__altered = true;
3694
+ return list;
3695
+ }
3696
+ return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
3697
+ }
3698
+
3699
+ function mergeIntoListWith(list, merger, iterables) {
3700
+ var iters = [];
3701
+ var maxSize = 0;
3702
+ for (var ii = 0; ii < iterables.length; ii++) {
3703
+ var value = iterables[ii];
3704
+ var iter = IndexedIterable(value);
3705
+ if (iter.size > maxSize) {
3706
+ maxSize = iter.size;
3707
+ }
3708
+ if (!isIterable(value)) {
3709
+ iter = iter.map(function(v ) {return fromJS(v)});
3710
+ }
3711
+ iters.push(iter);
3712
+ }
3713
+ if (maxSize > list.size) {
3714
+ list = list.setSize(maxSize);
3715
+ }
3716
+ return mergeIntoCollectionWith(list, merger, iters);
3717
+ }
3718
+
3719
+ function getTailOffset(size) {
3720
+ return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);
3721
+ }
3722
+
3723
+ createClass(OrderedMap, Map);
3724
+
3725
+ // @pragma Construction
3726
+
3727
+ function OrderedMap(value) {
3728
+ return value === null || value === undefined ? emptyOrderedMap() :
3729
+ isOrderedMap(value) ? value :
3730
+ emptyOrderedMap().withMutations(function(map ) {
3731
+ var iter = KeyedIterable(value);
3732
+ assertNotInfinite(iter.size);
3733
+ iter.forEach(function(v, k) {return map.set(k, v)});
3734
+ });
3735
+ }
3736
+
3737
+ OrderedMap.of = function(/*...values*/) {
3738
+ return this(arguments);
3739
+ };
3740
+
3741
+ OrderedMap.prototype.toString = function() {
3742
+ return this.__toString('OrderedMap {', '}');
3743
+ };
3744
+
3745
+ // @pragma Access
3746
+
3747
+ OrderedMap.prototype.get = function(k, notSetValue) {
3748
+ var index = this._map.get(k);
3749
+ return index !== undefined ? this._list.get(index)[1] : notSetValue;
3750
+ };
3751
+
3752
+ // @pragma Modification
3753
+
3754
+ OrderedMap.prototype.clear = function() {
3755
+ if (this.size === 0) {
3756
+ return this;
3757
+ }
3758
+ if (this.__ownerID) {
3759
+ this.size = 0;
3760
+ this._map.clear();
3761
+ this._list.clear();
3762
+ return this;
3763
+ }
3764
+ return emptyOrderedMap();
3765
+ };
3766
+
3767
+ OrderedMap.prototype.set = function(k, v) {
3768
+ return updateOrderedMap(this, k, v);
3769
+ };
3770
+
3771
+ OrderedMap.prototype.remove = function(k) {
3772
+ return updateOrderedMap(this, k, NOT_SET);
3773
+ };
3774
+
3775
+ OrderedMap.prototype.wasAltered = function() {
3776
+ return this._map.wasAltered() || this._list.wasAltered();
3777
+ };
3778
+
3779
+ OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;
3780
+ return this._list.__iterate(
3781
+ function(entry ) {return entry && fn(entry[1], entry[0], this$0)},
3782
+ reverse
3783
+ );
3784
+ };
3785
+
3786
+ OrderedMap.prototype.__iterator = function(type, reverse) {
3787
+ return this._list.fromEntrySeq().__iterator(type, reverse);
3788
+ };
3789
+
3790
+ OrderedMap.prototype.__ensureOwner = function(ownerID) {
3791
+ if (ownerID === this.__ownerID) {
3792
+ return this;
3793
+ }
3794
+ var newMap = this._map.__ensureOwner(ownerID);
3795
+ var newList = this._list.__ensureOwner(ownerID);
3796
+ if (!ownerID) {
3797
+ this.__ownerID = ownerID;
3798
+ this._map = newMap;
3799
+ this._list = newList;
3800
+ return this;
3801
+ }
3802
+ return makeOrderedMap(newMap, newList, ownerID, this.__hash);
3803
+ };
3804
+
3805
+
3806
+ function isOrderedMap(maybeOrderedMap) {
3807
+ return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
3808
+ }
3809
+
3810
+ OrderedMap.isOrderedMap = isOrderedMap;
3811
+
3812
+ OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
3813
+ OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
3814
+
3815
+
3816
+
3817
+ function makeOrderedMap(map, list, ownerID, hash) {
3818
+ var omap = Object.create(OrderedMap.prototype);
3819
+ omap.size = map ? map.size : 0;
3820
+ omap._map = map;
3821
+ omap._list = list;
3822
+ omap.__ownerID = ownerID;
3823
+ omap.__hash = hash;
3824
+ return omap;
3825
+ }
3826
+
3827
+ var EMPTY_ORDERED_MAP;
3828
+ function emptyOrderedMap() {
3829
+ return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
3830
+ }
3831
+
3832
+ function updateOrderedMap(omap, k, v) {
3833
+ var map = omap._map;
3834
+ var list = omap._list;
3835
+ var i = map.get(k);
3836
+ var has = i !== undefined;
3837
+ var newMap;
3838
+ var newList;
3839
+ if (v === NOT_SET) { // removed
3840
+ if (!has) {
3841
+ return omap;
3842
+ }
3843
+ if (list.size >= SIZE && list.size >= map.size * 2) {
3844
+ newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx});
3845
+ newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();
3846
+ if (omap.__ownerID) {
3847
+ newMap.__ownerID = newList.__ownerID = omap.__ownerID;
3848
+ }
3849
+ } else {
3850
+ newMap = map.remove(k);
3851
+ newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
3852
+ }
3853
+ } else {
3854
+ if (has) {
3855
+ if (v === list.get(i)[1]) {
3856
+ return omap;
3857
+ }
3858
+ newMap = map;
3859
+ newList = list.set(i, [k, v]);
3860
+ } else {
3861
+ newMap = map.set(k, list.size);
3862
+ newList = list.set(list.size, [k, v]);
3863
+ }
3864
+ }
3865
+ if (omap.__ownerID) {
3866
+ omap.size = newMap.size;
3867
+ omap._map = newMap;
3868
+ omap._list = newList;
3869
+ omap.__hash = undefined;
3870
+ return omap;
3871
+ }
3872
+ return makeOrderedMap(newMap, newList);
3873
+ }
3874
+
3875
+ createClass(ToKeyedSequence, KeyedSeq);
3876
+ function ToKeyedSequence(indexed, useKeys) {
3877
+ this._iter = indexed;
3878
+ this._useKeys = useKeys;
3879
+ this.size = indexed.size;
3880
+ }
3881
+
3882
+ ToKeyedSequence.prototype.get = function(key, notSetValue) {
3883
+ return this._iter.get(key, notSetValue);
3884
+ };
3885
+
3886
+ ToKeyedSequence.prototype.has = function(key) {
3887
+ return this._iter.has(key);
3888
+ };
3889
+
3890
+ ToKeyedSequence.prototype.valueSeq = function() {
3891
+ return this._iter.valueSeq();
3892
+ };
3893
+
3894
+ ToKeyedSequence.prototype.reverse = function() {var this$0 = this;
3895
+ var reversedSequence = reverseFactory(this, true);
3896
+ if (!this._useKeys) {
3897
+ reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()};
3898
+ }
3899
+ return reversedSequence;
3900
+ };
3901
+
3902
+ ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;
3903
+ var mappedSequence = mapFactory(this, mapper, context);
3904
+ if (!this._useKeys) {
3905
+ mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)};
3906
+ }
3907
+ return mappedSequence;
3908
+ };
3909
+
3910
+ ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
3911
+ var ii;
3912
+ return this._iter.__iterate(
3913
+ this._useKeys ?
3914
+ function(v, k) {return fn(v, k, this$0)} :
3915
+ ((ii = reverse ? resolveSize(this) : 0),
3916
+ function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),
3917
+ reverse
3918
+ );
3919
+ };
3920
+
3921
+ ToKeyedSequence.prototype.__iterator = function(type, reverse) {
3922
+ if (this._useKeys) {
3923
+ return this._iter.__iterator(type, reverse);
3924
+ }
3925
+ var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
3926
+ var ii = reverse ? resolveSize(this) : 0;
3927
+ return new Iterator(function() {
3928
+ var step = iterator.next();
3929
+ return step.done ? step :
3930
+ iteratorValue(type, reverse ? --ii : ii++, step.value, step);
3931
+ });
3932
+ };
3933
+
3934
+ ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;
3935
+
3936
+
3937
+ createClass(ToIndexedSequence, IndexedSeq);
3938
+ function ToIndexedSequence(iter) {
3939
+ this._iter = iter;
3940
+ this.size = iter.size;
3941
+ }
3942
+
3943
+ ToIndexedSequence.prototype.includes = function(value) {
3944
+ return this._iter.includes(value);
3945
+ };
3946
+
3947
+ ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
3948
+ var iterations = 0;
3949
+ return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);
3950
+ };
3951
+
3952
+ ToIndexedSequence.prototype.__iterator = function(type, reverse) {
3953
+ var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
3954
+ var iterations = 0;
3955
+ return new Iterator(function() {
3956
+ var step = iterator.next();
3957
+ return step.done ? step :
3958
+ iteratorValue(type, iterations++, step.value, step)
3959
+ });
3960
+ };
3961
+
3962
+
3963
+
3964
+ createClass(ToSetSequence, SetSeq);
3965
+ function ToSetSequence(iter) {
3966
+ this._iter = iter;
3967
+ this.size = iter.size;
3968
+ }
3969
+
3970
+ ToSetSequence.prototype.has = function(key) {
3971
+ return this._iter.includes(key);
3972
+ };
3973
+
3974
+ ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
3975
+ return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);
3976
+ };
3977
+
3978
+ ToSetSequence.prototype.__iterator = function(type, reverse) {
3979
+ var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
3980
+ return new Iterator(function() {
3981
+ var step = iterator.next();
3982
+ return step.done ? step :
3983
+ iteratorValue(type, step.value, step.value, step);
3984
+ });
3985
+ };
3986
+
3987
+
3988
+
3989
+ createClass(FromEntriesSequence, KeyedSeq);
3990
+ function FromEntriesSequence(entries) {
3991
+ this._iter = entries;
3992
+ this.size = entries.size;
3993
+ }
3994
+
3995
+ FromEntriesSequence.prototype.entrySeq = function() {
3996
+ return this._iter.toSeq();
3997
+ };
3998
+
3999
+ FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
4000
+ return this._iter.__iterate(function(entry ) {
4001
+ // Check if entry exists first so array access doesn't throw for holes
4002
+ // in the parent iteration.
4003
+ if (entry) {
4004
+ validateEntry(entry);
4005
+ var indexedIterable = isIterable(entry);
4006
+ return fn(
4007
+ indexedIterable ? entry.get(1) : entry[1],
4008
+ indexedIterable ? entry.get(0) : entry[0],
4009
+ this$0
4010
+ );
4011
+ }
4012
+ }, reverse);
4013
+ };
4014
+
4015
+ FromEntriesSequence.prototype.__iterator = function(type, reverse) {
4016
+ var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
4017
+ return new Iterator(function() {
4018
+ while (true) {
4019
+ var step = iterator.next();
4020
+ if (step.done) {
4021
+ return step;
4022
+ }
4023
+ var entry = step.value;
4024
+ // Check if entry exists first so array access doesn't throw for holes
4025
+ // in the parent iteration.
4026
+ if (entry) {
4027
+ validateEntry(entry);
4028
+ var indexedIterable = isIterable(entry);
4029
+ return iteratorValue(
4030
+ type,
4031
+ indexedIterable ? entry.get(0) : entry[0],
4032
+ indexedIterable ? entry.get(1) : entry[1],
4033
+ step
4034
+ );
4035
+ }
4036
+ }
4037
+ });
4038
+ };
4039
+
4040
+
4041
+ ToIndexedSequence.prototype.cacheResult =
4042
+ ToKeyedSequence.prototype.cacheResult =
4043
+ ToSetSequence.prototype.cacheResult =
4044
+ FromEntriesSequence.prototype.cacheResult =
4045
+ cacheResultThrough;
4046
+
4047
+
4048
+ function flipFactory(iterable) {
4049
+ var flipSequence = makeSequence(iterable);
4050
+ flipSequence._iter = iterable;
4051
+ flipSequence.size = iterable.size;
4052
+ flipSequence.flip = function() {return iterable};
4053
+ flipSequence.reverse = function () {
4054
+ var reversedSequence = iterable.reverse.apply(this); // super.reverse()
4055
+ reversedSequence.flip = function() {return iterable.reverse()};
4056
+ return reversedSequence;
4057
+ };
4058
+ flipSequence.has = function(key ) {return iterable.includes(key)};
4059
+ flipSequence.includes = function(key ) {return iterable.has(key)};
4060
+ flipSequence.cacheResult = cacheResultThrough;
4061
+ flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
4062
+ return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse);
4063
+ }
4064
+ flipSequence.__iteratorUncached = function(type, reverse) {
4065
+ if (type === ITERATE_ENTRIES) {
4066
+ var iterator = iterable.__iterator(type, reverse);
4067
+ return new Iterator(function() {
4068
+ var step = iterator.next();
4069
+ if (!step.done) {
4070
+ var k = step.value[0];
4071
+ step.value[0] = step.value[1];
4072
+ step.value[1] = k;
4073
+ }
4074
+ return step;
4075
+ });
4076
+ }
4077
+ return iterable.__iterator(
4078
+ type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
4079
+ reverse
4080
+ );
4081
+ }
4082
+ return flipSequence;
4083
+ }
4084
+
4085
+
4086
+ function mapFactory(iterable, mapper, context) {
4087
+ var mappedSequence = makeSequence(iterable);
4088
+ mappedSequence.size = iterable.size;
4089
+ mappedSequence.has = function(key ) {return iterable.has(key)};
4090
+ mappedSequence.get = function(key, notSetValue) {
4091
+ var v = iterable.get(key, NOT_SET);
4092
+ return v === NOT_SET ?
4093
+ notSetValue :
4094
+ mapper.call(context, v, key, iterable);
4095
+ };
4096
+ mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
4097
+ return iterable.__iterate(
4098
+ function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false},
4099
+ reverse
4100
+ );
4101
+ }
4102
+ mappedSequence.__iteratorUncached = function (type, reverse) {
4103
+ var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
4104
+ return new Iterator(function() {
4105
+ var step = iterator.next();
4106
+ if (step.done) {
4107
+ return step;
4108
+ }
4109
+ var entry = step.value;
4110
+ var key = entry[0];
4111
+ return iteratorValue(
4112
+ type,
4113
+ key,
4114
+ mapper.call(context, entry[1], key, iterable),
4115
+ step
4116
+ );
4117
+ });
4118
+ }
4119
+ return mappedSequence;
4120
+ }
4121
+
4122
+
4123
+ function reverseFactory(iterable, useKeys) {
4124
+ var reversedSequence = makeSequence(iterable);
4125
+ reversedSequence._iter = iterable;
4126
+ reversedSequence.size = iterable.size;
4127
+ reversedSequence.reverse = function() {return iterable};
4128
+ if (iterable.flip) {
4129
+ reversedSequence.flip = function () {
4130
+ var flipSequence = flipFactory(iterable);
4131
+ flipSequence.reverse = function() {return iterable.flip()};
4132
+ return flipSequence;
4133
+ };
4134
+ }
4135
+ reversedSequence.get = function(key, notSetValue)
4136
+ {return iterable.get(useKeys ? key : -1 - key, notSetValue)};
4137
+ reversedSequence.has = function(key )
4138
+ {return iterable.has(useKeys ? key : -1 - key)};
4139
+ reversedSequence.includes = function(value ) {return iterable.includes(value)};
4140
+ reversedSequence.cacheResult = cacheResultThrough;
4141
+ reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;
4142
+ return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse);
4143
+ };
4144
+ reversedSequence.__iterator =
4145
+ function(type, reverse) {return iterable.__iterator(type, !reverse)};
4146
+ return reversedSequence;
4147
+ }
4148
+
4149
+
4150
+ function filterFactory(iterable, predicate, context, useKeys) {
4151
+ var filterSequence = makeSequence(iterable);
4152
+ if (useKeys) {
4153
+ filterSequence.has = function(key ) {
4154
+ var v = iterable.get(key, NOT_SET);
4155
+ return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
4156
+ };
4157
+ filterSequence.get = function(key, notSetValue) {
4158
+ var v = iterable.get(key, NOT_SET);
4159
+ return v !== NOT_SET && predicate.call(context, v, key, iterable) ?
4160
+ v : notSetValue;
4161
+ };
4162
+ }
4163
+ filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
4164
+ var iterations = 0;
4165
+ iterable.__iterate(function(v, k, c) {
4166
+ if (predicate.call(context, v, k, c)) {
4167
+ iterations++;
4168
+ return fn(v, useKeys ? k : iterations - 1, this$0);
4169
+ }
4170
+ }, reverse);
4171
+ return iterations;
4172
+ };
4173
+ filterSequence.__iteratorUncached = function (type, reverse) {
4174
+ var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
4175
+ var iterations = 0;
4176
+ return new Iterator(function() {
4177
+ while (true) {
4178
+ var step = iterator.next();
4179
+ if (step.done) {
4180
+ return step;
4181
+ }
4182
+ var entry = step.value;
4183
+ var key = entry[0];
4184
+ var value = entry[1];
4185
+ if (predicate.call(context, value, key, iterable)) {
4186
+ return iteratorValue(type, useKeys ? key : iterations++, value, step);
4187
+ }
4188
+ }
4189
+ });
4190
+ }
4191
+ return filterSequence;
4192
+ }
4193
+
4194
+
4195
+ function countByFactory(iterable, grouper, context) {
4196
+ var groups = Map().asMutable();
4197
+ iterable.__iterate(function(v, k) {
4198
+ groups.update(
4199
+ grouper.call(context, v, k, iterable),
4200
+ 0,
4201
+ function(a ) {return a + 1}
4202
+ );
4203
+ });
4204
+ return groups.asImmutable();
4205
+ }
4206
+
4207
+
4208
+ function groupByFactory(iterable, grouper, context) {
4209
+ var isKeyedIter = isKeyed(iterable);
4210
+ var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
4211
+ iterable.__iterate(function(v, k) {
4212
+ groups.update(
4213
+ grouper.call(context, v, k, iterable),
4214
+ function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}
4215
+ );
4216
+ });
4217
+ var coerce = iterableClass(iterable);
4218
+ return groups.map(function(arr ) {return reify(iterable, coerce(arr))});
4219
+ }
4220
+
4221
+
4222
+ function sliceFactory(iterable, begin, end, useKeys) {
4223
+ var originalSize = iterable.size;
4224
+
4225
+ // Sanitize begin & end using this shorthand for ToInt32(argument)
4226
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
4227
+ if (begin !== undefined) {
4228
+ begin = begin | 0;
4229
+ }
4230
+ if (end !== undefined) {
4231
+ if (end === Infinity) {
4232
+ end = originalSize;
4233
+ } else {
4234
+ end = end | 0;
4235
+ }
4236
+ }
4237
+
4238
+ if (wholeSlice(begin, end, originalSize)) {
4239
+ return iterable;
4240
+ }
4241
+
4242
+ var resolvedBegin = resolveBegin(begin, originalSize);
4243
+ var resolvedEnd = resolveEnd(end, originalSize);
4244
+
4245
+ // begin or end will be NaN if they were provided as negative numbers and
4246
+ // this iterable's size is unknown. In that case, cache first so there is
4247
+ // a known size and these do not resolve to NaN.
4248
+ if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
4249
+ return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
4250
+ }
4251
+
4252
+ // Note: resolvedEnd is undefined when the original sequence's length is
4253
+ // unknown and this slice did not supply an end and should contain all
4254
+ // elements after resolvedBegin.
4255
+ // In that case, resolvedSize will be NaN and sliceSize will remain undefined.
4256
+ var resolvedSize = resolvedEnd - resolvedBegin;
4257
+ var sliceSize;
4258
+ if (resolvedSize === resolvedSize) {
4259
+ sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
4260
+ }
4261
+
4262
+ var sliceSeq = makeSequence(iterable);
4263
+
4264
+ // If iterable.size is undefined, the size of the realized sliceSeq is
4265
+ // unknown at this point unless the number of items to slice is 0
4266
+ sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;
4267
+
4268
+ if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
4269
+ sliceSeq.get = function (index, notSetValue) {
4270
+ index = wrapIndex(this, index);
4271
+ return index >= 0 && index < sliceSize ?
4272
+ iterable.get(index + resolvedBegin, notSetValue) :
4273
+ notSetValue;
4274
+ }
4275
+ }
4276
+
4277
+ sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;
4278
+ if (sliceSize === 0) {
4279
+ return 0;
4280
+ }
4281
+ if (reverse) {
4282
+ return this.cacheResult().__iterate(fn, reverse);
4283
+ }
4284
+ var skipped = 0;
4285
+ var isSkipping = true;
4286
+ var iterations = 0;
4287
+ iterable.__iterate(function(v, k) {
4288
+ if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
4289
+ iterations++;
4290
+ return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&
4291
+ iterations !== sliceSize;
4292
+ }
4293
+ });
4294
+ return iterations;
4295
+ };
4296
+
4297
+ sliceSeq.__iteratorUncached = function(type, reverse) {
4298
+ if (sliceSize !== 0 && reverse) {
4299
+ return this.cacheResult().__iterator(type, reverse);
4300
+ }
4301
+ // Don't bother instantiating parent iterator if taking 0.
4302
+ var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
4303
+ var skipped = 0;
4304
+ var iterations = 0;
4305
+ return new Iterator(function() {
4306
+ while (skipped++ < resolvedBegin) {
4307
+ iterator.next();
4308
+ }
4309
+ if (++iterations > sliceSize) {
4310
+ return iteratorDone();
4311
+ }
4312
+ var step = iterator.next();
4313
+ if (useKeys || type === ITERATE_VALUES) {
4314
+ return step;
4315
+ } else if (type === ITERATE_KEYS) {
4316
+ return iteratorValue(type, iterations - 1, undefined, step);
4317
+ } else {
4318
+ return iteratorValue(type, iterations - 1, step.value[1], step);
4319
+ }
4320
+ });
4321
+ }
4322
+
4323
+ return sliceSeq;
4324
+ }
4325
+
4326
+
4327
+ function takeWhileFactory(iterable, predicate, context) {
4328
+ var takeSequence = makeSequence(iterable);
4329
+ takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
4330
+ if (reverse) {
4331
+ return this.cacheResult().__iterate(fn, reverse);
4332
+ }
4333
+ var iterations = 0;
4334
+ iterable.__iterate(function(v, k, c)
4335
+ {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}
4336
+ );
4337
+ return iterations;
4338
+ };
4339
+ takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
4340
+ if (reverse) {
4341
+ return this.cacheResult().__iterator(type, reverse);
4342
+ }
4343
+ var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
4344
+ var iterating = true;
4345
+ return new Iterator(function() {
4346
+ if (!iterating) {
4347
+ return iteratorDone();
4348
+ }
4349
+ var step = iterator.next();
4350
+ if (step.done) {
4351
+ return step;
4352
+ }
4353
+ var entry = step.value;
4354
+ var k = entry[0];
4355
+ var v = entry[1];
4356
+ if (!predicate.call(context, v, k, this$0)) {
4357
+ iterating = false;
4358
+ return iteratorDone();
4359
+ }
4360
+ return type === ITERATE_ENTRIES ? step :
4361
+ iteratorValue(type, k, v, step);
4362
+ });
4363
+ };
4364
+ return takeSequence;
4365
+ }
4366
+
4367
+
4368
+ function skipWhileFactory(iterable, predicate, context, useKeys) {
4369
+ var skipSequence = makeSequence(iterable);
4370
+ skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
4371
+ if (reverse) {
4372
+ return this.cacheResult().__iterate(fn, reverse);
4373
+ }
4374
+ var isSkipping = true;
4375
+ var iterations = 0;
4376
+ iterable.__iterate(function(v, k, c) {
4377
+ if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
4378
+ iterations++;
4379
+ return fn(v, useKeys ? k : iterations - 1, this$0);
4380
+ }
4381
+ });
4382
+ return iterations;
4383
+ };
4384
+ skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
4385
+ if (reverse) {
4386
+ return this.cacheResult().__iterator(type, reverse);
4387
+ }
4388
+ var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
4389
+ var skipping = true;
4390
+ var iterations = 0;
4391
+ return new Iterator(function() {
4392
+ var step, k, v;
4393
+ do {
4394
+ step = iterator.next();
4395
+ if (step.done) {
4396
+ if (useKeys || type === ITERATE_VALUES) {
4397
+ return step;
4398
+ } else if (type === ITERATE_KEYS) {
4399
+ return iteratorValue(type, iterations++, undefined, step);
4400
+ } else {
4401
+ return iteratorValue(type, iterations++, step.value[1], step);
4402
+ }
4403
+ }
4404
+ var entry = step.value;
4405
+ k = entry[0];
4406
+ v = entry[1];
4407
+ skipping && (skipping = predicate.call(context, v, k, this$0));
4408
+ } while (skipping);
4409
+ return type === ITERATE_ENTRIES ? step :
4410
+ iteratorValue(type, k, v, step);
4411
+ });
4412
+ };
4413
+ return skipSequence;
4414
+ }
4415
+
4416
+
4417
+ function concatFactory(iterable, values) {
4418
+ var isKeyedIterable = isKeyed(iterable);
4419
+ var iters = [iterable].concat(values).map(function(v ) {
4420
+ if (!isIterable(v)) {
4421
+ v = isKeyedIterable ?
4422
+ keyedSeqFromValue(v) :
4423
+ indexedSeqFromValue(Array.isArray(v) ? v : [v]);
4424
+ } else if (isKeyedIterable) {
4425
+ v = KeyedIterable(v);
4426
+ }
4427
+ return v;
4428
+ }).filter(function(v ) {return v.size !== 0});
4429
+
4430
+ if (iters.length === 0) {
4431
+ return iterable;
4432
+ }
4433
+
4434
+ if (iters.length === 1) {
4435
+ var singleton = iters[0];
4436
+ if (singleton === iterable ||
4437
+ isKeyedIterable && isKeyed(singleton) ||
4438
+ isIndexed(iterable) && isIndexed(singleton)) {
4439
+ return singleton;
4440
+ }
4441
+ }
4442
+
4443
+ var concatSeq = new ArraySeq(iters);
4444
+ if (isKeyedIterable) {
4445
+ concatSeq = concatSeq.toKeyedSeq();
4446
+ } else if (!isIndexed(iterable)) {
4447
+ concatSeq = concatSeq.toSetSeq();
4448
+ }
4449
+ concatSeq = concatSeq.flatten(true);
4450
+ concatSeq.size = iters.reduce(
4451
+ function(sum, seq) {
4452
+ if (sum !== undefined) {
4453
+ var size = seq.size;
4454
+ if (size !== undefined) {
4455
+ return sum + size;
4456
+ }
4457
+ }
4458
+ },
4459
+ 0
4460
+ );
4461
+ return concatSeq;
4462
+ }
4463
+
4464
+
4465
+ function flattenFactory(iterable, depth, useKeys) {
4466
+ var flatSequence = makeSequence(iterable);
4467
+ flatSequence.__iterateUncached = function(fn, reverse) {
4468
+ var iterations = 0;
4469
+ var stopped = false;
4470
+ function flatDeep(iter, currentDepth) {var this$0 = this;
4471
+ iter.__iterate(function(v, k) {
4472
+ if ((!depth || currentDepth < depth) && isIterable(v)) {
4473
+ flatDeep(v, currentDepth + 1);
4474
+ } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
4475
+ stopped = true;
4476
+ }
4477
+ return !stopped;
4478
+ }, reverse);
4479
+ }
4480
+ flatDeep(iterable, 0);
4481
+ return iterations;
4482
+ }
4483
+ flatSequence.__iteratorUncached = function(type, reverse) {
4484
+ var iterator = iterable.__iterator(type, reverse);
4485
+ var stack = [];
4486
+ var iterations = 0;
4487
+ return new Iterator(function() {
4488
+ while (iterator) {
4489
+ var step = iterator.next();
4490
+ if (step.done !== false) {
4491
+ iterator = stack.pop();
4492
+ continue;
4493
+ }
4494
+ var v = step.value;
4495
+ if (type === ITERATE_ENTRIES) {
4496
+ v = v[1];
4497
+ }
4498
+ if ((!depth || stack.length < depth) && isIterable(v)) {
4499
+ stack.push(iterator);
4500
+ iterator = v.__iterator(type, reverse);
4501
+ } else {
4502
+ return useKeys ? step : iteratorValue(type, iterations++, v, step);
4503
+ }
4504
+ }
4505
+ return iteratorDone();
4506
+ });
4507
+ }
4508
+ return flatSequence;
4509
+ }
4510
+
4511
+
4512
+ function flatMapFactory(iterable, mapper, context) {
4513
+ var coerce = iterableClass(iterable);
4514
+ return iterable.toSeq().map(
4515
+ function(v, k) {return coerce(mapper.call(context, v, k, iterable))}
4516
+ ).flatten(true);
4517
+ }
4518
+
4519
+
4520
+ function interposeFactory(iterable, separator) {
4521
+ var interposedSequence = makeSequence(iterable);
4522
+ interposedSequence.size = iterable.size && iterable.size * 2 -1;
4523
+ interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
4524
+ var iterations = 0;
4525
+ iterable.__iterate(function(v, k)
4526
+ {return (!iterations || fn(separator, iterations++, this$0) !== false) &&
4527
+ fn(v, iterations++, this$0) !== false},
4528
+ reverse
4529
+ );
4530
+ return iterations;
4531
+ };
4532
+ interposedSequence.__iteratorUncached = function(type, reverse) {
4533
+ var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
4534
+ var iterations = 0;
4535
+ var step;
4536
+ return new Iterator(function() {
4537
+ if (!step || iterations % 2) {
4538
+ step = iterator.next();
4539
+ if (step.done) {
4540
+ return step;
4541
+ }
4542
+ }
4543
+ return iterations % 2 ?
4544
+ iteratorValue(type, iterations++, separator) :
4545
+ iteratorValue(type, iterations++, step.value, step);
4546
+ });
4547
+ };
4548
+ return interposedSequence;
4549
+ }
4550
+
4551
+
4552
+ function sortFactory(iterable, comparator, mapper) {
4553
+ if (!comparator) {
4554
+ comparator = defaultComparator;
4555
+ }
4556
+ var isKeyedIterable = isKeyed(iterable);
4557
+ var index = 0;
4558
+ var entries = iterable.toSeq().map(
4559
+ function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}
4560
+ ).toArray();
4561
+ entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(
4562
+ isKeyedIterable ?
4563
+ function(v, i) { entries[i].length = 2; } :
4564
+ function(v, i) { entries[i] = v[1]; }
4565
+ );
4566
+ return isKeyedIterable ? KeyedSeq(entries) :
4567
+ isIndexed(iterable) ? IndexedSeq(entries) :
4568
+ SetSeq(entries);
4569
+ }
4570
+
4571
+
4572
+ function maxFactory(iterable, comparator, mapper) {
4573
+ if (!comparator) {
4574
+ comparator = defaultComparator;
4575
+ }
4576
+ if (mapper) {
4577
+ var entry = iterable.toSeq()
4578
+ .map(function(v, k) {return [v, mapper(v, k, iterable)]})
4579
+ .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a});
4580
+ return entry && entry[0];
4581
+ } else {
4582
+ return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a});
4583
+ }
4584
+ }
4585
+
4586
+ function maxCompare(comparator, a, b) {
4587
+ var comp = comparator(b, a);
4588
+ // b is considered the new max if the comparator declares them equal, but
4589
+ // they are not equal and b is in fact a nullish value.
4590
+ return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;
4591
+ }
4592
+
4593
+
4594
+ function zipWithFactory(keyIter, zipper, iters) {
4595
+ var zipSequence = makeSequence(keyIter);
4596
+ zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
4597
+ // Note: this a generic base implementation of __iterate in terms of
4598
+ // __iterator which may be more generically useful in the future.
4599
+ zipSequence.__iterate = function(fn, reverse) {
4600
+ /* generic:
4601
+ var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
4602
+ var step;
4603
+ var iterations = 0;
4604
+ while (!(step = iterator.next()).done) {
4605
+ iterations++;
4606
+ if (fn(step.value[1], step.value[0], this) === false) {
4607
+ break;
4608
+ }
4609
+ }
4610
+ return iterations;
4611
+ */
4612
+ // indexed:
4613
+ var iterator = this.__iterator(ITERATE_VALUES, reverse);
4614
+ var step;
4615
+ var iterations = 0;
4616
+ while (!(step = iterator.next()).done) {
4617
+ if (fn(step.value, iterations++, this) === false) {
4618
+ break;
4619
+ }
4620
+ }
4621
+ return iterations;
4622
+ };
4623
+ zipSequence.__iteratorUncached = function(type, reverse) {
4624
+ var iterators = iters.map(function(i )
4625
+ {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}
4626
+ );
4627
+ var iterations = 0;
4628
+ var isDone = false;
4629
+ return new Iterator(function() {
4630
+ var steps;
4631
+ if (!isDone) {
4632
+ steps = iterators.map(function(i ) {return i.next()});
4633
+ isDone = steps.some(function(s ) {return s.done});
4634
+ }
4635
+ if (isDone) {
4636
+ return iteratorDone();
4637
+ }
4638
+ return iteratorValue(
4639
+ type,
4640
+ iterations++,
4641
+ zipper.apply(null, steps.map(function(s ) {return s.value}))
4642
+ );
4643
+ });
4644
+ };
4645
+ return zipSequence
4646
+ }
4647
+
4648
+
4649
+ // #pragma Helper Functions
4650
+
4651
+ function reify(iter, seq) {
4652
+ return isSeq(iter) ? seq : iter.constructor(seq);
4653
+ }
4654
+
4655
+ function validateEntry(entry) {
4656
+ if (entry !== Object(entry)) {
4657
+ throw new TypeError('Expected [K, V] tuple: ' + entry);
4658
+ }
4659
+ }
4660
+
4661
+ function resolveSize(iter) {
4662
+ assertNotInfinite(iter.size);
4663
+ return ensureSize(iter);
4664
+ }
4665
+
4666
+ function iterableClass(iterable) {
4667
+ return isKeyed(iterable) ? KeyedIterable :
4668
+ isIndexed(iterable) ? IndexedIterable :
4669
+ SetIterable;
4670
+ }
4671
+
4672
+ function makeSequence(iterable) {
4673
+ return Object.create(
4674
+ (
4675
+ isKeyed(iterable) ? KeyedSeq :
4676
+ isIndexed(iterable) ? IndexedSeq :
4677
+ SetSeq
4678
+ ).prototype
4679
+ );
4680
+ }
4681
+
4682
+ function cacheResultThrough() {
4683
+ if (this._iter.cacheResult) {
4684
+ this._iter.cacheResult();
4685
+ this.size = this._iter.size;
4686
+ return this;
4687
+ } else {
4688
+ return Seq.prototype.cacheResult.call(this);
4689
+ }
4690
+ }
4691
+
4692
+ function defaultComparator(a, b) {
4693
+ return a > b ? 1 : a < b ? -1 : 0;
4694
+ }
4695
+
4696
+ function forceIterator(keyPath) {
4697
+ var iter = getIterator(keyPath);
4698
+ if (!iter) {
4699
+ // Array might not be iterable in this environment, so we need a fallback
4700
+ // to our wrapped type.
4701
+ if (!isArrayLike(keyPath)) {
4702
+ throw new TypeError('Expected iterable or array-like: ' + keyPath);
4703
+ }
4704
+ iter = getIterator(Iterable(keyPath));
4705
+ }
4706
+ return iter;
4707
+ }
4708
+
4709
+ createClass(Record, KeyedCollection);
4710
+
4711
+ function Record(defaultValues, name) {
4712
+ var hasInitialized;
4713
+
4714
+ var RecordType = function Record(values) {
4715
+ if (values instanceof RecordType) {
4716
+ return values;
4717
+ }
4718
+ if (!(this instanceof RecordType)) {
4719
+ return new RecordType(values);
4720
+ }
4721
+ if (!hasInitialized) {
4722
+ hasInitialized = true;
4723
+ var keys = Object.keys(defaultValues);
4724
+ setProps(RecordTypePrototype, keys);
4725
+ RecordTypePrototype.size = keys.length;
4726
+ RecordTypePrototype._name = name;
4727
+ RecordTypePrototype._keys = keys;
4728
+ RecordTypePrototype._defaultValues = defaultValues;
4729
+ }
4730
+ this._map = Map(values);
4731
+ };
4732
+
4733
+ var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
4734
+ RecordTypePrototype.constructor = RecordType;
4735
+
4736
+ return RecordType;
4737
+ }
4738
+
4739
+ Record.prototype.toString = function() {
4740
+ return this.__toString(recordName(this) + ' {', '}');
4741
+ };
4742
+
4743
+ // @pragma Access
4744
+
4745
+ Record.prototype.has = function(k) {
4746
+ return this._defaultValues.hasOwnProperty(k);
4747
+ };
4748
+
4749
+ Record.prototype.get = function(k, notSetValue) {
4750
+ if (!this.has(k)) {
4751
+ return notSetValue;
4752
+ }
4753
+ var defaultVal = this._defaultValues[k];
4754
+ return this._map ? this._map.get(k, defaultVal) : defaultVal;
4755
+ };
4756
+
4757
+ // @pragma Modification
4758
+
4759
+ Record.prototype.clear = function() {
4760
+ if (this.__ownerID) {
4761
+ this._map && this._map.clear();
4762
+ return this;
4763
+ }
4764
+ var RecordType = this.constructor;
4765
+ return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
4766
+ };
4767
+
4768
+ Record.prototype.set = function(k, v) {
4769
+ if (!this.has(k)) {
4770
+ throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
4771
+ }
4772
+ if (this._map && !this._map.has(k)) {
4773
+ var defaultVal = this._defaultValues[k];
4774
+ if (v === defaultVal) {
4775
+ return this;
4776
+ }
4777
+ }
4778
+ var newMap = this._map && this._map.set(k, v);
4779
+ if (this.__ownerID || newMap === this._map) {
4780
+ return this;
4781
+ }
4782
+ return makeRecord(this, newMap);
4783
+ };
4784
+
4785
+ Record.prototype.remove = function(k) {
4786
+ if (!this.has(k)) {
4787
+ return this;
4788
+ }
4789
+ var newMap = this._map && this._map.remove(k);
4790
+ if (this.__ownerID || newMap === this._map) {
4791
+ return this;
4792
+ }
4793
+ return makeRecord(this, newMap);
4794
+ };
4795
+
4796
+ Record.prototype.wasAltered = function() {
4797
+ return this._map.wasAltered();
4798
+ };
4799
+
4800
+ Record.prototype.__iterator = function(type, reverse) {var this$0 = this;
4801
+ return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse);
4802
+ };
4803
+
4804
+ Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;
4805
+ return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse);
4806
+ };
4807
+
4808
+ Record.prototype.__ensureOwner = function(ownerID) {
4809
+ if (ownerID === this.__ownerID) {
4810
+ return this;
4811
+ }
4812
+ var newMap = this._map && this._map.__ensureOwner(ownerID);
4813
+ if (!ownerID) {
4814
+ this.__ownerID = ownerID;
4815
+ this._map = newMap;
4816
+ return this;
4817
+ }
4818
+ return makeRecord(this, newMap, ownerID);
4819
+ };
4820
+
4821
+
4822
+ var RecordPrototype = Record.prototype;
4823
+ RecordPrototype[DELETE] = RecordPrototype.remove;
4824
+ RecordPrototype.deleteIn =
4825
+ RecordPrototype.removeIn = MapPrototype.removeIn;
4826
+ RecordPrototype.merge = MapPrototype.merge;
4827
+ RecordPrototype.mergeWith = MapPrototype.mergeWith;
4828
+ RecordPrototype.mergeIn = MapPrototype.mergeIn;
4829
+ RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
4830
+ RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
4831
+ RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
4832
+ RecordPrototype.setIn = MapPrototype.setIn;
4833
+ RecordPrototype.update = MapPrototype.update;
4834
+ RecordPrototype.updateIn = MapPrototype.updateIn;
4835
+ RecordPrototype.withMutations = MapPrototype.withMutations;
4836
+ RecordPrototype.asMutable = MapPrototype.asMutable;
4837
+ RecordPrototype.asImmutable = MapPrototype.asImmutable;
4838
+
4839
+
4840
+ function makeRecord(likeRecord, map, ownerID) {
4841
+ var record = Object.create(Object.getPrototypeOf(likeRecord));
4842
+ record._map = map;
4843
+ record.__ownerID = ownerID;
4844
+ return record;
4845
+ }
4846
+
4847
+ function recordName(record) {
4848
+ return record._name || record.constructor.name || 'Record';
4849
+ }
4850
+
4851
+ function setProps(prototype, names) {
4852
+ try {
4853
+ names.forEach(setProp.bind(undefined, prototype));
4854
+ } catch (error) {
4855
+ // Object.defineProperty failed. Probably IE8.
4856
+ }
4857
+ }
4858
+
4859
+ function setProp(prototype, name) {
4860
+ Object.defineProperty(prototype, name, {
4861
+ get: function() {
4862
+ return this.get(name);
4863
+ },
4864
+ set: function(value) {
4865
+ invariant(this.__ownerID, 'Cannot set on an immutable record.');
4866
+ this.set(name, value);
4867
+ }
4868
+ });
4869
+ }
4870
+
4871
+ createClass(Set, SetCollection);
4872
+
4873
+ // @pragma Construction
4874
+
4875
+ function Set(value) {
4876
+ return value === null || value === undefined ? emptySet() :
4877
+ isSet(value) && !isOrdered(value) ? value :
4878
+ emptySet().withMutations(function(set ) {
4879
+ var iter = SetIterable(value);
4880
+ assertNotInfinite(iter.size);
4881
+ iter.forEach(function(v ) {return set.add(v)});
4882
+ });
4883
+ }
4884
+
4885
+ Set.of = function(/*...values*/) {
4886
+ return this(arguments);
4887
+ };
4888
+
4889
+ Set.fromKeys = function(value) {
4890
+ return this(KeyedIterable(value).keySeq());
4891
+ };
4892
+
4893
+ Set.prototype.toString = function() {
4894
+ return this.__toString('Set {', '}');
4895
+ };
4896
+
4897
+ // @pragma Access
4898
+
4899
+ Set.prototype.has = function(value) {
4900
+ return this._map.has(value);
4901
+ };
4902
+
4903
+ // @pragma Modification
4904
+
4905
+ Set.prototype.add = function(value) {
4906
+ return updateSet(this, this._map.set(value, true));
4907
+ };
4908
+
4909
+ Set.prototype.remove = function(value) {
4910
+ return updateSet(this, this._map.remove(value));
4911
+ };
4912
+
4913
+ Set.prototype.clear = function() {
4914
+ return updateSet(this, this._map.clear());
4915
+ };
4916
+
4917
+ // @pragma Composition
4918
+
4919
+ Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);
4920
+ iters = iters.filter(function(x ) {return x.size !== 0});
4921
+ if (iters.length === 0) {
4922
+ return this;
4923
+ }
4924
+ if (this.size === 0 && !this.__ownerID && iters.length === 1) {
4925
+ return this.constructor(iters[0]);
4926
+ }
4927
+ return this.withMutations(function(set ) {
4928
+ for (var ii = 0; ii < iters.length; ii++) {
4929
+ SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});
4930
+ }
4931
+ });
4932
+ };
4933
+
4934
+ Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);
4935
+ if (iters.length === 0) {
4936
+ return this;
4937
+ }
4938
+ iters = iters.map(function(iter ) {return SetIterable(iter)});
4939
+ var originalSet = this;
4940
+ return this.withMutations(function(set ) {
4941
+ originalSet.forEach(function(value ) {
4942
+ if (!iters.every(function(iter ) {return iter.includes(value)})) {
4943
+ set.remove(value);
4944
+ }
4945
+ });
4946
+ });
4947
+ };
4948
+
4949
+ Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);
4950
+ if (iters.length === 0) {
4951
+ return this;
4952
+ }
4953
+ iters = iters.map(function(iter ) {return SetIterable(iter)});
4954
+ var originalSet = this;
4955
+ return this.withMutations(function(set ) {
4956
+ originalSet.forEach(function(value ) {
4957
+ if (iters.some(function(iter ) {return iter.includes(value)})) {
4958
+ set.remove(value);
4959
+ }
4960
+ });
4961
+ });
4962
+ };
4963
+
4964
+ Set.prototype.merge = function() {
4965
+ return this.union.apply(this, arguments);
4966
+ };
4967
+
4968
+ Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
4969
+ return this.union.apply(this, iters);
4970
+ };
4971
+
4972
+ Set.prototype.sort = function(comparator) {
4973
+ // Late binding
4974
+ return OrderedSet(sortFactory(this, comparator));
4975
+ };
4976
+
4977
+ Set.prototype.sortBy = function(mapper, comparator) {
4978
+ // Late binding
4979
+ return OrderedSet(sortFactory(this, comparator, mapper));
4980
+ };
4981
+
4982
+ Set.prototype.wasAltered = function() {
4983
+ return this._map.wasAltered();
4984
+ };
4985
+
4986
+ Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;
4987
+ return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse);
4988
+ };
4989
+
4990
+ Set.prototype.__iterator = function(type, reverse) {
4991
+ return this._map.map(function(_, k) {return k}).__iterator(type, reverse);
4992
+ };
4993
+
4994
+ Set.prototype.__ensureOwner = function(ownerID) {
4995
+ if (ownerID === this.__ownerID) {
4996
+ return this;
4997
+ }
4998
+ var newMap = this._map.__ensureOwner(ownerID);
4999
+ if (!ownerID) {
5000
+ this.__ownerID = ownerID;
5001
+ this._map = newMap;
5002
+ return this;
5003
+ }
5004
+ return this.__make(newMap, ownerID);
5005
+ };
5006
+
5007
+
5008
+ function isSet(maybeSet) {
5009
+ return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
5010
+ }
5011
+
5012
+ Set.isSet = isSet;
5013
+
5014
+ var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
5015
+
5016
+ var SetPrototype = Set.prototype;
5017
+ SetPrototype[IS_SET_SENTINEL] = true;
5018
+ SetPrototype[DELETE] = SetPrototype.remove;
5019
+ SetPrototype.mergeDeep = SetPrototype.merge;
5020
+ SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
5021
+ SetPrototype.withMutations = MapPrototype.withMutations;
5022
+ SetPrototype.asMutable = MapPrototype.asMutable;
5023
+ SetPrototype.asImmutable = MapPrototype.asImmutable;
5024
+
5025
+ SetPrototype.__empty = emptySet;
5026
+ SetPrototype.__make = makeSet;
5027
+
5028
+ function updateSet(set, newMap) {
5029
+ if (set.__ownerID) {
5030
+ set.size = newMap.size;
5031
+ set._map = newMap;
5032
+ return set;
5033
+ }
5034
+ return newMap === set._map ? set :
5035
+ newMap.size === 0 ? set.__empty() :
5036
+ set.__make(newMap);
5037
+ }
5038
+
5039
+ function makeSet(map, ownerID) {
5040
+ var set = Object.create(SetPrototype);
5041
+ set.size = map ? map.size : 0;
5042
+ set._map = map;
5043
+ set.__ownerID = ownerID;
5044
+ return set;
5045
+ }
5046
+
5047
+ var EMPTY_SET;
5048
+ function emptySet() {
5049
+ return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
5050
+ }
5051
+
5052
+ createClass(OrderedSet, Set);
5053
+
5054
+ // @pragma Construction
5055
+
5056
+ function OrderedSet(value) {
5057
+ return value === null || value === undefined ? emptyOrderedSet() :
5058
+ isOrderedSet(value) ? value :
5059
+ emptyOrderedSet().withMutations(function(set ) {
5060
+ var iter = SetIterable(value);
5061
+ assertNotInfinite(iter.size);
5062
+ iter.forEach(function(v ) {return set.add(v)});
5063
+ });
5064
+ }
5065
+
5066
+ OrderedSet.of = function(/*...values*/) {
5067
+ return this(arguments);
5068
+ };
5069
+
5070
+ OrderedSet.fromKeys = function(value) {
5071
+ return this(KeyedIterable(value).keySeq());
5072
+ };
5073
+
5074
+ OrderedSet.prototype.toString = function() {
5075
+ return this.__toString('OrderedSet {', '}');
5076
+ };
5077
+
5078
+
5079
+ function isOrderedSet(maybeOrderedSet) {
5080
+ return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
5081
+ }
5082
+
5083
+ OrderedSet.isOrderedSet = isOrderedSet;
5084
+
5085
+ var OrderedSetPrototype = OrderedSet.prototype;
5086
+ OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;
5087
+
5088
+ OrderedSetPrototype.__empty = emptyOrderedSet;
5089
+ OrderedSetPrototype.__make = makeOrderedSet;
5090
+
5091
+ function makeOrderedSet(map, ownerID) {
5092
+ var set = Object.create(OrderedSetPrototype);
5093
+ set.size = map ? map.size : 0;
5094
+ set._map = map;
5095
+ set.__ownerID = ownerID;
5096
+ return set;
5097
+ }
5098
+
5099
+ var EMPTY_ORDERED_SET;
5100
+ function emptyOrderedSet() {
5101
+ return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
5102
+ }
5103
+
5104
+ createClass(Stack, IndexedCollection);
5105
+
5106
+ // @pragma Construction
5107
+
5108
+ function Stack(value) {
5109
+ return value === null || value === undefined ? emptyStack() :
5110
+ isStack(value) ? value :
5111
+ emptyStack().unshiftAll(value);
5112
+ }
5113
+
5114
+ Stack.of = function(/*...values*/) {
5115
+ return this(arguments);
5116
+ };
5117
+
5118
+ Stack.prototype.toString = function() {
5119
+ return this.__toString('Stack [', ']');
5120
+ };
5121
+
5122
+ // @pragma Access
5123
+
5124
+ Stack.prototype.get = function(index, notSetValue) {
5125
+ var head = this._head;
5126
+ index = wrapIndex(this, index);
5127
+ while (head && index--) {
5128
+ head = head.next;
5129
+ }
5130
+ return head ? head.value : notSetValue;
5131
+ };
5132
+
5133
+ Stack.prototype.peek = function() {
5134
+ return this._head && this._head.value;
5135
+ };
5136
+
5137
+ // @pragma Modification
5138
+
5139
+ Stack.prototype.push = function(/*...values*/) {
5140
+ if (arguments.length === 0) {
5141
+ return this;
5142
+ }
5143
+ var newSize = this.size + arguments.length;
5144
+ var head = this._head;
5145
+ for (var ii = arguments.length - 1; ii >= 0; ii--) {
5146
+ head = {
5147
+ value: arguments[ii],
5148
+ next: head
5149
+ };
5150
+ }
5151
+ if (this.__ownerID) {
5152
+ this.size = newSize;
5153
+ this._head = head;
5154
+ this.__hash = undefined;
5155
+ this.__altered = true;
5156
+ return this;
5157
+ }
5158
+ return makeStack(newSize, head);
5159
+ };
5160
+
5161
+ Stack.prototype.pushAll = function(iter) {
5162
+ iter = IndexedIterable(iter);
5163
+ if (iter.size === 0) {
5164
+ return this;
5165
+ }
5166
+ assertNotInfinite(iter.size);
5167
+ var newSize = this.size;
5168
+ var head = this._head;
5169
+ iter.reverse().forEach(function(value ) {
5170
+ newSize++;
5171
+ head = {
5172
+ value: value,
5173
+ next: head
5174
+ };
5175
+ });
5176
+ if (this.__ownerID) {
5177
+ this.size = newSize;
5178
+ this._head = head;
5179
+ this.__hash = undefined;
5180
+ this.__altered = true;
5181
+ return this;
5182
+ }
5183
+ return makeStack(newSize, head);
5184
+ };
5185
+
5186
+ Stack.prototype.pop = function() {
5187
+ return this.slice(1);
5188
+ };
5189
+
5190
+ Stack.prototype.unshift = function(/*...values*/) {
5191
+ return this.push.apply(this, arguments);
5192
+ };
5193
+
5194
+ Stack.prototype.unshiftAll = function(iter) {
5195
+ return this.pushAll(iter);
5196
+ };
5197
+
5198
+ Stack.prototype.shift = function() {
5199
+ return this.pop.apply(this, arguments);
5200
+ };
5201
+
5202
+ Stack.prototype.clear = function() {
5203
+ if (this.size === 0) {
5204
+ return this;
5205
+ }
5206
+ if (this.__ownerID) {
5207
+ this.size = 0;
5208
+ this._head = undefined;
5209
+ this.__hash = undefined;
5210
+ this.__altered = true;
5211
+ return this;
5212
+ }
5213
+ return emptyStack();
5214
+ };
5215
+
5216
+ Stack.prototype.slice = function(begin, end) {
5217
+ if (wholeSlice(begin, end, this.size)) {
5218
+ return this;
5219
+ }
5220
+ var resolvedBegin = resolveBegin(begin, this.size);
5221
+ var resolvedEnd = resolveEnd(end, this.size);
5222
+ if (resolvedEnd !== this.size) {
5223
+ // super.slice(begin, end);
5224
+ return IndexedCollection.prototype.slice.call(this, begin, end);
5225
+ }
5226
+ var newSize = this.size - resolvedBegin;
5227
+ var head = this._head;
5228
+ while (resolvedBegin--) {
5229
+ head = head.next;
5230
+ }
5231
+ if (this.__ownerID) {
5232
+ this.size = newSize;
5233
+ this._head = head;
5234
+ this.__hash = undefined;
5235
+ this.__altered = true;
5236
+ return this;
5237
+ }
5238
+ return makeStack(newSize, head);
5239
+ };
5240
+
5241
+ // @pragma Mutability
5242
+
5243
+ Stack.prototype.__ensureOwner = function(ownerID) {
5244
+ if (ownerID === this.__ownerID) {
5245
+ return this;
5246
+ }
5247
+ if (!ownerID) {
5248
+ this.__ownerID = ownerID;
5249
+ this.__altered = false;
5250
+ return this;
5251
+ }
5252
+ return makeStack(this.size, this._head, ownerID, this.__hash);
5253
+ };
5254
+
5255
+ // @pragma Iteration
5256
+
5257
+ Stack.prototype.__iterate = function(fn, reverse) {
5258
+ if (reverse) {
5259
+ return this.reverse().__iterate(fn);
5260
+ }
5261
+ var iterations = 0;
5262
+ var node = this._head;
5263
+ while (node) {
5264
+ if (fn(node.value, iterations++, this) === false) {
5265
+ break;
5266
+ }
5267
+ node = node.next;
5268
+ }
5269
+ return iterations;
5270
+ };
5271
+
5272
+ Stack.prototype.__iterator = function(type, reverse) {
5273
+ if (reverse) {
5274
+ return this.reverse().__iterator(type);
5275
+ }
5276
+ var iterations = 0;
5277
+ var node = this._head;
5278
+ return new Iterator(function() {
5279
+ if (node) {
5280
+ var value = node.value;
5281
+ node = node.next;
5282
+ return iteratorValue(type, iterations++, value);
5283
+ }
5284
+ return iteratorDone();
5285
+ });
5286
+ };
5287
+
5288
+
5289
+ function isStack(maybeStack) {
5290
+ return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
5291
+ }
5292
+
5293
+ Stack.isStack = isStack;
5294
+
5295
+ var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
5296
+
5297
+ var StackPrototype = Stack.prototype;
5298
+ StackPrototype[IS_STACK_SENTINEL] = true;
5299
+ StackPrototype.withMutations = MapPrototype.withMutations;
5300
+ StackPrototype.asMutable = MapPrototype.asMutable;
5301
+ StackPrototype.asImmutable = MapPrototype.asImmutable;
5302
+ StackPrototype.wasAltered = MapPrototype.wasAltered;
5303
+
5304
+
5305
+ function makeStack(size, head, ownerID, hash) {
5306
+ var map = Object.create(StackPrototype);
5307
+ map.size = size;
5308
+ map._head = head;
5309
+ map.__ownerID = ownerID;
5310
+ map.__hash = hash;
5311
+ map.__altered = false;
5312
+ return map;
5313
+ }
5314
+
5315
+ var EMPTY_STACK;
5316
+ function emptyStack() {
5317
+ return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
5318
+ }
5319
+
5320
+ /**
5321
+ * Contributes additional methods to a constructor
5322
+ */
5323
+ function mixin(ctor, methods) {
5324
+ var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };
5325
+ Object.keys(methods).forEach(keyCopier);
5326
+ Object.getOwnPropertySymbols &&
5327
+ Object.getOwnPropertySymbols(methods).forEach(keyCopier);
5328
+ return ctor;
5329
+ }
5330
+
5331
+ Iterable.Iterator = Iterator;
5332
+
5333
+ mixin(Iterable, {
5334
+
5335
+ // ### Conversion to other types
5336
+
5337
+ toArray: function() {
5338
+ assertNotInfinite(this.size);
5339
+ var array = new Array(this.size || 0);
5340
+ this.valueSeq().__iterate(function(v, i) { array[i] = v; });
5341
+ return array;
5342
+ },
5343
+
5344
+ toIndexedSeq: function() {
5345
+ return new ToIndexedSequence(this);
5346
+ },
5347
+
5348
+ toJS: function() {
5349
+ return this.toSeq().map(
5350
+ function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}
5351
+ ).__toJS();
5352
+ },
5353
+
5354
+ toJSON: function() {
5355
+ return this.toSeq().map(
5356
+ function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}
5357
+ ).__toJS();
5358
+ },
5359
+
5360
+ toKeyedSeq: function() {
5361
+ return new ToKeyedSequence(this, true);
5362
+ },
5363
+
5364
+ toMap: function() {
5365
+ // Use Late Binding here to solve the circular dependency.
5366
+ return Map(this.toKeyedSeq());
5367
+ },
5368
+
5369
+ toObject: function() {
5370
+ assertNotInfinite(this.size);
5371
+ var object = {};
5372
+ this.__iterate(function(v, k) { object[k] = v; });
5373
+ return object;
5374
+ },
5375
+
5376
+ toOrderedMap: function() {
5377
+ // Use Late Binding here to solve the circular dependency.
5378
+ return OrderedMap(this.toKeyedSeq());
5379
+ },
5380
+
5381
+ toOrderedSet: function() {
5382
+ // Use Late Binding here to solve the circular dependency.
5383
+ return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
5384
+ },
5385
+
5386
+ toSet: function() {
5387
+ // Use Late Binding here to solve the circular dependency.
5388
+ return Set(isKeyed(this) ? this.valueSeq() : this);
5389
+ },
5390
+
5391
+ toSetSeq: function() {
5392
+ return new ToSetSequence(this);
5393
+ },
5394
+
5395
+ toSeq: function() {
5396
+ return isIndexed(this) ? this.toIndexedSeq() :
5397
+ isKeyed(this) ? this.toKeyedSeq() :
5398
+ this.toSetSeq();
5399
+ },
5400
+
5401
+ toStack: function() {
5402
+ // Use Late Binding here to solve the circular dependency.
5403
+ return Stack(isKeyed(this) ? this.valueSeq() : this);
5404
+ },
5405
+
5406
+ toList: function() {
5407
+ // Use Late Binding here to solve the circular dependency.
5408
+ return List(isKeyed(this) ? this.valueSeq() : this);
5409
+ },
5410
+
5411
+
5412
+ // ### Common JavaScript methods and properties
5413
+
5414
+ toString: function() {
5415
+ return '[Iterable]';
5416
+ },
5417
+
5418
+ __toString: function(head, tail) {
5419
+ if (this.size === 0) {
5420
+ return head + tail;
5421
+ }
5422
+ return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;
5423
+ },
5424
+
5425
+
5426
+ // ### ES6 Collection methods (ES6 Array and Map)
5427
+
5428
+ concat: function() {var values = SLICE$0.call(arguments, 0);
5429
+ return reify(this, concatFactory(this, values));
5430
+ },
5431
+
5432
+ includes: function(searchValue) {
5433
+ return this.some(function(value ) {return is(value, searchValue)});
5434
+ },
5435
+
5436
+ entries: function() {
5437
+ return this.__iterator(ITERATE_ENTRIES);
5438
+ },
5439
+
5440
+ every: function(predicate, context) {
5441
+ assertNotInfinite(this.size);
5442
+ var returnValue = true;
5443
+ this.__iterate(function(v, k, c) {
5444
+ if (!predicate.call(context, v, k, c)) {
5445
+ returnValue = false;
5446
+ return false;
5447
+ }
5448
+ });
5449
+ return returnValue;
5450
+ },
5451
+
5452
+ filter: function(predicate, context) {
5453
+ return reify(this, filterFactory(this, predicate, context, true));
5454
+ },
5455
+
5456
+ find: function(predicate, context, notSetValue) {
5457
+ var entry = this.findEntry(predicate, context);
5458
+ return entry ? entry[1] : notSetValue;
5459
+ },
5460
+
5461
+ forEach: function(sideEffect, context) {
5462
+ assertNotInfinite(this.size);
5463
+ return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
5464
+ },
5465
+
5466
+ join: function(separator) {
5467
+ assertNotInfinite(this.size);
5468
+ separator = separator !== undefined ? '' + separator : ',';
5469
+ var joined = '';
5470
+ var isFirst = true;
5471
+ this.__iterate(function(v ) {
5472
+ isFirst ? (isFirst = false) : (joined += separator);
5473
+ joined += v !== null && v !== undefined ? v.toString() : '';
5474
+ });
5475
+ return joined;
5476
+ },
5477
+
5478
+ keys: function() {
5479
+ return this.__iterator(ITERATE_KEYS);
5480
+ },
5481
+
5482
+ map: function(mapper, context) {
5483
+ return reify(this, mapFactory(this, mapper, context));
5484
+ },
5485
+
5486
+ reduce: function(reducer, initialReduction, context) {
5487
+ assertNotInfinite(this.size);
5488
+ var reduction;
5489
+ var useFirst;
5490
+ if (arguments.length < 2) {
5491
+ useFirst = true;
5492
+ } else {
5493
+ reduction = initialReduction;
5494
+ }
5495
+ this.__iterate(function(v, k, c) {
5496
+ if (useFirst) {
5497
+ useFirst = false;
5498
+ reduction = v;
5499
+ } else {
5500
+ reduction = reducer.call(context, reduction, v, k, c);
5501
+ }
5502
+ });
5503
+ return reduction;
5504
+ },
5505
+
5506
+ reduceRight: function(reducer, initialReduction, context) {
5507
+ var reversed = this.toKeyedSeq().reverse();
5508
+ return reversed.reduce.apply(reversed, arguments);
5509
+ },
5510
+
5511
+ reverse: function() {
5512
+ return reify(this, reverseFactory(this, true));
5513
+ },
5514
+
5515
+ slice: function(begin, end) {
5516
+ return reify(this, sliceFactory(this, begin, end, true));
5517
+ },
5518
+
5519
+ some: function(predicate, context) {
5520
+ return !this.every(not(predicate), context);
5521
+ },
5522
+
5523
+ sort: function(comparator) {
5524
+ return reify(this, sortFactory(this, comparator));
5525
+ },
5526
+
5527
+ values: function() {
5528
+ return this.__iterator(ITERATE_VALUES);
5529
+ },
5530
+
5531
+
5532
+ // ### More sequential methods
5533
+
5534
+ butLast: function() {
5535
+ return this.slice(0, -1);
5536
+ },
5537
+
5538
+ isEmpty: function() {
5539
+ return this.size !== undefined ? this.size === 0 : !this.some(function() {return true});
5540
+ },
5541
+
5542
+ count: function(predicate, context) {
5543
+ return ensureSize(
5544
+ predicate ? this.toSeq().filter(predicate, context) : this
5545
+ );
5546
+ },
5547
+
5548
+ countBy: function(grouper, context) {
5549
+ return countByFactory(this, grouper, context);
5550
+ },
5551
+
5552
+ equals: function(other) {
5553
+ return deepEqual(this, other);
5554
+ },
5555
+
5556
+ entrySeq: function() {
5557
+ var iterable = this;
5558
+ if (iterable._cache) {
5559
+ // We cache as an entries array, so we can just return the cache!
5560
+ return new ArraySeq(iterable._cache);
5561
+ }
5562
+ var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
5563
+ entriesSequence.fromEntrySeq = function() {return iterable.toSeq()};
5564
+ return entriesSequence;
5565
+ },
5566
+
5567
+ filterNot: function(predicate, context) {
5568
+ return this.filter(not(predicate), context);
5569
+ },
5570
+
5571
+ findEntry: function(predicate, context, notSetValue) {
5572
+ var found = notSetValue;
5573
+ this.__iterate(function(v, k, c) {
5574
+ if (predicate.call(context, v, k, c)) {
5575
+ found = [k, v];
5576
+ return false;
5577
+ }
5578
+ });
5579
+ return found;
5580
+ },
5581
+
5582
+ findKey: function(predicate, context) {
5583
+ var entry = this.findEntry(predicate, context);
5584
+ return entry && entry[0];
5585
+ },
5586
+
5587
+ findLast: function(predicate, context, notSetValue) {
5588
+ return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
5589
+ },
5590
+
5591
+ findLastEntry: function(predicate, context, notSetValue) {
5592
+ return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
5593
+ },
5594
+
5595
+ findLastKey: function(predicate, context) {
5596
+ return this.toKeyedSeq().reverse().findKey(predicate, context);
5597
+ },
5598
+
5599
+ first: function() {
5600
+ return this.find(returnTrue);
5601
+ },
5602
+
5603
+ flatMap: function(mapper, context) {
5604
+ return reify(this, flatMapFactory(this, mapper, context));
5605
+ },
5606
+
5607
+ flatten: function(depth) {
5608
+ return reify(this, flattenFactory(this, depth, true));
5609
+ },
5610
+
5611
+ fromEntrySeq: function() {
5612
+ return new FromEntriesSequence(this);
5613
+ },
5614
+
5615
+ get: function(searchKey, notSetValue) {
5616
+ return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue);
5617
+ },
5618
+
5619
+ getIn: function(searchKeyPath, notSetValue) {
5620
+ var nested = this;
5621
+ // Note: in an ES6 environment, we would prefer:
5622
+ // for (var key of searchKeyPath) {
5623
+ var iter = forceIterator(searchKeyPath);
5624
+ var step;
5625
+ while (!(step = iter.next()).done) {
5626
+ var key = step.value;
5627
+ nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
5628
+ if (nested === NOT_SET) {
5629
+ return notSetValue;
5630
+ }
5631
+ }
5632
+ return nested;
5633
+ },
5634
+
5635
+ groupBy: function(grouper, context) {
5636
+ return groupByFactory(this, grouper, context);
5637
+ },
5638
+
5639
+ has: function(searchKey) {
5640
+ return this.get(searchKey, NOT_SET) !== NOT_SET;
5641
+ },
5642
+
5643
+ hasIn: function(searchKeyPath) {
5644
+ return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
5645
+ },
5646
+
5647
+ isSubset: function(iter) {
5648
+ iter = typeof iter.includes === 'function' ? iter : Iterable(iter);
5649
+ return this.every(function(value ) {return iter.includes(value)});
5650
+ },
5651
+
5652
+ isSuperset: function(iter) {
5653
+ iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);
5654
+ return iter.isSubset(this);
5655
+ },
5656
+
5657
+ keyOf: function(searchValue) {
5658
+ return this.findKey(function(value ) {return is(value, searchValue)});
5659
+ },
5660
+
5661
+ keySeq: function() {
5662
+ return this.toSeq().map(keyMapper).toIndexedSeq();
5663
+ },
5664
+
5665
+ last: function() {
5666
+ return this.toSeq().reverse().first();
5667
+ },
5668
+
5669
+ lastKeyOf: function(searchValue) {
5670
+ return this.toKeyedSeq().reverse().keyOf(searchValue);
5671
+ },
5672
+
5673
+ max: function(comparator) {
5674
+ return maxFactory(this, comparator);
5675
+ },
5676
+
5677
+ maxBy: function(mapper, comparator) {
5678
+ return maxFactory(this, comparator, mapper);
5679
+ },
5680
+
5681
+ min: function(comparator) {
5682
+ return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
5683
+ },
5684
+
5685
+ minBy: function(mapper, comparator) {
5686
+ return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
5687
+ },
5688
+
5689
+ rest: function() {
5690
+ return this.slice(1);
5691
+ },
5692
+
5693
+ skip: function(amount) {
5694
+ return this.slice(Math.max(0, amount));
5695
+ },
5696
+
5697
+ skipLast: function(amount) {
5698
+ return reify(this, this.toSeq().reverse().skip(amount).reverse());
5699
+ },
5700
+
5701
+ skipWhile: function(predicate, context) {
5702
+ return reify(this, skipWhileFactory(this, predicate, context, true));
5703
+ },
5704
+
5705
+ skipUntil: function(predicate, context) {
5706
+ return this.skipWhile(not(predicate), context);
5707
+ },
5708
+
5709
+ sortBy: function(mapper, comparator) {
5710
+ return reify(this, sortFactory(this, comparator, mapper));
5711
+ },
5712
+
5713
+ take: function(amount) {
5714
+ return this.slice(0, Math.max(0, amount));
5715
+ },
5716
+
5717
+ takeLast: function(amount) {
5718
+ return reify(this, this.toSeq().reverse().take(amount).reverse());
5719
+ },
5720
+
5721
+ takeWhile: function(predicate, context) {
5722
+ return reify(this, takeWhileFactory(this, predicate, context));
5723
+ },
5724
+
5725
+ takeUntil: function(predicate, context) {
5726
+ return this.takeWhile(not(predicate), context);
5727
+ },
5728
+
5729
+ valueSeq: function() {
5730
+ return this.toIndexedSeq();
5731
+ },
5732
+
5733
+
5734
+ // ### Hashable Object
5735
+
5736
+ hashCode: function() {
5737
+ return this.__hash || (this.__hash = hashIterable(this));
5738
+ }
5739
+
5740
+
5741
+ // ### Internal
5742
+
5743
+ // abstract __iterate(fn, reverse)
5744
+
5745
+ // abstract __iterator(type, reverse)
5746
+ });
5747
+
5748
+ // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
5749
+ // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
5750
+ // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
5751
+ // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
5752
+
5753
+ var IterablePrototype = Iterable.prototype;
5754
+ IterablePrototype[IS_ITERABLE_SENTINEL] = true;
5755
+ IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
5756
+ IterablePrototype.__toJS = IterablePrototype.toArray;
5757
+ IterablePrototype.__toStringMapper = quoteString;
5758
+ IterablePrototype.inspect =
5759
+ IterablePrototype.toSource = function() { return this.toString(); };
5760
+ IterablePrototype.chain = IterablePrototype.flatMap;
5761
+ IterablePrototype.contains = IterablePrototype.includes;
5762
+
5763
+ mixin(KeyedIterable, {
5764
+
5765
+ // ### More sequential methods
5766
+
5767
+ flip: function() {
5768
+ return reify(this, flipFactory(this));
5769
+ },
5770
+
5771
+ mapEntries: function(mapper, context) {var this$0 = this;
5772
+ var iterations = 0;
5773
+ return reify(this,
5774
+ this.toSeq().map(
5775
+ function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)}
5776
+ ).fromEntrySeq()
5777
+ );
5778
+ },
5779
+
5780
+ mapKeys: function(mapper, context) {var this$0 = this;
5781
+ return reify(this,
5782
+ this.toSeq().flip().map(
5783
+ function(k, v) {return mapper.call(context, k, v, this$0)}
5784
+ ).flip()
5785
+ );
5786
+ }
5787
+
5788
+ });
5789
+
5790
+ var KeyedIterablePrototype = KeyedIterable.prototype;
5791
+ KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
5792
+ KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
5793
+ KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
5794
+ KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)};
5795
+
5796
+
5797
+
5798
+ mixin(IndexedIterable, {
5799
+
5800
+ // ### Conversion to other types
5801
+
5802
+ toKeyedSeq: function() {
5803
+ return new ToKeyedSequence(this, false);
5804
+ },
5805
+
5806
+
5807
+ // ### ES6 Collection methods (ES6 Array and Map)
5808
+
5809
+ filter: function(predicate, context) {
5810
+ return reify(this, filterFactory(this, predicate, context, false));
5811
+ },
5812
+
5813
+ findIndex: function(predicate, context) {
5814
+ var entry = this.findEntry(predicate, context);
5815
+ return entry ? entry[0] : -1;
5816
+ },
5817
+
5818
+ indexOf: function(searchValue) {
5819
+ var key = this.keyOf(searchValue);
5820
+ return key === undefined ? -1 : key;
5821
+ },
5822
+
5823
+ lastIndexOf: function(searchValue) {
5824
+ var key = this.lastKeyOf(searchValue);
5825
+ return key === undefined ? -1 : key;
5826
+ },
5827
+
5828
+ reverse: function() {
5829
+ return reify(this, reverseFactory(this, false));
5830
+ },
5831
+
5832
+ slice: function(begin, end) {
5833
+ return reify(this, sliceFactory(this, begin, end, false));
5834
+ },
5835
+
5836
+ splice: function(index, removeNum /*, ...values*/) {
5837
+ var numArgs = arguments.length;
5838
+ removeNum = Math.max(removeNum | 0, 0);
5839
+ if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
5840
+ return this;
5841
+ }
5842
+ // If index is negative, it should resolve relative to the size of the
5843
+ // collection. However size may be expensive to compute if not cached, so
5844
+ // only call count() if the number is in fact negative.
5845
+ index = resolveBegin(index, index < 0 ? this.count() : this.size);
5846
+ var spliced = this.slice(0, index);
5847
+ return reify(
5848
+ this,
5849
+ numArgs === 1 ?
5850
+ spliced :
5851
+ spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
5852
+ );
5853
+ },
5854
+
5855
+
5856
+ // ### More collection methods
5857
+
5858
+ findLastIndex: function(predicate, context) {
5859
+ var entry = this.findLastEntry(predicate, context);
5860
+ return entry ? entry[0] : -1;
5861
+ },
5862
+
5863
+ first: function() {
5864
+ return this.get(0);
5865
+ },
5866
+
5867
+ flatten: function(depth) {
5868
+ return reify(this, flattenFactory(this, depth, false));
5869
+ },
5870
+
5871
+ get: function(index, notSetValue) {
5872
+ index = wrapIndex(this, index);
5873
+ return (index < 0 || (this.size === Infinity ||
5874
+ (this.size !== undefined && index > this.size))) ?
5875
+ notSetValue :
5876
+ this.find(function(_, key) {return key === index}, undefined, notSetValue);
5877
+ },
5878
+
5879
+ has: function(index) {
5880
+ index = wrapIndex(this, index);
5881
+ return index >= 0 && (this.size !== undefined ?
5882
+ this.size === Infinity || index < this.size :
5883
+ this.indexOf(index) !== -1
5884
+ );
5885
+ },
5886
+
5887
+ interpose: function(separator) {
5888
+ return reify(this, interposeFactory(this, separator));
5889
+ },
5890
+
5891
+ interleave: function(/*...iterables*/) {
5892
+ var iterables = [this].concat(arrCopy(arguments));
5893
+ var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
5894
+ var interleaved = zipped.flatten(true);
5895
+ if (zipped.size) {
5896
+ interleaved.size = zipped.size * iterables.length;
5897
+ }
5898
+ return reify(this, interleaved);
5899
+ },
5900
+
5901
+ keySeq: function() {
5902
+ return Range(0, this.size);
5903
+ },
5904
+
5905
+ last: function() {
5906
+ return this.get(-1);
5907
+ },
5908
+
5909
+ skipWhile: function(predicate, context) {
5910
+ return reify(this, skipWhileFactory(this, predicate, context, false));
5911
+ },
5912
+
5913
+ zip: function(/*, ...iterables */) {
5914
+ var iterables = [this].concat(arrCopy(arguments));
5915
+ return reify(this, zipWithFactory(this, defaultZipper, iterables));
5916
+ },
5917
+
5918
+ zipWith: function(zipper/*, ...iterables */) {
5919
+ var iterables = arrCopy(arguments);
5920
+ iterables[0] = this;
5921
+ return reify(this, zipWithFactory(this, zipper, iterables));
5922
+ }
5923
+
5924
+ });
5925
+
5926
+ IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
5927
+ IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;
5928
+
5929
+
5930
+
5931
+ mixin(SetIterable, {
5932
+
5933
+ // ### ES6 Collection methods (ES6 Array and Map)
5934
+
5935
+ get: function(value, notSetValue) {
5936
+ return this.has(value) ? value : notSetValue;
5937
+ },
5938
+
5939
+ includes: function(value) {
5940
+ return this.has(value);
5941
+ },
5942
+
5943
+
5944
+ // ### More sequential methods
5945
+
5946
+ keySeq: function() {
5947
+ return this.valueSeq();
5948
+ }
5949
+
5950
+ });
5951
+
5952
+ SetIterable.prototype.has = IterablePrototype.includes;
5953
+ SetIterable.prototype.contains = SetIterable.prototype.includes;
5954
+
5955
+
5956
+ // Mixin subclasses
5957
+
5958
+ mixin(KeyedSeq, KeyedIterable.prototype);
5959
+ mixin(IndexedSeq, IndexedIterable.prototype);
5960
+ mixin(SetSeq, SetIterable.prototype);
5961
+
5962
+ mixin(KeyedCollection, KeyedIterable.prototype);
5963
+ mixin(IndexedCollection, IndexedIterable.prototype);
5964
+ mixin(SetCollection, SetIterable.prototype);
5965
+
5966
+
5967
+ // #pragma Helper functions
5968
+
5969
+ function keyMapper(v, k) {
5970
+ return k;
5971
+ }
5972
+
5973
+ function entryMapper(v, k) {
5974
+ return [k, v];
5975
+ }
5976
+
5977
+ function not(predicate) {
5978
+ return function() {
5979
+ return !predicate.apply(this, arguments);
5980
+ }
5981
+ }
5982
+
5983
+ function neg(predicate) {
5984
+ return function() {
5985
+ return -predicate.apply(this, arguments);
5986
+ }
5987
+ }
5988
+
5989
+ function quoteString(value) {
5990
+ return typeof value === 'string' ? JSON.stringify(value) : String(value);
5991
+ }
5992
+
5993
+ function defaultZipper() {
5994
+ return arrCopy(arguments);
5995
+ }
5996
+
5997
+ function defaultNegComparator(a, b) {
5998
+ return a < b ? 1 : a > b ? -1 : 0;
5999
+ }
6000
+
6001
+ function hashIterable(iterable) {
6002
+ if (iterable.size === Infinity) {
6003
+ return 0;
6004
+ }
6005
+ var ordered = isOrdered(iterable);
6006
+ var keyed = isKeyed(iterable);
6007
+ var h = ordered ? 1 : 0;
6008
+ var size = iterable.__iterate(
6009
+ keyed ?
6010
+ ordered ?
6011
+ function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :
6012
+ function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } :
6013
+ ordered ?
6014
+ function(v ) { h = 31 * h + hash(v) | 0; } :
6015
+ function(v ) { h = h + hash(v) | 0; }
6016
+ );
6017
+ return murmurHashOfSize(size, h);
6018
+ }
6019
+
6020
+ function murmurHashOfSize(size, h) {
6021
+ h = imul(h, 0xCC9E2D51);
6022
+ h = imul(h << 15 | h >>> -15, 0x1B873593);
6023
+ h = imul(h << 13 | h >>> -13, 5);
6024
+ h = (h + 0xE6546B64 | 0) ^ size;
6025
+ h = imul(h ^ h >>> 16, 0x85EBCA6B);
6026
+ h = imul(h ^ h >>> 13, 0xC2B2AE35);
6027
+ h = smi(h ^ h >>> 16);
6028
+ return h;
6029
+ }
6030
+
6031
+ function hashMerge(a, b) {
6032
+ return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int
6033
+ }
6034
+
6035
+ var Immutable = {
6036
+
6037
+ Iterable: Iterable,
6038
+
6039
+ Seq: Seq,
6040
+ Collection: Collection,
6041
+ Map: Map,
6042
+ OrderedMap: OrderedMap,
6043
+ List: List,
6044
+ Stack: Stack,
6045
+ Set: Set,
6046
+ OrderedSet: OrderedSet,
6047
+
6048
+ Record: Record,
6049
+ Range: Range,
6050
+ Repeat: Repeat,
6051
+
6052
+ is: is,
6053
+ fromJS: fromJS
6054
+
6055
+ };
6056
+
6057
+ return Immutable;
6058
+
6059
+ }));
6060
+
6061
+ /***/ }),
6062
+ /* 18 */
6063
+ /***/ (function(module, exports, __webpack_require__) {
6064
+
6065
+ "use strict";
6066
+
6067
+ Object.defineProperty(exports, "__esModule", { value: true });
6068
+ var REST_OPTIONS_1 = __webpack_require__(37);
6069
+ var WordPressRestApi = /** @class */ (function () {
6070
+ function WordPressRestApi() {
6071
+ }
6072
+ Object.defineProperty(WordPressRestApi, "instance", {
6073
+ get: function () {
6074
+ if (!WordPressRestApi.current)
6075
+ WordPressRestApi.current = new WordPressRestApi();
6076
+ return WordPressRestApi.current;
6077
+ },
6078
+ set: function (newInstance) {
6079
+ WordPressRestApi.current = newInstance;
6080
+ },
6081
+ enumerable: true,
6082
+ configurable: true
6083
+ });
6084
+ WordPressRestApi.prototype.pluginRestGet = function (path, onLoad) {
6085
+ var _this = this;
6086
+ return this.makeApiRequest('GET', "" + REST_OPTIONS_1.default.base + REST_OPTIONS_1.default.disqusBase + path, null, function (xhr) {
6087
+ _this.handleResponse(xhr.target.responseText, onLoad);
6088
+ });
6089
+ };
6090
+ WordPressRestApi.prototype.pluginRestPost = function (path, data, onLoad) {
6091
+ var _this = this;
6092
+ return this.makeApiRequest('POST', "" + REST_OPTIONS_1.default.base + REST_OPTIONS_1.default.disqusBase + path, data && JSON.stringify(data), function (xhr) {
6093
+ _this.handleResponse(xhr.target.responseText, onLoad);
6094
+ });
6095
+ };
6096
+ WordPressRestApi.prototype.wordpressRestGet = function (path, query, onLoad) {
6097
+ var _this = this;
6098
+ return this.makeApiRequest('GET', REST_OPTIONS_1.default.base + "wp/v2/" + path + (REST_OPTIONS_1.default.base.indexOf('?') > -1 ? '&' : '?') + (query || ''), null, function (xhr) {
6099
+ _this.handleResponse(xhr.target.responseText, onLoad);
6100
+ });
6101
+ };
6102
+ WordPressRestApi.prototype.makeApiRequest = function (method, url, data, onLoad) {
6103
+ var XHR = new XMLHttpRequest();
6104
+ XHR.open(method, url);
6105
+ XHR.setRequestHeader('Content-type', 'application/json');
6106
+ XHR.setRequestHeader('X-WP-Nonce', REST_OPTIONS_1.default.nonce);
6107
+ XHR.addEventListener('load', onLoad);
6108
+ XHR.send(data);
6109
+ return XHR;
6110
+ };
6111
+ WordPressRestApi.prototype.handleResponse = function (text, callback) {
6112
+ var jsonObject = null;
6113
+ try {
6114
+ jsonObject = JSON.parse(text);
6115
+ }
6116
+ catch (error) {
6117
+ // Continue
6118
+ }
6119
+ callback.call(null, jsonObject);
6120
+ };
6121
+ return WordPressRestApi;
6122
+ }());
6123
+ exports.WordPressRestApi = WordPressRestApi;
6124
+
6125
+
6126
+ /***/ }),
6127
+ /* 19 */
6128
+ /***/ (function(module, exports, __webpack_require__) {
6129
+
6130
+ "use strict";
6131
+ /**
6132
+ * Copyright (c) 2013-present, Facebook, Inc.
6133
+ *
6134
+ * This source code is licensed under the MIT license found in the
6135
+ * LICENSE file in the root directory of this source tree.
6136
+ *
6137
+ */
6138
+
6139
+
6140
+
6141
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
6142
+
6143
+ /**
6144
+ * Simple, lightweight module assisting with the detection and context of
6145
+ * Worker. Helps avoid circular dependencies and allows code to reason about
6146
+ * whether or not they are in a Worker, even if they never include the main
6147
+ * `ReactWorker` dependency.
6148
+ */
6149
+ var ExecutionEnvironment = {
6150
+
6151
+ canUseDOM: canUseDOM,
6152
+
6153
+ canUseWorkers: typeof Worker !== 'undefined',
6154
+
6155
+ canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
6156
+
6157
+ canUseViewport: canUseDOM && !!window.screen,
6158
+
6159
+ isInWorker: !canUseDOM // For now, this is true - might change in the future.
6160
+
6161
+ };
6162
+
6163
+ module.exports = ExecutionEnvironment;
6164
+
6165
+ /***/ }),
6166
+ /* 20 */
6167
+ /***/ (function(module, exports, __webpack_require__) {
6168
+
6169
+ "use strict";
6170
+ /* WEBPACK VAR INJECTION */(function(process) {
6171
+
6172
+ /**
6173
+ * Copyright (c) 2013-present, Facebook, Inc.
6174
+ *
6175
+ * This source code is licensed under the MIT license found in the
6176
+ * LICENSE file in the root directory of this source tree.
6177
+ *
6178
+ * @typechecks
6179
+ */
6180
+
6181
+ var emptyFunction = __webpack_require__(2);
6182
+
6183
+ /**
6184
+ * Upstream version of event listener. Does not take into account specific
6185
+ * nature of platform.
6186
+ */
6187
+ var EventListener = {
6188
+ /**
6189
+ * Listen to DOM events during the bubble phase.
6190
+ *
6191
+ * @param {DOMEventTarget} target DOM element to register listener on.
6192
+ * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
6193
+ * @param {function} callback Callback function.
6194
+ * @return {object} Object with a `remove` method.
6195
+ */
6196
+ listen: function listen(target, eventType, callback) {
6197
+ if (target.addEventListener) {
6198
+ target.addEventListener(eventType, callback, false);
6199
+ return {
6200
+ remove: function remove() {
6201
+ target.removeEventListener(eventType, callback, false);
6202
+ }
6203
+ };
6204
+ } else if (target.attachEvent) {
6205
+ target.attachEvent('on' + eventType, callback);
6206
+ return {
6207
+ remove: function remove() {
6208
+ target.detachEvent('on' + eventType, callback);
6209
+ }
6210
+ };
6211
+ }
6212
+ },
6213
+
6214
+ /**
6215
+ * Listen to DOM events during the capture phase.
6216
+ *
6217
+ * @param {DOMEventTarget} target DOM element to register listener on.
6218
+ * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
6219
+ * @param {function} callback Callback function.
6220
+ * @return {object} Object with a `remove` method.
6221
+ */
6222
+ capture: function capture(target, eventType, callback) {
6223
+ if (target.addEventListener) {
6224
+ target.addEventListener(eventType, callback, true);
6225
+ return {
6226
+ remove: function remove() {
6227
+ target.removeEventListener(eventType, callback, true);
6228
+ }
6229
+ };
6230
+ } else {
6231
+ if (process.env.NODE_ENV !== 'production') {
6232
+ console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
6233
+ }
6234
+ return {
6235
+ remove: emptyFunction
6236
+ };
6237
+ }
6238
+ },
6239
+
6240
+ registerDefault: function registerDefault() {}
6241
+ };
6242
+
6243
+ module.exports = EventListener;
6244
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
6245
+
6246
+ /***/ }),
6247
+ /* 21 */
6248
+ /***/ (function(module, exports, __webpack_require__) {
6249
+
6250
+ "use strict";
6251
+
6252
+
6253
+ /**
6254
+ * Copyright (c) 2013-present, Facebook, Inc.
6255
+ *
6256
+ * This source code is licensed under the MIT license found in the
6257
+ * LICENSE file in the root directory of this source tree.
6258
+ *
6259
+ * @typechecks
6260
+ */
6261
+
6262
+ /* eslint-disable fb-www/typeof-undefined */
6263
+
6264
+ /**
6265
+ * Same as document.activeElement but wraps in a try-catch block. In IE it is
6266
+ * not safe to call document.activeElement if there is nothing focused.
6267
+ *
6268
+ * The activeElement will be null only if the document or document body is not
6269
+ * yet defined.
6270
+ *
6271
+ * @param {?DOMDocument} doc Defaults to current document.
6272
+ * @return {?DOMElement}
6273
+ */
6274
+ function getActiveElement(doc) /*?DOMElement*/{
6275
+ doc = doc || (typeof document !== 'undefined' ? document : undefined);
6276
+ if (typeof doc === 'undefined') {
6277
+ return null;
6278
+ }
6279
+ try {
6280
+ return doc.activeElement || doc.body;
6281
+ } catch (e) {
6282
+ return doc.body;
6283
+ }
6284
+ }
6285
+
6286
+ module.exports = getActiveElement;
6287
+
6288
+ /***/ }),
6289
+ /* 22 */
6290
+ /***/ (function(module, exports, __webpack_require__) {
6291
+
6292
+ "use strict";
6293
+ /**
6294
+ * Copyright (c) 2013-present, Facebook, Inc.
6295
+ *
6296
+ * This source code is licensed under the MIT license found in the
6297
+ * LICENSE file in the root directory of this source tree.
6298
+ *
6299
+ * @typechecks
6300
+ *
6301
+ */
6302
+
6303
+ /*eslint-disable no-self-compare */
6304
+
6305
+
6306
+
6307
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
6308
+
6309
+ /**
6310
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
6311
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
6312
+ */
6313
+ function is(x, y) {
6314
+ // SameValue algorithm
6315
+ if (x === y) {
6316
+ // Steps 1-5, 7-10
6317
+ // Steps 6.b-6.e: +0 != -0
6318
+ // Added the nonzero y check to make Flow happy, but it is redundant
6319
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
6320
+ } else {
6321
+ // Step 6.a: NaN == NaN
6322
+ return x !== x && y !== y;
6323
+ }
6324
+ }
6325
+
6326
+ /**
6327
+ * Performs equality by iterating through keys on an object and returning false
6328
+ * when any key has values which are not strictly equal between the arguments.
6329
+ * Returns true when the values of all keys are strictly equal.
6330
+ */
6331
+ function shallowEqual(objA, objB) {
6332
+ if (is(objA, objB)) {
6333
+ return true;
6334
+ }
6335
+
6336
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
6337
+ return false;
6338
+ }
6339
+
6340
+ var keysA = Object.keys(objA);
6341
+ var keysB = Object.keys(objB);
6342
+
6343
+ if (keysA.length !== keysB.length) {
6344
+ return false;
6345
+ }
6346
+
6347
+ // Test for A's keys different from B.
6348
+ for (var i = 0; i < keysA.length; i++) {
6349
+ if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
6350
+ return false;
6351
+ }
6352
+ }
6353
+
6354
+ return true;
6355
+ }
6356
+
6357
+ module.exports = shallowEqual;
6358
+
6359
+ /***/ }),
6360
+ /* 23 */
6361
+ /***/ (function(module, exports, __webpack_require__) {
6362
+
6363
+ "use strict";
6364
+
6365
+
6366
+ /**
6367
+ * Copyright (c) 2013-present, Facebook, Inc.
6368
+ *
6369
+ * This source code is licensed under the MIT license found in the
6370
+ * LICENSE file in the root directory of this source tree.
6371
+ *
6372
+ *
6373
+ */
6374
+
6375
+ var isTextNode = __webpack_require__(44);
6376
+
6377
+ /*eslint-disable no-bitwise */
6378
+
6379
+ /**
6380
+ * Checks if a given DOM node contains or is another DOM node.
6381
+ */
6382
+ function containsNode(outerNode, innerNode) {
6383
+ if (!outerNode || !innerNode) {
6384
+ return false;
6385
+ } else if (outerNode === innerNode) {
6386
+ return true;
6387
+ } else if (isTextNode(outerNode)) {
6388
+ return false;
6389
+ } else if (isTextNode(innerNode)) {
6390
+ return containsNode(outerNode, innerNode.parentNode);
6391
+ } else if ('contains' in outerNode) {
6392
+ return outerNode.contains(innerNode);
6393
+ } else if (outerNode.compareDocumentPosition) {
6394
+ return !!(outerNode.compareDocumentPosition(innerNode) & 16);
6395
+ } else {
6396
+ return false;
6397
+ }
6398
+ }
6399
+
6400
+ module.exports = containsNode;
6401
+
6402
+ /***/ }),
6403
+ /* 24 */
6404
+ /***/ (function(module, exports, __webpack_require__) {
6405
+
6406
+ "use strict";
6407
+ /**
6408
+ * Copyright (c) 2013-present, Facebook, Inc.
6409
+ *
6410
+ * This source code is licensed under the MIT license found in the
6411
+ * LICENSE file in the root directory of this source tree.
6412
+ *
6413
+ */
6414
+
6415
+
6416
+
6417
+ /**
6418
+ * @param {DOMElement} node input/textarea to focus
6419
+ */
6420
+
6421
+ function focusNode(node) {
6422
+ // IE8 can throw "Can't move focus to the control because it is invisible,
6423
+ // not enabled, or of a type that does not accept the focus." for all kinds of
6424
+ // reasons that are too expensive and fragile to test.
6425
+ try {
6426
+ node.focus();
6427
+ } catch (e) {}
6428
+ }
6429
+
6430
+ module.exports = focusNode;
6431
+
6432
+ /***/ }),
6433
+ /* 25 */
6434
+ /***/ (function(module, exports, __webpack_require__) {
6435
+
6436
+ /* WEBPACK VAR INJECTION */(function(process) {/**
6437
+ * Copyright (c) 2013-present, Facebook, Inc.
6438
+ *
6439
+ * This source code is licensed under the MIT license found in the
6440
+ * LICENSE file in the root directory of this source tree.
6441
+ */
6442
+
6443
+ if (process.env.NODE_ENV !== 'production') {
6444
+ var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
6445
+ Symbol.for &&
6446
+ Symbol.for('react.element')) ||
6447
+ 0xeac7;
6448
+
6449
+ var isValidElement = function(object) {
6450
+ return typeof object === 'object' &&
6451
+ object !== null &&
6452
+ object.$$typeof === REACT_ELEMENT_TYPE;
6453
+ };
6454
+
6455
+ // By explicitly using `prop-types` you are opting into new development behavior.
6456
+ // http://fb.me/prop-types-in-prod
6457
+ var throwOnDirectAccess = true;
6458
+ module.exports = __webpack_require__(52)(isValidElement, throwOnDirectAccess);
6459
+ } else {
6460
+ // By explicitly using `prop-types` you are opting into new production behavior.
6461
+ // http://fb.me/prop-types-in-prod
6462
+ module.exports = __webpack_require__(53)();
6463
+ }
6464
+
6465
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
6466
+
6467
+ /***/ }),
6468
+ /* 26 */
6469
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6470
+
6471
+ "use strict";
6472
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; });
6473
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; });
6474
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(25);
6475
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
6476
+
6477
+
6478
+ var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
6479
+ trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
6480
+ tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
6481
+ notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
6482
+ isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
6483
+ });
6484
+
6485
+ var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
6486
+ subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
6487
+ dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
6488
+ getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
6489
+ });
6490
+
6491
+ /***/ }),
6492
+ /* 27 */
6493
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6494
+
6495
+ "use strict";
6496
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced;
6497
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(54);
6498
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__);
6499
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(55);
6500
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
6501
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
6502
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
6503
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(56);
6504
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(26);
6505
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6506
+
6507
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6508
+
6509
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6510
+
6511
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
6512
+
6513
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
6514
+
6515
+
6516
+
6517
+
6518
+
6519
+
6520
+
6521
+
6522
+ var hotReloadingVersion = 0;
6523
+ var dummyState = {};
6524
+ function noop() {}
6525
+ function makeSelectorStateful(sourceSelector, store) {
6526
+ // wrap the selector in an object that tracks its results between runs.
6527
+ var selector = {
6528
+ run: function runComponentSelector(props) {
6529
+ try {
6530
+ var nextProps = sourceSelector(store.getState(), props);
6531
+ if (nextProps !== selector.props || selector.error) {
6532
+ selector.shouldComponentUpdate = true;
6533
+ selector.props = nextProps;
6534
+ selector.error = null;
6535
+ }
6536
+ } catch (error) {
6537
+ selector.shouldComponentUpdate = true;
6538
+ selector.error = error;
6539
+ }
6540
+ }
6541
+ };
6542
+
6543
+ return selector;
6544
+ }
6545
+
6546
+ function connectAdvanced(
6547
+ /*
6548
+ selectorFactory is a func that is responsible for returning the selector function used to
6549
+ compute new props from state, props, and dispatch. For example:
6550
+ export default connectAdvanced((dispatch, options) => (state, props) => ({
6551
+ thing: state.things[props.thingId],
6552
+ saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
6553
+ }))(YourComponent)
6554
+ Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
6555
+ outside of their selector as an optimization. Options passed to connectAdvanced are passed to
6556
+ the selectorFactory, along with displayName and WrappedComponent, as the second argument.
6557
+ Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
6558
+ props. Do not use connectAdvanced directly without memoizing results between calls to your
6559
+ selector, otherwise the Connect component will re-render on every state or props change.
6560
+ */
6561
+ selectorFactory) {
6562
+ var _contextTypes, _childContextTypes;
6563
+
6564
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
6565
+ _ref$getDisplayName = _ref.getDisplayName,
6566
+ getDisplayName = _ref$getDisplayName === undefined ? function (name) {
6567
+ return 'ConnectAdvanced(' + name + ')';
6568
+ } : _ref$getDisplayName,
6569
+ _ref$methodName = _ref.methodName,
6570
+ methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,
6571
+ _ref$renderCountProp = _ref.renderCountProp,
6572
+ renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,
6573
+ _ref$shouldHandleStat = _ref.shouldHandleStateChanges,
6574
+ shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,
6575
+ _ref$storeKey = _ref.storeKey,
6576
+ storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,
6577
+ _ref$withRef = _ref.withRef,
6578
+ withRef = _ref$withRef === undefined ? false : _ref$withRef,
6579
+ connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);
6580
+
6581
+ var subscriptionKey = storeKey + 'Subscription';
6582
+ var version = hotReloadingVersion++;
6583
+
6584
+ var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes);
6585
+ var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes);
6586
+
6587
+ return function wrapWithConnect(WrappedComponent) {
6588
+ __WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent)));
6589
+
6590
+ var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
6591
+
6592
+ var displayName = getDisplayName(wrappedComponentName);
6593
+
6594
+ var selectorFactoryOptions = _extends({}, connectOptions, {
6595
+ getDisplayName: getDisplayName,
6596
+ methodName: methodName,
6597
+ renderCountProp: renderCountProp,
6598
+ shouldHandleStateChanges: shouldHandleStateChanges,
6599
+ storeKey: storeKey,
6600
+ withRef: withRef,
6601
+ displayName: displayName,
6602
+ wrappedComponentName: wrappedComponentName,
6603
+ WrappedComponent: WrappedComponent
6604
+ });
6605
+
6606
+ var Connect = function (_Component) {
6607
+ _inherits(Connect, _Component);
6608
+
6609
+ function Connect(props, context) {
6610
+ _classCallCheck(this, Connect);
6611
+
6612
+ var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
6613
+
6614
+ _this.version = version;
6615
+ _this.state = {};
6616
+ _this.renderCount = 0;
6617
+ _this.store = props[storeKey] || context[storeKey];
6618
+ _this.propsMode = Boolean(props[storeKey]);
6619
+ _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
6620
+
6621
+ __WEBPACK_IMPORTED_MODULE_1_invariant___default()(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a <Provider>, ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".'));
6622
+
6623
+ _this.initSelector();
6624
+ _this.initSubscription();
6625
+ return _this;
6626
+ }
6627
+
6628
+ Connect.prototype.getChildContext = function getChildContext() {
6629
+ var _ref2;
6630
+
6631
+ // If this component received store from props, its subscription should be transparent
6632
+ // to any descendants receiving store+subscription from context; it passes along
6633
+ // subscription passed to it. Otherwise, it shadows the parent subscription, which allows
6634
+ // Connect to control ordering of notifications to flow top-down.
6635
+ var subscription = this.propsMode ? null : this.subscription;
6636
+ return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2;
6637
+ };
6638
+
6639
+ Connect.prototype.componentDidMount = function componentDidMount() {
6640
+ if (!shouldHandleStateChanges) return;
6641
+
6642
+ // componentWillMount fires during server side rendering, but componentDidMount and
6643
+ // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.
6644
+ // Otherwise, unsubscription would never take place during SSR, causing a memory leak.
6645
+ // To handle the case where a child component may have triggered a state change by
6646
+ // dispatching an action in its componentWillMount, we have to re-run the select and maybe
6647
+ // re-render.
6648
+ this.subscription.trySubscribe();
6649
+ this.selector.run(this.props);
6650
+ if (this.selector.shouldComponentUpdate) this.forceUpdate();
6651
+ };
6652
+
6653
+ Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
6654
+ this.selector.run(nextProps);
6655
+ };
6656
+
6657
+ Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {
6658
+ return this.selector.shouldComponentUpdate;
6659
+ };
6660
+
6661
+ Connect.prototype.componentWillUnmount = function componentWillUnmount() {
6662
+ if (this.subscription) this.subscription.tryUnsubscribe();
6663
+ this.subscription = null;
6664
+ this.notifyNestedSubs = noop;
6665
+ this.store = null;
6666
+ this.selector.run = noop;
6667
+ this.selector.shouldComponentUpdate = false;
6668
+ };
6669
+
6670
+ Connect.prototype.getWrappedInstance = function getWrappedInstance() {
6671
+ __WEBPACK_IMPORTED_MODULE_1_invariant___default()(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));
6672
+ return this.wrappedInstance;
6673
+ };
6674
+
6675
+ Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {
6676
+ this.wrappedInstance = ref;
6677
+ };
6678
+
6679
+ Connect.prototype.initSelector = function initSelector() {
6680
+ var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);
6681
+ this.selector = makeSelectorStateful(sourceSelector, this.store);
6682
+ this.selector.run(this.props);
6683
+ };
6684
+
6685
+ Connect.prototype.initSubscription = function initSubscription() {
6686
+ if (!shouldHandleStateChanges) return;
6687
+
6688
+ // parentSub's source should match where store came from: props vs. context. A component
6689
+ // connected to the store via props shouldn't use subscription from context, or vice versa.
6690
+ var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];
6691
+ this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this));
6692
+
6693
+ // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
6694
+ // the middle of the notification loop, where `this.subscription` will then be null. An
6695
+ // extra null check every change can be avoided by copying the method onto `this` and then
6696
+ // replacing it with a no-op on unmount. This can probably be avoided if Subscription's
6697
+ // listeners logic is changed to not call listeners that have been unsubscribed in the
6698
+ // middle of the notification loop.
6699
+ this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);
6700
+ };
6701
+
6702
+ Connect.prototype.onStateChange = function onStateChange() {
6703
+ this.selector.run(this.props);
6704
+
6705
+ if (!this.selector.shouldComponentUpdate) {
6706
+ this.notifyNestedSubs();
6707
+ } else {
6708
+ this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;
6709
+ this.setState(dummyState);
6710
+ }
6711
+ };
6712
+
6713
+ Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {
6714
+ // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it
6715
+ // needs to notify nested subs. Once called, it unimplements itself until further state
6716
+ // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does
6717
+ // a boolean check every time avoids an extra method call most of the time, resulting
6718
+ // in some perf boost.
6719
+ this.componentDidUpdate = undefined;
6720
+ this.notifyNestedSubs();
6721
+ };
6722
+
6723
+ Connect.prototype.isSubscribed = function isSubscribed() {
6724
+ return Boolean(this.subscription) && this.subscription.isSubscribed();
6725
+ };
6726
+
6727
+ Connect.prototype.addExtraProps = function addExtraProps(props) {
6728
+ if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props;
6729
+ // make a shallow copy so that fields added don't leak to the original selector.
6730
+ // this is especially important for 'ref' since that's a reference back to the component
6731
+ // instance. a singleton memoized selector would then be holding a reference to the
6732
+ // instance, preventing the instance from being garbage collected, and that would be bad
6733
+ var withExtras = _extends({}, props);
6734
+ if (withRef) withExtras.ref = this.setWrappedInstance;
6735
+ if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
6736
+ if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;
6737
+ return withExtras;
6738
+ };
6739
+
6740
+ Connect.prototype.render = function render() {
6741
+ var selector = this.selector;
6742
+ selector.shouldComponentUpdate = false;
6743
+
6744
+ if (selector.error) {
6745
+ throw selector.error;
6746
+ } else {
6747
+ return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props));
6748
+ }
6749
+ };
6750
+
6751
+ return Connect;
6752
+ }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
6753
+
6754
+ Connect.WrappedComponent = WrappedComponent;
6755
+ Connect.displayName = displayName;
6756
+ Connect.childContextTypes = childContextTypes;
6757
+ Connect.contextTypes = contextTypes;
6758
+ Connect.propTypes = contextTypes;
6759
+
6760
+ if (process.env.NODE_ENV !== 'production') {
6761
+ Connect.prototype.componentWillUpdate = function componentWillUpdate() {
6762
+ var _this2 = this;
6763
+
6764
+ // We are hot reloading!
6765
+ if (this.version !== version) {
6766
+ this.version = version;
6767
+ this.initSelector();
6768
+
6769
+ // If any connected descendants don't hot reload (and resubscribe in the process), their
6770
+ // listeners will be lost when we unsubscribe. Unfortunately, by copying over all
6771
+ // listeners, this does mean that the old versions of connected descendants will still be
6772
+ // notified of state changes; however, their onStateChange function is a no-op so this
6773
+ // isn't a huge deal.
6774
+ var oldListeners = [];
6775
+
6776
+ if (this.subscription) {
6777
+ oldListeners = this.subscription.listeners.get();
6778
+ this.subscription.tryUnsubscribe();
6779
+ }
6780
+ this.initSubscription();
6781
+ if (shouldHandleStateChanges) {
6782
+ this.subscription.trySubscribe();
6783
+ oldListeners.forEach(function (listener) {
6784
+ return _this2.subscription.listeners.subscribe(listener);
6785
+ });
6786
+ }
6787
+ }
6788
+ };
6789
+ }
6790
+
6791
+ return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent);
6792
+ };
6793
+ }
6794
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
6795
+
6796
+ /***/ }),
6797
+ /* 28 */
6798
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6799
+
6800
+ "use strict";
6801
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
6802
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(29);
6803
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(72);
6804
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(73);
6805
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(74);
6806
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(33);
6807
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(32);
6808
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; });
6809
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; });
6810
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; });
6811
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; });
6812
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; });
6813
+
6814
+
6815
+
6816
+
6817
+
6818
+
6819
+
6820
+ /*
6821
+ * This is a dummy function to check if the function name has been altered by minification.
6822
+ * If the function has been minified and NODE_ENV !== 'production', warn the user.
6823
+ */
6824
+ function isCrushed() {}
6825
+
6826
+ if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
6827
+ Object(__WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
6828
+ }
6829
+
6830
+
6831
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
6832
+
6833
+ /***/ }),
6834
+ /* 29 */
6835
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6836
+
6837
+ "use strict";
6838
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; });
6839
+ /* harmony export (immutable) */ __webpack_exports__["b"] = createStore;
6840
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(15);
6841
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(68);
6842
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__);
6843
+
6844
+
6845
+
6846
+ /**
6847
+ * These are private action types reserved by Redux.
6848
+ * For any unknown actions, you must return the current state.
6849
+ * If the current state is undefined, you must return the initial state.
6850
+ * Do not reference these action types directly in your code.
6851
+ */
6852
+ var ActionTypes = {
6853
+ INIT: '@@redux/INIT'
6854
+
6855
+ /**
6856
+ * Creates a Redux store that holds the state tree.
6857
+ * The only way to change the data in the store is to call `dispatch()` on it.
6858
+ *
6859
+ * There should only be a single store in your app. To specify how different
6860
+ * parts of the state tree respond to actions, you may combine several reducers
6861
+ * into a single reducer function by using `combineReducers`.
6862
+ *
6863
+ * @param {Function} reducer A function that returns the next state tree, given
6864
+ * the current state tree and the action to handle.
6865
+ *
6866
+ * @param {any} [preloadedState] The initial state. You may optionally specify it
6867
+ * to hydrate the state from the server in universal apps, or to restore a
6868
+ * previously serialized user session.
6869
+ * If you use `combineReducers` to produce the root reducer function, this must be
6870
+ * an object with the same shape as `combineReducers` keys.
6871
+ *
6872
+ * @param {Function} [enhancer] The store enhancer. You may optionally specify it
6873
+ * to enhance the store with third-party capabilities such as middleware,
6874
+ * time travel, persistence, etc. The only store enhancer that ships with Redux
6875
+ * is `applyMiddleware()`.
6876
+ *
6877
+ * @returns {Store} A Redux store that lets you read the state, dispatch actions
6878
+ * and subscribe to changes.
6879
+ */
6880
+ };function createStore(reducer, preloadedState, enhancer) {
6881
+ var _ref2;
6882
+
6883
+ if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
6884
+ enhancer = preloadedState;
6885
+ preloadedState = undefined;
6886
+ }
6887
+
6888
+ if (typeof enhancer !== 'undefined') {
6889
+ if (typeof enhancer !== 'function') {
6890
+ throw new Error('Expected the enhancer to be a function.');
6891
+ }
6892
+
6893
+ return enhancer(createStore)(reducer, preloadedState);
6894
+ }
6895
+
6896
+ if (typeof reducer !== 'function') {
6897
+ throw new Error('Expected the reducer to be a function.');
6898
+ }
6899
+
6900
+ var currentReducer = reducer;
6901
+ var currentState = preloadedState;
6902
+ var currentListeners = [];
6903
+ var nextListeners = currentListeners;
6904
+ var isDispatching = false;
6905
+
6906
+ function ensureCanMutateNextListeners() {
6907
+ if (nextListeners === currentListeners) {
6908
+ nextListeners = currentListeners.slice();
6909
+ }
6910
+ }
6911
+
6912
+ /**
6913
+ * Reads the state tree managed by the store.
6914
+ *
6915
+ * @returns {any} The current state tree of your application.
6916
+ */
6917
+ function getState() {
6918
+ return currentState;
6919
+ }
6920
+
6921
+ /**
6922
+ * Adds a change listener. It will be called any time an action is dispatched,
6923
+ * and some part of the state tree may potentially have changed. You may then
6924
+ * call `getState()` to read the current state tree inside the callback.
6925
+ *
6926
+ * You may call `dispatch()` from a change listener, with the following
6927
+ * caveats:
6928
+ *
6929
+ * 1. The subscriptions are snapshotted just before every `dispatch()` call.
6930
+ * If you subscribe or unsubscribe while the listeners are being invoked, this
6931
+ * will not have any effect on the `dispatch()` that is currently in progress.
6932
+ * However, the next `dispatch()` call, whether nested or not, will use a more
6933
+ * recent snapshot of the subscription list.
6934
+ *
6935
+ * 2. The listener should not expect to see all state changes, as the state
6936
+ * might have been updated multiple times during a nested `dispatch()` before
6937
+ * the listener is called. It is, however, guaranteed that all subscribers
6938
+ * registered before the `dispatch()` started will be called with the latest
6939
+ * state by the time it exits.
6940
+ *
6941
+ * @param {Function} listener A callback to be invoked on every dispatch.
6942
+ * @returns {Function} A function to remove this change listener.
6943
+ */
6944
+ function subscribe(listener) {
6945
+ if (typeof listener !== 'function') {
6946
+ throw new Error('Expected listener to be a function.');
6947
+ }
6948
+
6949
+ var isSubscribed = true;
6950
+
6951
+ ensureCanMutateNextListeners();
6952
+ nextListeners.push(listener);
6953
+
6954
+ return function unsubscribe() {
6955
+ if (!isSubscribed) {
6956
+ return;
6957
+ }
6958
+
6959
+ isSubscribed = false;
6960
+
6961
+ ensureCanMutateNextListeners();
6962
+ var index = nextListeners.indexOf(listener);
6963
+ nextListeners.splice(index, 1);
6964
+ };
6965
+ }
6966
+
6967
+ /**
6968
+ * Dispatches an action. It is the only way to trigger a state change.
6969
+ *
6970
+ * The `reducer` function, used to create the store, will be called with the
6971
+ * current state tree and the given `action`. Its return value will
6972
+ * be considered the **next** state of the tree, and the change listeners
6973
+ * will be notified.
6974
+ *
6975
+ * The base implementation only supports plain object actions. If you want to
6976
+ * dispatch a Promise, an Observable, a thunk, or something else, you need to
6977
+ * wrap your store creating function into the corresponding middleware. For
6978
+ * example, see the documentation for the `redux-thunk` package. Even the
6979
+ * middleware will eventually dispatch plain object actions using this method.
6980
+ *
6981
+ * @param {Object} action A plain object representing “what changed”. It is
6982
+ * a good idea to keep actions serializable so you can record and replay user
6983
+ * sessions, or use the time travelling `redux-devtools`. An action must have
6984
+ * a `type` property which may not be `undefined`. It is a good idea to use
6985
+ * string constants for action types.
6986
+ *
6987
+ * @returns {Object} For convenience, the same action object you dispatched.
6988
+ *
6989
+ * Note that, if you use a custom middleware, it may wrap `dispatch()` to
6990
+ * return something else (for example, a Promise you can await).
6991
+ */
6992
+ function dispatch(action) {
6993
+ if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(action)) {
6994
+ throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
6995
+ }
6996
+
6997
+ if (typeof action.type === 'undefined') {
6998
+ throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
6999
+ }
7000
+
7001
+ if (isDispatching) {
7002
+ throw new Error('Reducers may not dispatch actions.');
7003
+ }
7004
+
7005
+ try {
7006
+ isDispatching = true;
7007
+ currentState = currentReducer(currentState, action);
7008
+ } finally {
7009
+ isDispatching = false;
7010
+ }
7011
+
7012
+ var listeners = currentListeners = nextListeners;
7013
+ for (var i = 0; i < listeners.length; i++) {
7014
+ var listener = listeners[i];
7015
+ listener();
7016
+ }
7017
+
7018
+ return action;
7019
+ }
7020
+
7021
+ /**
7022
+ * Replaces the reducer currently used by the store to calculate the state.
7023
+ *
7024
+ * You might need this if your app implements code splitting and you want to
7025
+ * load some of the reducers dynamically. You might also need this if you
7026
+ * implement a hot reloading mechanism for Redux.
7027
+ *
7028
+ * @param {Function} nextReducer The reducer for the store to use instead.
7029
+ * @returns {void}
7030
+ */
7031
+ function replaceReducer(nextReducer) {
7032
+ if (typeof nextReducer !== 'function') {
7033
+ throw new Error('Expected the nextReducer to be a function.');
7034
+ }
7035
+
7036
+ currentReducer = nextReducer;
7037
+ dispatch({ type: ActionTypes.INIT });
7038
+ }
7039
+
7040
+ /**
7041
+ * Interoperability point for observable/reactive libraries.
7042
+ * @returns {observable} A minimal observable of state changes.
7043
+ * For more information, see the observable proposal:
7044
+ * https://github.com/tc39/proposal-observable
7045
+ */
7046
+ function observable() {
7047
+ var _ref;
7048
+
7049
+ var outerSubscribe = subscribe;
7050
+ return _ref = {
7051
+ /**
7052
+ * The minimal observable subscription method.
7053
+ * @param {Object} observer Any object that can be used as an observer.
7054
+ * The observer object should have a `next` method.
7055
+ * @returns {subscription} An object with an `unsubscribe` method that can
7056
+ * be used to unsubscribe the observable from the store, and prevent further
7057
+ * emission of values from the observable.
7058
+ */
7059
+ subscribe: function subscribe(observer) {
7060
+ if (typeof observer !== 'object') {
7061
+ throw new TypeError('Expected the observer to be an object.');
7062
+ }
7063
+
7064
+ function observeState() {
7065
+ if (observer.next) {
7066
+ observer.next(getState());
7067
+ }
7068
+ }
7069
+
7070
+ observeState();
7071
+ var unsubscribe = outerSubscribe(observeState);
7072
+ return { unsubscribe: unsubscribe };
7073
+ }
7074
+ }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () {
7075
+ return this;
7076
+ }, _ref;
7077
+ }
7078
+
7079
+ // When a store is created, an "INIT" action is dispatched so that every
7080
+ // reducer returns their initial state. This effectively populates
7081
+ // the initial state tree.
7082
+ dispatch({ type: ActionTypes.INIT });
7083
+
7084
+ return _ref2 = {
7085
+ dispatch: dispatch,
7086
+ subscribe: subscribe,
7087
+ getState: getState,
7088
+ replaceReducer: replaceReducer
7089
+ }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2;
7090
+ }
7091
+
7092
+ /***/ }),
7093
+ /* 30 */
7094
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7095
+
7096
+ "use strict";
7097
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(61);
7098
+
7099
+
7100
+ /** Built-in value references. */
7101
+ var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol;
7102
+
7103
+ /* harmony default export */ __webpack_exports__["a"] = (Symbol);
7104
+
7105
+
7106
+ /***/ }),
7107
+ /* 31 */
7108
+ /***/ (function(module, exports) {
7109
+
7110
+ var g;
7111
+
7112
+ // This works in non-strict mode
7113
+ g = (function() {
7114
+ return this;
7115
+ })();
7116
+
7117
+ try {
7118
+ // This works if eval is allowed (see CSP)
7119
+ g = g || Function("return this")() || (1,eval)("this");
7120
+ } catch(e) {
7121
+ // This works if the window reference is available
7122
+ if(typeof window === "object")
7123
+ g = window;
7124
+ }
7125
+
7126
+ // g can still be undefined, but nothing to do about it...
7127
+ // We return undefined, instead of nothing here, so it's
7128
+ // easier to handle this case. if(!global) { ...}
7129
+
7130
+ module.exports = g;
7131
+
7132
+
7133
+ /***/ }),
7134
+ /* 32 */
7135
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7136
+
7137
+ "use strict";
7138
+ /* harmony export (immutable) */ __webpack_exports__["a"] = warning;
7139
+ /**
7140
+ * Prints a warning in the console if it exists.
7141
+ *
7142
+ * @param {String} message The warning message.
7143
+ * @returns {void}
7144
+ */
7145
+ function warning(message) {
7146
+ /* eslint-disable no-console */
7147
+ if (typeof console !== 'undefined' && typeof console.error === 'function') {
7148
+ console.error(message);
7149
+ }
7150
+ /* eslint-enable no-console */
7151
+ try {
7152
+ // This error was thrown as a convenience so that if you enable
7153
+ // "break on all exceptions" in your console,
7154
+ // it would pause the execution at this line.
7155
+ throw new Error(message);
7156
+ /* eslint-disable no-empty */
7157
+ } catch (e) {}
7158
+ /* eslint-enable no-empty */
7159
+ }
7160
+
7161
+ /***/ }),
7162
+ /* 33 */
7163
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7164
+
7165
+ "use strict";
7166
+ /* harmony export (immutable) */ __webpack_exports__["a"] = compose;
7167
+ /**
7168
+ * Composes single-argument functions from right to left. The rightmost
7169
+ * function can take multiple arguments as it provides the signature for
7170
+ * the resulting composite function.
7171
+ *
7172
+ * @param {...Function} funcs The functions to compose.
7173
+ * @returns {Function} A function obtained by composing the argument functions
7174
+ * from right to left. For example, compose(f, g, h) is identical to doing
7175
+ * (...args) => f(g(h(...args))).
7176
+ */
7177
+
7178
+ function compose() {
7179
+ for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
7180
+ funcs[_key] = arguments[_key];
7181
+ }
7182
+
7183
+ if (funcs.length === 0) {
7184
+ return function (arg) {
7185
+ return arg;
7186
+ };
7187
+ }
7188
+
7189
+ if (funcs.length === 1) {
7190
+ return funcs[0];
7191
+ }
7192
+
7193
+ return funcs.reduce(function (a, b) {
7194
+ return function () {
7195
+ return a(b.apply(undefined, arguments));
7196
+ };
7197
+ });
7198
+ }
7199
+
7200
+ /***/ }),
7201
+ /* 34 */
7202
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7203
+
7204
+ "use strict";
7205
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant;
7206
+ /* unused harmony export getDependsOnOwnProps */
7207
+ /* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc;
7208
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(35);
7209
+
7210
+
7211
+ function wrapMapToPropsConstant(getConstant) {
7212
+ return function initConstantSelector(dispatch, options) {
7213
+ var constant = getConstant(dispatch, options);
7214
+
7215
+ function constantSelector() {
7216
+ return constant;
7217
+ }
7218
+ constantSelector.dependsOnOwnProps = false;
7219
+ return constantSelector;
7220
+ };
7221
+ }
7222
+
7223
+ // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
7224
+ // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
7225
+ // whether mapToProps needs to be invoked when props have changed.
7226
+ //
7227
+ // A length of one signals that mapToProps does not depend on props from the parent component.
7228
+ // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
7229
+ // therefore not reporting its length accurately..
7230
+ function getDependsOnOwnProps(mapToProps) {
7231
+ return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
7232
+ }
7233
+
7234
+ // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
7235
+ // this function wraps mapToProps in a proxy function which does several things:
7236
+ //
7237
+ // * Detects whether the mapToProps function being called depends on props, which
7238
+ // is used by selectorFactory to decide if it should reinvoke on props changes.
7239
+ //
7240
+ // * On first call, handles mapToProps if returns another function, and treats that
7241
+ // new function as the true mapToProps for subsequent calls.
7242
+ //
7243
+ // * On first call, verifies the first result is a plain object, in order to warn
7244
+ // the developer that their mapToProps function is not returning a valid result.
7245
+ //
7246
+ function wrapMapToPropsFunc(mapToProps, methodName) {
7247
+ return function initProxySelector(dispatch, _ref) {
7248
+ var displayName = _ref.displayName;
7249
+
7250
+ var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
7251
+ return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
7252
+ };
7253
+
7254
+ // allow detectFactoryAndVerify to get ownProps
7255
+ proxy.dependsOnOwnProps = true;
7256
+
7257
+ proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
7258
+ proxy.mapToProps = mapToProps;
7259
+ proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
7260
+ var props = proxy(stateOrDispatch, ownProps);
7261
+
7262
+ if (typeof props === 'function') {
7263
+ proxy.mapToProps = props;
7264
+ proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
7265
+ props = proxy(stateOrDispatch, ownProps);
7266
+ }
7267
+
7268
+ if (process.env.NODE_ENV !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(props, displayName, methodName);
7269
+
7270
+ return props;
7271
+ };
7272
+
7273
+ return proxy;
7274
+ };
7275
+ }
7276
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
7277
+
7278
+ /***/ }),
7279
+ /* 35 */
7280
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7281
+
7282
+ "use strict";
7283
+ /* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject;
7284
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(15);
7285
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(14);
7286
+
7287
+
7288
+
7289
+ function verifyPlainObject(value, displayName, methodName) {
7290
+ if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) {
7291
+ Object(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');
7292
+ }
7293
+ }
7294
+
7295
+ /***/ }),
7296
+ /* 36 */
7297
+ /***/ (function(module, exports, __webpack_require__) {
7298
+
7299
+ "use strict";
7300
+
7301
+ Object.defineProperty(exports, "__esModule", { value: true });
7302
+ var DisqusApi = /** @class */ (function () {
7303
+ function DisqusApi() {
7304
+ }
7305
+ Object.defineProperty(DisqusApi, "instance", {
7306
+ get: function () {
7307
+ return disqusApi;
7308
+ },
7309
+ enumerable: true,
7310
+ configurable: true
7311
+ });
7312
+ Object.defineProperty(DisqusApi.prototype, "apiKey", {
7313
+ // tslint:enable:variable-name
7314
+ get: function () {
7315
+ return this._apiKey;
7316
+ },
7317
+ enumerable: true,
7318
+ configurable: true
7319
+ });
7320
+ Object.defineProperty(DisqusApi.prototype, "accessToken", {
7321
+ get: function () {
7322
+ return this._accessToken;
7323
+ },
7324
+ enumerable: true,
7325
+ configurable: true
7326
+ });
7327
+ Object.defineProperty(DisqusApi.prototype, "forum", {
7328
+ get: function () {
7329
+ return this._forum;
7330
+ },
7331
+ enumerable: true,
7332
+ configurable: true
7333
+ });
7334
+ DisqusApi.prototype.configure = function (apiKey, accessToken, forum) {
7335
+ this._apiKey = apiKey;
7336
+ this._accessToken = accessToken;
7337
+ this._forum = forum;
7338
+ };
7339
+ DisqusApi.prototype.createImport = function (xmlContent, filename, onLoad) {
7340
+ var formData = new FormData();
7341
+ formData.append('upload', new Blob([xmlContent], { type: 'text/xml' }), filename);
7342
+ formData.append('sourceType', '0');
7343
+ formData.append('forum', this.forum);
7344
+ formData.append('api_key', this.apiKey);
7345
+ formData.append('access_token', this.accessToken);
7346
+ return this.post('imports/create', formData, onLoad);
7347
+ };
7348
+ DisqusApi.prototype.post = function (path, data, onLoad) {
7349
+ if (!this.apiKey)
7350
+ return null;
7351
+ var XHR = new XMLHttpRequest();
7352
+ XHR.open('POST', "https://disqus.com/api/3.0/" + path + ".json");
7353
+ XHR.addEventListener('load', onLoad);
7354
+ XHR.send(data);
7355
+ return XHR;
7356
+ };
7357
+ return DisqusApi;
7358
+ }());
7359
+ exports.DisqusApi = DisqusApi;
7360
+ var disqusApi = new DisqusApi();
7361
+
7362
+
7363
+ /***/ }),
7364
+ /* 37 */
7365
+ /***/ (function(module, exports, __webpack_require__) {
7366
+
7367
+ "use strict";
7368
+
7369
+ Object.defineProperty(exports, "__esModule", { value: true });
7370
+ var WIN = window;
7371
+ var REST_OPTIONS = WIN.DISQUS_WP && WIN.DISQUS_WP.rest;
7372
+ exports.default = REST_OPTIONS;
7373
+
7374
+
7375
+ /***/ }),
7376
+ /* 38 */
7377
+ /***/ (function(module, exports, __webpack_require__) {
7378
+
7379
+ "use strict";
7380
+
7381
+ Object.defineProperty(exports, "__esModule", { value: true });
7382
+ __webpack_require__(39);
7383
+
7384
+
7385
+ /***/ }),
7386
+ /* 39 */
7387
+ /***/ (function(module, exports, __webpack_require__) {
7388
+
7389
+ "use strict";
7390
+
7391
+ Object.defineProperty(exports, "__esModule", { value: true });
7392
+ var React = __webpack_require__(1);
7393
+ var ReactDOM = __webpack_require__(42);
7394
+ var ReactRedux = __webpack_require__(3);
7395
+ var Redux = __webpack_require__(28);
7396
+ var actions_1 = __webpack_require__(10);
7397
+ var MainContainer_1 = __webpack_require__(79);
7398
+ var DisqusApi_1 = __webpack_require__(36);
7399
+ var adminApp_1 = __webpack_require__(102);
7400
+ var WordPressRestApi_1 = __webpack_require__(18);
7401
+ var store = Redux.createStore(adminApp_1.default);
7402
+ var element = document.getElementById('disqus-admin');
7403
+ var onClearMessage = function (event) {
7404
+ store.dispatch(actions_1.setMessageAction(null));
7405
+ };
7406
+ // Sets up the hashchange router for configuration tabs.
7407
+ var onHashChange = function (event) {
7408
+ if (event)
7409
+ event.preventDefault();
7410
+ store.dispatch(actions_1.changeTabStateAction(window.location.hash.replace('#', '')));
7411
+ };
7412
+ window.addEventListener('hashchange', onHashChange);
7413
+ if (window.location.hash)
7414
+ onHashChange(null);
7415
+ ReactDOM.render(React.createElement(ReactRedux.Provider, { store: store },
7416
+ React.createElement(MainContainer_1.default, null)), element, function () {
7417
+ var checkResponse = function (response) {
7418
+ if (!response)
7419
+ return false;
7420
+ if (response.code !== 'OK') {
7421
+ store.dispatch(actions_1.setMessageAction({
7422
+ onDismiss: onClearMessage,
7423
+ text: response.message,
7424
+ type: 'error',
7425
+ }));
7426
+ return false;
7427
+ }
7428
+ return true;
7429
+ };
7430
+ store.dispatch(actions_1.setValueAction('isFetchingAdminOptions', true));
7431
+ store.dispatch(actions_1.setValueAction('isFetchingSyncStatus', true));
7432
+ // Fetch the admin options
7433
+ WordPressRestApi_1.WordPressRestApi.instance.pluginRestGet('settings', function (response) {
7434
+ store.dispatch(actions_1.setValueAction('isFetchingAdminOptions', false));
7435
+ if (!checkResponse(response))
7436
+ return;
7437
+ var data = response.data;
7438
+ DisqusApi_1.DisqusApi.instance.configure(data.disqus_public_key, data.disqus_admin_access_token, data.disqus_forum_url);
7439
+ store.dispatch(actions_1.updateAdminOptionsAction(response.data));
7440
+ });
7441
+ // Fetch the sync status
7442
+ WordPressRestApi_1.WordPressRestApi.instance.pluginRestGet('sync/status', function (response) {
7443
+ store.dispatch(actions_1.setValueAction('isFetchingSyncStatus', false));
7444
+ if (!checkResponse(response))
7445
+ return;
7446
+ store.dispatch(actions_1.updateSyncStatusAction(response.data));
7447
+ });
7448
+ });
7449
+
7450
+
7451
+ /***/ }),
7452
+ /* 40 */
7453
+ /***/ (function(module, exports, __webpack_require__) {
7454
+
7455
+ "use strict";
7456
+ /** @license React v16.2.0
7457
+ * react.production.min.js
7458
+ *
7459
+ * Copyright (c) 2013-present, Facebook, Inc.
7460
+ *
7461
+ * This source code is licensed under the MIT license found in the
7462
+ * LICENSE file in the root directory of this source tree.
7463
+ */
7464
+
7465
+ var m=__webpack_require__(6),n=__webpack_require__(8),p=__webpack_require__(2),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.call"):60104,u=q?Symbol["for"]("react.return"):60105,v=q?Symbol["for"]("react.portal"):60106,w=q?Symbol["for"]("react.fragment"):60107,x="function"===typeof Symbol&&Symbol.iterator;
7466
+ function y(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}
7467
+ var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function A(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||z}A.prototype.isReactComponent={};A.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?y("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};A.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};
7468
+ function B(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||z}function C(){}C.prototype=A.prototype;var D=B.prototype=new C;D.constructor=B;m(D,A.prototype);D.isPureReactComponent=!0;function E(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||z}var F=E.prototype=new C;F.constructor=E;m(F,A.prototype);F.unstable_isAsyncReactComponent=!0;F.render=function(){return this.props.children};var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
7469
+ function J(a,b,e){var c,d={},g=null,k=null;if(null!=b)for(c in void 0!==b.ref&&(k=b.ref),void 0!==b.key&&(g=""+b.key),b)H.call(b,c)&&!I.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var h=Array(f),l=0;l<f;l++)h[l]=arguments[l+2];d.children=h}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:r,type:a,key:g,ref:k,props:d,_owner:G.current}}function K(a){return"object"===typeof a&&null!==a&&a.$$typeof===r}
7470
+ function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var L=/\/+/g,M=[];function N(a,b,e,c){if(M.length){var d=M.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}function O(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>M.length&&M.push(a)}
7471
+ function P(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:case u:case v:g=!0}}if(g)return e(c,a,""===b?"."+Q(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;k<a.length;k++){d=a[k];var f=b+Q(d,k);g+=P(d,f,e,c)}else if(null===a||"undefined"===typeof a?f=null:(f=x&&a[x]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=
7472
+ f.call(a),k=0;!(d=a.next()).done;)d=d.value,f=b+Q(d,k++),g+=P(d,f,e,c);else"object"===d&&(e=""+a,y("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function Q(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function R(a,b){a.func.call(a.context,b,a.count++)}
7473
+ function S(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?T(a,c,e,p.thatReturnsArgument):null!=a&&(K(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(L,"$\x26/")+"/")+e,a={$$typeof:r,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function T(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(L,"$\x26/")+"/");b=N(b,g,c,d);null==a||P(a,"",S,b);O(b)}
7474
+ var U={Children:{map:function(a,b,e){if(null==a)return a;var c=[];T(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=N(null,null,b,e);null==a||P(a,"",R,b);O(b)},count:function(a){return null==a?0:P(a,"",p.thatReturnsNull,null)},toArray:function(a){var b=[];T(a,b,null,p.thatReturnsArgument);return b},only:function(a){K(a)?void 0:y("143");return a}},Component:A,PureComponent:B,unstable_AsyncComponent:E,Fragment:w,createElement:J,cloneElement:function(a,b,e){var c=m({},a.props),
7475
+ d=a.key,g=a.ref,k=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,k=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(h in b)H.call(b,h)&&!I.hasOwnProperty(h)&&(c[h]=void 0===b[h]&&void 0!==f?f[h]:b[h])}var h=arguments.length-2;if(1===h)c.children=e;else if(1<h){f=Array(h);for(var l=0;l<h;l++)f[l]=arguments[l+2];c.children=f}return{$$typeof:r,type:a.type,key:d,ref:g,props:c,_owner:k}},createFactory:function(a){var b=J.bind(null,a);b.type=a;return b},
7476
+ isValidElement:K,version:"16.2.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:G,assign:m}},V=Object.freeze({default:U}),W=V&&U||V;module.exports=W["default"]?W["default"]:W;
7477
+
7478
+
7479
+ /***/ }),
7480
+ /* 41 */
7481
+ /***/ (function(module, exports, __webpack_require__) {
7482
+
7483
+ "use strict";
7484
+ /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.2.0
7485
+ * react.development.js
7486
+ *
7487
+ * Copyright (c) 2013-present, Facebook, Inc.
7488
+ *
7489
+ * This source code is licensed under the MIT license found in the
7490
+ * LICENSE file in the root directory of this source tree.
7491
+ */
7492
+
7493
+
7494
+
7495
+
7496
+
7497
+ if (process.env.NODE_ENV !== "production") {
7498
+ (function() {
7499
+ 'use strict';
7500
+
7501
+ var _assign = __webpack_require__(6);
7502
+ var emptyObject = __webpack_require__(8);
7503
+ var invariant = __webpack_require__(7);
7504
+ var warning = __webpack_require__(9);
7505
+ var emptyFunction = __webpack_require__(2);
7506
+ var checkPropTypes = __webpack_require__(12);
7507
+
7508
+ // TODO: this is special because it gets imported during build.
7509
+
7510
+ var ReactVersion = '16.2.0';
7511
+
7512
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
7513
+ // nor polyfill, then a plain number is used for performance.
7514
+ var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
7515
+
7516
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7;
7517
+ var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
7518
+ var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
7519
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
7520
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
7521
+
7522
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
7523
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
7524
+
7525
+ function getIteratorFn(maybeIterable) {
7526
+ if (maybeIterable === null || typeof maybeIterable === 'undefined') {
7527
+ return null;
7528
+ }
7529
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
7530
+ if (typeof maybeIterator === 'function') {
7531
+ return maybeIterator;
7532
+ }
7533
+ return null;
7534
+ }
7535
+
7536
+ /**
7537
+ * WARNING: DO NOT manually require this module.
7538
+ * This is a replacement for `invariant(...)` used by the error code system
7539
+ * and will _only_ be required by the corresponding babel pass.
7540
+ * It always throws.
7541
+ */
7542
+
7543
+ /**
7544
+ * Forked from fbjs/warning:
7545
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
7546
+ *
7547
+ * Only change is we use console.warn instead of console.error,
7548
+ * and do nothing when 'console' is not supported.
7549
+ * This really simplifies the code.
7550
+ * ---
7551
+ * Similar to invariant but only logs a warning if the condition is not met.
7552
+ * This can be used to log issues in development environments in critical
7553
+ * paths. Removing the logging code for production environments will keep the
7554
+ * same logic and follow the same code paths.
7555
+ */
7556
+
7557
+ var lowPriorityWarning = function () {};
7558
+
7559
+ {
7560
+ var printWarning = function (format) {
7561
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
7562
+ args[_key - 1] = arguments[_key];
7563
+ }
7564
+
7565
+ var argIndex = 0;
7566
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
7567
+ return args[argIndex++];
7568
+ });
7569
+ if (typeof console !== 'undefined') {
7570
+ console.warn(message);
7571
+ }
7572
+ try {
7573
+ // --- Welcome to debugging React ---
7574
+ // This error was thrown as a convenience so that you can use this stack
7575
+ // to find the callsite that caused this warning to fire.
7576
+ throw new Error(message);
7577
+ } catch (x) {}
7578
+ };
7579
+
7580
+ lowPriorityWarning = function (condition, format) {
7581
+ if (format === undefined) {
7582
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
7583
+ }
7584
+ if (!condition) {
7585
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
7586
+ args[_key2 - 2] = arguments[_key2];
7587
+ }
7588
+
7589
+ printWarning.apply(undefined, [format].concat(args));
7590
+ }
7591
+ };
7592
+ }
7593
+
7594
+ var lowPriorityWarning$1 = lowPriorityWarning;
7595
+
7596
+ var didWarnStateUpdateForUnmountedComponent = {};
7597
+
7598
+ function warnNoop(publicInstance, callerName) {
7599
+ {
7600
+ var constructor = publicInstance.constructor;
7601
+ var componentName = constructor && (constructor.displayName || constructor.name) || 'ReactClass';
7602
+ var warningKey = componentName + '.' + callerName;
7603
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
7604
+ return;
7605
+ }
7606
+ warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
7607
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
7608
+ }
7609
+ }
7610
+
7611
+ /**
7612
+ * This is the abstract API for an update queue.
7613
+ */
7614
+ var ReactNoopUpdateQueue = {
7615
+ /**
7616
+ * Checks whether or not this composite component is mounted.
7617
+ * @param {ReactClass} publicInstance The instance we want to test.
7618
+ * @return {boolean} True if mounted, false otherwise.
7619
+ * @protected
7620
+ * @final
7621
+ */
7622
+ isMounted: function (publicInstance) {
7623
+ return false;
7624
+ },
7625
+
7626
+ /**
7627
+ * Forces an update. This should only be invoked when it is known with
7628
+ * certainty that we are **not** in a DOM transaction.
7629
+ *
7630
+ * You may want to call this when you know that some deeper aspect of the
7631
+ * component's state has changed but `setState` was not called.
7632
+ *
7633
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
7634
+ * `componentWillUpdate` and `componentDidUpdate`.
7635
+ *
7636
+ * @param {ReactClass} publicInstance The instance that should rerender.
7637
+ * @param {?function} callback Called after component is updated.
7638
+ * @param {?string} callerName name of the calling function in the public API.
7639
+ * @internal
7640
+ */
7641
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
7642
+ warnNoop(publicInstance, 'forceUpdate');
7643
+ },
7644
+
7645
+ /**
7646
+ * Replaces all of the state. Always use this or `setState` to mutate state.
7647
+ * You should treat `this.state` as immutable.
7648
+ *
7649
+ * There is no guarantee that `this.state` will be immediately updated, so
7650
+ * accessing `this.state` after calling this method may return the old value.
7651
+ *
7652
+ * @param {ReactClass} publicInstance The instance that should rerender.
7653
+ * @param {object} completeState Next state.
7654
+ * @param {?function} callback Called after component is updated.
7655
+ * @param {?string} callerName name of the calling function in the public API.
7656
+ * @internal
7657
+ */
7658
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
7659
+ warnNoop(publicInstance, 'replaceState');
7660
+ },
7661
+
7662
+ /**
7663
+ * Sets a subset of the state. This only exists because _pendingState is
7664
+ * internal. This provides a merging strategy that is not available to deep
7665
+ * properties which is confusing. TODO: Expose pendingState or don't use it
7666
+ * during the merge.
7667
+ *
7668
+ * @param {ReactClass} publicInstance The instance that should rerender.
7669
+ * @param {object} partialState Next partial state to be merged with state.
7670
+ * @param {?function} callback Called after component is updated.
7671
+ * @param {?string} Name of the calling function in the public API.
7672
+ * @internal
7673
+ */
7674
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
7675
+ warnNoop(publicInstance, 'setState');
7676
+ }
7677
+ };
7678
+
7679
+ /**
7680
+ * Base class helpers for the updating state of a component.
7681
+ */
7682
+ function Component(props, context, updater) {
7683
+ this.props = props;
7684
+ this.context = context;
7685
+ this.refs = emptyObject;
7686
+ // We initialize the default updater but the real one gets injected by the
7687
+ // renderer.
7688
+ this.updater = updater || ReactNoopUpdateQueue;
7689
+ }
7690
+
7691
+ Component.prototype.isReactComponent = {};
7692
+
7693
+ /**
7694
+ * Sets a subset of the state. Always use this to mutate
7695
+ * state. You should treat `this.state` as immutable.
7696
+ *
7697
+ * There is no guarantee that `this.state` will be immediately updated, so
7698
+ * accessing `this.state` after calling this method may return the old value.
7699
+ *
7700
+ * There is no guarantee that calls to `setState` will run synchronously,
7701
+ * as they may eventually be batched together. You can provide an optional
7702
+ * callback that will be executed when the call to setState is actually
7703
+ * completed.
7704
+ *
7705
+ * When a function is provided to setState, it will be called at some point in
7706
+ * the future (not synchronously). It will be called with the up to date
7707
+ * component arguments (state, props, context). These values can be different
7708
+ * from this.* because your function may be called after receiveProps but before
7709
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
7710
+ * assigned to this.
7711
+ *
7712
+ * @param {object|function} partialState Next partial state or function to
7713
+ * produce next partial state to be merged with current state.
7714
+ * @param {?function} callback Called after state is updated.
7715
+ * @final
7716
+ * @protected
7717
+ */
7718
+ Component.prototype.setState = function (partialState, callback) {
7719
+ !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
7720
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
7721
+ };
7722
+
7723
+ /**
7724
+ * Forces an update. This should only be invoked when it is known with
7725
+ * certainty that we are **not** in a DOM transaction.
7726
+ *
7727
+ * You may want to call this when you know that some deeper aspect of the
7728
+ * component's state has changed but `setState` was not called.
7729
+ *
7730
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
7731
+ * `componentWillUpdate` and `componentDidUpdate`.
7732
+ *
7733
+ * @param {?function} callback Called after update is complete.
7734
+ * @final
7735
+ * @protected
7736
+ */
7737
+ Component.prototype.forceUpdate = function (callback) {
7738
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
7739
+ };
7740
+
7741
+ /**
7742
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
7743
+ * we would like to deprecate them, we're not going to move them over to this
7744
+ * modern base class. Instead, we define a getter that warns if it's accessed.
7745
+ */
7746
+ {
7747
+ var deprecatedAPIs = {
7748
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
7749
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
7750
+ };
7751
+ var defineDeprecationWarning = function (methodName, info) {
7752
+ Object.defineProperty(Component.prototype, methodName, {
7753
+ get: function () {
7754
+ lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
7755
+ return undefined;
7756
+ }
7757
+ });
7758
+ };
7759
+ for (var fnName in deprecatedAPIs) {
7760
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
7761
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
7762
+ }
7763
+ }
7764
+ }
7765
+
7766
+ /**
7767
+ * Base class helpers for the updating state of a component.
7768
+ */
7769
+ function PureComponent(props, context, updater) {
7770
+ // Duplicated from Component.
7771
+ this.props = props;
7772
+ this.context = context;
7773
+ this.refs = emptyObject;
7774
+ // We initialize the default updater but the real one gets injected by the
7775
+ // renderer.
7776
+ this.updater = updater || ReactNoopUpdateQueue;
7777
+ }
7778
+
7779
+ function ComponentDummy() {}
7780
+ ComponentDummy.prototype = Component.prototype;
7781
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
7782
+ pureComponentPrototype.constructor = PureComponent;
7783
+ // Avoid an extra prototype jump for these methods.
7784
+ _assign(pureComponentPrototype, Component.prototype);
7785
+ pureComponentPrototype.isPureReactComponent = true;
7786
+
7787
+ function AsyncComponent(props, context, updater) {
7788
+ // Duplicated from Component.
7789
+ this.props = props;
7790
+ this.context = context;
7791
+ this.refs = emptyObject;
7792
+ // We initialize the default updater but the real one gets injected by the
7793
+ // renderer.
7794
+ this.updater = updater || ReactNoopUpdateQueue;
7795
+ }
7796
+
7797
+ var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
7798
+ asyncComponentPrototype.constructor = AsyncComponent;
7799
+ // Avoid an extra prototype jump for these methods.
7800
+ _assign(asyncComponentPrototype, Component.prototype);
7801
+ asyncComponentPrototype.unstable_isAsyncReactComponent = true;
7802
+ asyncComponentPrototype.render = function () {
7803
+ return this.props.children;
7804
+ };
7805
+
7806
+ /**
7807
+ * Keeps track of the current owner.
7808
+ *
7809
+ * The current owner is the component who should own any components that are
7810
+ * currently being constructed.
7811
+ */
7812
+ var ReactCurrentOwner = {
7813
+ /**
7814
+ * @internal
7815
+ * @type {ReactComponent}
7816
+ */
7817
+ current: null
7818
+ };
7819
+
7820
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
7821
+
7822
+ var RESERVED_PROPS = {
7823
+ key: true,
7824
+ ref: true,
7825
+ __self: true,
7826
+ __source: true
7827
+ };
7828
+
7829
+ var specialPropKeyWarningShown;
7830
+ var specialPropRefWarningShown;
7831
+
7832
+ function hasValidRef(config) {
7833
+ {
7834
+ if (hasOwnProperty.call(config, 'ref')) {
7835
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
7836
+ if (getter && getter.isReactWarning) {
7837
+ return false;
7838
+ }
7839
+ }
7840
+ }
7841
+ return config.ref !== undefined;
7842
+ }
7843
+
7844
+ function hasValidKey(config) {
7845
+ {
7846
+ if (hasOwnProperty.call(config, 'key')) {
7847
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
7848
+ if (getter && getter.isReactWarning) {
7849
+ return false;
7850
+ }
7851
+ }
7852
+ }
7853
+ return config.key !== undefined;
7854
+ }
7855
+
7856
+ function defineKeyPropWarningGetter(props, displayName) {
7857
+ var warnAboutAccessingKey = function () {
7858
+ if (!specialPropKeyWarningShown) {
7859
+ specialPropKeyWarningShown = true;
7860
+ warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
7861
+ }
7862
+ };
7863
+ warnAboutAccessingKey.isReactWarning = true;
7864
+ Object.defineProperty(props, 'key', {
7865
+ get: warnAboutAccessingKey,
7866
+ configurable: true
7867
+ });
7868
+ }
7869
+
7870
+ function defineRefPropWarningGetter(props, displayName) {
7871
+ var warnAboutAccessingRef = function () {
7872
+ if (!specialPropRefWarningShown) {
7873
+ specialPropRefWarningShown = true;
7874
+ warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
7875
+ }
7876
+ };
7877
+ warnAboutAccessingRef.isReactWarning = true;
7878
+ Object.defineProperty(props, 'ref', {
7879
+ get: warnAboutAccessingRef,
7880
+ configurable: true
7881
+ });
7882
+ }
7883
+
7884
+ /**
7885
+ * Factory method to create a new React element. This no longer adheres to
7886
+ * the class pattern, so do not use new to call it. Also, no instanceof check
7887
+ * will work. Instead test $$typeof field against Symbol.for('react.element') to check
7888
+ * if something is a React Element.
7889
+ *
7890
+ * @param {*} type
7891
+ * @param {*} key
7892
+ * @param {string|object} ref
7893
+ * @param {*} self A *temporary* helper to detect places where `this` is
7894
+ * different from the `owner` when React.createElement is called, so that we
7895
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
7896
+ * functions, and as long as `this` and owner are the same, there will be no
7897
+ * change in behavior.
7898
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
7899
+ * indicating filename, line number, and/or other information.
7900
+ * @param {*} owner
7901
+ * @param {*} props
7902
+ * @internal
7903
+ */
7904
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
7905
+ var element = {
7906
+ // This tag allow us to uniquely identify this as a React Element
7907
+ $$typeof: REACT_ELEMENT_TYPE,
7908
+
7909
+ // Built-in properties that belong on the element
7910
+ type: type,
7911
+ key: key,
7912
+ ref: ref,
7913
+ props: props,
7914
+
7915
+ // Record the component responsible for creating this element.
7916
+ _owner: owner
7917
+ };
7918
+
7919
+ {
7920
+ // The validation flag is currently mutative. We put it on
7921
+ // an external backing store so that we can freeze the whole object.
7922
+ // This can be replaced with a WeakMap once they are implemented in
7923
+ // commonly used development environments.
7924
+ element._store = {};
7925
+
7926
+ // To make comparing ReactElements easier for testing purposes, we make
7927
+ // the validation flag non-enumerable (where possible, which should
7928
+ // include every environment we run tests in), so the test framework
7929
+ // ignores it.
7930
+ Object.defineProperty(element._store, 'validated', {
7931
+ configurable: false,
7932
+ enumerable: false,
7933
+ writable: true,
7934
+ value: false
7935
+ });
7936
+ // self and source are DEV only properties.
7937
+ Object.defineProperty(element, '_self', {
7938
+ configurable: false,
7939
+ enumerable: false,
7940
+ writable: false,
7941
+ value: self
7942
+ });
7943
+ // Two elements created in two different places should be considered
7944
+ // equal for testing purposes and therefore we hide it from enumeration.
7945
+ Object.defineProperty(element, '_source', {
7946
+ configurable: false,
7947
+ enumerable: false,
7948
+ writable: false,
7949
+ value: source
7950
+ });
7951
+ if (Object.freeze) {
7952
+ Object.freeze(element.props);
7953
+ Object.freeze(element);
7954
+ }
7955
+ }
7956
+
7957
+ return element;
7958
+ };
7959
+
7960
+ /**
7961
+ * Create and return a new ReactElement of the given type.
7962
+ * See https://reactjs.org/docs/react-api.html#createelement
7963
+ */
7964
+ function createElement(type, config, children) {
7965
+ var propName;
7966
+
7967
+ // Reserved names are extracted
7968
+ var props = {};
7969
+
7970
+ var key = null;
7971
+ var ref = null;
7972
+ var self = null;
7973
+ var source = null;
7974
+
7975
+ if (config != null) {
7976
+ if (hasValidRef(config)) {
7977
+ ref = config.ref;
7978
+ }
7979
+ if (hasValidKey(config)) {
7980
+ key = '' + config.key;
7981
+ }
7982
+
7983
+ self = config.__self === undefined ? null : config.__self;
7984
+ source = config.__source === undefined ? null : config.__source;
7985
+ // Remaining properties are added to a new props object
7986
+ for (propName in config) {
7987
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
7988
+ props[propName] = config[propName];
7989
+ }
7990
+ }
7991
+ }
7992
+
7993
+ // Children can be more than one argument, and those are transferred onto
7994
+ // the newly allocated props object.
7995
+ var childrenLength = arguments.length - 2;
7996
+ if (childrenLength === 1) {
7997
+ props.children = children;
7998
+ } else if (childrenLength > 1) {
7999
+ var childArray = Array(childrenLength);
8000
+ for (var i = 0; i < childrenLength; i++) {
8001
+ childArray[i] = arguments[i + 2];
8002
+ }
8003
+ {
8004
+ if (Object.freeze) {
8005
+ Object.freeze(childArray);
8006
+ }
8007
+ }
8008
+ props.children = childArray;
8009
+ }
8010
+
8011
+ // Resolve default props
8012
+ if (type && type.defaultProps) {
8013
+ var defaultProps = type.defaultProps;
8014
+ for (propName in defaultProps) {
8015
+ if (props[propName] === undefined) {
8016
+ props[propName] = defaultProps[propName];
8017
+ }
8018
+ }
8019
+ }
8020
+ {
8021
+ if (key || ref) {
8022
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
8023
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
8024
+ if (key) {
8025
+ defineKeyPropWarningGetter(props, displayName);
8026
+ }
8027
+ if (ref) {
8028
+ defineRefPropWarningGetter(props, displayName);
8029
+ }
8030
+ }
8031
+ }
8032
+ }
8033
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
8034
+ }
8035
+
8036
+ /**
8037
+ * Return a function that produces ReactElements of a given type.
8038
+ * See https://reactjs.org/docs/react-api.html#createfactory
8039
+ */
8040
+
8041
+
8042
+ function cloneAndReplaceKey(oldElement, newKey) {
8043
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
8044
+
8045
+ return newElement;
8046
+ }
8047
+
8048
+ /**
8049
+ * Clone and return a new ReactElement using element as the starting point.
8050
+ * See https://reactjs.org/docs/react-api.html#cloneelement
8051
+ */
8052
+ function cloneElement(element, config, children) {
8053
+ var propName;
8054
+
8055
+ // Original props are copied
8056
+ var props = _assign({}, element.props);
8057
+
8058
+ // Reserved names are extracted
8059
+ var key = element.key;
8060
+ var ref = element.ref;
8061
+ // Self is preserved since the owner is preserved.
8062
+ var self = element._self;
8063
+ // Source is preserved since cloneElement is unlikely to be targeted by a
8064
+ // transpiler, and the original source is probably a better indicator of the
8065
+ // true owner.
8066
+ var source = element._source;
8067
+
8068
+ // Owner will be preserved, unless ref is overridden
8069
+ var owner = element._owner;
8070
+
8071
+ if (config != null) {
8072
+ if (hasValidRef(config)) {
8073
+ // Silently steal the ref from the parent.
8074
+ ref = config.ref;
8075
+ owner = ReactCurrentOwner.current;
8076
+ }
8077
+ if (hasValidKey(config)) {
8078
+ key = '' + config.key;
8079
+ }
8080
+
8081
+ // Remaining properties override existing props
8082
+ var defaultProps;
8083
+ if (element.type && element.type.defaultProps) {
8084
+ defaultProps = element.type.defaultProps;
8085
+ }
8086
+ for (propName in config) {
8087
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
8088
+ if (config[propName] === undefined && defaultProps !== undefined) {
8089
+ // Resolve default props
8090
+ props[propName] = defaultProps[propName];
8091
+ } else {
8092
+ props[propName] = config[propName];
8093
+ }
8094
+ }
8095
+ }
8096
+ }
8097
+
8098
+ // Children can be more than one argument, and those are transferred onto
8099
+ // the newly allocated props object.
8100
+ var childrenLength = arguments.length - 2;
8101
+ if (childrenLength === 1) {
8102
+ props.children = children;
8103
+ } else if (childrenLength > 1) {
8104
+ var childArray = Array(childrenLength);
8105
+ for (var i = 0; i < childrenLength; i++) {
8106
+ childArray[i] = arguments[i + 2];
8107
+ }
8108
+ props.children = childArray;
8109
+ }
8110
+
8111
+ return ReactElement(element.type, key, ref, self, source, owner, props);
8112
+ }
8113
+
8114
+ /**
8115
+ * Verifies the object is a ReactElement.
8116
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
8117
+ * @param {?object} object
8118
+ * @return {boolean} True if `object` is a valid component.
8119
+ * @final
8120
+ */
8121
+ function isValidElement(object) {
8122
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
8123
+ }
8124
+
8125
+ var ReactDebugCurrentFrame = {};
8126
+
8127
+ {
8128
+ // Component that is being worked on
8129
+ ReactDebugCurrentFrame.getCurrentStack = null;
8130
+
8131
+ ReactDebugCurrentFrame.getStackAddendum = function () {
8132
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
8133
+ if (impl) {
8134
+ return impl();
8135
+ }
8136
+ return null;
8137
+ };
8138
+ }
8139
+
8140
+ var SEPARATOR = '.';
8141
+ var SUBSEPARATOR = ':';
8142
+
8143
+ /**
8144
+ * Escape and wrap key so it is safe to use as a reactid
8145
+ *
8146
+ * @param {string} key to be escaped.
8147
+ * @return {string} the escaped key.
8148
+ */
8149
+ function escape(key) {
8150
+ var escapeRegex = /[=:]/g;
8151
+ var escaperLookup = {
8152
+ '=': '=0',
8153
+ ':': '=2'
8154
+ };
8155
+ var escapedString = ('' + key).replace(escapeRegex, function (match) {
8156
+ return escaperLookup[match];
8157
+ });
8158
+
8159
+ return '$' + escapedString;
8160
+ }
8161
+
8162
+ /**
8163
+ * TODO: Test that a single child and an array with one item have the same key
8164
+ * pattern.
8165
+ */
8166
+
8167
+ var didWarnAboutMaps = false;
8168
+
8169
+ var userProvidedKeyEscapeRegex = /\/+/g;
8170
+ function escapeUserProvidedKey(text) {
8171
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
8172
+ }
8173
+
8174
+ var POOL_SIZE = 10;
8175
+ var traverseContextPool = [];
8176
+ function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
8177
+ if (traverseContextPool.length) {
8178
+ var traverseContext = traverseContextPool.pop();
8179
+ traverseContext.result = mapResult;
8180
+ traverseContext.keyPrefix = keyPrefix;
8181
+ traverseContext.func = mapFunction;
8182
+ traverseContext.context = mapContext;
8183
+ traverseContext.count = 0;
8184
+ return traverseContext;
8185
+ } else {
8186
+ return {
8187
+ result: mapResult,
8188
+ keyPrefix: keyPrefix,
8189
+ func: mapFunction,
8190
+ context: mapContext,
8191
+ count: 0
8192
+ };
8193
+ }
8194
+ }
8195
+
8196
+ function releaseTraverseContext(traverseContext) {
8197
+ traverseContext.result = null;
8198
+ traverseContext.keyPrefix = null;
8199
+ traverseContext.func = null;
8200
+ traverseContext.context = null;
8201
+ traverseContext.count = 0;
8202
+ if (traverseContextPool.length < POOL_SIZE) {
8203
+ traverseContextPool.push(traverseContext);
8204
+ }
8205
+ }
8206
+
8207
+ /**
8208
+ * @param {?*} children Children tree container.
8209
+ * @param {!string} nameSoFar Name of the key path so far.
8210
+ * @param {!function} callback Callback to invoke with each child found.
8211
+ * @param {?*} traverseContext Used to pass information throughout the traversal
8212
+ * process.
8213
+ * @return {!number} The number of children in this subtree.
8214
+ */
8215
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
8216
+ var type = typeof children;
8217
+
8218
+ if (type === 'undefined' || type === 'boolean') {
8219
+ // All of the above are perceived as null.
8220
+ children = null;
8221
+ }
8222
+
8223
+ var invokeCallback = false;
8224
+
8225
+ if (children === null) {
8226
+ invokeCallback = true;
8227
+ } else {
8228
+ switch (type) {
8229
+ case 'string':
8230
+ case 'number':
8231
+ invokeCallback = true;
8232
+ break;
8233
+ case 'object':
8234
+ switch (children.$$typeof) {
8235
+ case REACT_ELEMENT_TYPE:
8236
+ case REACT_CALL_TYPE:
8237
+ case REACT_RETURN_TYPE:
8238
+ case REACT_PORTAL_TYPE:
8239
+ invokeCallback = true;
8240
+ }
8241
+ }
8242
+ }
8243
+
8244
+ if (invokeCallback) {
8245
+ callback(traverseContext, children,
8246
+ // If it's the only child, treat the name as if it was wrapped in an array
8247
+ // so that it's consistent if the number of children grows.
8248
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
8249
+ return 1;
8250
+ }
8251
+
8252
+ var child;
8253
+ var nextName;
8254
+ var subtreeCount = 0; // Count of children found in the current subtree.
8255
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
8256
+
8257
+ if (Array.isArray(children)) {
8258
+ for (var i = 0; i < children.length; i++) {
8259
+ child = children[i];
8260
+ nextName = nextNamePrefix + getComponentKey(child, i);
8261
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
8262
+ }
8263
+ } else {
8264
+ var iteratorFn = getIteratorFn(children);
8265
+ if (typeof iteratorFn === 'function') {
8266
+ {
8267
+ // Warn about using Maps as children
8268
+ if (iteratorFn === children.entries) {
8269
+ warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum());
8270
+ didWarnAboutMaps = true;
8271
+ }
8272
+ }
8273
+
8274
+ var iterator = iteratorFn.call(children);
8275
+ var step;
8276
+ var ii = 0;
8277
+ while (!(step = iterator.next()).done) {
8278
+ child = step.value;
8279
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
8280
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
8281
+ }
8282
+ } else if (type === 'object') {
8283
+ var addendum = '';
8284
+ {
8285
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
8286
+ }
8287
+ var childrenString = '' + children;
8288
+ invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
8289
+ }
8290
+ }
8291
+
8292
+ return subtreeCount;
8293
+ }
8294
+
8295
+ /**
8296
+ * Traverses children that are typically specified as `props.children`, but
8297
+ * might also be specified through attributes:
8298
+ *
8299
+ * - `traverseAllChildren(this.props.children, ...)`
8300
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
8301
+ *
8302
+ * The `traverseContext` is an optional argument that is passed through the
8303
+ * entire traversal. It can be used to store accumulations or anything else that
8304
+ * the callback might find relevant.
8305
+ *
8306
+ * @param {?*} children Children tree object.
8307
+ * @param {!function} callback To invoke upon traversing each child.
8308
+ * @param {?*} traverseContext Context for traversal.
8309
+ * @return {!number} The number of children in this subtree.
8310
+ */
8311
+ function traverseAllChildren(children, callback, traverseContext) {
8312
+ if (children == null) {
8313
+ return 0;
8314
+ }
8315
+
8316
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
8317
+ }
8318
+
8319
+ /**
8320
+ * Generate a key string that identifies a component within a set.
8321
+ *
8322
+ * @param {*} component A component that could contain a manual key.
8323
+ * @param {number} index Index that is used if a manual key is not provided.
8324
+ * @return {string}
8325
+ */
8326
+ function getComponentKey(component, index) {
8327
+ // Do some typechecking here since we call this blindly. We want to ensure
8328
+ // that we don't block potential future ES APIs.
8329
+ if (typeof component === 'object' && component !== null && component.key != null) {
8330
+ // Explicit key
8331
+ return escape(component.key);
8332
+ }
8333
+ // Implicit key determined by the index in the set
8334
+ return index.toString(36);
8335
+ }
8336
+
8337
+ function forEachSingleChild(bookKeeping, child, name) {
8338
+ var func = bookKeeping.func,
8339
+ context = bookKeeping.context;
8340
+
8341
+ func.call(context, child, bookKeeping.count++);
8342
+ }
8343
+
8344
+ /**
8345
+ * Iterates through children that are typically specified as `props.children`.
8346
+ *
8347
+ * See https://reactjs.org/docs/react-api.html#react.children.foreach
8348
+ *
8349
+ * The provided forEachFunc(child, index) will be called for each
8350
+ * leaf child.
8351
+ *
8352
+ * @param {?*} children Children tree container.
8353
+ * @param {function(*, int)} forEachFunc
8354
+ * @param {*} forEachContext Context for forEachContext.
8355
+ */
8356
+ function forEachChildren(children, forEachFunc, forEachContext) {
8357
+ if (children == null) {
8358
+ return children;
8359
+ }
8360
+ var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
8361
+ traverseAllChildren(children, forEachSingleChild, traverseContext);
8362
+ releaseTraverseContext(traverseContext);
8363
+ }
8364
+
8365
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
8366
+ var result = bookKeeping.result,
8367
+ keyPrefix = bookKeeping.keyPrefix,
8368
+ func = bookKeeping.func,
8369
+ context = bookKeeping.context;
8370
+
8371
+
8372
+ var mappedChild = func.call(context, child, bookKeeping.count++);
8373
+ if (Array.isArray(mappedChild)) {
8374
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
8375
+ } else if (mappedChild != null) {
8376
+ if (isValidElement(mappedChild)) {
8377
+ mappedChild = cloneAndReplaceKey(mappedChild,
8378
+ // Keep both the (mapped) and old keys if they differ, just as
8379
+ // traverseAllChildren used to do for objects as children
8380
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
8381
+ }
8382
+ result.push(mappedChild);
8383
+ }
8384
+ }
8385
+
8386
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
8387
+ var escapedPrefix = '';
8388
+ if (prefix != null) {
8389
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
8390
+ }
8391
+ var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
8392
+ traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
8393
+ releaseTraverseContext(traverseContext);
8394
+ }
8395
+
8396
+ /**
8397
+ * Maps children that are typically specified as `props.children`.
8398
+ *
8399
+ * See https://reactjs.org/docs/react-api.html#react.children.map
8400
+ *
8401
+ * The provided mapFunction(child, key, index) will be called for each
8402
+ * leaf child.
8403
+ *
8404
+ * @param {?*} children Children tree container.
8405
+ * @param {function(*, int)} func The map function.
8406
+ * @param {*} context Context for mapFunction.
8407
+ * @return {object} Object containing the ordered map of results.
8408
+ */
8409
+ function mapChildren(children, func, context) {
8410
+ if (children == null) {
8411
+ return children;
8412
+ }
8413
+ var result = [];
8414
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
8415
+ return result;
8416
+ }
8417
+
8418
+ /**
8419
+ * Count the number of children that are typically specified as
8420
+ * `props.children`.
8421
+ *
8422
+ * See https://reactjs.org/docs/react-api.html#react.children.count
8423
+ *
8424
+ * @param {?*} children Children tree container.
8425
+ * @return {number} The number of children.
8426
+ */
8427
+ function countChildren(children, context) {
8428
+ return traverseAllChildren(children, emptyFunction.thatReturnsNull, null);
8429
+ }
8430
+
8431
+ /**
8432
+ * Flatten a children object (typically specified as `props.children`) and
8433
+ * return an array with appropriately re-keyed children.
8434
+ *
8435
+ * See https://reactjs.org/docs/react-api.html#react.children.toarray
8436
+ */
8437
+ function toArray(children) {
8438
+ var result = [];
8439
+ mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
8440
+ return result;
8441
+ }
8442
+
8443
+ /**
8444
+ * Returns the first child in a collection of children and verifies that there
8445
+ * is only one child in the collection.
8446
+ *
8447
+ * See https://reactjs.org/docs/react-api.html#react.children.only
8448
+ *
8449
+ * The current implementation of this function assumes that a single child gets
8450
+ * passed without a wrapper, but the purpose of this helper function is to
8451
+ * abstract away the particular structure of children.
8452
+ *
8453
+ * @param {?object} children Child collection structure.
8454
+ * @return {ReactElement} The first and only `ReactElement` contained in the
8455
+ * structure.
8456
+ */
8457
+ function onlyChild(children) {
8458
+ !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
8459
+ return children;
8460
+ }
8461
+
8462
+ var describeComponentFrame = function (name, source, ownerName) {
8463
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
8464
+ };
8465
+
8466
+ function getComponentName(fiber) {
8467
+ var type = fiber.type;
8468
+
8469
+ if (typeof type === 'string') {
8470
+ return type;
8471
+ }
8472
+ if (typeof type === 'function') {
8473
+ return type.displayName || type.name;
8474
+ }
8475
+ return null;
8476
+ }
8477
+
8478
+ /**
8479
+ * ReactElementValidator provides a wrapper around a element factory
8480
+ * which validates the props passed to the element. This is intended to be
8481
+ * used only in DEV and could be replaced by a static type checker for languages
8482
+ * that support it.
8483
+ */
8484
+
8485
+ {
8486
+ var currentlyValidatingElement = null;
8487
+
8488
+ var propTypesMisspellWarningShown = false;
8489
+
8490
+ var getDisplayName = function (element) {
8491
+ if (element == null) {
8492
+ return '#empty';
8493
+ } else if (typeof element === 'string' || typeof element === 'number') {
8494
+ return '#text';
8495
+ } else if (typeof element.type === 'string') {
8496
+ return element.type;
8497
+ } else if (element.type === REACT_FRAGMENT_TYPE) {
8498
+ return 'React.Fragment';
8499
+ } else {
8500
+ return element.type.displayName || element.type.name || 'Unknown';
8501
+ }
8502
+ };
8503
+
8504
+ var getStackAddendum = function () {
8505
+ var stack = '';
8506
+ if (currentlyValidatingElement) {
8507
+ var name = getDisplayName(currentlyValidatingElement);
8508
+ var owner = currentlyValidatingElement._owner;
8509
+ stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
8510
+ }
8511
+ stack += ReactDebugCurrentFrame.getStackAddendum() || '';
8512
+ return stack;
8513
+ };
8514
+
8515
+ var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
8516
+ }
8517
+
8518
+ function getDeclarationErrorAddendum() {
8519
+ if (ReactCurrentOwner.current) {
8520
+ var name = getComponentName(ReactCurrentOwner.current);
8521
+ if (name) {
8522
+ return '\n\nCheck the render method of `' + name + '`.';
8523
+ }
8524
+ }
8525
+ return '';
8526
+ }
8527
+
8528
+ function getSourceInfoErrorAddendum(elementProps) {
8529
+ if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
8530
+ var source = elementProps.__source;
8531
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
8532
+ var lineNumber = source.lineNumber;
8533
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
8534
+ }
8535
+ return '';
8536
+ }
8537
+
8538
+ /**
8539
+ * Warn if there's no key explicitly set on dynamic arrays of children or
8540
+ * object keys are not valid. This allows us to keep track of children between
8541
+ * updates.
8542
+ */
8543
+ var ownerHasKeyUseWarning = {};
8544
+
8545
+ function getCurrentComponentErrorInfo(parentType) {
8546
+ var info = getDeclarationErrorAddendum();
8547
+
8548
+ if (!info) {
8549
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
8550
+ if (parentName) {
8551
+ info = '\n\nCheck the top-level render call using <' + parentName + '>.';
8552
+ }
8553
+ }
8554
+ return info;
8555
+ }
8556
+
8557
+ /**
8558
+ * Warn if the element doesn't have an explicit key assigned to it.
8559
+ * This element is in an array. The array could grow and shrink or be
8560
+ * reordered. All children that haven't already been validated are required to
8561
+ * have a "key" property assigned to it. Error statuses are cached so a warning
8562
+ * will only be shown once.
8563
+ *
8564
+ * @internal
8565
+ * @param {ReactElement} element Element that requires a key.
8566
+ * @param {*} parentType element's parent's type.
8567
+ */
8568
+ function validateExplicitKey(element, parentType) {
8569
+ if (!element._store || element._store.validated || element.key != null) {
8570
+ return;
8571
+ }
8572
+ element._store.validated = true;
8573
+
8574
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
8575
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
8576
+ return;
8577
+ }
8578
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
8579
+
8580
+ // Usually the current owner is the offender, but if it accepts children as a
8581
+ // property, it may be the creator of the child that's responsible for
8582
+ // assigning it a key.
8583
+ var childOwner = '';
8584
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
8585
+ // Give the component that originally created this child.
8586
+ childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
8587
+ }
8588
+
8589
+ currentlyValidatingElement = element;
8590
+ {
8591
+ warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum());
8592
+ }
8593
+ currentlyValidatingElement = null;
8594
+ }
8595
+
8596
+ /**
8597
+ * Ensure that every element either is passed in a static location, in an
8598
+ * array with an explicit keys property defined, or in an object literal
8599
+ * with valid key property.
8600
+ *
8601
+ * @internal
8602
+ * @param {ReactNode} node Statically passed child of any type.
8603
+ * @param {*} parentType node's parent's type.
8604
+ */
8605
+ function validateChildKeys(node, parentType) {
8606
+ if (typeof node !== 'object') {
8607
+ return;
8608
+ }
8609
+ if (Array.isArray(node)) {
8610
+ for (var i = 0; i < node.length; i++) {
8611
+ var child = node[i];
8612
+ if (isValidElement(child)) {
8613
+ validateExplicitKey(child, parentType);
8614
+ }
8615
+ }
8616
+ } else if (isValidElement(node)) {
8617
+ // This element was passed in a valid location.
8618
+ if (node._store) {
8619
+ node._store.validated = true;
8620
+ }
8621
+ } else if (node) {
8622
+ var iteratorFn = getIteratorFn(node);
8623
+ if (typeof iteratorFn === 'function') {
8624
+ // Entry iterators used to provide implicit keys,
8625
+ // but now we print a separate warning for them later.
8626
+ if (iteratorFn !== node.entries) {
8627
+ var iterator = iteratorFn.call(node);
8628
+ var step;
8629
+ while (!(step = iterator.next()).done) {
8630
+ if (isValidElement(step.value)) {
8631
+ validateExplicitKey(step.value, parentType);
8632
+ }
8633
+ }
8634
+ }
8635
+ }
8636
+ }
8637
+ }
8638
+
8639
+ /**
8640
+ * Given an element, validate that its props follow the propTypes definition,
8641
+ * provided by the type.
8642
+ *
8643
+ * @param {ReactElement} element
8644
+ */
8645
+ function validatePropTypes(element) {
8646
+ var componentClass = element.type;
8647
+ if (typeof componentClass !== 'function') {
8648
+ return;
8649
+ }
8650
+ var name = componentClass.displayName || componentClass.name;
8651
+ var propTypes = componentClass.propTypes;
8652
+ if (propTypes) {
8653
+ currentlyValidatingElement = element;
8654
+ checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
8655
+ currentlyValidatingElement = null;
8656
+ } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {
8657
+ propTypesMisspellWarningShown = true;
8658
+ warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
8659
+ }
8660
+ if (typeof componentClass.getDefaultProps === 'function') {
8661
+ warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
8662
+ }
8663
+ }
8664
+
8665
+ /**
8666
+ * Given a fragment, validate that it can only be provided with fragment props
8667
+ * @param {ReactElement} fragment
8668
+ */
8669
+ function validateFragmentProps(fragment) {
8670
+ currentlyValidatingElement = fragment;
8671
+
8672
+ var _iteratorNormalCompletion = true;
8673
+ var _didIteratorError = false;
8674
+ var _iteratorError = undefined;
8675
+
8676
+ try {
8677
+ for (var _iterator = Object.keys(fragment.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
8678
+ var key = _step.value;
8679
+
8680
+ if (!VALID_FRAGMENT_PROPS.has(key)) {
8681
+ warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
8682
+ break;
8683
+ }
8684
+ }
8685
+ } catch (err) {
8686
+ _didIteratorError = true;
8687
+ _iteratorError = err;
8688
+ } finally {
8689
+ try {
8690
+ if (!_iteratorNormalCompletion && _iterator['return']) {
8691
+ _iterator['return']();
8692
+ }
8693
+ } finally {
8694
+ if (_didIteratorError) {
8695
+ throw _iteratorError;
8696
+ }
8697
+ }
8698
+ }
8699
+
8700
+ if (fragment.ref !== null) {
8701
+ warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
8702
+ }
8703
+
8704
+ currentlyValidatingElement = null;
8705
+ }
8706
+
8707
+ function createElementWithValidation(type, props, children) {
8708
+ var validType = typeof type === 'string' || typeof type === 'function' || typeof type === 'symbol' || typeof type === 'number';
8709
+ // We warn in this case but don't throw. We expect the element creation to
8710
+ // succeed and there will likely be errors in render.
8711
+ if (!validType) {
8712
+ var info = '';
8713
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
8714
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
8715
+ }
8716
+
8717
+ var sourceInfo = getSourceInfoErrorAddendum(props);
8718
+ if (sourceInfo) {
8719
+ info += sourceInfo;
8720
+ } else {
8721
+ info += getDeclarationErrorAddendum();
8722
+ }
8723
+
8724
+ info += getStackAddendum() || '';
8725
+
8726
+ warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
8727
+ }
8728
+
8729
+ var element = createElement.apply(this, arguments);
8730
+
8731
+ // The result can be nullish if a mock or a custom function is used.
8732
+ // TODO: Drop this when these are no longer allowed as the type argument.
8733
+ if (element == null) {
8734
+ return element;
8735
+ }
8736
+
8737
+ // Skip key warning if the type isn't valid since our key validation logic
8738
+ // doesn't expect a non-string/function type and can throw confusing errors.
8739
+ // We don't want exception behavior to differ between dev and prod.
8740
+ // (Rendering will throw with a helpful message and as soon as the type is
8741
+ // fixed, the key warnings will appear.)
8742
+ if (validType) {
8743
+ for (var i = 2; i < arguments.length; i++) {
8744
+ validateChildKeys(arguments[i], type);
8745
+ }
8746
+ }
8747
+
8748
+ if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE) {
8749
+ validateFragmentProps(element);
8750
+ } else {
8751
+ validatePropTypes(element);
8752
+ }
8753
+
8754
+ return element;
8755
+ }
8756
+
8757
+ function createFactoryWithValidation(type) {
8758
+ var validatedFactory = createElementWithValidation.bind(null, type);
8759
+ // Legacy hook TODO: Warn if this is accessed
8760
+ validatedFactory.type = type;
8761
+
8762
+ {
8763
+ Object.defineProperty(validatedFactory, 'type', {
8764
+ enumerable: false,
8765
+ get: function () {
8766
+ lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
8767
+ Object.defineProperty(this, 'type', {
8768
+ value: type
8769
+ });
8770
+ return type;
8771
+ }
8772
+ });
8773
+ }
8774
+
8775
+ return validatedFactory;
8776
+ }
8777
+
8778
+ function cloneElementWithValidation(element, props, children) {
8779
+ var newElement = cloneElement.apply(this, arguments);
8780
+ for (var i = 2; i < arguments.length; i++) {
8781
+ validateChildKeys(arguments[i], newElement.type);
8782
+ }
8783
+ validatePropTypes(newElement);
8784
+ return newElement;
8785
+ }
8786
+
8787
+ var React = {
8788
+ Children: {
8789
+ map: mapChildren,
8790
+ forEach: forEachChildren,
8791
+ count: countChildren,
8792
+ toArray: toArray,
8793
+ only: onlyChild
8794
+ },
8795
+
8796
+ Component: Component,
8797
+ PureComponent: PureComponent,
8798
+ unstable_AsyncComponent: AsyncComponent,
8799
+
8800
+ Fragment: REACT_FRAGMENT_TYPE,
8801
+
8802
+ createElement: createElementWithValidation,
8803
+ cloneElement: cloneElementWithValidation,
8804
+ createFactory: createFactoryWithValidation,
8805
+ isValidElement: isValidElement,
8806
+
8807
+ version: ReactVersion,
8808
+
8809
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
8810
+ ReactCurrentOwner: ReactCurrentOwner,
8811
+ // Used by renderers to avoid bundling object-assign twice in UMD bundles:
8812
+ assign: _assign
8813
+ }
8814
+ };
8815
+
8816
+ {
8817
+ _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
8818
+ // These should not be included in production.
8819
+ ReactDebugCurrentFrame: ReactDebugCurrentFrame,
8820
+ // Shim for React DOM 16.0.0 which still destructured (but not used) this.
8821
+ // TODO: remove in React 17.0.
8822
+ ReactComponentTreeHook: {}
8823
+ });
8824
+ }
8825
+
8826
+
8827
+
8828
+ var React$2 = Object.freeze({
8829
+ default: React
8830
+ });
8831
+
8832
+ var React$3 = ( React$2 && React ) || React$2;
8833
+
8834
+ // TODO: decide on the top-level export form.
8835
+ // This is hacky but makes it work with both Rollup and Jest.
8836
+ var react = React$3['default'] ? React$3['default'] : React$3;
8837
+
8838
+ module.exports = react;
8839
+ })();
8840
+ }
8841
+
8842
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
8843
+
8844
+ /***/ }),
8845
+ /* 42 */
8846
+ /***/ (function(module, exports, __webpack_require__) {
8847
+
8848
+ "use strict";
8849
+ /* WEBPACK VAR INJECTION */(function(process) {
8850
+
8851
+ function checkDCE() {
8852
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
8853
+ if (
8854
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
8855
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
8856
+ ) {
8857
+ return;
8858
+ }
8859
+ if (process.env.NODE_ENV !== 'production') {
8860
+ // This branch is unreachable because this function is only called
8861
+ // in production, but the condition is true only in development.
8862
+ // Therefore if the branch is still here, dead code elimination wasn't
8863
+ // properly applied.
8864
+ // Don't change the message. React DevTools relies on it. Also make sure
8865
+ // this message doesn't occur elsewhere in this function, or it will cause
8866
+ // a false positive.
8867
+ throw new Error('^_^');
8868
+ }
8869
+ try {
8870
+ // Verify that the code above has been dead code eliminated (DCE'd).
8871
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
8872
+ } catch (err) {
8873
+ // DevTools shouldn't crash React, no matter what.
8874
+ // We should still report in case we break this code.
8875
+ console.error(err);
8876
+ }
8877
+ }
8878
+
8879
+ if (process.env.NODE_ENV === 'production') {
8880
+ // DCE check should happen before ReactDOM bundle executes so that
8881
+ // DevTools can report bad minification during injection.
8882
+ checkDCE();
8883
+ module.exports = __webpack_require__(43);
8884
+ } else {
8885
+ module.exports = __webpack_require__(46);
8886
+ }
8887
+
8888
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
8889
+
8890
+ /***/ }),
8891
+ /* 43 */
8892
+ /***/ (function(module, exports, __webpack_require__) {
8893
+
8894
+ "use strict";
8895
+ /** @license React v16.2.0
8896
+ * react-dom.production.min.js
8897
+ *
8898
+ * Copyright (c) 2013-present, Facebook, Inc.
8899
+ *
8900
+ * This source code is licensed under the MIT license found in the
8901
+ * LICENSE file in the root directory of this source tree.
8902
+ */
8903
+
8904
+ /*
8905
+ Modernizr 3.0.0pre (Custom Build) | MIT
8906
+ */
8907
+ var aa=__webpack_require__(1),l=__webpack_require__(19),B=__webpack_require__(6),C=__webpack_require__(2),ba=__webpack_require__(20),da=__webpack_require__(21),ea=__webpack_require__(22),fa=__webpack_require__(23),ia=__webpack_require__(24),D=__webpack_require__(8);
8908
+ function E(a){for(var b=arguments.length-1,c="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,d=0;d<b;d++)c+="\x26args[]\x3d"+encodeURIComponent(arguments[d+1]);b=Error(c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}aa?void 0:E("227");
8909
+ var oa={children:!0,dangerouslySetInnerHTML:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,style:!0};function pa(a,b){return(a&b)===b}
8910
+ var ta={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,HAS_STRING_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(a){var b=ta,c=a.Properties||{},d=a.DOMAttributeNamespaces||{},e=a.DOMAttributeNames||{};a=a.DOMMutationMethods||{};for(var f in c){ua.hasOwnProperty(f)?E("48",f):void 0;var g=f.toLowerCase(),h=c[f];g={attributeName:g,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseProperty:pa(h,b.MUST_USE_PROPERTY),
8911
+ hasBooleanValue:pa(h,b.HAS_BOOLEAN_VALUE),hasNumericValue:pa(h,b.HAS_NUMERIC_VALUE),hasPositiveNumericValue:pa(h,b.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:pa(h,b.HAS_OVERLOADED_BOOLEAN_VALUE),hasStringBooleanValue:pa(h,b.HAS_STRING_BOOLEAN_VALUE)};1>=g.hasBooleanValue+g.hasNumericValue+g.hasOverloadedBooleanValue?void 0:E("50",f);e.hasOwnProperty(f)&&(g.attributeName=e[f]);d.hasOwnProperty(f)&&(g.attributeNamespace=d[f]);a.hasOwnProperty(f)&&(g.mutationMethod=a[f]);ua[f]=g}}},ua={};
8912
+ function va(a,b){if(oa.hasOwnProperty(a)||2<a.length&&("o"===a[0]||"O"===a[0])&&("n"===a[1]||"N"===a[1]))return!1;if(null===b)return!0;switch(typeof b){case "boolean":return oa.hasOwnProperty(a)?a=!0:(b=wa(a))?a=b.hasBooleanValue||b.hasStringBooleanValue||b.hasOverloadedBooleanValue:(a=a.toLowerCase().slice(0,5),a="data-"===a||"aria-"===a),a;case "undefined":case "number":case "string":case "object":return!0;default:return!1}}function wa(a){return ua.hasOwnProperty(a)?ua[a]:null}
8913
+ var xa=ta,ya=xa.MUST_USE_PROPERTY,K=xa.HAS_BOOLEAN_VALUE,za=xa.HAS_NUMERIC_VALUE,Aa=xa.HAS_POSITIVE_NUMERIC_VALUE,Ba=xa.HAS_OVERLOADED_BOOLEAN_VALUE,Ca=xa.HAS_STRING_BOOLEAN_VALUE,Da={Properties:{allowFullScreen:K,async:K,autoFocus:K,autoPlay:K,capture:Ba,checked:ya|K,cols:Aa,contentEditable:Ca,controls:K,"default":K,defer:K,disabled:K,download:Ba,draggable:Ca,formNoValidate:K,hidden:K,loop:K,multiple:ya|K,muted:ya|K,noValidate:K,open:K,playsInline:K,readOnly:K,required:K,reversed:K,rows:Aa,rowSpan:za,
8914
+ scoped:K,seamless:K,selected:ya|K,size:Aa,start:za,span:Aa,spellCheck:Ca,style:0,tabIndex:0,itemScope:K,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:Ca},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(a,b){if(null==b)return a.removeAttribute("value");"number"!==a.type||!1===a.hasAttribute("value")?a.setAttribute("value",""+b):a.validity&&!a.validity.badInput&&a.ownerDocument.activeElement!==a&&
8915
+ a.setAttribute("value",""+b)}}},Ea=xa.HAS_STRING_BOOLEAN_VALUE,M={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Ga={Properties:{autoReverse:Ea,externalResourcesRequired:Ea,preserveAlpha:Ea},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:M.xlink,xlinkArcrole:M.xlink,xlinkHref:M.xlink,xlinkRole:M.xlink,xlinkShow:M.xlink,xlinkTitle:M.xlink,xlinkType:M.xlink,
8916
+ xmlBase:M.xml,xmlLang:M.xml,xmlSpace:M.xml}},Ha=/[\-\:]([a-z])/g;function Ia(a){return a[1].toUpperCase()}
8917
+ "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(a){var b=a.replace(Ha,
8918
+ Ia);Ga.Properties[b]=0;Ga.DOMAttributeNames[b]=a});xa.injectDOMPropertyConfig(Da);xa.injectDOMPropertyConfig(Ga);
8919
+ var P={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(a){"function"!==typeof a.invokeGuardedCallback?E("197"):void 0;Ja=a.invokeGuardedCallback}},invokeGuardedCallback:function(a,b,c,d,e,f,g,h,k){Ja.apply(P,arguments)},invokeGuardedCallbackAndCatchFirstError:function(a,b,c,d,e,f,g,h,k){P.invokeGuardedCallback.apply(this,arguments);if(P.hasCaughtError()){var q=P.clearCaughtError();P._hasRethrowError||(P._hasRethrowError=!0,P._rethrowError=
8920
+ q)}},rethrowCaughtError:function(){return Ka.apply(P,arguments)},hasCaughtError:function(){return P._hasCaughtError},clearCaughtError:function(){if(P._hasCaughtError){var a=P._caughtError;P._caughtError=null;P._hasCaughtError=!1;return a}E("198")}};function Ja(a,b,c,d,e,f,g,h,k){P._hasCaughtError=!1;P._caughtError=null;var q=Array.prototype.slice.call(arguments,3);try{b.apply(c,q)}catch(v){P._caughtError=v,P._hasCaughtError=!0}}
8921
+ function Ka(){if(P._hasRethrowError){var a=P._rethrowError;P._rethrowError=null;P._hasRethrowError=!1;throw a;}}var La=null,Ma={};
8922
+ function Na(){if(La)for(var a in Ma){var b=Ma[a],c=La.indexOf(a);-1<c?void 0:E("96",a);if(!Oa[c]){b.extractEvents?void 0:E("97",a);Oa[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;Pa.hasOwnProperty(h)?E("99",h):void 0;Pa[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&Qa(k[e],g,h);e=!0}else f.registrationName?(Qa(f.registrationName,g,h),e=!0):e=!1;e?void 0:E("98",d,a)}}}}
8923
+ function Qa(a,b,c){Ra[a]?E("100",a):void 0;Ra[a]=b;Sa[a]=b.eventTypes[c].dependencies}var Oa=[],Pa={},Ra={},Sa={};function Ta(a){La?E("101"):void 0;La=Array.prototype.slice.call(a);Na()}function Ua(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];Ma.hasOwnProperty(c)&&Ma[c]===d||(Ma[c]?E("102",c):void 0,Ma[c]=d,b=!0)}b&&Na()}
8924
+ var Va=Object.freeze({plugins:Oa,eventNameDispatchConfigs:Pa,registrationNameModules:Ra,registrationNameDependencies:Sa,possibleRegistrationNames:null,injectEventPluginOrder:Ta,injectEventPluginsByName:Ua}),Wa=null,Xa=null,Ya=null;function Za(a,b,c,d){b=a.type||"unknown-event";a.currentTarget=Ya(d);P.invokeGuardedCallbackAndCatchFirstError(b,c,void 0,a);a.currentTarget=null}
8925
+ function $a(a,b){null==b?E("30"):void 0;if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function ab(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var bb=null;
8926
+ function cb(a,b){if(a){var c=a._dispatchListeners,d=a._dispatchInstances;if(Array.isArray(c))for(var e=0;e<c.length&&!a.isPropagationStopped();e++)Za(a,b,c[e],d[e]);else c&&Za(a,b,c,d);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}}function db(a){return cb(a,!0)}function gb(a){return cb(a,!1)}var hb={injectEventPluginOrder:Ta,injectEventPluginsByName:Ua};
8927
+ function ib(a,b){var c=a.stateNode;if(!c)return null;var d=Wa(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;c&&"function"!==typeof c?E("231",b,typeof c):void 0;
8928
+ return c}function jb(a,b,c,d){for(var e,f=0;f<Oa.length;f++){var g=Oa[f];g&&(g=g.extractEvents(a,b,c,d))&&(e=$a(e,g))}return e}function kb(a){a&&(bb=$a(bb,a))}function lb(a){var b=bb;bb=null;b&&(a?ab(b,db):ab(b,gb),bb?E("95"):void 0,P.rethrowCaughtError())}var mb=Object.freeze({injection:hb,getListener:ib,extractEvents:jb,enqueueEvents:kb,processEventQueue:lb}),nb=Math.random().toString(36).slice(2),Q="__reactInternalInstance$"+nb,ob="__reactEventHandlers$"+nb;
8929
+ function pb(a){if(a[Q])return a[Q];for(var b=[];!a[Q];)if(b.push(a),a.parentNode)a=a.parentNode;else return null;var c=void 0,d=a[Q];if(5===d.tag||6===d.tag)return d;for(;a&&(d=a[Q]);a=b.pop())c=d;return c}function qb(a){if(5===a.tag||6===a.tag)return a.stateNode;E("33")}function rb(a){return a[ob]||null}
8930
+ var sb=Object.freeze({precacheFiberNode:function(a,b){b[Q]=a},getClosestInstanceFromNode:pb,getInstanceFromNode:function(a){a=a[Q];return!a||5!==a.tag&&6!==a.tag?null:a},getNodeFromInstance:qb,getFiberCurrentPropsFromNode:rb,updateFiberProps:function(a,b){a[ob]=b}});function tb(a){do a=a["return"];while(a&&5!==a.tag);return a?a:null}function ub(a,b,c){for(var d=[];a;)d.push(a),a=tb(a);for(a=d.length;0<a--;)b(d[a],"captured",c);for(a=0;a<d.length;a++)b(d[a],"bubbled",c)}
8931
+ function vb(a,b,c){if(b=ib(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=$a(c._dispatchListeners,b),c._dispatchInstances=$a(c._dispatchInstances,a)}function wb(a){a&&a.dispatchConfig.phasedRegistrationNames&&ub(a._targetInst,vb,a)}function xb(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?tb(b):null;ub(b,vb,a)}}
8932
+ function yb(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=ib(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=$a(c._dispatchListeners,b),c._dispatchInstances=$a(c._dispatchInstances,a))}function zb(a){a&&a.dispatchConfig.registrationName&&yb(a._targetInst,null,a)}function Ab(a){ab(a,wb)}
8933
+ function Bb(a,b,c,d){if(c&&d)a:{var e=c;for(var f=d,g=0,h=e;h;h=tb(h))g++;h=0;for(var k=f;k;k=tb(k))h++;for(;0<g-h;)e=tb(e),g--;for(;0<h-g;)f=tb(f),h--;for(;g--;){if(e===f||e===f.alternate)break a;e=tb(e);f=tb(f)}e=null}else e=null;f=e;for(e=[];c&&c!==f;){g=c.alternate;if(null!==g&&g===f)break;e.push(c);c=tb(c)}for(c=[];d&&d!==f;){g=d.alternate;if(null!==g&&g===f)break;c.push(d);d=tb(d)}for(d=0;d<e.length;d++)yb(e[d],"bubbled",a);for(a=c.length;0<a--;)yb(c[a],"captured",b)}
8934
+ var Cb=Object.freeze({accumulateTwoPhaseDispatches:Ab,accumulateTwoPhaseDispatchesSkipTarget:function(a){ab(a,xb)},accumulateEnterLeaveDispatches:Bb,accumulateDirectDispatches:function(a){ab(a,zb)}}),Db=null;function Eb(){!Db&&l.canUseDOM&&(Db="textContent"in document.documentElement?"textContent":"innerText");return Db}var S={_root:null,_startText:null,_fallbackText:null};
8935
+ function Fb(){if(S._fallbackText)return S._fallbackText;var a,b=S._startText,c=b.length,d,e=Gb(),f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);S._fallbackText=e.slice(a,1<d?1-d:void 0);return S._fallbackText}function Gb(){return"value"in S._root?S._root.value:S._root[Eb()]}
8936
+ var Hb="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),Ib={type:null,target:null,currentTarget:C.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
8937
+ function T(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?C.thatReturnsTrue:C.thatReturnsFalse;this.isPropagationStopped=C.thatReturnsFalse;return this}
8938
+ B(T.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=C.thatReturnsTrue)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=C.thatReturnsTrue)},persist:function(){this.isPersistent=C.thatReturnsTrue},isPersistent:C.thatReturnsFalse,
8939
+ destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;for(a=0;a<Hb.length;a++)this[Hb[a]]=null}});T.Interface=Ib;T.augmentClass=function(a,b){function c(){}c.prototype=this.prototype;var d=new c;B(d,a.prototype);a.prototype=d;a.prototype.constructor=a;a.Interface=B({},this.Interface,b);a.augmentClass=this.augmentClass;Jb(a)};Jb(T);function Kb(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}
8940
+ function Lb(a){a instanceof this?void 0:E("223");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function Jb(a){a.eventPool=[];a.getPooled=Kb;a.release=Lb}function Mb(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Mb,{data:null});function Nb(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Nb,{data:null});var Pb=[9,13,27,32],Vb=l.canUseDOM&&"CompositionEvent"in window,Wb=null;l.canUseDOM&&"documentMode"in document&&(Wb=document.documentMode);var Xb;
8941
+ if(Xb=l.canUseDOM&&"TextEvent"in window&&!Wb){var Yb=window.opera;Xb=!("object"===typeof Yb&&"function"===typeof Yb.version&&12>=parseInt(Yb.version(),10))}
8942
+ var Zb=Xb,$b=l.canUseDOM&&(!Vb||Wb&&8<Wb&&11>=Wb),ac=String.fromCharCode(32),bc={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",
8943
+ captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},cc=!1;
8944
+ function dc(a,b){switch(a){case "topKeyUp":return-1!==Pb.indexOf(b.keyCode);case "topKeyDown":return 229!==b.keyCode;case "topKeyPress":case "topMouseDown":case "topBlur":return!0;default:return!1}}function ec(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var fc=!1;function gc(a,b){switch(a){case "topCompositionEnd":return ec(b);case "topKeyPress":if(32!==b.which)return null;cc=!0;return ac;case "topTextInput":return a=b.data,a===ac&&cc?null:a;default:return null}}
8945
+ function hc(a,b){if(fc)return"topCompositionEnd"===a||!Vb&&dc(a,b)?(a=Fb(),S._root=null,S._startText=null,S._fallbackText=null,fc=!1,a):null;switch(a){case "topPaste":return null;case "topKeyPress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "topCompositionEnd":return $b?null:b.data;default:return null}}
8946
+ var ic={eventTypes:bc,extractEvents:function(a,b,c,d){var e;if(Vb)b:{switch(a){case "topCompositionStart":var f=bc.compositionStart;break b;case "topCompositionEnd":f=bc.compositionEnd;break b;case "topCompositionUpdate":f=bc.compositionUpdate;break b}f=void 0}else fc?dc(a,c)&&(f=bc.compositionEnd):"topKeyDown"===a&&229===c.keyCode&&(f=bc.compositionStart);f?($b&&(fc||f!==bc.compositionStart?f===bc.compositionEnd&&fc&&(e=Fb()):(S._root=d,S._startText=Gb(),fc=!0)),f=Mb.getPooled(f,b,c,d),e?f.data=
8947
+ e:(e=ec(c),null!==e&&(f.data=e)),Ab(f),e=f):e=null;(a=Zb?gc(a,c):hc(a,c))?(b=Nb.getPooled(bc.beforeInput,b,c,d),b.data=a,Ab(b)):b=null;return[e,b]}},jc=null,kc=null,lc=null;function mc(a){if(a=Xa(a)){jc&&"function"===typeof jc.restoreControlledState?void 0:E("194");var b=Wa(a.stateNode);jc.restoreControlledState(a.stateNode,a.type,b)}}var nc={injectFiberControlledHostComponent:function(a){jc=a}};function oc(a){kc?lc?lc.push(a):lc=[a]:kc=a}
8948
+ function pc(){if(kc){var a=kc,b=lc;lc=kc=null;mc(a);if(b)for(a=0;a<b.length;a++)mc(b[a])}}var qc=Object.freeze({injection:nc,enqueueStateRestore:oc,restoreStateIfNeeded:pc});function rc(a,b){return a(b)}var sc=!1;function tc(a,b){if(sc)return rc(a,b);sc=!0;try{return rc(a,b)}finally{sc=!1,pc()}}var uc={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};
8949
+ function vc(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!uc[a.type]:"textarea"===b?!0:!1}function wc(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var xc;l.canUseDOM&&(xc=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));
8950
+ function yc(a,b){if(!l.canUseDOM||b&&!("addEventListener"in document))return!1;b="on"+a;var c=b in document;c||(c=document.createElement("div"),c.setAttribute(b,"return;"),c="function"===typeof c[b]);!c&&xc&&"wheel"===a&&(c=document.implementation.hasFeature("Events.wheel","3.0"));return c}function zc(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
8951
+ function Ac(a){var b=zc(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"function"===typeof c.get&&"function"===typeof c.set)return Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:!0,get:function(){return c.get.call(this)},set:function(a){d=""+a;c.set.call(this,a)}}),{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=null;delete a[b]}}}
8952
+ function Bc(a){a._valueTracker||(a._valueTracker=Ac(a))}function Cc(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=zc(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}var Dc={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}};
8953
+ function Ec(a,b,c){a=T.getPooled(Dc.change,a,b,c);a.type="change";oc(c);Ab(a);return a}var Fc=null,Gc=null;function Hc(a){kb(a);lb(!1)}function Ic(a){var b=qb(a);if(Cc(b))return a}function Jc(a,b){if("topChange"===a)return b}var Kc=!1;l.canUseDOM&&(Kc=yc("input")&&(!document.documentMode||9<document.documentMode));function Lc(){Fc&&(Fc.detachEvent("onpropertychange",Mc),Gc=Fc=null)}function Mc(a){"value"===a.propertyName&&Ic(Gc)&&(a=Ec(Gc,a,wc(a)),tc(Hc,a))}
8954
+ function Nc(a,b,c){"topFocus"===a?(Lc(),Fc=b,Gc=c,Fc.attachEvent("onpropertychange",Mc)):"topBlur"===a&&Lc()}function Oc(a){if("topSelectionChange"===a||"topKeyUp"===a||"topKeyDown"===a)return Ic(Gc)}function Pc(a,b){if("topClick"===a)return Ic(b)}function $c(a,b){if("topInput"===a||"topChange"===a)return Ic(b)}
8955
+ var ad={eventTypes:Dc,_isInputEventSupported:Kc,extractEvents:function(a,b,c,d){var e=b?qb(b):window,f=e.nodeName&&e.nodeName.toLowerCase();if("select"===f||"input"===f&&"file"===e.type)var g=Jc;else if(vc(e))if(Kc)g=$c;else{g=Oc;var h=Nc}else f=e.nodeName,!f||"input"!==f.toLowerCase()||"checkbox"!==e.type&&"radio"!==e.type||(g=Pc);if(g&&(g=g(a,b)))return Ec(g,c,d);h&&h(a,e,b);"topBlur"===a&&null!=b&&(a=b._wrapperState||e._wrapperState)&&a.controlled&&"number"===e.type&&(a=""+e.value,e.getAttribute("value")!==
8956
+ a&&e.setAttribute("value",a))}};function bd(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(bd,{view:null,detail:null});var cd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=cd[a])?!!b[a]:!1}function ed(){return dd}function fd(a,b,c,d){return T.call(this,a,b,c,d)}
8957
+ bd.augmentClass(fd,{screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:ed,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)}});
8958
+ var gd={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},hd={eventTypes:gd,extractEvents:function(a,b,c,d){if("topMouseOver"===a&&(c.relatedTarget||c.fromElement)||"topMouseOut"!==a&&"topMouseOver"!==a)return null;var e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;"topMouseOut"===a?(a=b,b=(b=c.relatedTarget||c.toElement)?pb(b):null):a=null;if(a===
8959
+ b)return null;var f=null==a?e:qb(a);e=null==b?e:qb(b);var g=fd.getPooled(gd.mouseLeave,a,c,d);g.type="mouseleave";g.target=f;g.relatedTarget=e;c=fd.getPooled(gd.mouseEnter,b,c,d);c.type="mouseenter";c.target=e;c.relatedTarget=f;Bb(g,c,a,b);return[g,c]}},id=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;function jd(a){a=a.type;return"string"===typeof a?a:"function"===typeof a?a.displayName||a.name:null}
8960
+ function kd(a){var b=a;if(a.alternate)for(;b["return"];)b=b["return"];else{if(0!==(b.effectTag&2))return 1;for(;b["return"];)if(b=b["return"],0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function ld(a){return(a=a._reactInternalFiber)?2===kd(a):!1}function md(a){2!==kd(a)?E("188"):void 0}
8961
+ function nd(a){var b=a.alternate;if(!b)return b=kd(a),3===b?E("188"):void 0,1===b?null:a;for(var c=a,d=b;;){var e=c["return"],f=e?e.alternate:null;if(!e||!f)break;if(e.child===f.child){for(var g=e.child;g;){if(g===c)return md(e),a;if(g===d)return md(e),b;g=g.sibling}E("188")}if(c["return"]!==d["return"])c=e,d=f;else{g=!1;for(var h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}g?
8962
+ void 0:E("189")}}c.alternate!==d?E("190"):void 0}3!==c.tag?E("188"):void 0;return c.stateNode.current===c?a:b}function od(a){a=nd(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child["return"]=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b["return"]||b["return"]===a)return null;b=b["return"]}b.sibling["return"]=b["return"];b=b.sibling}}return null}
8963
+ function pd(a){a=nd(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child&&4!==b.tag)b.child["return"]=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b["return"]||b["return"]===a)return null;b=b["return"]}b.sibling["return"]=b["return"];b=b.sibling}}return null}var qd=[];
8964
+ function rd(a){var b=a.targetInst;do{if(!b){a.ancestors.push(b);break}var c;for(c=b;c["return"];)c=c["return"];c=3!==c.tag?null:c.stateNode.containerInfo;if(!c)break;a.ancestors.push(b);b=pb(c)}while(b);for(c=0;c<a.ancestors.length;c++)b=a.ancestors[c],sd(a.topLevelType,b,a.nativeEvent,wc(a.nativeEvent))}var td=!0,sd=void 0;function ud(a){td=!!a}function U(a,b,c){return c?ba.listen(c,b,vd.bind(null,a)):null}function wd(a,b,c){return c?ba.capture(c,b,vd.bind(null,a)):null}
8965
+ function vd(a,b){if(td){var c=wc(b);c=pb(c);null===c||"number"!==typeof c.tag||2===kd(c)||(c=null);if(qd.length){var d=qd.pop();d.topLevelType=a;d.nativeEvent=b;d.targetInst=c;a=d}else a={topLevelType:a,nativeEvent:b,targetInst:c,ancestors:[]};try{tc(rd,a)}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,10>qd.length&&qd.push(a)}}}
8966
+ var xd=Object.freeze({get _enabled(){return td},get _handleTopLevel(){return sd},setHandleTopLevel:function(a){sd=a},setEnabled:ud,isEnabled:function(){return td},trapBubbledEvent:U,trapCapturedEvent:wd,dispatchEvent:vd});function yd(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;c["ms"+a]="MS"+b;c["O"+a]="o"+b.toLowerCase();return c}
8967
+ var zd={animationend:yd("Animation","AnimationEnd"),animationiteration:yd("Animation","AnimationIteration"),animationstart:yd("Animation","AnimationStart"),transitionend:yd("Transition","TransitionEnd")},Ad={},Bd={};l.canUseDOM&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete zd.animationend.animation,delete zd.animationiteration.animation,delete zd.animationstart.animation),"TransitionEvent"in window||delete zd.transitionend.transition);
8968
+ function Cd(a){if(Ad[a])return Ad[a];if(!zd[a])return a;var b=zd[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Bd)return Ad[a]=b[c];return""}
8969
+ var Dd={topAbort:"abort",topAnimationEnd:Cd("animationend")||"animationend",topAnimationIteration:Cd("animationiteration")||"animationiteration",topAnimationStart:Cd("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",
8970
+ topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",
8971
+ topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",
8972
+ topTouchStart:"touchstart",topTransitionEnd:Cd("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},Ed={},Fd=0,Gd="_reactListenersID"+(""+Math.random()).slice(2);function Hd(a){Object.prototype.hasOwnProperty.call(a,Gd)||(a[Gd]=Fd++,Ed[a[Gd]]={});return Ed[a[Gd]]}function Id(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
8973
+ function Jd(a,b){var c=Id(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Id(c)}}function Kd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&"text"===a.type||"textarea"===b||"true"===a.contentEditable)}
8974
+ var Ld=l.canUseDOM&&"documentMode"in document&&11>=document.documentMode,Md={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},Nd=null,Od=null,Pd=null,Qd=!1;
8975
+ function Rd(a,b){if(Qd||null==Nd||Nd!==da())return null;var c=Nd;"selectionStart"in c&&Kd(c)?c={start:c.selectionStart,end:c.selectionEnd}:window.getSelection?(c=window.getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}):c=void 0;return Pd&&ea(Pd,c)?null:(Pd=c,a=T.getPooled(Md.select,Od,a,b),a.type="select",a.target=Nd,Ab(a),a)}
8976
+ var Sd={eventTypes:Md,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Hd(e);f=Sa.onSelect;for(var g=0;g<f.length;g++){var h=f[g];if(!e.hasOwnProperty(h)||!e[h]){e=!1;break a}}e=!0}f=!e}if(f)return null;e=b?qb(b):window;switch(a){case "topFocus":if(vc(e)||"true"===e.contentEditable)Nd=e,Od=b,Pd=null;break;case "topBlur":Pd=Od=Nd=null;break;case "topMouseDown":Qd=!0;break;case "topContextMenu":case "topMouseUp":return Qd=!1,Rd(c,d);case "topSelectionChange":if(Ld)break;
8977
+ case "topKeyDown":case "topKeyUp":return Rd(c,d)}return null}};function Td(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Td,{animationName:null,elapsedTime:null,pseudoElement:null});function Ud(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Ud,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}});function Vd(a,b,c,d){return T.call(this,a,b,c,d)}bd.augmentClass(Vd,{relatedTarget:null});
8978
+ function Wd(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;return 32<=a||13===a?a:0}
8979
+ var Xd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",
8980
+ 116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};function Zd(a,b,c,d){return T.call(this,a,b,c,d)}
8981
+ bd.augmentClass(Zd,{key:function(a){if(a.key){var b=Xd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=Wd(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?Yd[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:ed,charCode:function(a){return"keypress"===a.type?Wd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===
8982
+ a.type?Wd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}});function $d(a,b,c,d){return T.call(this,a,b,c,d)}fd.augmentClass($d,{dataTransfer:null});function ae(a,b,c,d){return T.call(this,a,b,c,d)}bd.augmentClass(ae,{touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:ed});function be(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(be,{propertyName:null,elapsedTime:null,pseudoElement:null});
8983
+ function ce(a,b,c,d){return T.call(this,a,b,c,d)}fd.augmentClass(ce,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null});var de={},ee={};
8984
+ "abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel".split(" ").forEach(function(a){var b=a[0].toUpperCase()+
8985
+ a.slice(1),c="on"+b;b="top"+b;c={phasedRegistrationNames:{bubbled:c,captured:c+"Capture"},dependencies:[b]};de[a]=c;ee[b]=c});
8986
+ var fe={eventTypes:de,extractEvents:function(a,b,c,d){var e=ee[a];if(!e)return null;switch(a){case "topKeyPress":if(0===Wd(c))return null;case "topKeyDown":case "topKeyUp":a=Zd;break;case "topBlur":case "topFocus":a=Vd;break;case "topClick":if(2===c.button)return null;case "topDoubleClick":case "topMouseDown":case "topMouseMove":case "topMouseUp":case "topMouseOut":case "topMouseOver":case "topContextMenu":a=fd;break;case "topDrag":case "topDragEnd":case "topDragEnter":case "topDragExit":case "topDragLeave":case "topDragOver":case "topDragStart":case "topDrop":a=
8987
+ $d;break;case "topTouchCancel":case "topTouchEnd":case "topTouchMove":case "topTouchStart":a=ae;break;case "topAnimationEnd":case "topAnimationIteration":case "topAnimationStart":a=Td;break;case "topTransitionEnd":a=be;break;case "topScroll":a=bd;break;case "topWheel":a=ce;break;case "topCopy":case "topCut":case "topPaste":a=Ud;break;default:a=T}b=a.getPooled(e,b,c,d);Ab(b);return b}};sd=function(a,b,c,d){a=jb(a,b,c,d);kb(a);lb(!1)};hb.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));
8988
+ Wa=sb.getFiberCurrentPropsFromNode;Xa=sb.getInstanceFromNode;Ya=sb.getNodeFromInstance;hb.injectEventPluginsByName({SimpleEventPlugin:fe,EnterLeaveEventPlugin:hd,ChangeEventPlugin:ad,SelectEventPlugin:Sd,BeforeInputEventPlugin:ic});var ge=[],he=-1;function V(a){0>he||(a.current=ge[he],ge[he]=null,he--)}function W(a,b){he++;ge[he]=a.current;a.current=b}new Set;var ie={current:D},X={current:!1},je=D;function ke(a){return le(a)?je:ie.current}
8989
+ function me(a,b){var c=a.type.contextTypes;if(!c)return D;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function le(a){return 2===a.tag&&null!=a.type.childContextTypes}function ne(a){le(a)&&(V(X,a),V(ie,a))}
8990
+ function oe(a,b,c){null!=ie.cursor?E("168"):void 0;W(ie,b,a);W(X,c,a)}function pe(a,b){var c=a.stateNode,d=a.type.childContextTypes;if("function"!==typeof c.getChildContext)return b;c=c.getChildContext();for(var e in c)e in d?void 0:E("108",jd(a)||"Unknown",e);return B({},b,c)}function qe(a){if(!le(a))return!1;var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||D;je=ie.current;W(ie,b,a);W(X,X.current,a);return!0}
8991
+ function re(a,b){var c=a.stateNode;c?void 0:E("169");if(b){var d=pe(a,je);c.__reactInternalMemoizedMergedChildContext=d;V(X,a);V(ie,a);W(ie,d,a)}else V(X,a);W(X,b,a)}
8992
+ function Y(a,b,c){this.tag=a;this.key=b;this.stateNode=this.type=null;this.sibling=this.child=this["return"]=null;this.index=0;this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null;this.internalContextTag=c;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.expirationTime=0;this.alternate=null}
8993
+ function se(a,b,c){var d=a.alternate;null===d?(d=new Y(a.tag,a.key,a.internalContextTag),d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.effectTag=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null);d.expirationTime=c;d.pendingProps=b;d.child=a.child;d.memoizedProps=a.memoizedProps;d.memoizedState=a.memoizedState;d.updateQueue=a.updateQueue;d.sibling=a.sibling;d.index=a.index;d.ref=a.ref;return d}
8994
+ function te(a,b,c){var d=void 0,e=a.type,f=a.key;"function"===typeof e?(d=e.prototype&&e.prototype.isReactComponent?new Y(2,f,b):new Y(0,f,b),d.type=e,d.pendingProps=a.props):"string"===typeof e?(d=new Y(5,f,b),d.type=e,d.pendingProps=a.props):"object"===typeof e&&null!==e&&"number"===typeof e.tag?(d=e,d.pendingProps=a.props):E("130",null==e?e:typeof e,"");d.expirationTime=c;return d}function ue(a,b,c,d){b=new Y(10,d,b);b.pendingProps=a;b.expirationTime=c;return b}
8995
+ function ve(a,b,c){b=new Y(6,null,b);b.pendingProps=a;b.expirationTime=c;return b}function we(a,b,c){b=new Y(7,a.key,b);b.type=a.handler;b.pendingProps=a;b.expirationTime=c;return b}function xe(a,b,c){a=new Y(9,null,b);a.expirationTime=c;return a}function ye(a,b,c){b=new Y(4,a.key,b);b.pendingProps=a.children||[];b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}var ze=null,Ae=null;
8996
+ function Be(a){return function(b){try{return a(b)}catch(c){}}}function Ce(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);ze=Be(function(a){return b.onCommitFiberRoot(c,a)});Ae=Be(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function De(a){"function"===typeof ze&&ze(a)}function Ee(a){"function"===typeof Ae&&Ae(a)}
8997
+ function Fe(a){return{baseState:a,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1}}function Ge(a,b){null===a.last?a.first=a.last=b:(a.last.next=b,a.last=b);if(0===a.expirationTime||a.expirationTime>b.expirationTime)a.expirationTime=b.expirationTime}
8998
+ function He(a,b){var c=a.alternate,d=a.updateQueue;null===d&&(d=a.updateQueue=Fe(null));null!==c?(a=c.updateQueue,null===a&&(a=c.updateQueue=Fe(null))):a=null;a=a!==d?a:null;null===a?Ge(d,b):null===d.last||null===a.last?(Ge(d,b),Ge(a,b)):(Ge(d,b),a.last=b)}function Ie(a,b,c,d){a=a.partialState;return"function"===typeof a?a.call(b,c,d):a}
8999
+ function Je(a,b,c,d,e,f){null!==a&&a.updateQueue===c&&(c=b.updateQueue={baseState:c.baseState,expirationTime:c.expirationTime,first:c.first,last:c.last,isInitialized:c.isInitialized,callbackList:null,hasForceUpdate:!1});c.expirationTime=0;c.isInitialized?a=c.baseState:(a=c.baseState=b.memoizedState,c.isInitialized=!0);for(var g=!0,h=c.first,k=!1;null!==h;){var q=h.expirationTime;if(q>f){var v=c.expirationTime;if(0===v||v>q)c.expirationTime=q;k||(k=!0,c.baseState=a)}else{k||(c.first=h.next,null===
9000
+ c.first&&(c.last=null));if(h.isReplace)a=Ie(h,d,a,e),g=!0;else if(q=Ie(h,d,a,e))a=g?B({},a,q):B(a,q),g=!1;h.isForced&&(c.hasForceUpdate=!0);null!==h.callback&&(q=c.callbackList,null===q&&(q=c.callbackList=[]),q.push(h))}h=h.next}null!==c.callbackList?b.effectTag|=32:null!==c.first||c.hasForceUpdate||(b.updateQueue=null);k||(c.baseState=a);return a}
9001
+ function Ke(a,b){var c=a.callbackList;if(null!==c)for(a.callbackList=null,a=0;a<c.length;a++){var d=c[a],e=d.callback;d.callback=null;"function"!==typeof e?E("191",e):void 0;e.call(b)}}
9002
+ function Le(a,b,c,d){function e(a,b){b.updater=f;a.stateNode=b;b._reactInternalFiber=a}var f={isMounted:ld,enqueueSetState:function(c,d,e){c=c._reactInternalFiber;e=void 0===e?null:e;var g=b(c);He(c,{expirationTime:g,partialState:d,callback:e,isReplace:!1,isForced:!1,nextCallback:null,next:null});a(c,g)},enqueueReplaceState:function(c,d,e){c=c._reactInternalFiber;e=void 0===e?null:e;var g=b(c);He(c,{expirationTime:g,partialState:d,callback:e,isReplace:!0,isForced:!1,nextCallback:null,next:null});
9003
+ a(c,g)},enqueueForceUpdate:function(c,d){c=c._reactInternalFiber;d=void 0===d?null:d;var e=b(c);He(c,{expirationTime:e,partialState:null,callback:d,isReplace:!1,isForced:!0,nextCallback:null,next:null});a(c,e)}};return{adoptClassInstance:e,constructClassInstance:function(a,b){var c=a.type,d=ke(a),f=2===a.tag&&null!=a.type.contextTypes,g=f?me(a,d):D;b=new c(b,g);e(a,b);f&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=d,a.__reactInternalMemoizedMaskedChildContext=g);return b},mountClassInstance:function(a,
9004
+ b){var c=a.alternate,d=a.stateNode,e=d.state||null,g=a.pendingProps;g?void 0:E("158");var h=ke(a);d.props=g;d.state=a.memoizedState=e;d.refs=D;d.context=me(a,h);null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent&&(a.internalContextTag|=1);"function"===typeof d.componentWillMount&&(e=d.state,d.componentWillMount(),e!==d.state&&f.enqueueReplaceState(d,d.state,null),e=a.updateQueue,null!==e&&(d.state=Je(c,a,e,d,g,b)));"function"===typeof d.componentDidMount&&(a.effectTag|=
9005
+ 4)},updateClassInstance:function(a,b,e){var g=b.stateNode;g.props=b.memoizedProps;g.state=b.memoizedState;var h=b.memoizedProps,k=b.pendingProps;k||(k=h,null==k?E("159"):void 0);var u=g.context,z=ke(b);z=me(b,z);"function"!==typeof g.componentWillReceiveProps||h===k&&u===z||(u=g.state,g.componentWillReceiveProps(k,z),g.state!==u&&f.enqueueReplaceState(g,g.state,null));u=b.memoizedState;e=null!==b.updateQueue?Je(a,b,b.updateQueue,g,k,e):u;if(!(h!==k||u!==e||X.current||null!==b.updateQueue&&b.updateQueue.hasForceUpdate))return"function"!==
9006
+ typeof g.componentDidUpdate||h===a.memoizedProps&&u===a.memoizedState||(b.effectTag|=4),!1;var G=k;if(null===h||null!==b.updateQueue&&b.updateQueue.hasForceUpdate)G=!0;else{var I=b.stateNode,L=b.type;G="function"===typeof I.shouldComponentUpdate?I.shouldComponentUpdate(G,e,z):L.prototype&&L.prototype.isPureReactComponent?!ea(h,G)||!ea(u,e):!0}G?("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(k,e,z),"function"===typeof g.componentDidUpdate&&(b.effectTag|=4)):("function"!==typeof g.componentDidUpdate||
9007
+ h===a.memoizedProps&&u===a.memoizedState||(b.effectTag|=4),c(b,k),d(b,e));g.props=k;g.state=e;g.context=z;return G}}}var Qe="function"===typeof Symbol&&Symbol["for"],Re=Qe?Symbol["for"]("react.element"):60103,Se=Qe?Symbol["for"]("react.call"):60104,Te=Qe?Symbol["for"]("react.return"):60105,Ue=Qe?Symbol["for"]("react.portal"):60106,Ve=Qe?Symbol["for"]("react.fragment"):60107,We="function"===typeof Symbol&&Symbol.iterator;
9008
+ function Xe(a){if(null===a||"undefined"===typeof a)return null;a=We&&a[We]||a["@@iterator"];return"function"===typeof a?a:null}var Ye=Array.isArray;
9009
+ function Ze(a,b){var c=b.ref;if(null!==c&&"function"!==typeof c){if(b._owner){b=b._owner;var d=void 0;b&&(2!==b.tag?E("110"):void 0,d=b.stateNode);d?void 0:E("147",c);var e=""+c;if(null!==a&&null!==a.ref&&a.ref._stringRef===e)return a.ref;a=function(a){var b=d.refs===D?d.refs={}:d.refs;null===a?delete b[e]:b[e]=a};a._stringRef=e;return a}"string"!==typeof c?E("148"):void 0;b._owner?void 0:E("149",c)}return c}
9010
+ function $e(a,b){"textarea"!==a.type&&E("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")}
9011
+ function af(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=se(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag=
9012
+ 2,c):d;b.effectTag=2;return c}function g(b){a&&null===b.alternate&&(b.effectTag=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=ve(c,a.internalContextTag,d),b["return"]=a,b;b=e(b,c,d);b["return"]=a;return b}function k(a,b,c,d){if(null!==b&&b.type===c.type)return d=e(b,c.props,d),d.ref=Ze(b,c),d["return"]=a,d;d=te(c,a.internalContextTag,d);d.ref=Ze(b,c);d["return"]=a;return d}function q(a,b,c,d){if(null===b||7!==b.tag)return b=we(c,a.internalContextTag,d),b["return"]=a,b;b=e(b,c,d);
9013
+ b["return"]=a;return b}function v(a,b,c,d){if(null===b||9!==b.tag)return b=xe(c,a.internalContextTag,d),b.type=c.value,b["return"]=a,b;b=e(b,null,d);b.type=c.value;b["return"]=a;return b}function y(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=ye(c,a.internalContextTag,d),b["return"]=a,b;b=e(b,c.children||[],d);b["return"]=a;return b}function u(a,b,c,d,f){if(null===b||10!==b.tag)return b=ue(c,a.internalContextTag,
9014
+ d,f),b["return"]=a,b;b=e(b,c,d);b["return"]=a;return b}function z(a,b,c){if("string"===typeof b||"number"===typeof b)return b=ve(""+b,a.internalContextTag,c),b["return"]=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case Re:if(b.type===Ve)return b=ue(b.props.children,a.internalContextTag,c,b.key),b["return"]=a,b;c=te(b,a.internalContextTag,c);c.ref=Ze(null,b);c["return"]=a;return c;case Se:return b=we(b,a.internalContextTag,c),b["return"]=a,b;case Te:return c=xe(b,a.internalContextTag,
9015
+ c),c.type=b.value,c["return"]=a,c;case Ue:return b=ye(b,a.internalContextTag,c),b["return"]=a,b}if(Ye(b)||Xe(b))return b=ue(b,a.internalContextTag,c,null),b["return"]=a,b;$e(a,b)}return null}function G(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case Re:return c.key===e?c.type===Ve?u(a,b,c.props.children,d,e):k(a,b,c,d):null;case Se:return c.key===e?q(a,b,c,d):null;case Te:return null===
9016
+ e?v(a,b,c,d):null;case Ue:return c.key===e?y(a,b,c,d):null}if(Ye(c)||Xe(c))return null!==e?null:u(a,b,c,d,null);$e(a,c)}return null}function I(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a=a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case Re:return a=a.get(null===d.key?c:d.key)||null,d.type===Ve?u(b,a,d.props.children,e,d.key):k(b,a,d,e);case Se:return a=a.get(null===d.key?c:d.key)||null,q(b,a,d,e);case Te:return a=a.get(c)||null,v(b,a,d,e);case Ue:return a=
9017
+ a.get(null===d.key?c:d.key)||null,y(b,a,d,e)}if(Ye(d)||Xe(d))return a=a.get(c)||null,u(b,a,d,e,null);$e(b,d)}return null}function L(e,g,m,A){for(var h=null,r=null,n=g,w=g=0,k=null;null!==n&&w<m.length;w++){n.index>w?(k=n,n=null):k=n.sibling;var x=G(e,n,m[w],A);if(null===x){null===n&&(n=k);break}a&&n&&null===x.alternate&&b(e,n);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x;n=k}if(w===m.length)return c(e,n),h;if(null===n){for(;w<m.length;w++)if(n=z(e,m[w],A))g=f(n,g,w),null===r?h=n:r.sibling=n,r=n;return h}for(n=
9018
+ d(e,n);w<m.length;w++)if(k=I(n,e,w,m[w],A)){if(a&&null!==k.alternate)n["delete"](null===k.key?w:k.key);g=f(k,g,w);null===r?h=k:r.sibling=k;r=k}a&&n.forEach(function(a){return b(e,a)});return h}function N(e,g,m,A){var h=Xe(m);"function"!==typeof h?E("150"):void 0;m=h.call(m);null==m?E("151"):void 0;for(var r=h=null,n=g,w=g=0,k=null,x=m.next();null!==n&&!x.done;w++,x=m.next()){n.index>w?(k=n,n=null):k=n.sibling;var J=G(e,n,x.value,A);if(null===J){n||(n=k);break}a&&n&&null===J.alternate&&b(e,n);g=f(J,
9019
+ g,w);null===r?h=J:r.sibling=J;r=J;n=k}if(x.done)return c(e,n),h;if(null===n){for(;!x.done;w++,x=m.next())x=z(e,x.value,A),null!==x&&(g=f(x,g,w),null===r?h=x:r.sibling=x,r=x);return h}for(n=d(e,n);!x.done;w++,x=m.next())if(x=I(n,e,w,x.value,A),null!==x){if(a&&null!==x.alternate)n["delete"](null===x.key?w:x.key);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x}a&&n.forEach(function(a){return b(e,a)});return h}return function(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Ve&&null===f.key&&(f=f.props.children);
9020
+ var m="object"===typeof f&&null!==f;if(m)switch(f.$$typeof){case Re:a:{var r=f.key;for(m=d;null!==m;){if(m.key===r)if(10===m.tag?f.type===Ve:m.type===f.type){c(a,m.sibling);d=e(m,f.type===Ve?f.props.children:f.props,h);d.ref=Ze(m,f);d["return"]=a;a=d;break a}else{c(a,m);break}else b(a,m);m=m.sibling}f.type===Ve?(d=ue(f.props.children,a.internalContextTag,h,f.key),d["return"]=a,a=d):(h=te(f,a.internalContextTag,h),h.ref=Ze(d,f),h["return"]=a,a=h)}return g(a);case Se:a:{for(m=f.key;null!==d;){if(d.key===
9021
+ m)if(7===d.tag){c(a,d.sibling);d=e(d,f,h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=we(f,a.internalContextTag,h);d["return"]=a;a=d}return g(a);case Te:a:{if(null!==d)if(9===d.tag){c(a,d.sibling);d=e(d,null,h);d.type=f.value;d["return"]=a;a=d;break a}else c(a,d);d=xe(f,a.internalContextTag,h);d.type=f.value;d["return"]=a;a=d}return g(a);case Ue:a:{for(m=f.key;null!==d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===
9022
+ f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ye(f,a.internalContextTag,h);d["return"]=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h)):(c(a,d),d=ve(f,a.internalContextTag,h)),d["return"]=a,a=d,g(a);if(Ye(f))return L(a,d,f,h);if(Xe(f))return N(a,d,f,h);m&&$e(a,f);if("undefined"===typeof f)switch(a.tag){case 2:case 1:h=a.type,E("152",h.displayName||
9023
+ h.name||"Component")}return c(a,d)}}var bf=af(!0),cf=af(!1);
9024
+ function df(a,b,c,d,e){function f(a,b,c){var d=b.expirationTime;b.child=null===a?cf(b,null,c,d):bf(b,a.child,c,d)}function g(a,b){var c=b.ref;null===c||a&&a.ref===c||(b.effectTag|=128)}function h(a,b,c,d){g(a,b);if(!c)return d&&re(b,!1),q(a,b);c=b.stateNode;id.current=b;var e=c.render();b.effectTag|=1;f(a,b,e);b.memoizedState=c.state;b.memoizedProps=c.props;d&&re(b,!0);return b.child}function k(a){var b=a.stateNode;b.pendingContext?oe(a,b.pendingContext,b.pendingContext!==b.context):b.context&&oe(a,
9025
+ b.context,!1);I(a,b.containerInfo)}function q(a,b){null!==a&&b.child!==a.child?E("153"):void 0;if(null!==b.child){a=b.child;var c=se(a,a.pendingProps,a.expirationTime);b.child=c;for(c["return"]=b;null!==a.sibling;)a=a.sibling,c=c.sibling=se(a,a.pendingProps,a.expirationTime),c["return"]=b;c.sibling=null}return b.child}function v(a,b){switch(b.tag){case 3:k(b);break;case 2:qe(b);break;case 4:I(b,b.stateNode.containerInfo)}return null}var y=a.shouldSetTextContent,u=a.useSyncScheduling,z=a.shouldDeprioritizeSubtree,
9026
+ G=b.pushHostContext,I=b.pushHostContainer,L=c.enterHydrationState,N=c.resetHydrationState,J=c.tryToClaimNextHydratableInstance;a=Le(d,e,function(a,b){a.memoizedProps=b},function(a,b){a.memoizedState=b});var w=a.adoptClassInstance,m=a.constructClassInstance,A=a.mountClassInstance,Ob=a.updateClassInstance;return{beginWork:function(a,b,c){if(0===b.expirationTime||b.expirationTime>c)return v(a,b);switch(b.tag){case 0:null!==a?E("155"):void 0;var d=b.type,e=b.pendingProps,r=ke(b);r=me(b,r);d=d(e,r);b.effectTag|=
9027
+ 1;"object"===typeof d&&null!==d&&"function"===typeof d.render?(b.tag=2,e=qe(b),w(b,d),A(b,c),b=h(a,b,!0,e)):(b.tag=1,f(a,b,d),b.memoizedProps=e,b=b.child);return b;case 1:a:{e=b.type;c=b.pendingProps;d=b.memoizedProps;if(X.current)null===c&&(c=d);else if(null===c||d===c){b=q(a,b);break a}d=ke(b);d=me(b,d);e=e(c,d);b.effectTag|=1;f(a,b,e);b.memoizedProps=c;b=b.child}return b;case 2:return e=qe(b),d=void 0,null===a?b.stateNode?E("153"):(m(b,b.pendingProps),A(b,c),d=!0):d=Ob(a,b,c),h(a,b,d,e);case 3:return k(b),
9028
+ e=b.updateQueue,null!==e?(d=b.memoizedState,e=Je(a,b,e,null,null,c),d===e?(N(),b=q(a,b)):(d=e.element,r=b.stateNode,(null===a||null===a.child)&&r.hydrate&&L(b)?(b.effectTag|=2,b.child=cf(b,null,d,c)):(N(),f(a,b,d)),b.memoizedState=e,b=b.child)):(N(),b=q(a,b)),b;case 5:G(b);null===a&&J(b);e=b.type;var n=b.memoizedProps;d=b.pendingProps;null===d&&(d=n,null===d?E("154"):void 0);r=null!==a?a.memoizedProps:null;X.current||null!==d&&n!==d?(n=d.children,y(e,d)?n=null:r&&y(e,r)&&(b.effectTag|=16),g(a,b),
9029
+ 2147483647!==c&&!u&&z(e,d)?(b.expirationTime=2147483647,b=null):(f(a,b,n),b.memoizedProps=d,b=b.child)):b=q(a,b);return b;case 6:return null===a&&J(b),a=b.pendingProps,null===a&&(a=b.memoizedProps),b.memoizedProps=a,null;case 8:b.tag=7;case 7:e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null===e?E("154"):void 0);else if(null===e||b.memoizedProps===e)e=b.memoizedProps;d=e.children;b.stateNode=null===a?cf(b,b.stateNode,d,c):bf(b,b.stateNode,d,c);b.memoizedProps=e;return b.stateNode;
9030
+ case 9:return null;case 4:a:{I(b,b.stateNode.containerInfo);e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null==e?E("154"):void 0);else if(null===e||b.memoizedProps===e){b=q(a,b);break a}null===a?b.child=bf(b,null,e,c):f(a,b,e);b.memoizedProps=e;b=b.child}return b;case 10:a:{c=b.pendingProps;if(X.current)null===c&&(c=b.memoizedProps);else if(null===c||b.memoizedProps===c){b=q(a,b);break a}f(a,b,c);b.memoizedProps=c;b=b.child}return b;default:E("156")}},beginFailedWork:function(a,b,
9031
+ c){switch(b.tag){case 2:qe(b);break;case 3:k(b);break;default:E("157")}b.effectTag|=64;null===a?b.child=null:b.child!==a.child&&(b.child=a.child);if(0===b.expirationTime||b.expirationTime>c)return v(a,b);b.firstEffect=null;b.lastEffect=null;b.child=null===a?cf(b,null,null,c):bf(b,a.child,null,c);2===b.tag&&(a=b.stateNode,b.memoizedProps=a.props,b.memoizedState=a.state);return b.child}}}
9032
+ function ef(a,b,c){function d(a){a.effectTag|=4}var e=a.createInstance,f=a.createTextInstance,g=a.appendInitialChild,h=a.finalizeInitialChildren,k=a.prepareUpdate,q=a.persistence,v=b.getRootHostContainer,y=b.popHostContext,u=b.getHostContext,z=b.popHostContainer,G=c.prepareToHydrateHostInstance,I=c.prepareToHydrateHostTextInstance,L=c.popHydrationState,N=void 0,J=void 0,w=void 0;a.mutation?(N=function(){},J=function(a,b,c){(b.updateQueue=c)&&d(b)},w=function(a,b,c,e){c!==e&&d(b)}):q?E("235"):E("236");
9033
+ return{completeWork:function(a,b,c){var m=b.pendingProps;if(null===m)m=b.memoizedProps;else if(2147483647!==b.expirationTime||2147483647===c)b.pendingProps=null;switch(b.tag){case 1:return null;case 2:return ne(b),null;case 3:z(b);V(X,b);V(ie,b);m=b.stateNode;m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null);if(null===a||null===a.child)L(b),b.effectTag&=-3;N(b);return null;case 5:y(b);c=v();var A=b.type;if(null!==a&&null!=b.stateNode){var p=a.memoizedProps,q=b.stateNode,x=u();q=
9034
+ k(q,A,p,m,c,x);J(a,b,q,A,p,m,c);a.ref!==b.ref&&(b.effectTag|=128)}else{if(!m)return null===b.stateNode?E("166"):void 0,null;a=u();if(L(b))G(b,c,a)&&d(b);else{a=e(A,m,c,a,b);a:for(p=b.child;null!==p;){if(5===p.tag||6===p.tag)g(a,p.stateNode);else if(4!==p.tag&&null!==p.child){p.child["return"]=p;p=p.child;continue}if(p===b)break;for(;null===p.sibling;){if(null===p["return"]||p["return"]===b)break a;p=p["return"]}p.sibling["return"]=p["return"];p=p.sibling}h(a,A,m,c)&&d(b);b.stateNode=a}null!==b.ref&&
9035
+ (b.effectTag|=128)}return null;case 6:if(a&&null!=b.stateNode)w(a,b,a.memoizedProps,m);else{if("string"!==typeof m)return null===b.stateNode?E("166"):void 0,null;a=v();c=u();L(b)?I(b)&&d(b):b.stateNode=f(m,a,c,b)}return null;case 7:(m=b.memoizedProps)?void 0:E("165");b.tag=8;A=[];a:for((p=b.stateNode)&&(p["return"]=b);null!==p;){if(5===p.tag||6===p.tag||4===p.tag)E("247");else if(9===p.tag)A.push(p.type);else if(null!==p.child){p.child["return"]=p;p=p.child;continue}for(;null===p.sibling;){if(null===
9036
+ p["return"]||p["return"]===b)break a;p=p["return"]}p.sibling["return"]=p["return"];p=p.sibling}p=m.handler;m=p(m.props,A);b.child=bf(b,null!==a?a.child:null,m,c);return b.child;case 8:return b.tag=7,null;case 9:return null;case 10:return null;case 4:return z(b),N(b),null;case 0:E("167");default:E("156")}}}}
9037
+ function ff(a,b){function c(a){var c=a.ref;if(null!==c)try{c(null)}catch(A){b(a,A)}}function d(a){"function"===typeof Ee&&Ee(a);switch(a.tag){case 2:c(a);var d=a.stateNode;if("function"===typeof d.componentWillUnmount)try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(A){b(a,A)}break;case 5:c(a);break;case 7:e(a.stateNode);break;case 4:k&&g(a)}}function e(a){for(var b=a;;)if(d(b),null===b.child||k&&4===b.tag){if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||
9038
+ b["return"]===a)return;b=b["return"]}b.sibling["return"]=b["return"];b=b.sibling}else b.child["return"]=b,b=b.child}function f(a){return 5===a.tag||3===a.tag||4===a.tag}function g(a){for(var b=a,c=!1,f=void 0,g=void 0;;){if(!c){c=b["return"];a:for(;;){null===c?E("160"):void 0;switch(c.tag){case 5:f=c.stateNode;g=!1;break a;case 3:f=c.stateNode.containerInfo;g=!0;break a;case 4:f=c.stateNode.containerInfo;g=!0;break a}c=c["return"]}c=!0}if(5===b.tag||6===b.tag)e(b),g?J(f,b.stateNode):N(f,b.stateNode);
9039
+ else if(4===b.tag?f=b.stateNode.containerInfo:d(b),null!==b.child){b.child["return"]=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||b["return"]===a)return;b=b["return"];4===b.tag&&(c=!1)}b.sibling["return"]=b["return"];b=b.sibling}}var h=a.getPublicInstance,k=a.mutation;a=a.persistence;k||(a?E("235"):E("236"));var q=k.commitMount,v=k.commitUpdate,y=k.resetTextContent,u=k.commitTextUpdate,z=k.appendChild,G=k.appendChildToContainer,I=k.insertBefore,L=k.insertInContainerBefore,
9040
+ N=k.removeChild,J=k.removeChildFromContainer;return{commitResetTextContent:function(a){y(a.stateNode)},commitPlacement:function(a){a:{for(var b=a["return"];null!==b;){if(f(b)){var c=b;break a}b=b["return"]}E("160");c=void 0}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:E("161")}c.effectTag&16&&(y(b),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c["return"]||f(c["return"])){c=
9041
+ null;break a}c=c["return"]}c.sibling["return"]=c["return"];for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child["return"]=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)c?d?L(b,e.stateNode,c):I(b,e.stateNode,c):d?G(b,e.stateNode):z(b,e.stateNode);else if(4!==e.tag&&null!==e.child){e.child["return"]=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e["return"]||e["return"]===
9042
+ a)return;e=e["return"]}e.sibling["return"]=e["return"];e=e.sibling}},commitDeletion:function(a){g(a);a["return"]=null;a.child=null;a.alternate&&(a.alternate.child=null,a.alternate["return"]=null)},commitWork:function(a,b){switch(b.tag){case 2:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&v(c,f,e,a,d,b)}break;case 6:null===b.stateNode?E("162"):void 0;c=b.memoizedProps;u(b.stateNode,null!==a?a.memoizedProps:
9043
+ c,c);break;case 3:break;default:E("163")}},commitLifeCycles:function(a,b){switch(b.tag){case 2:var c=b.stateNode;if(b.effectTag&4)if(null===a)c.props=b.memoizedProps,c.state=b.memoizedState,c.componentDidMount();else{var d=a.memoizedProps;a=a.memoizedState;c.props=b.memoizedProps;c.state=b.memoizedState;c.componentDidUpdate(d,a)}b=b.updateQueue;null!==b&&Ke(b,c);break;case 3:c=b.updateQueue;null!==c&&Ke(c,null!==b.child?b.child.stateNode:null);break;case 5:c=b.stateNode;null===a&&b.effectTag&4&&q(c,
9044
+ b.type,b.memoizedProps,b);break;case 6:break;case 4:break;default:E("163")}},commitAttachRef:function(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:b(h(c));break;default:b(c)}}},commitDetachRef:function(a){a=a.ref;null!==a&&a(null)}}}var gf={};
9045
+ function hf(a){function b(a){a===gf?E("174"):void 0;return a}var c=a.getChildHostContext,d=a.getRootHostContext,e={current:gf},f={current:gf},g={current:gf};return{getHostContext:function(){return b(e.current)},getRootHostContainer:function(){return b(g.current)},popHostContainer:function(a){V(e,a);V(f,a);V(g,a)},popHostContext:function(a){f.current===a&&(V(e,a),V(f,a))},pushHostContainer:function(a,b){W(g,b,a);b=d(b);W(f,a,a);W(e,b,a)},pushHostContext:function(a){var d=b(g.current),h=b(e.current);
9046
+ d=c(h,a.type,d);h!==d&&(W(f,a,a),W(e,d,a))},resetHostContainer:function(){e.current=gf;g.current=gf}}}
9047
+ function jf(a){function b(a,b){var c=new Y(5,null,0);c.type="DELETED";c.stateNode=b;c["return"]=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function c(a,b){switch(a.tag){case 5:return b=f(b,a.type,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;case 6:return b=g(b,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;default:return!1}}function d(a){for(a=a["return"];null!==a&&5!==a.tag&&3!==a.tag;)a=a["return"];y=a}var e=a.shouldSetTextContent;
9048
+ a=a.hydration;if(!a)return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){E("175")},prepareToHydrateHostTextInstance:function(){E("176")},popHydrationState:function(){return!1}};var f=a.canHydrateInstance,g=a.canHydrateTextInstance,h=a.getNextHydratableSibling,k=a.getFirstHydratableChild,q=a.hydrateInstance,v=a.hydrateTextInstance,y=null,u=null,z=!1;return{enterHydrationState:function(a){u=
9049
+ k(a.stateNode.containerInfo);y=a;return z=!0},resetHydrationState:function(){u=y=null;z=!1},tryToClaimNextHydratableInstance:function(a){if(z){var d=u;if(d){if(!c(a,d)){d=h(d);if(!d||!c(a,d)){a.effectTag|=2;z=!1;y=a;return}b(y,u)}y=a;u=k(d)}else a.effectTag|=2,z=!1,y=a}},prepareToHydrateHostInstance:function(a,b,c){b=q(a.stateNode,a.type,a.memoizedProps,b,c,a);a.updateQueue=b;return null!==b?!0:!1},prepareToHydrateHostTextInstance:function(a){return v(a.stateNode,a.memoizedProps,a)},popHydrationState:function(a){if(a!==
9050
+ y)return!1;if(!z)return d(a),z=!0,!1;var c=a.type;if(5!==a.tag||"head"!==c&&"body"!==c&&!e(c,a.memoizedProps))for(c=u;c;)b(a,c),c=h(c);d(a);u=y?h(a.stateNode):null;return!0}}}
9051
+ function kf(a){function b(a){Qb=ja=!0;var b=a.stateNode;b.current===a?E("177"):void 0;b.isReadyForCommit=!1;id.current=null;if(1<a.effectTag)if(null!==a.lastEffect){a.lastEffect.nextEffect=a;var c=a.firstEffect}else c=a;else c=a.firstEffect;yg();for(t=c;null!==t;){var d=!1,e=void 0;try{for(;null!==t;){var f=t.effectTag;f&16&&zg(t);if(f&128){var g=t.alternate;null!==g&&Ag(g)}switch(f&-242){case 2:Ne(t);t.effectTag&=-3;break;case 6:Ne(t);t.effectTag&=-3;Oe(t.alternate,t);break;case 4:Oe(t.alternate,
9052
+ t);break;case 8:Sc=!0,Bg(t),Sc=!1}t=t.nextEffect}}catch(Tc){d=!0,e=Tc}d&&(null===t?E("178"):void 0,h(t,e),null!==t&&(t=t.nextEffect))}Cg();b.current=a;for(t=c;null!==t;){c=!1;d=void 0;try{for(;null!==t;){var k=t.effectTag;k&36&&Dg(t.alternate,t);k&128&&Eg(t);if(k&64)switch(e=t,f=void 0,null!==R&&(f=R.get(e),R["delete"](e),null==f&&null!==e.alternate&&(e=e.alternate,f=R.get(e),R["delete"](e))),null==f?E("184"):void 0,e.tag){case 2:e.stateNode.componentDidCatch(f.error,{componentStack:f.componentStack});
9053
+ break;case 3:null===ca&&(ca=f.error);break;default:E("157")}var Qc=t.nextEffect;t.nextEffect=null;t=Qc}}catch(Tc){c=!0,d=Tc}c&&(null===t?E("178"):void 0,h(t,d),null!==t&&(t=t.nextEffect))}ja=Qb=!1;"function"===typeof De&&De(a.stateNode);ha&&(ha.forEach(G),ha=null);null!==ca&&(a=ca,ca=null,Ob(a));b=b.current.expirationTime;0===b&&(qa=R=null);return b}function c(a){for(;;){var b=Fg(a.alternate,a,H),c=a["return"],d=a.sibling;var e=a;if(2147483647===H||2147483647!==e.expirationTime){if(2!==e.tag&&3!==
9054
+ e.tag)var f=0;else f=e.updateQueue,f=null===f?0:f.expirationTime;for(var g=e.child;null!==g;)0!==g.expirationTime&&(0===f||f>g.expirationTime)&&(f=g.expirationTime),g=g.sibling;e.expirationTime=f}if(null!==b)return b;null!==c&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1<a.effectTag&&(null!==c.lastEffect?c.lastEffect.nextEffect=a:c.firstEffect=a,c.lastEffect=a));if(null!==d)return d;
9055
+ if(null!==c)a=c;else{a.stateNode.isReadyForCommit=!0;break}}return null}function d(a){var b=rg(a.alternate,a,H);null===b&&(b=c(a));id.current=null;return b}function e(a){var b=Gg(a.alternate,a,H);null===b&&(b=c(a));id.current=null;return b}function f(a){if(null!==R){if(!(0===H||H>a))if(H<=Uc)for(;null!==F;)F=k(F)?e(F):d(F);else for(;null!==F&&!A();)F=k(F)?e(F):d(F)}else if(!(0===H||H>a))if(H<=Uc)for(;null!==F;)F=d(F);else for(;null!==F&&!A();)F=d(F)}function g(a,b){ja?E("243"):void 0;ja=!0;a.isReadyForCommit=
9056
+ !1;if(a!==ra||b!==H||null===F){for(;-1<he;)ge[he]=null,he--;je=D;ie.current=D;X.current=!1;x();ra=a;H=b;F=se(ra.current,null,b)}var c=!1,d=null;try{f(b)}catch(Rc){c=!0,d=Rc}for(;c;){if(eb){ca=d;break}var g=F;if(null===g)eb=!0;else{var k=h(g,d);null===k?E("183"):void 0;if(!eb){try{c=k;d=b;for(k=c;null!==g;){switch(g.tag){case 2:ne(g);break;case 5:qg(g);break;case 3:p(g);break;case 4:p(g)}if(g===k||g.alternate===k)break;g=g["return"]}F=e(c);f(d)}catch(Rc){c=!0;d=Rc;continue}break}}}b=ca;eb=ja=!1;ca=
9057
+ null;null!==b&&Ob(b);return a.isReadyForCommit?a.current.alternate:null}function h(a,b){var c=id.current=null,d=!1,e=!1,f=null;if(3===a.tag)c=a,q(a)&&(eb=!0);else for(var g=a["return"];null!==g&&null===c;){2===g.tag?"function"===typeof g.stateNode.componentDidCatch&&(d=!0,f=jd(g),c=g,e=!0):3===g.tag&&(c=g);if(q(g)){if(Sc||null!==ha&&(ha.has(g)||null!==g.alternate&&ha.has(g.alternate)))return null;c=null;e=!1}g=g["return"]}if(null!==c){null===qa&&(qa=new Set);qa.add(c);var h="";g=a;do{a:switch(g.tag){case 0:case 1:case 2:case 5:var k=
9058
+ g._debugOwner,Qc=g._debugSource;var m=jd(g);var n=null;k&&(n=jd(k));k=Qc;m="\n in "+(m||"Unknown")+(k?" (at "+k.fileName.replace(/^.*[\\\/]/,"")+":"+k.lineNumber+")":n?" (created by "+n+")":"");break a;default:m=""}h+=m;g=g["return"]}while(g);g=h;a=jd(a);null===R&&(R=new Map);b={componentName:a,componentStack:g,error:b,errorBoundary:d?c.stateNode:null,errorBoundaryFound:d,errorBoundaryName:f,willRetry:e};R.set(c,b);try{var p=b.error;p&&p.suppressReactErrorLogging||console.error(p)}catch(Vc){Vc&&
9059
+ Vc.suppressReactErrorLogging||console.error(Vc)}Qb?(null===ha&&(ha=new Set),ha.add(c)):G(c);return c}null===ca&&(ca=b);return null}function k(a){return null!==R&&(R.has(a)||null!==a.alternate&&R.has(a.alternate))}function q(a){return null!==qa&&(qa.has(a)||null!==a.alternate&&qa.has(a.alternate))}function v(){return 20*(((I()+100)/20|0)+1)}function y(a){return 0!==ka?ka:ja?Qb?1:H:!Hg||a.internalContextTag&1?v():1}function u(a,b){return z(a,b,!1)}function z(a,b){for(;null!==a;){if(0===a.expirationTime||
9060
+ a.expirationTime>b)a.expirationTime=b;null!==a.alternate&&(0===a.alternate.expirationTime||a.alternate.expirationTime>b)&&(a.alternate.expirationTime=b);if(null===a["return"])if(3===a.tag){var c=a.stateNode;!ja&&c===ra&&b<H&&(F=ra=null,H=0);var d=c,e=b;Rb>Ig&&E("185");if(null===d.nextScheduledRoot)d.remainingExpirationTime=e,null===O?(sa=O=d,d.nextScheduledRoot=d):(O=O.nextScheduledRoot=d,O.nextScheduledRoot=sa);else{var f=d.remainingExpirationTime;if(0===f||e<f)d.remainingExpirationTime=e}Fa||(la?
9061
+ Sb&&(ma=d,na=1,m(ma,na)):1===e?w(1,null):L(e));!ja&&c===ra&&b<H&&(F=ra=null,H=0)}else break;a=a["return"]}}function G(a){z(a,1,!0)}function I(){return Uc=((Wc()-Pe)/10|0)+2}function L(a){if(0!==Tb){if(a>Tb)return;Jg(Xc)}var b=Wc()-Pe;Tb=a;Xc=Kg(J,{timeout:10*(a-2)-b})}function N(){var a=0,b=null;if(null!==O)for(var c=O,d=sa;null!==d;){var e=d.remainingExpirationTime;if(0===e){null===c||null===O?E("244"):void 0;if(d===d.nextScheduledRoot){sa=O=d.nextScheduledRoot=null;break}else if(d===sa)sa=e=d.nextScheduledRoot,
9062
+ O.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===O){O=c;O.nextScheduledRoot=sa;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{if(0===a||e<a)a=e,b=d;if(d===O)break;c=d;d=d.nextScheduledRoot}}c=ma;null!==c&&c===b?Rb++:Rb=0;ma=b;na=a}function J(a){w(0,a)}function w(a,b){fb=b;for(N();null!==ma&&0!==na&&(0===a||na<=a)&&!Yc;)m(ma,na),N();null!==fb&&(Tb=0,Xc=-1);0!==na&&L(na);fb=null;Yc=!1;Rb=0;if(Ub)throw a=Zc,Zc=
9063
+ null,Ub=!1,a;}function m(a,c){Fa?E("245"):void 0;Fa=!0;if(c<=I()){var d=a.finishedWork;null!==d?(a.finishedWork=null,a.remainingExpirationTime=b(d)):(a.finishedWork=null,d=g(a,c),null!==d&&(a.remainingExpirationTime=b(d)))}else d=a.finishedWork,null!==d?(a.finishedWork=null,a.remainingExpirationTime=b(d)):(a.finishedWork=null,d=g(a,c),null!==d&&(A()?a.finishedWork=d:a.remainingExpirationTime=b(d)));Fa=!1}function A(){return null===fb||fb.timeRemaining()>Lg?!1:Yc=!0}function Ob(a){null===ma?E("246"):
9064
+ void 0;ma.remainingExpirationTime=0;Ub||(Ub=!0,Zc=a)}var r=hf(a),n=jf(a),p=r.popHostContainer,qg=r.popHostContext,x=r.resetHostContainer,Me=df(a,r,n,u,y),rg=Me.beginWork,Gg=Me.beginFailedWork,Fg=ef(a,r,n).completeWork;r=ff(a,h);var zg=r.commitResetTextContent,Ne=r.commitPlacement,Bg=r.commitDeletion,Oe=r.commitWork,Dg=r.commitLifeCycles,Eg=r.commitAttachRef,Ag=r.commitDetachRef,Wc=a.now,Kg=a.scheduleDeferredCallback,Jg=a.cancelDeferredCallback,Hg=a.useSyncScheduling,yg=a.prepareForCommit,Cg=a.resetAfterCommit,
9065
+ Pe=Wc(),Uc=2,ka=0,ja=!1,F=null,ra=null,H=0,t=null,R=null,qa=null,ha=null,ca=null,eb=!1,Qb=!1,Sc=!1,sa=null,O=null,Tb=0,Xc=-1,Fa=!1,ma=null,na=0,Yc=!1,Ub=!1,Zc=null,fb=null,la=!1,Sb=!1,Ig=1E3,Rb=0,Lg=1;return{computeAsyncExpiration:v,computeExpirationForFiber:y,scheduleWork:u,batchedUpdates:function(a,b){var c=la;la=!0;try{return a(b)}finally{(la=c)||Fa||w(1,null)}},unbatchedUpdates:function(a){if(la&&!Sb){Sb=!0;try{return a()}finally{Sb=!1}}return a()},flushSync:function(a){var b=la;la=!0;try{a:{var c=
9066
+ ka;ka=1;try{var d=a();break a}finally{ka=c}d=void 0}return d}finally{la=b,Fa?E("187"):void 0,w(1,null)}},deferredUpdates:function(a){var b=ka;ka=v();try{return a()}finally{ka=b}}}}
9067
+ function lf(a){function b(a){a=od(a);return null===a?null:a.stateNode}var c=a.getPublicInstance;a=kf(a);var d=a.computeAsyncExpiration,e=a.computeExpirationForFiber,f=a.scheduleWork;return{createContainer:function(a,b){var c=new Y(3,null,0);a={current:c,containerInfo:a,pendingChildren:null,remainingExpirationTime:0,isReadyForCommit:!1,finishedWork:null,context:null,pendingContext:null,hydrate:b,nextScheduledRoot:null};return c.stateNode=a},updateContainer:function(a,b,c,q){var g=b.current;if(c){c=
9068
+ c._reactInternalFiber;var h;b:{2===kd(c)&&2===c.tag?void 0:E("170");for(h=c;3!==h.tag;){if(le(h)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}(h=h["return"])?void 0:E("171")}h=h.stateNode.context}c=le(c)?pe(c,h):h}else c=D;null===b.context?b.context=c:b.pendingContext=c;b=q;b=void 0===b?null:b;q=null!=a&&null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent?d():e(g);He(g,{expirationTime:q,partialState:{element:a},callback:b,isReplace:!1,isForced:!1,
9069
+ nextCallback:null,next:null});f(g,q)},batchedUpdates:a.batchedUpdates,unbatchedUpdates:a.unbatchedUpdates,deferredUpdates:a.deferredUpdates,flushSync:a.flushSync,getPublicRootInstance:function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return c(a.child.stateNode);default:return a.child.stateNode}},findHostInstance:b,findHostInstanceWithNoPortals:function(a){a=pd(a);return null===a?null:a.stateNode},injectIntoDevTools:function(a){var c=a.findFiberByHostInstance;return Ce(B({},
9070
+ a,{findHostInstanceByFiber:function(a){return b(a)},findFiberByHostInstance:function(a){return c?c(a):null}}))}}}var mf=Object.freeze({default:lf}),nf=mf&&lf||mf,of=nf["default"]?nf["default"]:nf;function pf(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ue,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}var qf="object"===typeof performance&&"function"===typeof performance.now,rf=void 0;rf=qf?function(){return performance.now()}:function(){return Date.now()};
9071
+ var sf=void 0,tf=void 0;
9072
+ if(l.canUseDOM)if("function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback){var uf=null,vf=!1,wf=-1,xf=!1,yf=0,zf=33,Af=33,Bf;Bf=qf?{didTimeout:!1,timeRemaining:function(){var a=yf-performance.now();return 0<a?a:0}}:{didTimeout:!1,timeRemaining:function(){var a=yf-Date.now();return 0<a?a:0}};var Cf="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(a){if(a.source===window&&a.data===Cf){vf=!1;a=rf();if(0>=yf-a)if(-1!==wf&&wf<=
9073
+ a)Bf.didTimeout=!0;else{xf||(xf=!0,requestAnimationFrame(Df));return}else Bf.didTimeout=!1;wf=-1;a=uf;uf=null;null!==a&&a(Bf)}},!1);var Df=function(a){xf=!1;var b=a-yf+Af;b<Af&&zf<Af?(8>b&&(b=8),Af=b<zf?zf:b):zf=b;yf=a+Af;vf||(vf=!0,window.postMessage(Cf,"*"))};sf=function(a,b){uf=a;null!=b&&"number"===typeof b.timeout&&(wf=rf()+b.timeout);xf||(xf=!0,requestAnimationFrame(Df));return 0};tf=function(){uf=null;vf=!1;wf=-1}}else sf=window.requestIdleCallback,tf=window.cancelIdleCallback;else sf=function(a){return setTimeout(function(){a({timeRemaining:function(){return Infinity}})})},
9074
+ tf=function(a){clearTimeout(a)};var Ef=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ff={},Gf={};
9075
+ function Hf(a){if(Gf.hasOwnProperty(a))return!0;if(Ff.hasOwnProperty(a))return!1;if(Ef.test(a))return Gf[a]=!0;Ff[a]=!0;return!1}
9076
+ function If(a,b,c){var d=wa(b);if(d&&va(b,c)){var e=d.mutationMethod;e?e(a,c):null==c||d.hasBooleanValue&&!c||d.hasNumericValue&&isNaN(c)||d.hasPositiveNumericValue&&1>c||d.hasOverloadedBooleanValue&&!1===c?Jf(a,b):d.mustUseProperty?a[d.propertyName]=c:(b=d.attributeName,(e=d.attributeNamespace)?a.setAttributeNS(e,b,""+c):d.hasBooleanValue||d.hasOverloadedBooleanValue&&!0===c?a.setAttribute(b,""):a.setAttribute(b,""+c))}else Kf(a,b,va(b,c)?c:null)}
9077
+ function Kf(a,b,c){Hf(b)&&(null==c?a.removeAttribute(b):a.setAttribute(b,""+c))}function Jf(a,b){var c=wa(b);c?(b=c.mutationMethod)?b(a,void 0):c.mustUseProperty?a[c.propertyName]=c.hasBooleanValue?!1:"":a.removeAttribute(c.attributeName):a.removeAttribute(b)}
9078
+ function Lf(a,b){var c=b.value,d=b.checked;return B({type:void 0,step:void 0,min:void 0,max:void 0},b,{defaultChecked:void 0,defaultValue:void 0,value:null!=c?c:a._wrapperState.initialValue,checked:null!=d?d:a._wrapperState.initialChecked})}function Mf(a,b){var c=b.defaultValue;a._wrapperState={initialChecked:null!=b.checked?b.checked:b.defaultChecked,initialValue:null!=b.value?b.value:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}
9079
+ function Nf(a,b){b=b.checked;null!=b&&If(a,"checked",b)}function Of(a,b){Nf(a,b);var c=b.value;if(null!=c)if(0===c&&""===a.value)a.value="0";else if("number"===b.type){if(b=parseFloat(a.value)||0,c!=b||c==b&&a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else null==b.value&&null!=b.defaultValue&&a.defaultValue!==""+b.defaultValue&&(a.defaultValue=""+b.defaultValue),null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
9080
+ function Pf(a,b){switch(b.type){case "submit":case "reset":break;case "color":case "date":case "datetime":case "datetime-local":case "month":case "time":case "week":a.value="";a.value=a.defaultValue;break;default:a.value=a.value}b=a.name;""!==b&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!a.defaultChecked;""!==b&&(a.name=b)}function Qf(a){var b="";aa.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a)});return b}
9081
+ function Rf(a,b){a=B({children:void 0},b);if(b=Qf(b.children))a.children=b;return a}function Sf(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+c;b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
9082
+ function Tf(a,b){var c=b.value;a._wrapperState={initialValue:null!=c?c:b.defaultValue,wasMultiple:!!b.multiple}}function Uf(a,b){null!=b.dangerouslySetInnerHTML?E("91"):void 0;return B({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Vf(a,b){var c=b.value;null==c&&(c=b.defaultValue,b=b.children,null!=b&&(null!=c?E("92"):void 0,Array.isArray(b)&&(1>=b.length?void 0:E("93"),b=b[0]),c=""+b),null==c&&(c=""));a._wrapperState={initialValue:""+c}}
9083
+ function Wf(a,b){var c=b.value;null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&(a.defaultValue=c));null!=b.defaultValue&&(a.defaultValue=b.defaultValue)}function Xf(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var Yf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
9084
+ function Zf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $f(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Zf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
9085
+ var ag=void 0,bg=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Yf.svg||"innerHTML"in a)a.innerHTML=b;else{ag=ag||document.createElement("div");ag.innerHTML="\x3csvg\x3e"+b+"\x3c/svg\x3e";for(b=ag.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
9086
+ function cg(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
9087
+ var dg={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,
9088
+ stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eg=["Webkit","ms","Moz","O"];Object.keys(dg).forEach(function(a){eg.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);dg[b]=dg[a]})});
9089
+ function fg(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--");var e=c;var f=b[c];e=null==f||"boolean"===typeof f||""===f?"":d||"number"!==typeof f||0===f||dg.hasOwnProperty(e)&&dg[e]?(""+f).trim():f+"px";"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var gg=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
9090
+ function hg(a,b,c){b&&(gg[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?E("137",a,c()):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?E("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:E("61")),null!=b.style&&"object"!==typeof b.style?E("62",c()):void 0)}
9091
+ function ig(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var jg=Yf.html,kg=C.thatReturns("");
9092
+ function lg(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Hd(a);b=Sa[b];for(var d=0;d<b.length;d++){var e=b[d];c.hasOwnProperty(e)&&c[e]||("topScroll"===e?wd("topScroll","scroll",a):"topFocus"===e||"topBlur"===e?(wd("topFocus","focus",a),wd("topBlur","blur",a),c.topBlur=!0,c.topFocus=!0):"topCancel"===e?(yc("cancel",!0)&&wd("topCancel","cancel",a),c.topCancel=!0):"topClose"===e?(yc("close",!0)&&wd("topClose","close",a),c.topClose=!0):Dd.hasOwnProperty(e)&&U(e,Dd[e],a),c[e]=!0)}}
9093
+ var mg={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",
9094
+ topWaiting:"waiting"};function ng(a,b,c,d){c=9===c.nodeType?c:c.ownerDocument;d===jg&&(d=Zf(a));d===jg?"script"===a?(a=c.createElement("div"),a.innerHTML="\x3cscript\x3e\x3c/script\x3e",a=a.removeChild(a.firstChild)):a="string"===typeof b.is?c.createElement(a,{is:b.is}):c.createElement(a):a=c.createElementNS(d,a);return a}function og(a,b){return(9===b.nodeType?b:b.ownerDocument).createTextNode(a)}
9095
+ function pg(a,b,c,d){var e=ig(b,c);switch(b){case "iframe":case "object":U("topLoad","load",a);var f=c;break;case "video":case "audio":for(f in mg)mg.hasOwnProperty(f)&&U(f,mg[f],a);f=c;break;case "source":U("topError","error",a);f=c;break;case "img":case "image":U("topError","error",a);U("topLoad","load",a);f=c;break;case "form":U("topReset","reset",a);U("topSubmit","submit",a);f=c;break;case "details":U("topToggle","toggle",a);f=c;break;case "input":Mf(a,c);f=Lf(a,c);U("topInvalid","invalid",a);
9096
+ lg(d,"onChange");break;case "option":f=Rf(a,c);break;case "select":Tf(a,c);f=B({},c,{value:void 0});U("topInvalid","invalid",a);lg(d,"onChange");break;case "textarea":Vf(a,c);f=Uf(a,c);U("topInvalid","invalid",a);lg(d,"onChange");break;default:f=c}hg(b,f,kg);var g=f,h;for(h in g)if(g.hasOwnProperty(h)){var k=g[h];"style"===h?fg(a,k,kg):"dangerouslySetInnerHTML"===h?(k=k?k.__html:void 0,null!=k&&bg(a,k)):"children"===h?"string"===typeof k?("textarea"!==b||""!==k)&&cg(a,k):"number"===typeof k&&cg(a,
9097
+ ""+k):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(Ra.hasOwnProperty(h)?null!=k&&lg(d,h):e?Kf(a,h,k):null!=k&&If(a,h,k))}switch(b){case "input":Bc(a);Pf(a,c);break;case "textarea":Bc(a);Xf(a,c);break;case "option":null!=c.value&&a.setAttribute("value",c.value);break;case "select":a.multiple=!!c.multiple;b=c.value;null!=b?Sf(a,!!c.multiple,b,!1):null!=c.defaultValue&&Sf(a,!!c.multiple,c.defaultValue,!0);break;default:"function"===typeof f.onClick&&(a.onclick=
9098
+ C)}}
9099
+ function sg(a,b,c,d,e){var f=null;switch(b){case "input":c=Lf(a,c);d=Lf(a,d);f=[];break;case "option":c=Rf(a,c);d=Rf(a,d);f=[];break;case "select":c=B({},c,{value:void 0});d=B({},d,{value:void 0});f=[];break;case "textarea":c=Uf(a,c);d=Uf(a,d);f=[];break;default:"function"!==typeof c.onClick&&"function"===typeof d.onClick&&(a.onclick=C)}hg(b,d,kg);var g,h;a=null;for(g in c)if(!d.hasOwnProperty(g)&&c.hasOwnProperty(g)&&null!=c[g])if("style"===g)for(h in b=c[g],b)b.hasOwnProperty(h)&&(a||(a={}),a[h]=
9100
+ "");else"dangerouslySetInnerHTML"!==g&&"children"!==g&&"suppressContentEditableWarning"!==g&&"suppressHydrationWarning"!==g&&"autoFocus"!==g&&(Ra.hasOwnProperty(g)?f||(f=[]):(f=f||[]).push(g,null));for(g in d){var k=d[g];b=null!=c?c[g]:void 0;if(d.hasOwnProperty(g)&&k!==b&&(null!=k||null!=b))if("style"===g)if(b){for(h in b)!b.hasOwnProperty(h)||k&&k.hasOwnProperty(h)||(a||(a={}),a[h]="");for(h in k)k.hasOwnProperty(h)&&b[h]!==k[h]&&(a||(a={}),a[h]=k[h])}else a||(f||(f=[]),f.push(g,a)),a=k;else"dangerouslySetInnerHTML"===
9101
+ g?(k=k?k.__html:void 0,b=b?b.__html:void 0,null!=k&&b!==k&&(f=f||[]).push(g,""+k)):"children"===g?b===k||"string"!==typeof k&&"number"!==typeof k||(f=f||[]).push(g,""+k):"suppressContentEditableWarning"!==g&&"suppressHydrationWarning"!==g&&(Ra.hasOwnProperty(g)?(null!=k&&lg(e,g),f||b===k||(f=[])):(f=f||[]).push(g,k))}a&&(f=f||[]).push("style",a);return f}
9102
+ function tg(a,b,c,d,e){"input"===c&&"radio"===e.type&&null!=e.name&&Nf(a,e);ig(c,d);d=ig(c,e);for(var f=0;f<b.length;f+=2){var g=b[f],h=b[f+1];"style"===g?fg(a,h,kg):"dangerouslySetInnerHTML"===g?bg(a,h):"children"===g?cg(a,h):d?null!=h?Kf(a,g,h):a.removeAttribute(g):null!=h?If(a,g,h):Jf(a,g)}switch(c){case "input":Of(a,e);break;case "textarea":Wf(a,e);break;case "select":a._wrapperState.initialValue=void 0,b=a._wrapperState.wasMultiple,a._wrapperState.wasMultiple=!!e.multiple,c=e.value,null!=c?Sf(a,
9103
+ !!e.multiple,c,!1):b!==!!e.multiple&&(null!=e.defaultValue?Sf(a,!!e.multiple,e.defaultValue,!0):Sf(a,!!e.multiple,e.multiple?[]:"",!1))}}
9104
+ function ug(a,b,c,d,e){switch(b){case "iframe":case "object":U("topLoad","load",a);break;case "video":case "audio":for(var f in mg)mg.hasOwnProperty(f)&&U(f,mg[f],a);break;case "source":U("topError","error",a);break;case "img":case "image":U("topError","error",a);U("topLoad","load",a);break;case "form":U("topReset","reset",a);U("topSubmit","submit",a);break;case "details":U("topToggle","toggle",a);break;case "input":Mf(a,c);U("topInvalid","invalid",a);lg(e,"onChange");break;case "select":Tf(a,c);
9105
+ U("topInvalid","invalid",a);lg(e,"onChange");break;case "textarea":Vf(a,c),U("topInvalid","invalid",a),lg(e,"onChange")}hg(b,c,kg);d=null;for(var g in c)c.hasOwnProperty(g)&&(f=c[g],"children"===g?"string"===typeof f?a.textContent!==f&&(d=["children",f]):"number"===typeof f&&a.textContent!==""+f&&(d=["children",""+f]):Ra.hasOwnProperty(g)&&null!=f&&lg(e,g));switch(b){case "input":Bc(a);Pf(a,c);break;case "textarea":Bc(a);Xf(a,c);break;case "select":case "option":break;default:"function"===typeof c.onClick&&
9106
+ (a.onclick=C)}return d}function vg(a,b){return a.nodeValue!==b}
9107
+ var wg=Object.freeze({createElement:ng,createTextNode:og,setInitialProperties:pg,diffProperties:sg,updateProperties:tg,diffHydratedProperties:ug,diffHydratedText:vg,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(a,b,c){switch(b){case "input":Of(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=
9108
+ c.parentNode;c=c.querySelectorAll("input[name\x3d"+JSON.stringify(""+b)+'][type\x3d"radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=rb(d);e?void 0:E("90");Cc(d);Of(d,e)}}}break;case "textarea":Wf(a,c);break;case "select":b=c.value,null!=b&&Sf(a,!!c.multiple,b,!1)}}});nc.injectFiberControlledHostComponent(wg);var xg=null,Mg=null;function Ng(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}
9109
+ function Og(a){a=a?9===a.nodeType?a.documentElement:a.firstChild:null;return!(!a||1!==a.nodeType||!a.hasAttribute("data-reactroot"))}
9110
+ var Z=of({getRootHostContext:function(a){var b=a.nodeType;switch(b){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:$f(null,"");break;default:b=8===b?a.parentNode:a,a=b.namespaceURI||null,b=b.tagName,a=$f(a,b)}return a},getChildHostContext:function(a,b){return $f(a,b)},getPublicInstance:function(a){return a},prepareForCommit:function(){xg=td;var a=da();if(Kd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{var c=window.getSelection&&window.getSelection();
9111
+ if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(z){b=null;break a}var f=0,g=-1,h=-1,k=0,q=0,v=a,y=null;b:for(;;){for(var u;;){v!==b||0!==d&&3!==v.nodeType||(g=f+d);v!==e||0!==c&&3!==v.nodeType||(h=f+c);3===v.nodeType&&(f+=v.nodeValue.length);if(null===(u=v.firstChild))break;y=v;v=u}for(;;){if(v===a)break b;y===b&&++k===d&&(g=f);y===e&&++q===c&&(h=f);if(null!==(u=v.nextSibling))break;v=y;y=v.parentNode}v=u}b=-1===g||-1===h?null:
9112
+ {start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;Mg={focusedElem:a,selectionRange:b};ud(!1)},resetAfterCommit:function(){var a=Mg,b=da(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&fa(document.documentElement,c)){if(Kd(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(window.getSelection){b=window.getSelection();var e=c[Eb()].length;a=Math.min(d.start,e);d=void 0===d.end?a:Math.min(d.end,e);!b.extend&&a>
9113
+ d&&(e=d,d=a,a=e);e=Jd(c,a);var f=Jd(c,d);if(e&&f&&(1!==b.rangeCount||b.anchorNode!==e.node||b.anchorOffset!==e.offset||b.focusNode!==f.node||b.focusOffset!==f.offset)){var g=document.createRange();g.setStart(e.node,e.offset);b.removeAllRanges();a>d?(b.addRange(g),b.extend(f.node,f.offset)):(g.setEnd(f.node,f.offset),b.addRange(g))}}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});ia(c);for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=
9114
+ a.top}Mg=null;ud(xg);xg=null},createInstance:function(a,b,c,d,e){a=ng(a,b,c,d);a[Q]=e;a[ob]=b;return a},appendInitialChild:function(a,b){a.appendChild(b)},finalizeInitialChildren:function(a,b,c,d){pg(a,b,c,d);a:{switch(b){case "button":case "input":case "select":case "textarea":a=!!c.autoFocus;break a}a=!1}return a},prepareUpdate:function(a,b,c,d,e){return sg(a,b,c,d,e)},shouldSetTextContent:function(a,b){return"textarea"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===
9115
+ typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&"string"===typeof b.dangerouslySetInnerHTML.__html},shouldDeprioritizeSubtree:function(a,b){return!!b.hidden},createTextInstance:function(a,b,c,d){a=og(a,b);a[Q]=d;return a},now:rf,mutation:{commitMount:function(a){a.focus()},commitUpdate:function(a,b,c,d,e){a[ob]=e;tg(a,b,c,d,e)},resetTextContent:function(a){a.textContent=""},commitTextUpdate:function(a,b,c){a.nodeValue=c},appendChild:function(a,b){a.appendChild(b)},appendChildToContainer:function(a,
9116
+ b){8===a.nodeType?a.parentNode.insertBefore(b,a):a.appendChild(b)},insertBefore:function(a,b,c){a.insertBefore(b,c)},insertInContainerBefore:function(a,b,c){8===a.nodeType?a.parentNode.insertBefore(b,c):a.insertBefore(b,c)},removeChild:function(a,b){a.removeChild(b)},removeChildFromContainer:function(a,b){8===a.nodeType?a.parentNode.removeChild(b):a.removeChild(b)}},hydration:{canHydrateInstance:function(a,b){return 1!==a.nodeType||b.toLowerCase()!==a.nodeName.toLowerCase()?null:a},canHydrateTextInstance:function(a,
9117
+ b){return""===b||3!==a.nodeType?null:a},getNextHydratableSibling:function(a){for(a=a.nextSibling;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a},getFirstHydratableChild:function(a){for(a=a.firstChild;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a},hydrateInstance:function(a,b,c,d,e,f){a[Q]=f;a[ob]=c;return ug(a,b,c,e,d)},hydrateTextInstance:function(a,b,c){a[Q]=c;return vg(a,b)},didNotMatchHydratedContainerTextInstance:function(){},didNotMatchHydratedTextInstance:function(){},
9118
+ didNotHydrateContainerInstance:function(){},didNotHydrateInstance:function(){},didNotFindHydratableContainerInstance:function(){},didNotFindHydratableContainerTextInstance:function(){},didNotFindHydratableInstance:function(){},didNotFindHydratableTextInstance:function(){}},scheduleDeferredCallback:sf,cancelDeferredCallback:tf,useSyncScheduling:!0});rc=Z.batchedUpdates;
9119
+ function Pg(a,b,c,d,e){Ng(c)?void 0:E("200");var f=c._reactRootContainer;if(f)Z.updateContainer(b,f,a,e);else{d=d||Og(c);if(!d)for(f=void 0;f=c.lastChild;)c.removeChild(f);var g=Z.createContainer(c,d);f=c._reactRootContainer=g;Z.unbatchedUpdates(function(){Z.updateContainer(b,g,a,e)})}return Z.getPublicRootInstance(f)}function Qg(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;Ng(b)?void 0:E("200");return pf(a,b,null,c)}
9120
+ function Rg(a,b){this._reactRootContainer=Z.createContainer(a,b)}Rg.prototype.render=function(a,b){Z.updateContainer(a,this._reactRootContainer,null,b)};Rg.prototype.unmount=function(a){Z.updateContainer(null,this._reactRootContainer,null,a)};
9121
+ var Sg={createPortal:Qg,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;if(b)return Z.findHostInstance(b);"function"===typeof a.render?E("188"):E("213",Object.keys(a))},hydrate:function(a,b,c){return Pg(null,a,b,!0,c)},render:function(a,b,c){return Pg(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){null==a||void 0===a._reactInternalFiber?E("38"):void 0;return Pg(a,b,c,!1,d)},unmountComponentAtNode:function(a){Ng(a)?void 0:
9122
+ E("40");return a._reactRootContainer?(Z.unbatchedUpdates(function(){Pg(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:Qg,unstable_batchedUpdates:tc,unstable_deferredUpdates:Z.deferredUpdates,flushSync:Z.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:mb,EventPluginRegistry:Va,EventPropagators:Cb,ReactControlledComponent:qc,ReactDOMComponentTree:sb,ReactDOMEventListener:xd}};
9123
+ Z.injectIntoDevTools({findFiberByHostInstance:pb,bundleType:0,version:"16.2.0",rendererPackageName:"react-dom"});var Tg=Object.freeze({default:Sg}),Ug=Tg&&Sg||Tg;module.exports=Ug["default"]?Ug["default"]:Ug;
9124
+
9125
+
9126
+ /***/ }),
9127
+ /* 44 */
9128
+ /***/ (function(module, exports, __webpack_require__) {
9129
+
9130
+ "use strict";
9131
+
9132
+
9133
+ /**
9134
+ * Copyright (c) 2013-present, Facebook, Inc.
9135
+ *
9136
+ * This source code is licensed under the MIT license found in the
9137
+ * LICENSE file in the root directory of this source tree.
9138
+ *
9139
+ * @typechecks
9140
+ */
9141
+
9142
+ var isNode = __webpack_require__(45);
9143
+
9144
+ /**
9145
+ * @param {*} object The object to check.
9146
+ * @return {boolean} Whether or not the object is a DOM text node.
9147
+ */
9148
+ function isTextNode(object) {
9149
+ return isNode(object) && object.nodeType == 3;
9150
+ }
9151
+
9152
+ module.exports = isTextNode;
9153
+
9154
+ /***/ }),
9155
+ /* 45 */
9156
+ /***/ (function(module, exports, __webpack_require__) {
9157
+
9158
+ "use strict";
9159
+
9160
+
9161
+ /**
9162
+ * Copyright (c) 2013-present, Facebook, Inc.
9163
+ *
9164
+ * This source code is licensed under the MIT license found in the
9165
+ * LICENSE file in the root directory of this source tree.
9166
+ *
9167
+ * @typechecks
9168
+ */
9169
+
9170
+ /**
9171
+ * @param {*} object The object to check.
9172
+ * @return {boolean} Whether or not the object is a DOM node.
9173
+ */
9174
+ function isNode(object) {
9175
+ var doc = object ? object.ownerDocument || object : document;
9176
+ var defaultView = doc.defaultView || window;
9177
+ return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
9178
+ }
9179
+
9180
+ module.exports = isNode;
9181
+
9182
+ /***/ }),
9183
+ /* 46 */
9184
+ /***/ (function(module, exports, __webpack_require__) {
9185
+
9186
+ "use strict";
9187
+ /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.2.0
9188
+ * react-dom.development.js
9189
+ *
9190
+ * Copyright (c) 2013-present, Facebook, Inc.
9191
+ *
9192
+ * This source code is licensed under the MIT license found in the
9193
+ * LICENSE file in the root directory of this source tree.
9194
+ */
9195
+
9196
+
9197
+
9198
+
9199
+
9200
+ if (process.env.NODE_ENV !== "production") {
9201
+ (function() {
9202
+ 'use strict';
9203
+
9204
+ var React = __webpack_require__(1);
9205
+ var invariant = __webpack_require__(7);
9206
+ var warning = __webpack_require__(9);
9207
+ var ExecutionEnvironment = __webpack_require__(19);
9208
+ var _assign = __webpack_require__(6);
9209
+ var emptyFunction = __webpack_require__(2);
9210
+ var EventListener = __webpack_require__(20);
9211
+ var getActiveElement = __webpack_require__(21);
9212
+ var shallowEqual = __webpack_require__(22);
9213
+ var containsNode = __webpack_require__(23);
9214
+ var focusNode = __webpack_require__(24);
9215
+ var emptyObject = __webpack_require__(8);
9216
+ var checkPropTypes = __webpack_require__(12);
9217
+ var hyphenateStyleName = __webpack_require__(47);
9218
+ var camelizeStyleName = __webpack_require__(49);
9219
+
9220
+ /**
9221
+ * WARNING: DO NOT manually require this module.
9222
+ * This is a replacement for `invariant(...)` used by the error code system
9223
+ * and will _only_ be required by the corresponding babel pass.
9224
+ * It always throws.
9225
+ */
9226
+
9227
+ !React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;
9228
+
9229
+ // These attributes should be all lowercase to allow for
9230
+ // case insensitive checks
9231
+ var RESERVED_PROPS = {
9232
+ children: true,
9233
+ dangerouslySetInnerHTML: true,
9234
+ defaultValue: true,
9235
+ defaultChecked: true,
9236
+ innerHTML: true,
9237
+ suppressContentEditableWarning: true,
9238
+ suppressHydrationWarning: true,
9239
+ style: true
9240
+ };
9241
+
9242
+ function checkMask(value, bitmask) {
9243
+ return (value & bitmask) === bitmask;
9244
+ }
9245
+
9246
+ var DOMPropertyInjection = {
9247
+ /**
9248
+ * Mapping from normalized, camelcased property names to a configuration that
9249
+ * specifies how the associated DOM property should be accessed or rendered.
9250
+ */
9251
+ MUST_USE_PROPERTY: 0x1,
9252
+ HAS_BOOLEAN_VALUE: 0x4,
9253
+ HAS_NUMERIC_VALUE: 0x8,
9254
+ HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
9255
+ HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
9256
+ HAS_STRING_BOOLEAN_VALUE: 0x40,
9257
+
9258
+ /**
9259
+ * Inject some specialized knowledge about the DOM. This takes a config object
9260
+ * with the following properties:
9261
+ *
9262
+ * Properties: object mapping DOM property name to one of the
9263
+ * DOMPropertyInjection constants or null. If your attribute isn't in here,
9264
+ * it won't get written to the DOM.
9265
+ *
9266
+ * DOMAttributeNames: object mapping React attribute name to the DOM
9267
+ * attribute name. Attribute names not specified use the **lowercase**
9268
+ * normalized name.
9269
+ *
9270
+ * DOMAttributeNamespaces: object mapping React attribute name to the DOM
9271
+ * attribute namespace URL. (Attribute names not specified use no namespace.)
9272
+ *
9273
+ * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
9274
+ * Property names not specified use the normalized name.
9275
+ *
9276
+ * DOMMutationMethods: Properties that require special mutation methods. If
9277
+ * `value` is undefined, the mutation method should unset the property.
9278
+ *
9279
+ * @param {object} domPropertyConfig the config as described above.
9280
+ */
9281
+ injectDOMPropertyConfig: function (domPropertyConfig) {
9282
+ var Injection = DOMPropertyInjection;
9283
+ var Properties = domPropertyConfig.Properties || {};
9284
+ var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
9285
+ var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
9286
+ var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
9287
+
9288
+ for (var propName in Properties) {
9289
+ !!properties.hasOwnProperty(propName) ? invariant(false, "injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.", propName) : void 0;
9290
+
9291
+ var lowerCased = propName.toLowerCase();
9292
+ var propConfig = Properties[propName];
9293
+
9294
+ var propertyInfo = {
9295
+ attributeName: lowerCased,
9296
+ attributeNamespace: null,
9297
+ propertyName: propName,
9298
+ mutationMethod: null,
9299
+
9300
+ mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
9301
+ hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
9302
+ hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
9303
+ hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
9304
+ hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE),
9305
+ hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE)
9306
+ };
9307
+ !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant(false, "DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s", propName) : void 0;
9308
+
9309
+ if (DOMAttributeNames.hasOwnProperty(propName)) {
9310
+ var attributeName = DOMAttributeNames[propName];
9311
+
9312
+ propertyInfo.attributeName = attributeName;
9313
+ }
9314
+
9315
+ if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
9316
+ propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
9317
+ }
9318
+
9319
+ if (DOMMutationMethods.hasOwnProperty(propName)) {
9320
+ propertyInfo.mutationMethod = DOMMutationMethods[propName];
9321
+ }
9322
+
9323
+ // Downcase references to whitelist properties to check for membership
9324
+ // without case-sensitivity. This allows the whitelist to pick up
9325
+ // `allowfullscreen`, which should be written using the property configuration
9326
+ // for `allowFullscreen`
9327
+ properties[propName] = propertyInfo;
9328
+ }
9329
+ }
9330
+ };
9331
+
9332
+ /* eslint-disable max-len */
9333
+ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
9334
+ /* eslint-enable max-len */
9335
+ var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
9336
+
9337
+
9338
+ var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
9339
+
9340
+ /**
9341
+ * Map from property "standard name" to an object with info about how to set
9342
+ * the property in the DOM. Each object contains:
9343
+ *
9344
+ * attributeName:
9345
+ * Used when rendering markup or with `*Attribute()`.
9346
+ * attributeNamespace
9347
+ * propertyName:
9348
+ * Used on DOM node instances. (This includes properties that mutate due to
9349
+ * external factors.)
9350
+ * mutationMethod:
9351
+ * If non-null, used instead of the property or `setAttribute()` after
9352
+ * initial render.
9353
+ * mustUseProperty:
9354
+ * Whether the property must be accessed and mutated as an object property.
9355
+ * hasBooleanValue:
9356
+ * Whether the property should be removed when set to a falsey value.
9357
+ * hasNumericValue:
9358
+ * Whether the property must be numeric or parse as a numeric and should be
9359
+ * removed when set to a falsey value.
9360
+ * hasPositiveNumericValue:
9361
+ * Whether the property must be positive numeric or parse as a positive
9362
+ * numeric and should be removed when set to a falsey value.
9363
+ * hasOverloadedBooleanValue:
9364
+ * Whether the property can be used as a flag as well as with a value.
9365
+ * Removed when strictly equal to false; present without a value when
9366
+ * strictly equal to true; present with a value otherwise.
9367
+ */
9368
+ var properties = {};
9369
+
9370
+ /**
9371
+ * Checks whether a property name is a writeable attribute.
9372
+ * @method
9373
+ */
9374
+ function shouldSetAttribute(name, value) {
9375
+ if (isReservedProp(name)) {
9376
+ return false;
9377
+ }
9378
+ if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
9379
+ return false;
9380
+ }
9381
+ if (value === null) {
9382
+ return true;
9383
+ }
9384
+ switch (typeof value) {
9385
+ case 'boolean':
9386
+ return shouldAttributeAcceptBooleanValue(name);
9387
+ case 'undefined':
9388
+ case 'number':
9389
+ case 'string':
9390
+ case 'object':
9391
+ return true;
9392
+ default:
9393
+ // function, symbol
9394
+ return false;
9395
+ }
9396
+ }
9397
+
9398
+ function getPropertyInfo(name) {
9399
+ return properties.hasOwnProperty(name) ? properties[name] : null;
9400
+ }
9401
+
9402
+ function shouldAttributeAcceptBooleanValue(name) {
9403
+ if (isReservedProp(name)) {
9404
+ return true;
9405
+ }
9406
+ var propertyInfo = getPropertyInfo(name);
9407
+ if (propertyInfo) {
9408
+ return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue;
9409
+ }
9410
+ var prefix = name.toLowerCase().slice(0, 5);
9411
+ return prefix === 'data-' || prefix === 'aria-';
9412
+ }
9413
+
9414
+ /**
9415
+ * Checks to see if a property name is within the list of properties
9416
+ * reserved for internal React operations. These properties should
9417
+ * not be set on an HTML element.
9418
+ *
9419
+ * @private
9420
+ * @param {string} name
9421
+ * @return {boolean} If the name is within reserved props
9422
+ */
9423
+ function isReservedProp(name) {
9424
+ return RESERVED_PROPS.hasOwnProperty(name);
9425
+ }
9426
+
9427
+ var injection = DOMPropertyInjection;
9428
+
9429
+ var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;
9430
+ var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;
9431
+ var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;
9432
+ var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;
9433
+ var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;
9434
+ var HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE;
9435
+
9436
+ var HTMLDOMPropertyConfig = {
9437
+ // When adding attributes to this list, be sure to also add them to
9438
+ // the `possibleStandardNames` module to ensure casing and incorrect
9439
+ // name warnings.
9440
+ Properties: {
9441
+ allowFullScreen: HAS_BOOLEAN_VALUE,
9442
+ // specifies target context for links with `preload` type
9443
+ async: HAS_BOOLEAN_VALUE,
9444
+ // Note: there is a special case that prevents it from being written to the DOM
9445
+ // on the client side because the browsers are inconsistent. Instead we call focus().
9446
+ autoFocus: HAS_BOOLEAN_VALUE,
9447
+ autoPlay: HAS_BOOLEAN_VALUE,
9448
+ capture: HAS_OVERLOADED_BOOLEAN_VALUE,
9449
+ checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
9450
+ cols: HAS_POSITIVE_NUMERIC_VALUE,
9451
+ contentEditable: HAS_STRING_BOOLEAN_VALUE,
9452
+ controls: HAS_BOOLEAN_VALUE,
9453
+ 'default': HAS_BOOLEAN_VALUE,
9454
+ defer: HAS_BOOLEAN_VALUE,
9455
+ disabled: HAS_BOOLEAN_VALUE,
9456
+ download: HAS_OVERLOADED_BOOLEAN_VALUE,
9457
+ draggable: HAS_STRING_BOOLEAN_VALUE,
9458
+ formNoValidate: HAS_BOOLEAN_VALUE,
9459
+ hidden: HAS_BOOLEAN_VALUE,
9460
+ loop: HAS_BOOLEAN_VALUE,
9461
+ // Caution; `option.selected` is not updated if `select.multiple` is
9462
+ // disabled with `removeAttribute`.
9463
+ multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
9464
+ muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
9465
+ noValidate: HAS_BOOLEAN_VALUE,
9466
+ open: HAS_BOOLEAN_VALUE,
9467
+ playsInline: HAS_BOOLEAN_VALUE,
9468
+ readOnly: HAS_BOOLEAN_VALUE,
9469
+ required: HAS_BOOLEAN_VALUE,
9470
+ reversed: HAS_BOOLEAN_VALUE,
9471
+ rows: HAS_POSITIVE_NUMERIC_VALUE,
9472
+ rowSpan: HAS_NUMERIC_VALUE,
9473
+ scoped: HAS_BOOLEAN_VALUE,
9474
+ seamless: HAS_BOOLEAN_VALUE,
9475
+ selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
9476
+ size: HAS_POSITIVE_NUMERIC_VALUE,
9477
+ start: HAS_NUMERIC_VALUE,
9478
+ // support for projecting regular DOM Elements via V1 named slots ( shadow dom )
9479
+ span: HAS_POSITIVE_NUMERIC_VALUE,
9480
+ spellCheck: HAS_STRING_BOOLEAN_VALUE,
9481
+ // Style must be explicitly set in the attribute list. React components
9482
+ // expect a style object
9483
+ style: 0,
9484
+ // Keep it in the whitelist because it is case-sensitive for SVG.
9485
+ tabIndex: 0,
9486
+ // itemScope is for for Microdata support.
9487
+ // See http://schema.org/docs/gs.html
9488
+ itemScope: HAS_BOOLEAN_VALUE,
9489
+ // These attributes must stay in the white-list because they have
9490
+ // different attribute names (see DOMAttributeNames below)
9491
+ acceptCharset: 0,
9492
+ className: 0,
9493
+ htmlFor: 0,
9494
+ httpEquiv: 0,
9495
+ // Attributes with mutation methods must be specified in the whitelist
9496
+ // Set the string boolean flag to allow the behavior
9497
+ value: HAS_STRING_BOOLEAN_VALUE
9498
+ },
9499
+ DOMAttributeNames: {
9500
+ acceptCharset: 'accept-charset',
9501
+ className: 'class',
9502
+ htmlFor: 'for',
9503
+ httpEquiv: 'http-equiv'
9504
+ },
9505
+ DOMMutationMethods: {
9506
+ value: function (node, value) {
9507
+ if (value == null) {
9508
+ return node.removeAttribute('value');
9509
+ }
9510
+
9511
+ // Number inputs get special treatment due to some edge cases in
9512
+ // Chrome. Let everything else assign the value attribute as normal.
9513
+ // https://github.com/facebook/react/issues/7253#issuecomment-236074326
9514
+ if (node.type !== 'number' || node.hasAttribute('value') === false) {
9515
+ node.setAttribute('value', '' + value);
9516
+ } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
9517
+ // Don't assign an attribute if validation reports bad
9518
+ // input. Chrome will clear the value. Additionally, don't
9519
+ // operate on inputs that have focus, otherwise Chrome might
9520
+ // strip off trailing decimal places and cause the user's
9521
+ // cursor position to jump to the beginning of the input.
9522
+ //
9523
+ // In ReactDOMInput, we have an onBlur event that will trigger
9524
+ // this function again when focus is lost.
9525
+ node.setAttribute('value', '' + value);
9526
+ }
9527
+ }
9528
+ }
9529
+ };
9530
+
9531
+ var HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE;
9532
+
9533
+
9534
+ var NS = {
9535
+ xlink: 'http://www.w3.org/1999/xlink',
9536
+ xml: 'http://www.w3.org/XML/1998/namespace'
9537
+ };
9538
+
9539
+ /**
9540
+ * This is a list of all SVG attributes that need special casing,
9541
+ * namespacing, or boolean value assignment.
9542
+ *
9543
+ * When adding attributes to this list, be sure to also add them to
9544
+ * the `possibleStandardNames` module to ensure casing and incorrect
9545
+ * name warnings.
9546
+ *
9547
+ * SVG Attributes List:
9548
+ * https://www.w3.org/TR/SVG/attindex.html
9549
+ * SMIL Spec:
9550
+ * https://www.w3.org/TR/smil
9551
+ */
9552
+ var ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space'];
9553
+
9554
+ var SVGDOMPropertyConfig = {
9555
+ Properties: {
9556
+ autoReverse: HAS_STRING_BOOLEAN_VALUE$1,
9557
+ externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1,
9558
+ preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1
9559
+ },
9560
+ DOMAttributeNames: {
9561
+ autoReverse: 'autoReverse',
9562
+ externalResourcesRequired: 'externalResourcesRequired',
9563
+ preserveAlpha: 'preserveAlpha'
9564
+ },
9565
+ DOMAttributeNamespaces: {
9566
+ xlinkActuate: NS.xlink,
9567
+ xlinkArcrole: NS.xlink,
9568
+ xlinkHref: NS.xlink,
9569
+ xlinkRole: NS.xlink,
9570
+ xlinkShow: NS.xlink,
9571
+ xlinkTitle: NS.xlink,
9572
+ xlinkType: NS.xlink,
9573
+ xmlBase: NS.xml,
9574
+ xmlLang: NS.xml,
9575
+ xmlSpace: NS.xml
9576
+ }
9577
+ };
9578
+
9579
+ var CAMELIZE = /[\-\:]([a-z])/g;
9580
+ var capitalize = function (token) {
9581
+ return token[1].toUpperCase();
9582
+ };
9583
+
9584
+ ATTRS.forEach(function (original) {
9585
+ var reactName = original.replace(CAMELIZE, capitalize);
9586
+
9587
+ SVGDOMPropertyConfig.Properties[reactName] = 0;
9588
+ SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original;
9589
+ });
9590
+
9591
+ injection.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
9592
+ injection.injectDOMPropertyConfig(SVGDOMPropertyConfig);
9593
+
9594
+ var ReactErrorUtils = {
9595
+ // Used by Fiber to simulate a try-catch.
9596
+ _caughtError: null,
9597
+ _hasCaughtError: false,
9598
+
9599
+ // Used by event system to capture/rethrow the first error.
9600
+ _rethrowError: null,
9601
+ _hasRethrowError: false,
9602
+
9603
+ injection: {
9604
+ injectErrorUtils: function (injectedErrorUtils) {
9605
+ !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant(false, 'Injected invokeGuardedCallback() must be a function.') : void 0;
9606
+ invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;
9607
+ }
9608
+ },
9609
+
9610
+ /**
9611
+ * Call a function while guarding against errors that happens within it.
9612
+ * Returns an error if it throws, otherwise null.
9613
+ *
9614
+ * In production, this is implemented using a try-catch. The reason we don't
9615
+ * use a try-catch directly is so that we can swap out a different
9616
+ * implementation in DEV mode.
9617
+ *
9618
+ * @param {String} name of the guard to use for logging or debugging
9619
+ * @param {Function} func The function to invoke
9620
+ * @param {*} context The context to use when calling the function
9621
+ * @param {...*} args Arguments for function
9622
+ */
9623
+ invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) {
9624
+ invokeGuardedCallback.apply(ReactErrorUtils, arguments);
9625
+ },
9626
+
9627
+ /**
9628
+ * Same as invokeGuardedCallback, but instead of returning an error, it stores
9629
+ * it in a global so it can be rethrown by `rethrowCaughtError` later.
9630
+ * TODO: See if _caughtError and _rethrowError can be unified.
9631
+ *
9632
+ * @param {String} name of the guard to use for logging or debugging
9633
+ * @param {Function} func The function to invoke
9634
+ * @param {*} context The context to use when calling the function
9635
+ * @param {...*} args Arguments for function
9636
+ */
9637
+ invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) {
9638
+ ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);
9639
+ if (ReactErrorUtils.hasCaughtError()) {
9640
+ var error = ReactErrorUtils.clearCaughtError();
9641
+ if (!ReactErrorUtils._hasRethrowError) {
9642
+ ReactErrorUtils._hasRethrowError = true;
9643
+ ReactErrorUtils._rethrowError = error;
9644
+ }
9645
+ }
9646
+ },
9647
+
9648
+ /**
9649
+ * During execution of guarded functions we will capture the first error which
9650
+ * we will rethrow to be handled by the top level error handler.
9651
+ */
9652
+ rethrowCaughtError: function () {
9653
+ return rethrowCaughtError.apply(ReactErrorUtils, arguments);
9654
+ },
9655
+
9656
+ hasCaughtError: function () {
9657
+ return ReactErrorUtils._hasCaughtError;
9658
+ },
9659
+
9660
+ clearCaughtError: function () {
9661
+ if (ReactErrorUtils._hasCaughtError) {
9662
+ var error = ReactErrorUtils._caughtError;
9663
+ ReactErrorUtils._caughtError = null;
9664
+ ReactErrorUtils._hasCaughtError = false;
9665
+ return error;
9666
+ } else {
9667
+ invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
9668
+ }
9669
+ }
9670
+ };
9671
+
9672
+ var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) {
9673
+ ReactErrorUtils._hasCaughtError = false;
9674
+ ReactErrorUtils._caughtError = null;
9675
+ var funcArgs = Array.prototype.slice.call(arguments, 3);
9676
+ try {
9677
+ func.apply(context, funcArgs);
9678
+ } catch (error) {
9679
+ ReactErrorUtils._caughtError = error;
9680
+ ReactErrorUtils._hasCaughtError = true;
9681
+ }
9682
+ };
9683
+
9684
+ {
9685
+ // In DEV mode, we swap out invokeGuardedCallback for a special version
9686
+ // that plays more nicely with the browser's DevTools. The idea is to preserve
9687
+ // "Pause on exceptions" behavior. Because React wraps all user-provided
9688
+ // functions in invokeGuardedCallback, and the production version of
9689
+ // invokeGuardedCallback uses a try-catch, all user exceptions are treated
9690
+ // like caught exceptions, and the DevTools won't pause unless the developer
9691
+ // takes the extra step of enabling pause on caught exceptions. This is
9692
+ // untintuitive, though, because even though React has caught the error, from
9693
+ // the developer's perspective, the error is uncaught.
9694
+ //
9695
+ // To preserve the expected "Pause on exceptions" behavior, we don't use a
9696
+ // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
9697
+ // DOM node, and call the user-provided callback from inside an event handler
9698
+ // for that fake event. If the callback throws, the error is "captured" using
9699
+ // a global event handler. But because the error happens in a different
9700
+ // event loop context, it does not interrupt the normal program flow.
9701
+ // Effectively, this gives us try-catch behavior without actually using
9702
+ // try-catch. Neat!
9703
+
9704
+ // Check that the browser supports the APIs we need to implement our special
9705
+ // DEV version of invokeGuardedCallback
9706
+ if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
9707
+ var fakeNode = document.createElement('react');
9708
+
9709
+ var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
9710
+ // Keeps track of whether the user-provided callback threw an error. We
9711
+ // set this to true at the beginning, then set it to false right after
9712
+ // calling the function. If the function errors, `didError` will never be
9713
+ // set to false. This strategy works even if the browser is flaky and
9714
+ // fails to call our global error handler, because it doesn't rely on
9715
+ // the error event at all.
9716
+ var didError = true;
9717
+
9718
+ // Create an event handler for our fake event. We will synchronously
9719
+ // dispatch our fake event using `dispatchEvent`. Inside the handler, we
9720
+ // call the user-provided callback.
9721
+ var funcArgs = Array.prototype.slice.call(arguments, 3);
9722
+ function callCallback() {
9723
+ // We immediately remove the callback from event listeners so that
9724
+ // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
9725
+ // nested call would trigger the fake event handlers of any call higher
9726
+ // in the stack.
9727
+ fakeNode.removeEventListener(evtType, callCallback, false);
9728
+ func.apply(context, funcArgs);
9729
+ didError = false;
9730
+ }
9731
+
9732
+ // Create a global error event handler. We use this to capture the value
9733
+ // that was thrown. It's possible that this error handler will fire more
9734
+ // than once; for example, if non-React code also calls `dispatchEvent`
9735
+ // and a handler for that event throws. We should be resilient to most of
9736
+ // those cases. Even if our error event handler fires more than once, the
9737
+ // last error event is always used. If the callback actually does error,
9738
+ // we know that the last error event is the correct one, because it's not
9739
+ // possible for anything else to have happened in between our callback
9740
+ // erroring and the code that follows the `dispatchEvent` call below. If
9741
+ // the callback doesn't error, but the error event was fired, we know to
9742
+ // ignore it because `didError` will be false, as described above.
9743
+ var error = void 0;
9744
+ // Use this to track whether the error event is ever called.
9745
+ var didSetError = false;
9746
+ var isCrossOriginError = false;
9747
+
9748
+ function onError(event) {
9749
+ error = event.error;
9750
+ didSetError = true;
9751
+ if (error === null && event.colno === 0 && event.lineno === 0) {
9752
+ isCrossOriginError = true;
9753
+ }
9754
+ }
9755
+
9756
+ // Create a fake event type.
9757
+ var evtType = 'react-' + (name ? name : 'invokeguardedcallback');
9758
+
9759
+ // Attach our event handlers
9760
+ window.addEventListener('error', onError);
9761
+ fakeNode.addEventListener(evtType, callCallback, false);
9762
+
9763
+ // Synchronously dispatch our fake event. If the user-provided function
9764
+ // errors, it will trigger our global error handler.
9765
+ var evt = document.createEvent('Event');
9766
+ evt.initEvent(evtType, false, false);
9767
+ fakeNode.dispatchEvent(evt);
9768
+
9769
+ if (didError) {
9770
+ if (!didSetError) {
9771
+ // The callback errored, but the error event never fired.
9772
+ error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
9773
+ } else if (isCrossOriginError) {
9774
+ error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
9775
+ }
9776
+ ReactErrorUtils._hasCaughtError = true;
9777
+ ReactErrorUtils._caughtError = error;
9778
+ } else {
9779
+ ReactErrorUtils._hasCaughtError = false;
9780
+ ReactErrorUtils._caughtError = null;
9781
+ }
9782
+
9783
+ // Remove our event listeners
9784
+ window.removeEventListener('error', onError);
9785
+ };
9786
+
9787
+ invokeGuardedCallback = invokeGuardedCallbackDev;
9788
+ }
9789
+ }
9790
+
9791
+ var rethrowCaughtError = function () {
9792
+ if (ReactErrorUtils._hasRethrowError) {
9793
+ var error = ReactErrorUtils._rethrowError;
9794
+ ReactErrorUtils._rethrowError = null;
9795
+ ReactErrorUtils._hasRethrowError = false;
9796
+ throw error;
9797
+ }
9798
+ };
9799
+
9800
+ /**
9801
+ * Injectable ordering of event plugins.
9802
+ */
9803
+ var eventPluginOrder = null;
9804
+
9805
+ /**
9806
+ * Injectable mapping from names to event plugin modules.
9807
+ */
9808
+ var namesToPlugins = {};
9809
+
9810
+ /**
9811
+ * Recomputes the plugin list using the injected plugins and plugin ordering.
9812
+ *
9813
+ * @private
9814
+ */
9815
+ function recomputePluginOrdering() {
9816
+ if (!eventPluginOrder) {
9817
+ // Wait until an `eventPluginOrder` is injected.
9818
+ return;
9819
+ }
9820
+ for (var pluginName in namesToPlugins) {
9821
+ var pluginModule = namesToPlugins[pluginName];
9822
+ var pluginIndex = eventPluginOrder.indexOf(pluginName);
9823
+ !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
9824
+ if (plugins[pluginIndex]) {
9825
+ continue;
9826
+ }
9827
+ !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
9828
+ plugins[pluginIndex] = pluginModule;
9829
+ var publishedEvents = pluginModule.eventTypes;
9830
+ for (var eventName in publishedEvents) {
9831
+ !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
9832
+ }
9833
+ }
9834
+ }
9835
+
9836
+ /**
9837
+ * Publishes an event so that it can be dispatched by the supplied plugin.
9838
+ *
9839
+ * @param {object} dispatchConfig Dispatch configuration for the event.
9840
+ * @param {object} PluginModule Plugin publishing the event.
9841
+ * @return {boolean} True if the event was successfully published.
9842
+ * @private
9843
+ */
9844
+ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
9845
+ !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
9846
+ eventNameDispatchConfigs[eventName] = dispatchConfig;
9847
+
9848
+ var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
9849
+ if (phasedRegistrationNames) {
9850
+ for (var phaseName in phasedRegistrationNames) {
9851
+ if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
9852
+ var phasedRegistrationName = phasedRegistrationNames[phaseName];
9853
+ publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
9854
+ }
9855
+ }
9856
+ return true;
9857
+ } else if (dispatchConfig.registrationName) {
9858
+ publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
9859
+ return true;
9860
+ }
9861
+ return false;
9862
+ }
9863
+
9864
+ /**
9865
+ * Publishes a registration name that is used to identify dispatched events.
9866
+ *
9867
+ * @param {string} registrationName Registration name to add.
9868
+ * @param {object} PluginModule Plugin publishing the event.
9869
+ * @private
9870
+ */
9871
+ function publishRegistrationName(registrationName, pluginModule, eventName) {
9872
+ !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
9873
+ registrationNameModules[registrationName] = pluginModule;
9874
+ registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
9875
+
9876
+ {
9877
+ var lowerCasedName = registrationName.toLowerCase();
9878
+ possibleRegistrationNames[lowerCasedName] = registrationName;
9879
+
9880
+ if (registrationName === 'onDoubleClick') {
9881
+ possibleRegistrationNames.ondblclick = registrationName;
9882
+ }
9883
+ }
9884
+ }
9885
+
9886
+ /**
9887
+ * Registers plugins so that they can extract and dispatch events.
9888
+ *
9889
+ * @see {EventPluginHub}
9890
+ */
9891
+
9892
+ /**
9893
+ * Ordered list of injected plugins.
9894
+ */
9895
+ var plugins = [];
9896
+
9897
+ /**
9898
+ * Mapping from event name to dispatch config
9899
+ */
9900
+ var eventNameDispatchConfigs = {};
9901
+
9902
+ /**
9903
+ * Mapping from registration name to plugin module
9904
+ */
9905
+ var registrationNameModules = {};
9906
+
9907
+ /**
9908
+ * Mapping from registration name to event name
9909
+ */
9910
+ var registrationNameDependencies = {};
9911
+
9912
+ /**
9913
+ * Mapping from lowercase registration names to the properly cased version,
9914
+ * used to warn in the case of missing event handlers. Available
9915
+ * only in true.
9916
+ * @type {Object}
9917
+ */
9918
+ var possibleRegistrationNames = {};
9919
+ // Trust the developer to only use possibleRegistrationNames in true
9920
+
9921
+ /**
9922
+ * Injects an ordering of plugins (by plugin name). This allows the ordering
9923
+ * to be decoupled from injection of the actual plugins so that ordering is
9924
+ * always deterministic regardless of packaging, on-the-fly injection, etc.
9925
+ *
9926
+ * @param {array} InjectedEventPluginOrder
9927
+ * @internal
9928
+ * @see {EventPluginHub.injection.injectEventPluginOrder}
9929
+ */
9930
+ function injectEventPluginOrder(injectedEventPluginOrder) {
9931
+ !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
9932
+ // Clone the ordering so it cannot be dynamically mutated.
9933
+ eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
9934
+ recomputePluginOrdering();
9935
+ }
9936
+
9937
+ /**
9938
+ * Injects plugins to be used by `EventPluginHub`. The plugin names must be
9939
+ * in the ordering injected by `injectEventPluginOrder`.
9940
+ *
9941
+ * Plugins can be injected as part of page initialization or on-the-fly.
9942
+ *
9943
+ * @param {object} injectedNamesToPlugins Map from names to plugin modules.
9944
+ * @internal
9945
+ * @see {EventPluginHub.injection.injectEventPluginsByName}
9946
+ */
9947
+ function injectEventPluginsByName(injectedNamesToPlugins) {
9948
+ var isOrderingDirty = false;
9949
+ for (var pluginName in injectedNamesToPlugins) {
9950
+ if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
9951
+ continue;
9952
+ }
9953
+ var pluginModule = injectedNamesToPlugins[pluginName];
9954
+ if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
9955
+ !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
9956
+ namesToPlugins[pluginName] = pluginModule;
9957
+ isOrderingDirty = true;
9958
+ }
9959
+ }
9960
+ if (isOrderingDirty) {
9961
+ recomputePluginOrdering();
9962
+ }
9963
+ }
9964
+
9965
+ var EventPluginRegistry = Object.freeze({
9966
+ plugins: plugins,
9967
+ eventNameDispatchConfigs: eventNameDispatchConfigs,
9968
+ registrationNameModules: registrationNameModules,
9969
+ registrationNameDependencies: registrationNameDependencies,
9970
+ possibleRegistrationNames: possibleRegistrationNames,
9971
+ injectEventPluginOrder: injectEventPluginOrder,
9972
+ injectEventPluginsByName: injectEventPluginsByName
9973
+ });
9974
+
9975
+ var getFiberCurrentPropsFromNode = null;
9976
+ var getInstanceFromNode = null;
9977
+ var getNodeFromInstance = null;
9978
+
9979
+ var injection$2 = {
9980
+ injectComponentTree: function (Injected) {
9981
+ getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode;
9982
+ getInstanceFromNode = Injected.getInstanceFromNode;
9983
+ getNodeFromInstance = Injected.getNodeFromInstance;
9984
+
9985
+ {
9986
+ warning(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
9987
+ }
9988
+ }
9989
+ };
9990
+
9991
+
9992
+
9993
+
9994
+
9995
+
9996
+ var validateEventDispatches;
9997
+ {
9998
+ validateEventDispatches = function (event) {
9999
+ var dispatchListeners = event._dispatchListeners;
10000
+ var dispatchInstances = event._dispatchInstances;
10001
+
10002
+ var listenersIsArr = Array.isArray(dispatchListeners);
10003
+ var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
10004
+
10005
+ var instancesIsArr = Array.isArray(dispatchInstances);
10006
+ var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
10007
+
10008
+ warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.');
10009
+ };
10010
+ }
10011
+
10012
+ /**
10013
+ * Dispatch the event to the listener.
10014
+ * @param {SyntheticEvent} event SyntheticEvent to handle
10015
+ * @param {boolean} simulated If the event is simulated (changes exn behavior)
10016
+ * @param {function} listener Application-level callback
10017
+ * @param {*} inst Internal component instance
10018
+ */
10019
+ function executeDispatch(event, simulated, listener, inst) {
10020
+ var type = event.type || 'unknown-event';
10021
+ event.currentTarget = getNodeFromInstance(inst);
10022
+ ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
10023
+ event.currentTarget = null;
10024
+ }
10025
+
10026
+ /**
10027
+ * Standard/simple iteration through an event's collected dispatches.
10028
+ */
10029
+ function executeDispatchesInOrder(event, simulated) {
10030
+ var dispatchListeners = event._dispatchListeners;
10031
+ var dispatchInstances = event._dispatchInstances;
10032
+ {
10033
+ validateEventDispatches(event);
10034
+ }
10035
+ if (Array.isArray(dispatchListeners)) {
10036
+ for (var i = 0; i < dispatchListeners.length; i++) {
10037
+ if (event.isPropagationStopped()) {
10038
+ break;
10039
+ }
10040
+ // Listeners and Instances are two parallel arrays that are always in sync.
10041
+ executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
10042
+ }
10043
+ } else if (dispatchListeners) {
10044
+ executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
10045
+ }
10046
+ event._dispatchListeners = null;
10047
+ event._dispatchInstances = null;
10048
+ }
10049
+
10050
+ /**
10051
+ * @see executeDispatchesInOrderStopAtTrueImpl
10052
+ */
10053
+
10054
+
10055
+ /**
10056
+ * Execution of a "direct" dispatch - there must be at most one dispatch
10057
+ * accumulated on the event or it is considered an error. It doesn't really make
10058
+ * sense for an event with multiple dispatches (bubbled) to keep track of the
10059
+ * return values at each dispatch execution, but it does tend to make sense when
10060
+ * dealing with "direct" dispatches.
10061
+ *
10062
+ * @return {*} The return value of executing the single dispatch.
10063
+ */
10064
+
10065
+
10066
+ /**
10067
+ * @param {SyntheticEvent} event
10068
+ * @return {boolean} True iff number of dispatches accumulated is greater than 0.
10069
+ */
10070
+
10071
+ /**
10072
+ * Accumulates items that must not be null or undefined into the first one. This
10073
+ * is used to conserve memory by avoiding array allocations, and thus sacrifices
10074
+ * API cleanness. Since `current` can be null before being passed in and not
10075
+ * null after this function, make sure to assign it back to `current`:
10076
+ *
10077
+ * `a = accumulateInto(a, b);`
10078
+ *
10079
+ * This API should be sparingly used. Try `accumulate` for something cleaner.
10080
+ *
10081
+ * @return {*|array<*>} An accumulation of items.
10082
+ */
10083
+
10084
+ function accumulateInto(current, next) {
10085
+ !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
10086
+
10087
+ if (current == null) {
10088
+ return next;
10089
+ }
10090
+
10091
+ // Both are not empty. Warning: Never call x.concat(y) when you are not
10092
+ // certain that x is an Array (x could be a string with concat method).
10093
+ if (Array.isArray(current)) {
10094
+ if (Array.isArray(next)) {
10095
+ current.push.apply(current, next);
10096
+ return current;
10097
+ }
10098
+ current.push(next);
10099
+ return current;
10100
+ }
10101
+
10102
+ if (Array.isArray(next)) {
10103
+ // A bit too dangerous to mutate `next`.
10104
+ return [current].concat(next);
10105
+ }
10106
+
10107
+ return [current, next];
10108
+ }
10109
+
10110
+ /**
10111
+ * @param {array} arr an "accumulation" of items which is either an Array or
10112
+ * a single item. Useful when paired with the `accumulate` module. This is a
10113
+ * simple utility that allows us to reason about a collection of items, but
10114
+ * handling the case when there is exactly one item (and we do not need to
10115
+ * allocate an array).
10116
+ * @param {function} cb Callback invoked with each element or a collection.
10117
+ * @param {?} [scope] Scope used as `this` in a callback.
10118
+ */
10119
+ function forEachAccumulated(arr, cb, scope) {
10120
+ if (Array.isArray(arr)) {
10121
+ arr.forEach(cb, scope);
10122
+ } else if (arr) {
10123
+ cb.call(scope, arr);
10124
+ }
10125
+ }
10126
+
10127
+ /**
10128
+ * Internal queue of events that have accumulated their dispatches and are
10129
+ * waiting to have their dispatches executed.
10130
+ */
10131
+ var eventQueue = null;
10132
+
10133
+ /**
10134
+ * Dispatches an event and releases it back into the pool, unless persistent.
10135
+ *
10136
+ * @param {?object} event Synthetic event to be dispatched.
10137
+ * @param {boolean} simulated If the event is simulated (changes exn behavior)
10138
+ * @private
10139
+ */
10140
+ var executeDispatchesAndRelease = function (event, simulated) {
10141
+ if (event) {
10142
+ executeDispatchesInOrder(event, simulated);
10143
+
10144
+ if (!event.isPersistent()) {
10145
+ event.constructor.release(event);
10146
+ }
10147
+ }
10148
+ };
10149
+ var executeDispatchesAndReleaseSimulated = function (e) {
10150
+ return executeDispatchesAndRelease(e, true);
10151
+ };
10152
+ var executeDispatchesAndReleaseTopLevel = function (e) {
10153
+ return executeDispatchesAndRelease(e, false);
10154
+ };
10155
+
10156
+ function isInteractive(tag) {
10157
+ return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
10158
+ }
10159
+
10160
+ function shouldPreventMouseEvent(name, type, props) {
10161
+ switch (name) {
10162
+ case 'onClick':
10163
+ case 'onClickCapture':
10164
+ case 'onDoubleClick':
10165
+ case 'onDoubleClickCapture':
10166
+ case 'onMouseDown':
10167
+ case 'onMouseDownCapture':
10168
+ case 'onMouseMove':
10169
+ case 'onMouseMoveCapture':
10170
+ case 'onMouseUp':
10171
+ case 'onMouseUpCapture':
10172
+ return !!(props.disabled && isInteractive(type));
10173
+ default:
10174
+ return false;
10175
+ }
10176
+ }
10177
+
10178
+ /**
10179
+ * This is a unified interface for event plugins to be installed and configured.
10180
+ *
10181
+ * Event plugins can implement the following properties:
10182
+ *
10183
+ * `extractEvents` {function(string, DOMEventTarget, string, object): *}
10184
+ * Required. When a top-level event is fired, this method is expected to
10185
+ * extract synthetic events that will in turn be queued and dispatched.
10186
+ *
10187
+ * `eventTypes` {object}
10188
+ * Optional, plugins that fire events must publish a mapping of registration
10189
+ * names that are used to register listeners. Values of this mapping must
10190
+ * be objects that contain `registrationName` or `phasedRegistrationNames`.
10191
+ *
10192
+ * `executeDispatch` {function(object, function, string)}
10193
+ * Optional, allows plugins to override how an event gets dispatched. By
10194
+ * default, the listener is simply invoked.
10195
+ *
10196
+ * Each plugin that is injected into `EventsPluginHub` is immediately operable.
10197
+ *
10198
+ * @public
10199
+ */
10200
+
10201
+ /**
10202
+ * Methods for injecting dependencies.
10203
+ */
10204
+ var injection$1 = {
10205
+ /**
10206
+ * @param {array} InjectedEventPluginOrder
10207
+ * @public
10208
+ */
10209
+ injectEventPluginOrder: injectEventPluginOrder,
10210
+
10211
+ /**
10212
+ * @param {object} injectedNamesToPlugins Map from names to plugin modules.
10213
+ */
10214
+ injectEventPluginsByName: injectEventPluginsByName
10215
+ };
10216
+
10217
+ /**
10218
+ * @param {object} inst The instance, which is the source of events.
10219
+ * @param {string} registrationName Name of listener (e.g. `onClick`).
10220
+ * @return {?function} The stored callback.
10221
+ */
10222
+ function getListener(inst, registrationName) {
10223
+ var listener;
10224
+
10225
+ // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
10226
+ // live here; needs to be moved to a better place soon
10227
+ var stateNode = inst.stateNode;
10228
+ if (!stateNode) {
10229
+ // Work in progress (ex: onload events in incremental mode).
10230
+ return null;
10231
+ }
10232
+ var props = getFiberCurrentPropsFromNode(stateNode);
10233
+ if (!props) {
10234
+ // Work in progress.
10235
+ return null;
10236
+ }
10237
+ listener = props[registrationName];
10238
+ if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
10239
+ return null;
10240
+ }
10241
+ !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
10242
+ return listener;
10243
+ }
10244
+
10245
+ /**
10246
+ * Allows registered plugins an opportunity to extract events from top-level
10247
+ * native browser events.
10248
+ *
10249
+ * @return {*} An accumulation of synthetic events.
10250
+ * @internal
10251
+ */
10252
+ function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
10253
+ var events;
10254
+ for (var i = 0; i < plugins.length; i++) {
10255
+ // Not every plugin in the ordering may be loaded at runtime.
10256
+ var possiblePlugin = plugins[i];
10257
+ if (possiblePlugin) {
10258
+ var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
10259
+ if (extractedEvents) {
10260
+ events = accumulateInto(events, extractedEvents);
10261
+ }
10262
+ }
10263
+ }
10264
+ return events;
10265
+ }
10266
+
10267
+ /**
10268
+ * Enqueues a synthetic event that should be dispatched when
10269
+ * `processEventQueue` is invoked.
10270
+ *
10271
+ * @param {*} events An accumulation of synthetic events.
10272
+ * @internal
10273
+ */
10274
+ function enqueueEvents(events) {
10275
+ if (events) {
10276
+ eventQueue = accumulateInto(eventQueue, events);
10277
+ }
10278
+ }
10279
+
10280
+ /**
10281
+ * Dispatches all synthetic events on the event queue.
10282
+ *
10283
+ * @internal
10284
+ */
10285
+ function processEventQueue(simulated) {
10286
+ // Set `eventQueue` to null before processing it so that we can tell if more
10287
+ // events get enqueued while processing.
10288
+ var processingEventQueue = eventQueue;
10289
+ eventQueue = null;
10290
+
10291
+ if (!processingEventQueue) {
10292
+ return;
10293
+ }
10294
+
10295
+ if (simulated) {
10296
+ forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
10297
+ } else {
10298
+ forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
10299
+ }
10300
+ !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
10301
+ // This would be a good time to rethrow if any of the event handlers threw.
10302
+ ReactErrorUtils.rethrowCaughtError();
10303
+ }
10304
+
10305
+ var EventPluginHub = Object.freeze({
10306
+ injection: injection$1,
10307
+ getListener: getListener,
10308
+ extractEvents: extractEvents,
10309
+ enqueueEvents: enqueueEvents,
10310
+ processEventQueue: processEventQueue
10311
+ });
10312
+
10313
+ var IndeterminateComponent = 0; // Before we know whether it is functional or class
10314
+ var FunctionalComponent = 1;
10315
+ var ClassComponent = 2;
10316
+ var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
10317
+ var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
10318
+ var HostComponent = 5;
10319
+ var HostText = 6;
10320
+ var CallComponent = 7;
10321
+ var CallHandlerPhase = 8;
10322
+ var ReturnComponent = 9;
10323
+ var Fragment = 10;
10324
+
10325
+ var randomKey = Math.random().toString(36).slice(2);
10326
+ var internalInstanceKey = '__reactInternalInstance$' + randomKey;
10327
+ var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
10328
+
10329
+ function precacheFiberNode$1(hostInst, node) {
10330
+ node[internalInstanceKey] = hostInst;
10331
+ }
10332
+
10333
+ /**
10334
+ * Given a DOM node, return the closest ReactDOMComponent or
10335
+ * ReactDOMTextComponent instance ancestor.
10336
+ */
10337
+ function getClosestInstanceFromNode(node) {
10338
+ if (node[internalInstanceKey]) {
10339
+ return node[internalInstanceKey];
10340
+ }
10341
+
10342
+ // Walk up the tree until we find an ancestor whose instance we have cached.
10343
+ var parents = [];
10344
+ while (!node[internalInstanceKey]) {
10345
+ parents.push(node);
10346
+ if (node.parentNode) {
10347
+ node = node.parentNode;
10348
+ } else {
10349
+ // Top of the tree. This node must not be part of a React tree (or is
10350
+ // unmounted, potentially).
10351
+ return null;
10352
+ }
10353
+ }
10354
+
10355
+ var closest = void 0;
10356
+ var inst = node[internalInstanceKey];
10357
+ if (inst.tag === HostComponent || inst.tag === HostText) {
10358
+ // In Fiber, this will always be the deepest root.
10359
+ return inst;
10360
+ }
10361
+ for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
10362
+ closest = inst;
10363
+ }
10364
+
10365
+ return closest;
10366
+ }
10367
+
10368
+ /**
10369
+ * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
10370
+ * instance, or null if the node was not rendered by this React.
10371
+ */
10372
+ function getInstanceFromNode$1(node) {
10373
+ var inst = node[internalInstanceKey];
10374
+ if (inst) {
10375
+ if (inst.tag === HostComponent || inst.tag === HostText) {
10376
+ return inst;
10377
+ } else {
10378
+ return null;
10379
+ }
10380
+ }
10381
+ return null;
10382
+ }
10383
+
10384
+ /**
10385
+ * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
10386
+ * DOM node.
10387
+ */
10388
+ function getNodeFromInstance$1(inst) {
10389
+ if (inst.tag === HostComponent || inst.tag === HostText) {
10390
+ // In Fiber this, is just the state node right now. We assume it will be
10391
+ // a host component or host text.
10392
+ return inst.stateNode;
10393
+ }
10394
+
10395
+ // Without this first invariant, passing a non-DOM-component triggers the next
10396
+ // invariant for a missing parent, which is super confusing.
10397
+ invariant(false, 'getNodeFromInstance: Invalid argument.');
10398
+ }
10399
+
10400
+ function getFiberCurrentPropsFromNode$1(node) {
10401
+ return node[internalEventHandlersKey] || null;
10402
+ }
10403
+
10404
+ function updateFiberProps$1(node, props) {
10405
+ node[internalEventHandlersKey] = props;
10406
+ }
10407
+
10408
+ var ReactDOMComponentTree = Object.freeze({
10409
+ precacheFiberNode: precacheFiberNode$1,
10410
+ getClosestInstanceFromNode: getClosestInstanceFromNode,
10411
+ getInstanceFromNode: getInstanceFromNode$1,
10412
+ getNodeFromInstance: getNodeFromInstance$1,
10413
+ getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1,
10414
+ updateFiberProps: updateFiberProps$1
10415
+ });
10416
+
10417
+ function getParent(inst) {
10418
+ do {
10419
+ inst = inst['return'];
10420
+ // TODO: If this is a HostRoot we might want to bail out.
10421
+ // That is depending on if we want nested subtrees (layers) to bubble
10422
+ // events to their parent. We could also go through parentNode on the
10423
+ // host node but that wouldn't work for React Native and doesn't let us
10424
+ // do the portal feature.
10425
+ } while (inst && inst.tag !== HostComponent);
10426
+ if (inst) {
10427
+ return inst;
10428
+ }
10429
+ return null;
10430
+ }
10431
+
10432
+ /**
10433
+ * Return the lowest common ancestor of A and B, or null if they are in
10434
+ * different trees.
10435
+ */
10436
+ function getLowestCommonAncestor(instA, instB) {
10437
+ var depthA = 0;
10438
+ for (var tempA = instA; tempA; tempA = getParent(tempA)) {
10439
+ depthA++;
10440
+ }
10441
+ var depthB = 0;
10442
+ for (var tempB = instB; tempB; tempB = getParent(tempB)) {
10443
+ depthB++;
10444
+ }
10445
+
10446
+ // If A is deeper, crawl up.
10447
+ while (depthA - depthB > 0) {
10448
+ instA = getParent(instA);
10449
+ depthA--;
10450
+ }
10451
+
10452
+ // If B is deeper, crawl up.
10453
+ while (depthB - depthA > 0) {
10454
+ instB = getParent(instB);
10455
+ depthB--;
10456
+ }
10457
+
10458
+ // Walk in lockstep until we find a match.
10459
+ var depth = depthA;
10460
+ while (depth--) {
10461
+ if (instA === instB || instA === instB.alternate) {
10462
+ return instA;
10463
+ }
10464
+ instA = getParent(instA);
10465
+ instB = getParent(instB);
10466
+ }
10467
+ return null;
10468
+ }
10469
+
10470
+ /**
10471
+ * Return if A is an ancestor of B.
10472
+ */
10473
+
10474
+
10475
+ /**
10476
+ * Return the parent instance of the passed-in instance.
10477
+ */
10478
+ function getParentInstance(inst) {
10479
+ return getParent(inst);
10480
+ }
10481
+
10482
+ /**
10483
+ * Simulates the traversal of a two-phase, capture/bubble event dispatch.
10484
+ */
10485
+ function traverseTwoPhase(inst, fn, arg) {
10486
+ var path = [];
10487
+ while (inst) {
10488
+ path.push(inst);
10489
+ inst = getParent(inst);
10490
+ }
10491
+ var i;
10492
+ for (i = path.length; i-- > 0;) {
10493
+ fn(path[i], 'captured', arg);
10494
+ }
10495
+ for (i = 0; i < path.length; i++) {
10496
+ fn(path[i], 'bubbled', arg);
10497
+ }
10498
+ }
10499
+
10500
+ /**
10501
+ * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
10502
+ * should would receive a `mouseEnter` or `mouseLeave` event.
10503
+ *
10504
+ * Does not invoke the callback on the nearest common ancestor because nothing
10505
+ * "entered" or "left" that element.
10506
+ */
10507
+ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
10508
+ var common = from && to ? getLowestCommonAncestor(from, to) : null;
10509
+ var pathFrom = [];
10510
+ while (true) {
10511
+ if (!from) {
10512
+ break;
10513
+ }
10514
+ if (from === common) {
10515
+ break;
10516
+ }
10517
+ var alternate = from.alternate;
10518
+ if (alternate !== null && alternate === common) {
10519
+ break;
10520
+ }
10521
+ pathFrom.push(from);
10522
+ from = getParent(from);
10523
+ }
10524
+ var pathTo = [];
10525
+ while (true) {
10526
+ if (!to) {
10527
+ break;
10528
+ }
10529
+ if (to === common) {
10530
+ break;
10531
+ }
10532
+ var _alternate = to.alternate;
10533
+ if (_alternate !== null && _alternate === common) {
10534
+ break;
10535
+ }
10536
+ pathTo.push(to);
10537
+ to = getParent(to);
10538
+ }
10539
+ for (var i = 0; i < pathFrom.length; i++) {
10540
+ fn(pathFrom[i], 'bubbled', argFrom);
10541
+ }
10542
+ for (var _i = pathTo.length; _i-- > 0;) {
10543
+ fn(pathTo[_i], 'captured', argTo);
10544
+ }
10545
+ }
10546
+
10547
+ /**
10548
+ * Some event types have a notion of different registration names for different
10549
+ * "phases" of propagation. This finds listeners by a given phase.
10550
+ */
10551
+ function listenerAtPhase(inst, event, propagationPhase) {
10552
+ var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
10553
+ return getListener(inst, registrationName);
10554
+ }
10555
+
10556
+ /**
10557
+ * A small set of propagation patterns, each of which will accept a small amount
10558
+ * of information, and generate a set of "dispatch ready event objects" - which
10559
+ * are sets of events that have already been annotated with a set of dispatched
10560
+ * listener functions/ids. The API is designed this way to discourage these
10561
+ * propagation strategies from actually executing the dispatches, since we
10562
+ * always want to collect the entire set of dispatches before executing even a
10563
+ * single one.
10564
+ */
10565
+
10566
+ /**
10567
+ * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
10568
+ * here, allows us to not have to bind or create functions for each event.
10569
+ * Mutating the event's members allows us to not have to create a wrapping
10570
+ * "dispatch" object that pairs the event with the listener.
10571
+ */
10572
+ function accumulateDirectionalDispatches(inst, phase, event) {
10573
+ {
10574
+ warning(inst, 'Dispatching inst must not be null');
10575
+ }
10576
+ var listener = listenerAtPhase(inst, event, phase);
10577
+ if (listener) {
10578
+ event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
10579
+ event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
10580
+ }
10581
+ }
10582
+
10583
+ /**
10584
+ * Collect dispatches (must be entirely collected before dispatching - see unit
10585
+ * tests). Lazily allocate the array to conserve memory. We must loop through
10586
+ * each event and perform the traversal for each one. We cannot perform a
10587
+ * single traversal for the entire collection of events because each event may
10588
+ * have a different target.
10589
+ */
10590
+ function accumulateTwoPhaseDispatchesSingle(event) {
10591
+ if (event && event.dispatchConfig.phasedRegistrationNames) {
10592
+ traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
10593
+ }
10594
+ }
10595
+
10596
+ /**
10597
+ * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
10598
+ */
10599
+ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
10600
+ if (event && event.dispatchConfig.phasedRegistrationNames) {
10601
+ var targetInst = event._targetInst;
10602
+ var parentInst = targetInst ? getParentInstance(targetInst) : null;
10603
+ traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
10604
+ }
10605
+ }
10606
+
10607
+ /**
10608
+ * Accumulates without regard to direction, does not look for phased
10609
+ * registration names. Same as `accumulateDirectDispatchesSingle` but without
10610
+ * requiring that the `dispatchMarker` be the same as the dispatched ID.
10611
+ */
10612
+ function accumulateDispatches(inst, ignoredDirection, event) {
10613
+ if (inst && event && event.dispatchConfig.registrationName) {
10614
+ var registrationName = event.dispatchConfig.registrationName;
10615
+ var listener = getListener(inst, registrationName);
10616
+ if (listener) {
10617
+ event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
10618
+ event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
10619
+ }
10620
+ }
10621
+ }
10622
+
10623
+ /**
10624
+ * Accumulates dispatches on an `SyntheticEvent`, but only for the
10625
+ * `dispatchMarker`.
10626
+ * @param {SyntheticEvent} event
10627
+ */
10628
+ function accumulateDirectDispatchesSingle(event) {
10629
+ if (event && event.dispatchConfig.registrationName) {
10630
+ accumulateDispatches(event._targetInst, null, event);
10631
+ }
10632
+ }
10633
+
10634
+ function accumulateTwoPhaseDispatches(events) {
10635
+ forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
10636
+ }
10637
+
10638
+ function accumulateTwoPhaseDispatchesSkipTarget(events) {
10639
+ forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
10640
+ }
10641
+
10642
+ function accumulateEnterLeaveDispatches(leave, enter, from, to) {
10643
+ traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
10644
+ }
10645
+
10646
+ function accumulateDirectDispatches(events) {
10647
+ forEachAccumulated(events, accumulateDirectDispatchesSingle);
10648
+ }
10649
+
10650
+ var EventPropagators = Object.freeze({
10651
+ accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
10652
+ accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
10653
+ accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches,
10654
+ accumulateDirectDispatches: accumulateDirectDispatches
10655
+ });
10656
+
10657
+ var contentKey = null;
10658
+
10659
+ /**
10660
+ * Gets the key used to access text content on a DOM node.
10661
+ *
10662
+ * @return {?string} Key used to access text content.
10663
+ * @internal
10664
+ */
10665
+ function getTextContentAccessor() {
10666
+ if (!contentKey && ExecutionEnvironment.canUseDOM) {
10667
+ // Prefer textContent to innerText because many browsers support both but
10668
+ // SVG <text> elements don't support innerText even when <div> does.
10669
+ contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
10670
+ }
10671
+ return contentKey;
10672
+ }
10673
+
10674
+ /**
10675
+ * This helper object stores information about text content of a target node,
10676
+ * allowing comparison of content before and after a given event.
10677
+ *
10678
+ * Identify the node where selection currently begins, then observe
10679
+ * both its text content and its current position in the DOM. Since the
10680
+ * browser may natively replace the target node during composition, we can
10681
+ * use its position to find its replacement.
10682
+ *
10683
+ *
10684
+ */
10685
+ var compositionState = {
10686
+ _root: null,
10687
+ _startText: null,
10688
+ _fallbackText: null
10689
+ };
10690
+
10691
+ function initialize(nativeEventTarget) {
10692
+ compositionState._root = nativeEventTarget;
10693
+ compositionState._startText = getText();
10694
+ return true;
10695
+ }
10696
+
10697
+ function reset() {
10698
+ compositionState._root = null;
10699
+ compositionState._startText = null;
10700
+ compositionState._fallbackText = null;
10701
+ }
10702
+
10703
+ function getData() {
10704
+ if (compositionState._fallbackText) {
10705
+ return compositionState._fallbackText;
10706
+ }
10707
+
10708
+ var start;
10709
+ var startValue = compositionState._startText;
10710
+ var startLength = startValue.length;
10711
+ var end;
10712
+ var endValue = getText();
10713
+ var endLength = endValue.length;
10714
+
10715
+ for (start = 0; start < startLength; start++) {
10716
+ if (startValue[start] !== endValue[start]) {
10717
+ break;
10718
+ }
10719
+ }
10720
+
10721
+ var minEnd = startLength - start;
10722
+ for (end = 1; end <= minEnd; end++) {
10723
+ if (startValue[startLength - end] !== endValue[endLength - end]) {
10724
+ break;
10725
+ }
10726
+ }
10727
+
10728
+ var sliceTail = end > 1 ? 1 - end : undefined;
10729
+ compositionState._fallbackText = endValue.slice(start, sliceTail);
10730
+ return compositionState._fallbackText;
10731
+ }
10732
+
10733
+ function getText() {
10734
+ if ('value' in compositionState._root) {
10735
+ return compositionState._root.value;
10736
+ }
10737
+ return compositionState._root[getTextContentAccessor()];
10738
+ }
10739
+
10740
+ /* eslint valid-typeof: 0 */
10741
+
10742
+ var didWarnForAddedNewProperty = false;
10743
+ var isProxySupported = typeof Proxy === 'function';
10744
+ var EVENT_POOL_SIZE = 10;
10745
+
10746
+ var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
10747
+
10748
+ /**
10749
+ * @interface Event
10750
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
10751
+ */
10752
+ var EventInterface = {
10753
+ type: null,
10754
+ target: null,
10755
+ // currentTarget is set when dispatching; no use in copying it here
10756
+ currentTarget: emptyFunction.thatReturnsNull,
10757
+ eventPhase: null,
10758
+ bubbles: null,
10759
+ cancelable: null,
10760
+ timeStamp: function (event) {
10761
+ return event.timeStamp || Date.now();
10762
+ },
10763
+ defaultPrevented: null,
10764
+ isTrusted: null
10765
+ };
10766
+
10767
+ /**
10768
+ * Synthetic events are dispatched by event plugins, typically in response to a
10769
+ * top-level event delegation handler.
10770
+ *
10771
+ * These systems should generally use pooling to reduce the frequency of garbage
10772
+ * collection. The system should check `isPersistent` to determine whether the
10773
+ * event should be released into the pool after being dispatched. Users that
10774
+ * need a persisted event should invoke `persist`.
10775
+ *
10776
+ * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
10777
+ * normalizing browser quirks. Subclasses do not necessarily have to implement a
10778
+ * DOM interface; custom application-specific events can also subclass this.
10779
+ *
10780
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
10781
+ * @param {*} targetInst Marker identifying the event target.
10782
+ * @param {object} nativeEvent Native browser event.
10783
+ * @param {DOMEventTarget} nativeEventTarget Target node.
10784
+ */
10785
+ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
10786
+ {
10787
+ // these have a getter/setter for warnings
10788
+ delete this.nativeEvent;
10789
+ delete this.preventDefault;
10790
+ delete this.stopPropagation;
10791
+ }
10792
+
10793
+ this.dispatchConfig = dispatchConfig;
10794
+ this._targetInst = targetInst;
10795
+ this.nativeEvent = nativeEvent;
10796
+
10797
+ var Interface = this.constructor.Interface;
10798
+ for (var propName in Interface) {
10799
+ if (!Interface.hasOwnProperty(propName)) {
10800
+ continue;
10801
+ }
10802
+ {
10803
+ delete this[propName]; // this has a getter/setter for warnings
10804
+ }
10805
+ var normalize = Interface[propName];
10806
+ if (normalize) {
10807
+ this[propName] = normalize(nativeEvent);
10808
+ } else {
10809
+ if (propName === 'target') {
10810
+ this.target = nativeEventTarget;
10811
+ } else {
10812
+ this[propName] = nativeEvent[propName];
10813
+ }
10814
+ }
10815
+ }
10816
+
10817
+ var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
10818
+ if (defaultPrevented) {
10819
+ this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
10820
+ } else {
10821
+ this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
10822
+ }
10823
+ this.isPropagationStopped = emptyFunction.thatReturnsFalse;
10824
+ return this;
10825
+ }
10826
+
10827
+ _assign(SyntheticEvent.prototype, {
10828
+ preventDefault: function () {
10829
+ this.defaultPrevented = true;
10830
+ var event = this.nativeEvent;
10831
+ if (!event) {
10832
+ return;
10833
+ }
10834
+
10835
+ if (event.preventDefault) {
10836
+ event.preventDefault();
10837
+ } else if (typeof event.returnValue !== 'unknown') {
10838
+ event.returnValue = false;
10839
+ }
10840
+ this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
10841
+ },
10842
+
10843
+ stopPropagation: function () {
10844
+ var event = this.nativeEvent;
10845
+ if (!event) {
10846
+ return;
10847
+ }
10848
+
10849
+ if (event.stopPropagation) {
10850
+ event.stopPropagation();
10851
+ } else if (typeof event.cancelBubble !== 'unknown') {
10852
+ // The ChangeEventPlugin registers a "propertychange" event for
10853
+ // IE. This event does not support bubbling or cancelling, and
10854
+ // any references to cancelBubble throw "Member not found". A
10855
+ // typeof check of "unknown" circumvents this issue (and is also
10856
+ // IE specific).
10857
+ event.cancelBubble = true;
10858
+ }
10859
+
10860
+ this.isPropagationStopped = emptyFunction.thatReturnsTrue;
10861
+ },
10862
+
10863
+ /**
10864
+ * We release all dispatched `SyntheticEvent`s after each event loop, adding
10865
+ * them back into the pool. This allows a way to hold onto a reference that
10866
+ * won't be added back into the pool.
10867
+ */
10868
+ persist: function () {
10869
+ this.isPersistent = emptyFunction.thatReturnsTrue;
10870
+ },
10871
+
10872
+ /**
10873
+ * Checks if this event should be released back into the pool.
10874
+ *
10875
+ * @return {boolean} True if this should not be released, false otherwise.
10876
+ */
10877
+ isPersistent: emptyFunction.thatReturnsFalse,
10878
+
10879
+ /**
10880
+ * `PooledClass` looks for `destructor` on each instance it releases.
10881
+ */
10882
+ destructor: function () {
10883
+ var Interface = this.constructor.Interface;
10884
+ for (var propName in Interface) {
10885
+ {
10886
+ Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
10887
+ }
10888
+ }
10889
+ for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
10890
+ this[shouldBeReleasedProperties[i]] = null;
10891
+ }
10892
+ {
10893
+ Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
10894
+ Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
10895
+ Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
10896
+ }
10897
+ }
10898
+ });
10899
+
10900
+ SyntheticEvent.Interface = EventInterface;
10901
+
10902
+ /**
10903
+ * Helper to reduce boilerplate when creating subclasses.
10904
+ *
10905
+ * @param {function} Class
10906
+ * @param {?object} Interface
10907
+ */
10908
+ SyntheticEvent.augmentClass = function (Class, Interface) {
10909
+ var Super = this;
10910
+
10911
+ var E = function () {};
10912
+ E.prototype = Super.prototype;
10913
+ var prototype = new E();
10914
+
10915
+ _assign(prototype, Class.prototype);
10916
+ Class.prototype = prototype;
10917
+ Class.prototype.constructor = Class;
10918
+
10919
+ Class.Interface = _assign({}, Super.Interface, Interface);
10920
+ Class.augmentClass = Super.augmentClass;
10921
+ addEventPoolingTo(Class);
10922
+ };
10923
+
10924
+ /** Proxying after everything set on SyntheticEvent
10925
+ * to resolve Proxy issue on some WebKit browsers
10926
+ * in which some Event properties are set to undefined (GH#10010)
10927
+ */
10928
+ {
10929
+ if (isProxySupported) {
10930
+ /*eslint-disable no-func-assign */
10931
+ SyntheticEvent = new Proxy(SyntheticEvent, {
10932
+ construct: function (target, args) {
10933
+ return this.apply(target, Object.create(target.prototype), args);
10934
+ },
10935
+ apply: function (constructor, that, args) {
10936
+ return new Proxy(constructor.apply(that, args), {
10937
+ set: function (target, prop, value) {
10938
+ if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
10939
+ warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.');
10940
+ didWarnForAddedNewProperty = true;
10941
+ }
10942
+ target[prop] = value;
10943
+ return true;
10944
+ }
10945
+ });
10946
+ }
10947
+ });
10948
+ /*eslint-enable no-func-assign */
10949
+ }
10950
+ }
10951
+
10952
+ addEventPoolingTo(SyntheticEvent);
10953
+
10954
+ /**
10955
+ * Helper to nullify syntheticEvent instance properties when destructing
10956
+ *
10957
+ * @param {String} propName
10958
+ * @param {?object} getVal
10959
+ * @return {object} defineProperty object
10960
+ */
10961
+ function getPooledWarningPropertyDefinition(propName, getVal) {
10962
+ var isFunction = typeof getVal === 'function';
10963
+ return {
10964
+ configurable: true,
10965
+ set: set,
10966
+ get: get
10967
+ };
10968
+
10969
+ function set(val) {
10970
+ var action = isFunction ? 'setting the method' : 'setting the property';
10971
+ warn(action, 'This is effectively a no-op');
10972
+ return val;
10973
+ }
10974
+
10975
+ function get() {
10976
+ var action = isFunction ? 'accessing the method' : 'accessing the property';
10977
+ var result = isFunction ? 'This is a no-op function' : 'This is set to null';
10978
+ warn(action, result);
10979
+ return getVal;
10980
+ }
10981
+
10982
+ function warn(action, result) {
10983
+ var warningCondition = false;
10984
+ warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);
10985
+ }
10986
+ }
10987
+
10988
+ function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
10989
+ var EventConstructor = this;
10990
+ if (EventConstructor.eventPool.length) {
10991
+ var instance = EventConstructor.eventPool.pop();
10992
+ EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
10993
+ return instance;
10994
+ }
10995
+ return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
10996
+ }
10997
+
10998
+ function releasePooledEvent(event) {
10999
+ var EventConstructor = this;
11000
+ !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
11001
+ event.destructor();
11002
+ if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
11003
+ EventConstructor.eventPool.push(event);
11004
+ }
11005
+ }
11006
+
11007
+ function addEventPoolingTo(EventConstructor) {
11008
+ EventConstructor.eventPool = [];
11009
+ EventConstructor.getPooled = getPooledEvent;
11010
+ EventConstructor.release = releasePooledEvent;
11011
+ }
11012
+
11013
+ var SyntheticEvent$1 = SyntheticEvent;
11014
+
11015
+ /**
11016
+ * @interface Event
11017
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
11018
+ */
11019
+ var CompositionEventInterface = {
11020
+ data: null
11021
+ };
11022
+
11023
+ /**
11024
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
11025
+ * @param {string} dispatchMarker Marker identifying the event target.
11026
+ * @param {object} nativeEvent Native browser event.
11027
+ * @extends {SyntheticEvent}
11028
+ */
11029
+ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11030
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11031
+ }
11032
+
11033
+ SyntheticEvent$1.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
11034
+
11035
+ /**
11036
+ * @interface Event
11037
+ * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
11038
+ * /#events-inputevents
11039
+ */
11040
+ var InputEventInterface = {
11041
+ data: null
11042
+ };
11043
+
11044
+ /**
11045
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
11046
+ * @param {string} dispatchMarker Marker identifying the event target.
11047
+ * @param {object} nativeEvent Native browser event.
11048
+ * @extends {SyntheticEvent}
11049
+ */
11050
+ function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11051
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11052
+ }
11053
+
11054
+ SyntheticEvent$1.augmentClass(SyntheticInputEvent, InputEventInterface);
11055
+
11056
+ var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
11057
+ var START_KEYCODE = 229;
11058
+
11059
+ var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
11060
+
11061
+ var documentMode = null;
11062
+ if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
11063
+ documentMode = document.documentMode;
11064
+ }
11065
+
11066
+ // Webkit offers a very useful `textInput` event that can be used to
11067
+ // directly represent `beforeInput`. The IE `textinput` event is not as
11068
+ // useful, so we don't use it.
11069
+ var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
11070
+
11071
+ // In IE9+, we have access to composition events, but the data supplied
11072
+ // by the native compositionend event may be incorrect. Japanese ideographic
11073
+ // spaces, for instance (\u3000) are not recorded correctly.
11074
+ var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
11075
+
11076
+ /**
11077
+ * Opera <= 12 includes TextEvent in window, but does not fire
11078
+ * text input events. Rely on keypress instead.
11079
+ */
11080
+ function isPresto() {
11081
+ var opera = window.opera;
11082
+ return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
11083
+ }
11084
+
11085
+ var SPACEBAR_CODE = 32;
11086
+ var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
11087
+
11088
+ // Events and their corresponding property names.
11089
+ var eventTypes = {
11090
+ beforeInput: {
11091
+ phasedRegistrationNames: {
11092
+ bubbled: 'onBeforeInput',
11093
+ captured: 'onBeforeInputCapture'
11094
+ },
11095
+ dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
11096
+ },
11097
+ compositionEnd: {
11098
+ phasedRegistrationNames: {
11099
+ bubbled: 'onCompositionEnd',
11100
+ captured: 'onCompositionEndCapture'
11101
+ },
11102
+ dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
11103
+ },
11104
+ compositionStart: {
11105
+ phasedRegistrationNames: {
11106
+ bubbled: 'onCompositionStart',
11107
+ captured: 'onCompositionStartCapture'
11108
+ },
11109
+ dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
11110
+ },
11111
+ compositionUpdate: {
11112
+ phasedRegistrationNames: {
11113
+ bubbled: 'onCompositionUpdate',
11114
+ captured: 'onCompositionUpdateCapture'
11115
+ },
11116
+ dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
11117
+ }
11118
+ };
11119
+
11120
+ // Track whether we've ever handled a keypress on the space key.
11121
+ var hasSpaceKeypress = false;
11122
+
11123
+ /**
11124
+ * Return whether a native keypress event is assumed to be a command.
11125
+ * This is required because Firefox fires `keypress` events for key commands
11126
+ * (cut, copy, select-all, etc.) even though no character is inserted.
11127
+ */
11128
+ function isKeypressCommand(nativeEvent) {
11129
+ return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
11130
+ // ctrlKey && altKey is equivalent to AltGr, and is not a command.
11131
+ !(nativeEvent.ctrlKey && nativeEvent.altKey);
11132
+ }
11133
+
11134
+ /**
11135
+ * Translate native top level events into event types.
11136
+ *
11137
+ * @param {string} topLevelType
11138
+ * @return {object}
11139
+ */
11140
+ function getCompositionEventType(topLevelType) {
11141
+ switch (topLevelType) {
11142
+ case 'topCompositionStart':
11143
+ return eventTypes.compositionStart;
11144
+ case 'topCompositionEnd':
11145
+ return eventTypes.compositionEnd;
11146
+ case 'topCompositionUpdate':
11147
+ return eventTypes.compositionUpdate;
11148
+ }
11149
+ }
11150
+
11151
+ /**
11152
+ * Does our fallback best-guess model think this event signifies that
11153
+ * composition has begun?
11154
+ *
11155
+ * @param {string} topLevelType
11156
+ * @param {object} nativeEvent
11157
+ * @return {boolean}
11158
+ */
11159
+ function isFallbackCompositionStart(topLevelType, nativeEvent) {
11160
+ return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
11161
+ }
11162
+
11163
+ /**
11164
+ * Does our fallback mode think that this event is the end of composition?
11165
+ *
11166
+ * @param {string} topLevelType
11167
+ * @param {object} nativeEvent
11168
+ * @return {boolean}
11169
+ */
11170
+ function isFallbackCompositionEnd(topLevelType, nativeEvent) {
11171
+ switch (topLevelType) {
11172
+ case 'topKeyUp':
11173
+ // Command keys insert or clear IME input.
11174
+ return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
11175
+ case 'topKeyDown':
11176
+ // Expect IME keyCode on each keydown. If we get any other
11177
+ // code we must have exited earlier.
11178
+ return nativeEvent.keyCode !== START_KEYCODE;
11179
+ case 'topKeyPress':
11180
+ case 'topMouseDown':
11181
+ case 'topBlur':
11182
+ // Events are not possible without cancelling IME.
11183
+ return true;
11184
+ default:
11185
+ return false;
11186
+ }
11187
+ }
11188
+
11189
+ /**
11190
+ * Google Input Tools provides composition data via a CustomEvent,
11191
+ * with the `data` property populated in the `detail` object. If this
11192
+ * is available on the event object, use it. If not, this is a plain
11193
+ * composition event and we have nothing special to extract.
11194
+ *
11195
+ * @param {object} nativeEvent
11196
+ * @return {?string}
11197
+ */
11198
+ function getDataFromCustomEvent(nativeEvent) {
11199
+ var detail = nativeEvent.detail;
11200
+ if (typeof detail === 'object' && 'data' in detail) {
11201
+ return detail.data;
11202
+ }
11203
+ return null;
11204
+ }
11205
+
11206
+ // Track the current IME composition status, if any.
11207
+ var isComposing = false;
11208
+
11209
+ /**
11210
+ * @return {?object} A SyntheticCompositionEvent.
11211
+ */
11212
+ function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11213
+ var eventType;
11214
+ var fallbackData;
11215
+
11216
+ if (canUseCompositionEvent) {
11217
+ eventType = getCompositionEventType(topLevelType);
11218
+ } else if (!isComposing) {
11219
+ if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
11220
+ eventType = eventTypes.compositionStart;
11221
+ }
11222
+ } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
11223
+ eventType = eventTypes.compositionEnd;
11224
+ }
11225
+
11226
+ if (!eventType) {
11227
+ return null;
11228
+ }
11229
+
11230
+ if (useFallbackCompositionData) {
11231
+ // The current composition is stored statically and must not be
11232
+ // overwritten while composition continues.
11233
+ if (!isComposing && eventType === eventTypes.compositionStart) {
11234
+ isComposing = initialize(nativeEventTarget);
11235
+ } else if (eventType === eventTypes.compositionEnd) {
11236
+ if (isComposing) {
11237
+ fallbackData = getData();
11238
+ }
11239
+ }
11240
+ }
11241
+
11242
+ var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
11243
+
11244
+ if (fallbackData) {
11245
+ // Inject data generated from fallback path into the synthetic event.
11246
+ // This matches the property of native CompositionEventInterface.
11247
+ event.data = fallbackData;
11248
+ } else {
11249
+ var customData = getDataFromCustomEvent(nativeEvent);
11250
+ if (customData !== null) {
11251
+ event.data = customData;
11252
+ }
11253
+ }
11254
+
11255
+ accumulateTwoPhaseDispatches(event);
11256
+ return event;
11257
+ }
11258
+
11259
+ /**
11260
+ * @param {TopLevelTypes} topLevelType Record from `BrowserEventConstants`.
11261
+ * @param {object} nativeEvent Native browser event.
11262
+ * @return {?string} The string corresponding to this `beforeInput` event.
11263
+ */
11264
+ function getNativeBeforeInputChars(topLevelType, nativeEvent) {
11265
+ switch (topLevelType) {
11266
+ case 'topCompositionEnd':
11267
+ return getDataFromCustomEvent(nativeEvent);
11268
+ case 'topKeyPress':
11269
+ /**
11270
+ * If native `textInput` events are available, our goal is to make
11271
+ * use of them. However, there is a special case: the spacebar key.
11272
+ * In Webkit, preventing default on a spacebar `textInput` event
11273
+ * cancels character insertion, but it *also* causes the browser
11274
+ * to fall back to its default spacebar behavior of scrolling the
11275
+ * page.
11276
+ *
11277
+ * Tracking at:
11278
+ * https://code.google.com/p/chromium/issues/detail?id=355103
11279
+ *
11280
+ * To avoid this issue, use the keypress event as if no `textInput`
11281
+ * event is available.
11282
+ */
11283
+ var which = nativeEvent.which;
11284
+ if (which !== SPACEBAR_CODE) {
11285
+ return null;
11286
+ }
11287
+
11288
+ hasSpaceKeypress = true;
11289
+ return SPACEBAR_CHAR;
11290
+
11291
+ case 'topTextInput':
11292
+ // Record the characters to be added to the DOM.
11293
+ var chars = nativeEvent.data;
11294
+
11295
+ // If it's a spacebar character, assume that we have already handled
11296
+ // it at the keypress level and bail immediately. Android Chrome
11297
+ // doesn't give us keycodes, so we need to blacklist it.
11298
+ if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
11299
+ return null;
11300
+ }
11301
+
11302
+ return chars;
11303
+
11304
+ default:
11305
+ // For other native event types, do nothing.
11306
+ return null;
11307
+ }
11308
+ }
11309
+
11310
+ /**
11311
+ * For browsers that do not provide the `textInput` event, extract the
11312
+ * appropriate string to use for SyntheticInputEvent.
11313
+ *
11314
+ * @param {string} topLevelType Record from `BrowserEventConstants`.
11315
+ * @param {object} nativeEvent Native browser event.
11316
+ * @return {?string} The fallback string for this `beforeInput` event.
11317
+ */
11318
+ function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
11319
+ // If we are currently composing (IME) and using a fallback to do so,
11320
+ // try to extract the composed characters from the fallback object.
11321
+ // If composition event is available, we extract a string only at
11322
+ // compositionevent, otherwise extract it at fallback events.
11323
+ if (isComposing) {
11324
+ if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
11325
+ var chars = getData();
11326
+ reset();
11327
+ isComposing = false;
11328
+ return chars;
11329
+ }
11330
+ return null;
11331
+ }
11332
+
11333
+ switch (topLevelType) {
11334
+ case 'topPaste':
11335
+ // If a paste event occurs after a keypress, throw out the input
11336
+ // chars. Paste events should not lead to BeforeInput events.
11337
+ return null;
11338
+ case 'topKeyPress':
11339
+ /**
11340
+ * As of v27, Firefox may fire keypress events even when no character
11341
+ * will be inserted. A few possibilities:
11342
+ *
11343
+ * - `which` is `0`. Arrow keys, Esc key, etc.
11344
+ *
11345
+ * - `which` is the pressed key code, but no char is available.
11346
+ * Ex: 'AltGr + d` in Polish. There is no modified character for
11347
+ * this key combination and no character is inserted into the
11348
+ * document, but FF fires the keypress for char code `100` anyway.
11349
+ * No `input` event will occur.
11350
+ *
11351
+ * - `which` is the pressed key code, but a command combination is
11352
+ * being used. Ex: `Cmd+C`. No character is inserted, and no
11353
+ * `input` event will occur.
11354
+ */
11355
+ if (!isKeypressCommand(nativeEvent)) {
11356
+ // IE fires the `keypress` event when a user types an emoji via
11357
+ // Touch keyboard of Windows. In such a case, the `char` property
11358
+ // holds an emoji character like `\uD83D\uDE0A`. Because its length
11359
+ // is 2, the property `which` does not represent an emoji correctly.
11360
+ // In such a case, we directly return the `char` property instead of
11361
+ // using `which`.
11362
+ if (nativeEvent.char && nativeEvent.char.length > 1) {
11363
+ return nativeEvent.char;
11364
+ } else if (nativeEvent.which) {
11365
+ return String.fromCharCode(nativeEvent.which);
11366
+ }
11367
+ }
11368
+ return null;
11369
+ case 'topCompositionEnd':
11370
+ return useFallbackCompositionData ? null : nativeEvent.data;
11371
+ default:
11372
+ return null;
11373
+ }
11374
+ }
11375
+
11376
+ /**
11377
+ * Extract a SyntheticInputEvent for `beforeInput`, based on either native
11378
+ * `textInput` or fallback behavior.
11379
+ *
11380
+ * @return {?object} A SyntheticInputEvent.
11381
+ */
11382
+ function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11383
+ var chars;
11384
+
11385
+ if (canUseTextInputEvent) {
11386
+ chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
11387
+ } else {
11388
+ chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
11389
+ }
11390
+
11391
+ // If no characters are being inserted, no BeforeInput event should
11392
+ // be fired.
11393
+ if (!chars) {
11394
+ return null;
11395
+ }
11396
+
11397
+ var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
11398
+
11399
+ event.data = chars;
11400
+ accumulateTwoPhaseDispatches(event);
11401
+ return event;
11402
+ }
11403
+
11404
+ /**
11405
+ * Create an `onBeforeInput` event to match
11406
+ * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
11407
+ *
11408
+ * This event plugin is based on the native `textInput` event
11409
+ * available in Chrome, Safari, Opera, and IE. This event fires after
11410
+ * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
11411
+ *
11412
+ * `beforeInput` is spec'd but not implemented in any browsers, and
11413
+ * the `input` event does not provide any useful information about what has
11414
+ * actually been added, contrary to the spec. Thus, `textInput` is the best
11415
+ * available event to identify the characters that have actually been inserted
11416
+ * into the target node.
11417
+ *
11418
+ * This plugin is also responsible for emitting `composition` events, thus
11419
+ * allowing us to share composition fallback code for both `beforeInput` and
11420
+ * `composition` event types.
11421
+ */
11422
+ var BeforeInputEventPlugin = {
11423
+ eventTypes: eventTypes,
11424
+
11425
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11426
+ return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
11427
+ }
11428
+ };
11429
+
11430
+ // Use to restore controlled state after a change event has fired.
11431
+
11432
+ var fiberHostComponent = null;
11433
+
11434
+ var ReactControlledComponentInjection = {
11435
+ injectFiberControlledHostComponent: function (hostComponentImpl) {
11436
+ // The fiber implementation doesn't use dynamic dispatch so we need to
11437
+ // inject the implementation.
11438
+ fiberHostComponent = hostComponentImpl;
11439
+ }
11440
+ };
11441
+
11442
+ var restoreTarget = null;
11443
+ var restoreQueue = null;
11444
+
11445
+ function restoreStateOfTarget(target) {
11446
+ // We perform this translation at the end of the event loop so that we
11447
+ // always receive the correct fiber here
11448
+ var internalInstance = getInstanceFromNode(target);
11449
+ if (!internalInstance) {
11450
+ // Unmounted
11451
+ return;
11452
+ }
11453
+ !(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? invariant(false, 'Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
11454
+ var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
11455
+ fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);
11456
+ }
11457
+
11458
+ var injection$3 = ReactControlledComponentInjection;
11459
+
11460
+ function enqueueStateRestore(target) {
11461
+ if (restoreTarget) {
11462
+ if (restoreQueue) {
11463
+ restoreQueue.push(target);
11464
+ } else {
11465
+ restoreQueue = [target];
11466
+ }
11467
+ } else {
11468
+ restoreTarget = target;
11469
+ }
11470
+ }
11471
+
11472
+ function restoreStateIfNeeded() {
11473
+ if (!restoreTarget) {
11474
+ return;
11475
+ }
11476
+ var target = restoreTarget;
11477
+ var queuedTargets = restoreQueue;
11478
+ restoreTarget = null;
11479
+ restoreQueue = null;
11480
+
11481
+ restoreStateOfTarget(target);
11482
+ if (queuedTargets) {
11483
+ for (var i = 0; i < queuedTargets.length; i++) {
11484
+ restoreStateOfTarget(queuedTargets[i]);
11485
+ }
11486
+ }
11487
+ }
11488
+
11489
+ var ReactControlledComponent = Object.freeze({
11490
+ injection: injection$3,
11491
+ enqueueStateRestore: enqueueStateRestore,
11492
+ restoreStateIfNeeded: restoreStateIfNeeded
11493
+ });
11494
+
11495
+ // Used as a way to call batchedUpdates when we don't have a reference to
11496
+ // the renderer. Such as when we're dispatching events or if third party
11497
+ // libraries need to call batchedUpdates. Eventually, this API will go away when
11498
+ // everything is batched by default. We'll then have a similar API to opt-out of
11499
+ // scheduled work and instead do synchronous work.
11500
+
11501
+ // Defaults
11502
+ var fiberBatchedUpdates = function (fn, bookkeeping) {
11503
+ return fn(bookkeeping);
11504
+ };
11505
+
11506
+ var isNestingBatched = false;
11507
+ function batchedUpdates(fn, bookkeeping) {
11508
+ if (isNestingBatched) {
11509
+ // If we are currently inside another batch, we need to wait until it
11510
+ // fully completes before restoring state. Therefore, we add the target to
11511
+ // a queue of work.
11512
+ return fiberBatchedUpdates(fn, bookkeeping);
11513
+ }
11514
+ isNestingBatched = true;
11515
+ try {
11516
+ return fiberBatchedUpdates(fn, bookkeeping);
11517
+ } finally {
11518
+ // Here we wait until all updates have propagated, which is important
11519
+ // when using controlled components within layers:
11520
+ // https://github.com/facebook/react/issues/1698
11521
+ // Then we restore state of any controlled component.
11522
+ isNestingBatched = false;
11523
+ restoreStateIfNeeded();
11524
+ }
11525
+ }
11526
+
11527
+ var ReactGenericBatchingInjection = {
11528
+ injectFiberBatchedUpdates: function (_batchedUpdates) {
11529
+ fiberBatchedUpdates = _batchedUpdates;
11530
+ }
11531
+ };
11532
+
11533
+ var injection$4 = ReactGenericBatchingInjection;
11534
+
11535
+ /**
11536
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
11537
+ */
11538
+ var supportedInputTypes = {
11539
+ color: true,
11540
+ date: true,
11541
+ datetime: true,
11542
+ 'datetime-local': true,
11543
+ email: true,
11544
+ month: true,
11545
+ number: true,
11546
+ password: true,
11547
+ range: true,
11548
+ search: true,
11549
+ tel: true,
11550
+ text: true,
11551
+ time: true,
11552
+ url: true,
11553
+ week: true
11554
+ };
11555
+
11556
+ function isTextInputElement(elem) {
11557
+ var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
11558
+
11559
+ if (nodeName === 'input') {
11560
+ return !!supportedInputTypes[elem.type];
11561
+ }
11562
+
11563
+ if (nodeName === 'textarea') {
11564
+ return true;
11565
+ }
11566
+
11567
+ return false;
11568
+ }
11569
+
11570
+ /**
11571
+ * HTML nodeType values that represent the type of the node
11572
+ */
11573
+
11574
+ var ELEMENT_NODE = 1;
11575
+ var TEXT_NODE = 3;
11576
+ var COMMENT_NODE = 8;
11577
+ var DOCUMENT_NODE = 9;
11578
+ var DOCUMENT_FRAGMENT_NODE = 11;
11579
+
11580
+ /**
11581
+ * Gets the target node from a native browser event by accounting for
11582
+ * inconsistencies in browser DOM APIs.
11583
+ *
11584
+ * @param {object} nativeEvent Native browser event.
11585
+ * @return {DOMEventTarget} Target node.
11586
+ */
11587
+ function getEventTarget(nativeEvent) {
11588
+ var target = nativeEvent.target || nativeEvent.srcElement || window;
11589
+
11590
+ // Normalize SVG <use> element events #4963
11591
+ if (target.correspondingUseElement) {
11592
+ target = target.correspondingUseElement;
11593
+ }
11594
+
11595
+ // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
11596
+ // @see http://www.quirksmode.org/js/events_properties.html
11597
+ return target.nodeType === TEXT_NODE ? target.parentNode : target;
11598
+ }
11599
+
11600
+ var useHasFeature;
11601
+ if (ExecutionEnvironment.canUseDOM) {
11602
+ useHasFeature = document.implementation && document.implementation.hasFeature &&
11603
+ // always returns true in newer browsers as per the standard.
11604
+ // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
11605
+ document.implementation.hasFeature('', '') !== true;
11606
+ }
11607
+
11608
+ /**
11609
+ * Checks if an event is supported in the current execution environment.
11610
+ *
11611
+ * NOTE: This will not work correctly for non-generic events such as `change`,
11612
+ * `reset`, `load`, `error`, and `select`.
11613
+ *
11614
+ * Borrows from Modernizr.
11615
+ *
11616
+ * @param {string} eventNameSuffix Event name, e.g. "click".
11617
+ * @param {?boolean} capture Check if the capture phase is supported.
11618
+ * @return {boolean} True if the event is supported.
11619
+ * @internal
11620
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
11621
+ */
11622
+ function isEventSupported(eventNameSuffix, capture) {
11623
+ if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
11624
+ return false;
11625
+ }
11626
+
11627
+ var eventName = 'on' + eventNameSuffix;
11628
+ var isSupported = eventName in document;
11629
+
11630
+ if (!isSupported) {
11631
+ var element = document.createElement('div');
11632
+ element.setAttribute(eventName, 'return;');
11633
+ isSupported = typeof element[eventName] === 'function';
11634
+ }
11635
+
11636
+ if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
11637
+ // This is the only way to test support for the `wheel` event in IE9+.
11638
+ isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
11639
+ }
11640
+
11641
+ return isSupported;
11642
+ }
11643
+
11644
+ function isCheckable(elem) {
11645
+ var type = elem.type;
11646
+ var nodeName = elem.nodeName;
11647
+ return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
11648
+ }
11649
+
11650
+ function getTracker(node) {
11651
+ return node._valueTracker;
11652
+ }
11653
+
11654
+ function detachTracker(node) {
11655
+ node._valueTracker = null;
11656
+ }
11657
+
11658
+ function getValueFromNode(node) {
11659
+ var value = '';
11660
+ if (!node) {
11661
+ return value;
11662
+ }
11663
+
11664
+ if (isCheckable(node)) {
11665
+ value = node.checked ? 'true' : 'false';
11666
+ } else {
11667
+ value = node.value;
11668
+ }
11669
+
11670
+ return value;
11671
+ }
11672
+
11673
+ function trackValueOnNode(node) {
11674
+ var valueField = isCheckable(node) ? 'checked' : 'value';
11675
+ var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
11676
+
11677
+ var currentValue = '' + node[valueField];
11678
+
11679
+ // if someone has already defined a value or Safari, then bail
11680
+ // and don't track value will cause over reporting of changes,
11681
+ // but it's better then a hard failure
11682
+ // (needed for certain tests that spyOn input values and Safari)
11683
+ if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
11684
+ return;
11685
+ }
11686
+
11687
+ Object.defineProperty(node, valueField, {
11688
+ enumerable: descriptor.enumerable,
11689
+ configurable: true,
11690
+ get: function () {
11691
+ return descriptor.get.call(this);
11692
+ },
11693
+ set: function (value) {
11694
+ currentValue = '' + value;
11695
+ descriptor.set.call(this, value);
11696
+ }
11697
+ });
11698
+
11699
+ var tracker = {
11700
+ getValue: function () {
11701
+ return currentValue;
11702
+ },
11703
+ setValue: function (value) {
11704
+ currentValue = '' + value;
11705
+ },
11706
+ stopTracking: function () {
11707
+ detachTracker(node);
11708
+ delete node[valueField];
11709
+ }
11710
+ };
11711
+ return tracker;
11712
+ }
11713
+
11714
+ function track(node) {
11715
+ if (getTracker(node)) {
11716
+ return;
11717
+ }
11718
+
11719
+ // TODO: Once it's just Fiber we can move this to node._wrapperState
11720
+ node._valueTracker = trackValueOnNode(node);
11721
+ }
11722
+
11723
+ function updateValueIfChanged(node) {
11724
+ if (!node) {
11725
+ return false;
11726
+ }
11727
+
11728
+ var tracker = getTracker(node);
11729
+ // if there is no tracker at this point it's unlikely
11730
+ // that trying again will succeed
11731
+ if (!tracker) {
11732
+ return true;
11733
+ }
11734
+
11735
+ var lastValue = tracker.getValue();
11736
+ var nextValue = getValueFromNode(node);
11737
+ if (nextValue !== lastValue) {
11738
+ tracker.setValue(nextValue);
11739
+ return true;
11740
+ }
11741
+ return false;
11742
+ }
11743
+
11744
+ var eventTypes$1 = {
11745
+ change: {
11746
+ phasedRegistrationNames: {
11747
+ bubbled: 'onChange',
11748
+ captured: 'onChangeCapture'
11749
+ },
11750
+ dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
11751
+ }
11752
+ };
11753
+
11754
+ function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
11755
+ var event = SyntheticEvent$1.getPooled(eventTypes$1.change, inst, nativeEvent, target);
11756
+ event.type = 'change';
11757
+ // Flag this event loop as needing state restore.
11758
+ enqueueStateRestore(target);
11759
+ accumulateTwoPhaseDispatches(event);
11760
+ return event;
11761
+ }
11762
+ /**
11763
+ * For IE shims
11764
+ */
11765
+ var activeElement = null;
11766
+ var activeElementInst = null;
11767
+
11768
+ /**
11769
+ * SECTION: handle `change` event
11770
+ */
11771
+ function shouldUseChangeEvent(elem) {
11772
+ var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
11773
+ return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
11774
+ }
11775
+
11776
+ function manualDispatchChangeEvent(nativeEvent) {
11777
+ var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
11778
+
11779
+ // If change and propertychange bubbled, we'd just bind to it like all the
11780
+ // other events and have it go through ReactBrowserEventEmitter. Since it
11781
+ // doesn't, we manually listen for the events and so we have to enqueue and
11782
+ // process the abstract event manually.
11783
+ //
11784
+ // Batching is necessary here in order to ensure that all event handlers run
11785
+ // before the next rerender (including event handlers attached to ancestor
11786
+ // elements instead of directly on the input). Without this, controlled
11787
+ // components don't work properly in conjunction with event bubbling because
11788
+ // the component is rerendered and the value reverted before all the event
11789
+ // handlers can run. See https://github.com/facebook/react/issues/708.
11790
+ batchedUpdates(runEventInBatch, event);
11791
+ }
11792
+
11793
+ function runEventInBatch(event) {
11794
+ enqueueEvents(event);
11795
+ processEventQueue(false);
11796
+ }
11797
+
11798
+ function getInstIfValueChanged(targetInst) {
11799
+ var targetNode = getNodeFromInstance$1(targetInst);
11800
+ if (updateValueIfChanged(targetNode)) {
11801
+ return targetInst;
11802
+ }
11803
+ }
11804
+
11805
+ function getTargetInstForChangeEvent(topLevelType, targetInst) {
11806
+ if (topLevelType === 'topChange') {
11807
+ return targetInst;
11808
+ }
11809
+ }
11810
+
11811
+ /**
11812
+ * SECTION: handle `input` event
11813
+ */
11814
+ var isInputEventSupported = false;
11815
+ if (ExecutionEnvironment.canUseDOM) {
11816
+ // IE9 claims to support the input event but fails to trigger it when
11817
+ // deleting text, so we ignore its input events.
11818
+ isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
11819
+ }
11820
+
11821
+ /**
11822
+ * (For IE <=9) Starts tracking propertychange events on the passed-in element
11823
+ * and override the value property so that we can distinguish user events from
11824
+ * value changes in JS.
11825
+ */
11826
+ function startWatchingForValueChange(target, targetInst) {
11827
+ activeElement = target;
11828
+ activeElementInst = targetInst;
11829
+ activeElement.attachEvent('onpropertychange', handlePropertyChange);
11830
+ }
11831
+
11832
+ /**
11833
+ * (For IE <=9) Removes the event listeners from the currently-tracked element,
11834
+ * if any exists.
11835
+ */
11836
+ function stopWatchingForValueChange() {
11837
+ if (!activeElement) {
11838
+ return;
11839
+ }
11840
+ activeElement.detachEvent('onpropertychange', handlePropertyChange);
11841
+ activeElement = null;
11842
+ activeElementInst = null;
11843
+ }
11844
+
11845
+ /**
11846
+ * (For IE <=9) Handles a propertychange event, sending a `change` event if
11847
+ * the value of the active element has changed.
11848
+ */
11849
+ function handlePropertyChange(nativeEvent) {
11850
+ if (nativeEvent.propertyName !== 'value') {
11851
+ return;
11852
+ }
11853
+ if (getInstIfValueChanged(activeElementInst)) {
11854
+ manualDispatchChangeEvent(nativeEvent);
11855
+ }
11856
+ }
11857
+
11858
+ function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
11859
+ if (topLevelType === 'topFocus') {
11860
+ // In IE9, propertychange fires for most input events but is buggy and
11861
+ // doesn't fire when text is deleted, but conveniently, selectionchange
11862
+ // appears to fire in all of the remaining cases so we catch those and
11863
+ // forward the event if the value has changed
11864
+ // In either case, we don't want to call the event handler if the value
11865
+ // is changed from JS so we redefine a setter for `.value` that updates
11866
+ // our activeElementValue variable, allowing us to ignore those changes
11867
+ //
11868
+ // stopWatching() should be a noop here but we call it just in case we
11869
+ // missed a blur event somehow.
11870
+ stopWatchingForValueChange();
11871
+ startWatchingForValueChange(target, targetInst);
11872
+ } else if (topLevelType === 'topBlur') {
11873
+ stopWatchingForValueChange();
11874
+ }
11875
+ }
11876
+
11877
+ // For IE8 and IE9.
11878
+ function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
11879
+ if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
11880
+ // On the selectionchange event, the target is just document which isn't
11881
+ // helpful for us so just check activeElement instead.
11882
+ //
11883
+ // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
11884
+ // propertychange on the first input event after setting `value` from a
11885
+ // script and fires only keydown, keypress, keyup. Catching keyup usually
11886
+ // gets it and catching keydown lets us fire an event for the first
11887
+ // keystroke if user does a key repeat (it'll be a little delayed: right
11888
+ // before the second keystroke). Other input methods (e.g., paste) seem to
11889
+ // fire selectionchange normally.
11890
+ return getInstIfValueChanged(activeElementInst);
11891
+ }
11892
+ }
11893
+
11894
+ /**
11895
+ * SECTION: handle `click` event
11896
+ */
11897
+ function shouldUseClickEvent(elem) {
11898
+ // Use the `click` event to detect changes to checkbox and radio inputs.
11899
+ // This approach works across all browsers, whereas `change` does not fire
11900
+ // until `blur` in IE8.
11901
+ var nodeName = elem.nodeName;
11902
+ return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
11903
+ }
11904
+
11905
+ function getTargetInstForClickEvent(topLevelType, targetInst) {
11906
+ if (topLevelType === 'topClick') {
11907
+ return getInstIfValueChanged(targetInst);
11908
+ }
11909
+ }
11910
+
11911
+ function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
11912
+ if (topLevelType === 'topInput' || topLevelType === 'topChange') {
11913
+ return getInstIfValueChanged(targetInst);
11914
+ }
11915
+ }
11916
+
11917
+ function handleControlledInputBlur(inst, node) {
11918
+ // TODO: In IE, inst is occasionally null. Why?
11919
+ if (inst == null) {
11920
+ return;
11921
+ }
11922
+
11923
+ // Fiber and ReactDOM keep wrapper state in separate places
11924
+ var state = inst._wrapperState || node._wrapperState;
11925
+
11926
+ if (!state || !state.controlled || node.type !== 'number') {
11927
+ return;
11928
+ }
11929
+
11930
+ // If controlled, assign the value attribute to the current value on blur
11931
+ var value = '' + node.value;
11932
+ if (node.getAttribute('value') !== value) {
11933
+ node.setAttribute('value', value);
11934
+ }
11935
+ }
11936
+
11937
+ /**
11938
+ * This plugin creates an `onChange` event that normalizes change events
11939
+ * across form elements. This event fires at a time when it's possible to
11940
+ * change the element's value without seeing a flicker.
11941
+ *
11942
+ * Supported elements are:
11943
+ * - input (see `isTextInputElement`)
11944
+ * - textarea
11945
+ * - select
11946
+ */
11947
+ var ChangeEventPlugin = {
11948
+ eventTypes: eventTypes$1,
11949
+
11950
+ _isInputEventSupported: isInputEventSupported,
11951
+
11952
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11953
+ var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
11954
+
11955
+ var getTargetInstFunc, handleEventFunc;
11956
+ if (shouldUseChangeEvent(targetNode)) {
11957
+ getTargetInstFunc = getTargetInstForChangeEvent;
11958
+ } else if (isTextInputElement(targetNode)) {
11959
+ if (isInputEventSupported) {
11960
+ getTargetInstFunc = getTargetInstForInputOrChangeEvent;
11961
+ } else {
11962
+ getTargetInstFunc = getTargetInstForInputEventPolyfill;
11963
+ handleEventFunc = handleEventsForInputEventPolyfill;
11964
+ }
11965
+ } else if (shouldUseClickEvent(targetNode)) {
11966
+ getTargetInstFunc = getTargetInstForClickEvent;
11967
+ }
11968
+
11969
+ if (getTargetInstFunc) {
11970
+ var inst = getTargetInstFunc(topLevelType, targetInst);
11971
+ if (inst) {
11972
+ var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
11973
+ return event;
11974
+ }
11975
+ }
11976
+
11977
+ if (handleEventFunc) {
11978
+ handleEventFunc(topLevelType, targetNode, targetInst);
11979
+ }
11980
+
11981
+ // When blurring, set the value attribute for number inputs
11982
+ if (topLevelType === 'topBlur') {
11983
+ handleControlledInputBlur(targetInst, targetNode);
11984
+ }
11985
+ }
11986
+ };
11987
+
11988
+ /**
11989
+ * Module that is injectable into `EventPluginHub`, that specifies a
11990
+ * deterministic ordering of `EventPlugin`s. A convenient way to reason about
11991
+ * plugins, without having to package every one of them. This is better than
11992
+ * having plugins be ordered in the same order that they are injected because
11993
+ * that ordering would be influenced by the packaging order.
11994
+ * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
11995
+ * preventing default on events is convenient in `SimpleEventPlugin` handlers.
11996
+ */
11997
+ var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
11998
+
11999
+ /**
12000
+ * @interface UIEvent
12001
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
12002
+ */
12003
+ var UIEventInterface = {
12004
+ view: null,
12005
+ detail: null
12006
+ };
12007
+
12008
+ /**
12009
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
12010
+ * @param {string} dispatchMarker Marker identifying the event target.
12011
+ * @param {object} nativeEvent Native browser event.
12012
+ * @extends {SyntheticEvent}
12013
+ */
12014
+ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12015
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12016
+ }
12017
+
12018
+ SyntheticEvent$1.augmentClass(SyntheticUIEvent, UIEventInterface);
12019
+
12020
+ /**
12021
+ * Translation from modifier key to the associated property in the event.
12022
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
12023
+ */
12024
+
12025
+ var modifierKeyToProp = {
12026
+ Alt: 'altKey',
12027
+ Control: 'ctrlKey',
12028
+ Meta: 'metaKey',
12029
+ Shift: 'shiftKey'
12030
+ };
12031
+
12032
+ // IE8 does not implement getModifierState so we simply map it to the only
12033
+ // modifier keys exposed by the event itself, does not support Lock-keys.
12034
+ // Currently, all major browsers except Chrome seems to support Lock-keys.
12035
+ function modifierStateGetter(keyArg) {
12036
+ var syntheticEvent = this;
12037
+ var nativeEvent = syntheticEvent.nativeEvent;
12038
+ if (nativeEvent.getModifierState) {
12039
+ return nativeEvent.getModifierState(keyArg);
12040
+ }
12041
+ var keyProp = modifierKeyToProp[keyArg];
12042
+ return keyProp ? !!nativeEvent[keyProp] : false;
12043
+ }
12044
+
12045
+ function getEventModifierState(nativeEvent) {
12046
+ return modifierStateGetter;
12047
+ }
12048
+
12049
+ /**
12050
+ * @interface MouseEvent
12051
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
12052
+ */
12053
+ var MouseEventInterface = {
12054
+ screenX: null,
12055
+ screenY: null,
12056
+ clientX: null,
12057
+ clientY: null,
12058
+ pageX: null,
12059
+ pageY: null,
12060
+ ctrlKey: null,
12061
+ shiftKey: null,
12062
+ altKey: null,
12063
+ metaKey: null,
12064
+ getModifierState: getEventModifierState,
12065
+ button: null,
12066
+ buttons: null,
12067
+ relatedTarget: function (event) {
12068
+ return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
12069
+ }
12070
+ };
12071
+
12072
+ /**
12073
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
12074
+ * @param {string} dispatchMarker Marker identifying the event target.
12075
+ * @param {object} nativeEvent Native browser event.
12076
+ * @extends {SyntheticUIEvent}
12077
+ */
12078
+ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12079
+ return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12080
+ }
12081
+
12082
+ SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
12083
+
12084
+ var eventTypes$2 = {
12085
+ mouseEnter: {
12086
+ registrationName: 'onMouseEnter',
12087
+ dependencies: ['topMouseOut', 'topMouseOver']
12088
+ },
12089
+ mouseLeave: {
12090
+ registrationName: 'onMouseLeave',
12091
+ dependencies: ['topMouseOut', 'topMouseOver']
12092
+ }
12093
+ };
12094
+
12095
+ var EnterLeaveEventPlugin = {
12096
+ eventTypes: eventTypes$2,
12097
+
12098
+ /**
12099
+ * For almost every interaction we care about, there will be both a top-level
12100
+ * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
12101
+ * we do not extract duplicate events. However, moving the mouse into the
12102
+ * browser from outside will not fire a `mouseout` event. In this case, we use
12103
+ * the `mouseover` top-level event.
12104
+ */
12105
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
12106
+ if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
12107
+ return null;
12108
+ }
12109
+ if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
12110
+ // Must not be a mouse in or mouse out - ignoring.
12111
+ return null;
12112
+ }
12113
+
12114
+ var win;
12115
+ if (nativeEventTarget.window === nativeEventTarget) {
12116
+ // `nativeEventTarget` is probably a window object.
12117
+ win = nativeEventTarget;
12118
+ } else {
12119
+ // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
12120
+ var doc = nativeEventTarget.ownerDocument;
12121
+ if (doc) {
12122
+ win = doc.defaultView || doc.parentWindow;
12123
+ } else {
12124
+ win = window;
12125
+ }
12126
+ }
12127
+
12128
+ var from;
12129
+ var to;
12130
+ if (topLevelType === 'topMouseOut') {
12131
+ from = targetInst;
12132
+ var related = nativeEvent.relatedTarget || nativeEvent.toElement;
12133
+ to = related ? getClosestInstanceFromNode(related) : null;
12134
+ } else {
12135
+ // Moving to a node from outside the window.
12136
+ from = null;
12137
+ to = targetInst;
12138
+ }
12139
+
12140
+ if (from === to) {
12141
+ // Nothing pertains to our managed components.
12142
+ return null;
12143
+ }
12144
+
12145
+ var fromNode = from == null ? win : getNodeFromInstance$1(from);
12146
+ var toNode = to == null ? win : getNodeFromInstance$1(to);
12147
+
12148
+ var leave = SyntheticMouseEvent.getPooled(eventTypes$2.mouseLeave, from, nativeEvent, nativeEventTarget);
12149
+ leave.type = 'mouseleave';
12150
+ leave.target = fromNode;
12151
+ leave.relatedTarget = toNode;
12152
+
12153
+ var enter = SyntheticMouseEvent.getPooled(eventTypes$2.mouseEnter, to, nativeEvent, nativeEventTarget);
12154
+ enter.type = 'mouseenter';
12155
+ enter.target = toNode;
12156
+ enter.relatedTarget = fromNode;
12157
+
12158
+ accumulateEnterLeaveDispatches(leave, enter, from, to);
12159
+
12160
+ return [leave, enter];
12161
+ }
12162
+ };
12163
+
12164
+ /**
12165
+ * `ReactInstanceMap` maintains a mapping from a public facing stateful
12166
+ * instance (key) and the internal representation (value). This allows public
12167
+ * methods to accept the user facing instance as an argument and map them back
12168
+ * to internal methods.
12169
+ *
12170
+ * Note that this module is currently shared and assumed to be stateless.
12171
+ * If this becomes an actual Map, that will break.
12172
+ */
12173
+
12174
+ /**
12175
+ * This API should be called `delete` but we'd have to make sure to always
12176
+ * transform these to strings for IE support. When this transform is fully
12177
+ * supported we can rename it.
12178
+ */
12179
+
12180
+
12181
+ function get(key) {
12182
+ return key._reactInternalFiber;
12183
+ }
12184
+
12185
+ function has(key) {
12186
+ return key._reactInternalFiber !== undefined;
12187
+ }
12188
+
12189
+ function set(key, value) {
12190
+ key._reactInternalFiber = value;
12191
+ }
12192
+
12193
+ var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
12194
+
12195
+ var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
12196
+ var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
12197
+
12198
+ function getComponentName(fiber) {
12199
+ var type = fiber.type;
12200
+
12201
+ if (typeof type === 'string') {
12202
+ return type;
12203
+ }
12204
+ if (typeof type === 'function') {
12205
+ return type.displayName || type.name;
12206
+ }
12207
+ return null;
12208
+ }
12209
+
12210
+ // Don't change these two values:
12211
+ var NoEffect = 0; // 0b00000000
12212
+ var PerformedWork = 1; // 0b00000001
12213
+
12214
+ // You can change the rest (and add more).
12215
+ var Placement = 2; // 0b00000010
12216
+ var Update = 4; // 0b00000100
12217
+ var PlacementAndUpdate = 6; // 0b00000110
12218
+ var Deletion = 8; // 0b00001000
12219
+ var ContentReset = 16; // 0b00010000
12220
+ var Callback = 32; // 0b00100000
12221
+ var Err = 64; // 0b01000000
12222
+ var Ref = 128; // 0b10000000
12223
+
12224
+ var MOUNTING = 1;
12225
+ var MOUNTED = 2;
12226
+ var UNMOUNTED = 3;
12227
+
12228
+ function isFiberMountedImpl(fiber) {
12229
+ var node = fiber;
12230
+ if (!fiber.alternate) {
12231
+ // If there is no alternate, this might be a new tree that isn't inserted
12232
+ // yet. If it is, then it will have a pending insertion effect on it.
12233
+ if ((node.effectTag & Placement) !== NoEffect) {
12234
+ return MOUNTING;
12235
+ }
12236
+ while (node['return']) {
12237
+ node = node['return'];
12238
+ if ((node.effectTag & Placement) !== NoEffect) {
12239
+ return MOUNTING;
12240
+ }
12241
+ }
12242
+ } else {
12243
+ while (node['return']) {
12244
+ node = node['return'];
12245
+ }
12246
+ }
12247
+ if (node.tag === HostRoot) {
12248
+ // TODO: Check if this was a nested HostRoot when used with
12249
+ // renderContainerIntoSubtree.
12250
+ return MOUNTED;
12251
+ }
12252
+ // If we didn't hit the root, that means that we're in an disconnected tree
12253
+ // that has been unmounted.
12254
+ return UNMOUNTED;
12255
+ }
12256
+
12257
+ function isFiberMounted(fiber) {
12258
+ return isFiberMountedImpl(fiber) === MOUNTED;
12259
+ }
12260
+
12261
+ function isMounted(component) {
12262
+ {
12263
+ var owner = ReactCurrentOwner.current;
12264
+ if (owner !== null && owner.tag === ClassComponent) {
12265
+ var ownerFiber = owner;
12266
+ var instance = ownerFiber.stateNode;
12267
+ warning(instance._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber) || 'A component');
12268
+ instance._warnedAboutRefsInRender = true;
12269
+ }
12270
+ }
12271
+
12272
+ var fiber = get(component);
12273
+ if (!fiber) {
12274
+ return false;
12275
+ }
12276
+ return isFiberMountedImpl(fiber) === MOUNTED;
12277
+ }
12278
+
12279
+ function assertIsMounted(fiber) {
12280
+ !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
12281
+ }
12282
+
12283
+ function findCurrentFiberUsingSlowPath(fiber) {
12284
+ var alternate = fiber.alternate;
12285
+ if (!alternate) {
12286
+ // If there is no alternate, then we only need to check if it is mounted.
12287
+ var state = isFiberMountedImpl(fiber);
12288
+ !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
12289
+ if (state === MOUNTING) {
12290
+ return null;
12291
+ }
12292
+ return fiber;
12293
+ }
12294
+ // If we have two possible branches, we'll walk backwards up to the root
12295
+ // to see what path the root points to. On the way we may hit one of the
12296
+ // special cases and we'll deal with them.
12297
+ var a = fiber;
12298
+ var b = alternate;
12299
+ while (true) {
12300
+ var parentA = a['return'];
12301
+ var parentB = parentA ? parentA.alternate : null;
12302
+ if (!parentA || !parentB) {
12303
+ // We're at the root.
12304
+ break;
12305
+ }
12306
+
12307
+ // If both copies of the parent fiber point to the same child, we can
12308
+ // assume that the child is current. This happens when we bailout on low
12309
+ // priority: the bailed out fiber's child reuses the current child.
12310
+ if (parentA.child === parentB.child) {
12311
+ var child = parentA.child;
12312
+ while (child) {
12313
+ if (child === a) {
12314
+ // We've determined that A is the current branch.
12315
+ assertIsMounted(parentA);
12316
+ return fiber;
12317
+ }
12318
+ if (child === b) {
12319
+ // We've determined that B is the current branch.
12320
+ assertIsMounted(parentA);
12321
+ return alternate;
12322
+ }
12323
+ child = child.sibling;
12324
+ }
12325
+ // We should never have an alternate for any mounting node. So the only
12326
+ // way this could possibly happen is if this was unmounted, if at all.
12327
+ invariant(false, 'Unable to find node on an unmounted component.');
12328
+ }
12329
+
12330
+ if (a['return'] !== b['return']) {
12331
+ // The return pointer of A and the return pointer of B point to different
12332
+ // fibers. We assume that return pointers never criss-cross, so A must
12333
+ // belong to the child set of A.return, and B must belong to the child
12334
+ // set of B.return.
12335
+ a = parentA;
12336
+ b = parentB;
12337
+ } else {
12338
+ // The return pointers point to the same fiber. We'll have to use the
12339
+ // default, slow path: scan the child sets of each parent alternate to see
12340
+ // which child belongs to which set.
12341
+ //
12342
+ // Search parent A's child set
12343
+ var didFindChild = false;
12344
+ var _child = parentA.child;
12345
+ while (_child) {
12346
+ if (_child === a) {
12347
+ didFindChild = true;
12348
+ a = parentA;
12349
+ b = parentB;
12350
+ break;
12351
+ }
12352
+ if (_child === b) {
12353
+ didFindChild = true;
12354
+ b = parentA;
12355
+ a = parentB;
12356
+ break;
12357
+ }
12358
+ _child = _child.sibling;
12359
+ }
12360
+ if (!didFindChild) {
12361
+ // Search parent B's child set
12362
+ _child = parentB.child;
12363
+ while (_child) {
12364
+ if (_child === a) {
12365
+ didFindChild = true;
12366
+ a = parentB;
12367
+ b = parentA;
12368
+ break;
12369
+ }
12370
+ if (_child === b) {
12371
+ didFindChild = true;
12372
+ b = parentB;
12373
+ a = parentA;
12374
+ break;
12375
+ }
12376
+ _child = _child.sibling;
12377
+ }
12378
+ !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
12379
+ }
12380
+ }
12381
+
12382
+ !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
12383
+ }
12384
+ // If the root is not a host container, we're in a disconnected tree. I.e.
12385
+ // unmounted.
12386
+ !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
12387
+ if (a.stateNode.current === a) {
12388
+ // We've determined that A is the current branch.
12389
+ return fiber;
12390
+ }
12391
+ // Otherwise B has to be current branch.
12392
+ return alternate;
12393
+ }
12394
+
12395
+ function findCurrentHostFiber(parent) {
12396
+ var currentParent = findCurrentFiberUsingSlowPath(parent);
12397
+ if (!currentParent) {
12398
+ return null;
12399
+ }
12400
+
12401
+ // Next we'll drill down this component to find the first HostComponent/Text.
12402
+ var node = currentParent;
12403
+ while (true) {
12404
+ if (node.tag === HostComponent || node.tag === HostText) {
12405
+ return node;
12406
+ } else if (node.child) {
12407
+ node.child['return'] = node;
12408
+ node = node.child;
12409
+ continue;
12410
+ }
12411
+ if (node === currentParent) {
12412
+ return null;
12413
+ }
12414
+ while (!node.sibling) {
12415
+ if (!node['return'] || node['return'] === currentParent) {
12416
+ return null;
12417
+ }
12418
+ node = node['return'];
12419
+ }
12420
+ node.sibling['return'] = node['return'];
12421
+ node = node.sibling;
12422
+ }
12423
+ // Flow needs the return null here, but ESLint complains about it.
12424
+ // eslint-disable-next-line no-unreachable
12425
+ return null;
12426
+ }
12427
+
12428
+ function findCurrentHostFiberWithNoPortals(parent) {
12429
+ var currentParent = findCurrentFiberUsingSlowPath(parent);
12430
+ if (!currentParent) {
12431
+ return null;
12432
+ }
12433
+
12434
+ // Next we'll drill down this component to find the first HostComponent/Text.
12435
+ var node = currentParent;
12436
+ while (true) {
12437
+ if (node.tag === HostComponent || node.tag === HostText) {
12438
+ return node;
12439
+ } else if (node.child && node.tag !== HostPortal) {
12440
+ node.child['return'] = node;
12441
+ node = node.child;
12442
+ continue;
12443
+ }
12444
+ if (node === currentParent) {
12445
+ return null;
12446
+ }
12447
+ while (!node.sibling) {
12448
+ if (!node['return'] || node['return'] === currentParent) {
12449
+ return null;
12450
+ }
12451
+ node = node['return'];
12452
+ }
12453
+ node.sibling['return'] = node['return'];
12454
+ node = node.sibling;
12455
+ }
12456
+ // Flow needs the return null here, but ESLint complains about it.
12457
+ // eslint-disable-next-line no-unreachable
12458
+ return null;
12459
+ }
12460
+
12461
+ var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
12462
+ var callbackBookkeepingPool = [];
12463
+
12464
+ /**
12465
+ * Find the deepest React component completely containing the root of the
12466
+ * passed-in instance (for use when entire React trees are nested within each
12467
+ * other). If React trees are not nested, returns null.
12468
+ */
12469
+ function findRootContainerNode(inst) {
12470
+ // TODO: It may be a good idea to cache this to prevent unnecessary DOM
12471
+ // traversal, but caching is difficult to do correctly without using a
12472
+ // mutation observer to listen for all DOM changes.
12473
+ while (inst['return']) {
12474
+ inst = inst['return'];
12475
+ }
12476
+ if (inst.tag !== HostRoot) {
12477
+ // This can happen if we're in a detached tree.
12478
+ return null;
12479
+ }
12480
+ return inst.stateNode.containerInfo;
12481
+ }
12482
+
12483
+ // Used to store ancestor hierarchy in top level callback
12484
+ function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
12485
+ if (callbackBookkeepingPool.length) {
12486
+ var instance = callbackBookkeepingPool.pop();
12487
+ instance.topLevelType = topLevelType;
12488
+ instance.nativeEvent = nativeEvent;
12489
+ instance.targetInst = targetInst;
12490
+ return instance;
12491
+ }
12492
+ return {
12493
+ topLevelType: topLevelType,
12494
+ nativeEvent: nativeEvent,
12495
+ targetInst: targetInst,
12496
+ ancestors: []
12497
+ };
12498
+ }
12499
+
12500
+ function releaseTopLevelCallbackBookKeeping(instance) {
12501
+ instance.topLevelType = null;
12502
+ instance.nativeEvent = null;
12503
+ instance.targetInst = null;
12504
+ instance.ancestors.length = 0;
12505
+ if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
12506
+ callbackBookkeepingPool.push(instance);
12507
+ }
12508
+ }
12509
+
12510
+ function handleTopLevelImpl(bookKeeping) {
12511
+ var targetInst = bookKeeping.targetInst;
12512
+
12513
+ // Loop through the hierarchy, in case there's any nested components.
12514
+ // It's important that we build the array of ancestors before calling any
12515
+ // event handlers, because event handlers can modify the DOM, leading to
12516
+ // inconsistencies with ReactMount's node cache. See #1105.
12517
+ var ancestor = targetInst;
12518
+ do {
12519
+ if (!ancestor) {
12520
+ bookKeeping.ancestors.push(ancestor);
12521
+ break;
12522
+ }
12523
+ var root = findRootContainerNode(ancestor);
12524
+ if (!root) {
12525
+ break;
12526
+ }
12527
+ bookKeeping.ancestors.push(ancestor);
12528
+ ancestor = getClosestInstanceFromNode(root);
12529
+ } while (ancestor);
12530
+
12531
+ for (var i = 0; i < bookKeeping.ancestors.length; i++) {
12532
+ targetInst = bookKeeping.ancestors[i];
12533
+ _handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
12534
+ }
12535
+ }
12536
+
12537
+ // TODO: can we stop exporting these?
12538
+ var _enabled = true;
12539
+ var _handleTopLevel = void 0;
12540
+
12541
+ function setHandleTopLevel(handleTopLevel) {
12542
+ _handleTopLevel = handleTopLevel;
12543
+ }
12544
+
12545
+ function setEnabled(enabled) {
12546
+ _enabled = !!enabled;
12547
+ }
12548
+
12549
+ function isEnabled() {
12550
+ return _enabled;
12551
+ }
12552
+
12553
+ /**
12554
+ * Traps top-level events by using event bubbling.
12555
+ *
12556
+ * @param {string} topLevelType Record from `BrowserEventConstants`.
12557
+ * @param {string} handlerBaseName Event name (e.g. "click").
12558
+ * @param {object} element Element on which to attach listener.
12559
+ * @return {?object} An object with a remove function which will forcefully
12560
+ * remove the listener.
12561
+ * @internal
12562
+ */
12563
+ function trapBubbledEvent(topLevelType, handlerBaseName, element) {
12564
+ if (!element) {
12565
+ return null;
12566
+ }
12567
+ return EventListener.listen(element, handlerBaseName, dispatchEvent.bind(null, topLevelType));
12568
+ }
12569
+
12570
+ /**
12571
+ * Traps a top-level event by using event capturing.
12572
+ *
12573
+ * @param {string} topLevelType Record from `BrowserEventConstants`.
12574
+ * @param {string} handlerBaseName Event name (e.g. "click").
12575
+ * @param {object} element Element on which to attach listener.
12576
+ * @return {?object} An object with a remove function which will forcefully
12577
+ * remove the listener.
12578
+ * @internal
12579
+ */
12580
+ function trapCapturedEvent(topLevelType, handlerBaseName, element) {
12581
+ if (!element) {
12582
+ return null;
12583
+ }
12584
+ return EventListener.capture(element, handlerBaseName, dispatchEvent.bind(null, topLevelType));
12585
+ }
12586
+
12587
+ function dispatchEvent(topLevelType, nativeEvent) {
12588
+ if (!_enabled) {
12589
+ return;
12590
+ }
12591
+
12592
+ var nativeEventTarget = getEventTarget(nativeEvent);
12593
+ var targetInst = getClosestInstanceFromNode(nativeEventTarget);
12594
+ if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {
12595
+ // If we get an event (ex: img onload) before committing that
12596
+ // component's mount, ignore it for now (that is, treat it as if it was an
12597
+ // event on a non-React tree). We might also consider queueing events and
12598
+ // dispatching them after the mount.
12599
+ targetInst = null;
12600
+ }
12601
+
12602
+ var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);
12603
+
12604
+ try {
12605
+ // Event queue being processed in the same cycle allows
12606
+ // `preventDefault`.
12607
+ batchedUpdates(handleTopLevelImpl, bookKeeping);
12608
+ } finally {
12609
+ releaseTopLevelCallbackBookKeeping(bookKeeping);
12610
+ }
12611
+ }
12612
+
12613
+ var ReactDOMEventListener = Object.freeze({
12614
+ get _enabled () { return _enabled; },
12615
+ get _handleTopLevel () { return _handleTopLevel; },
12616
+ setHandleTopLevel: setHandleTopLevel,
12617
+ setEnabled: setEnabled,
12618
+ isEnabled: isEnabled,
12619
+ trapBubbledEvent: trapBubbledEvent,
12620
+ trapCapturedEvent: trapCapturedEvent,
12621
+ dispatchEvent: dispatchEvent
12622
+ });
12623
+
12624
+ /**
12625
+ * Generate a mapping of standard vendor prefixes using the defined style property and event name.
12626
+ *
12627
+ * @param {string} styleProp
12628
+ * @param {string} eventName
12629
+ * @returns {object}
12630
+ */
12631
+ function makePrefixMap(styleProp, eventName) {
12632
+ var prefixes = {};
12633
+
12634
+ prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
12635
+ prefixes['Webkit' + styleProp] = 'webkit' + eventName;
12636
+ prefixes['Moz' + styleProp] = 'moz' + eventName;
12637
+ prefixes['ms' + styleProp] = 'MS' + eventName;
12638
+ prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
12639
+
12640
+ return prefixes;
12641
+ }
12642
+
12643
+ /**
12644
+ * A list of event names to a configurable list of vendor prefixes.
12645
+ */
12646
+ var vendorPrefixes = {
12647
+ animationend: makePrefixMap('Animation', 'AnimationEnd'),
12648
+ animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
12649
+ animationstart: makePrefixMap('Animation', 'AnimationStart'),
12650
+ transitionend: makePrefixMap('Transition', 'TransitionEnd')
12651
+ };
12652
+
12653
+ /**
12654
+ * Event names that have already been detected and prefixed (if applicable).
12655
+ */
12656
+ var prefixedEventNames = {};
12657
+
12658
+ /**
12659
+ * Element to check for prefixes on.
12660
+ */
12661
+ var style = {};
12662
+
12663
+ /**
12664
+ * Bootstrap if a DOM exists.
12665
+ */
12666
+ if (ExecutionEnvironment.canUseDOM) {
12667
+ style = document.createElement('div').style;
12668
+
12669
+ // On some platforms, in particular some releases of Android 4.x,
12670
+ // the un-prefixed "animation" and "transition" properties are defined on the
12671
+ // style object but the events that fire will still be prefixed, so we need
12672
+ // to check if the un-prefixed events are usable, and if not remove them from the map.
12673
+ if (!('AnimationEvent' in window)) {
12674
+ delete vendorPrefixes.animationend.animation;
12675
+ delete vendorPrefixes.animationiteration.animation;
12676
+ delete vendorPrefixes.animationstart.animation;
12677
+ }
12678
+
12679
+ // Same as above
12680
+ if (!('TransitionEvent' in window)) {
12681
+ delete vendorPrefixes.transitionend.transition;
12682
+ }
12683
+ }
12684
+
12685
+ /**
12686
+ * Attempts to determine the correct vendor prefixed event name.
12687
+ *
12688
+ * @param {string} eventName
12689
+ * @returns {string}
12690
+ */
12691
+ function getVendorPrefixedEventName(eventName) {
12692
+ if (prefixedEventNames[eventName]) {
12693
+ return prefixedEventNames[eventName];
12694
+ } else if (!vendorPrefixes[eventName]) {
12695
+ return eventName;
12696
+ }
12697
+
12698
+ var prefixMap = vendorPrefixes[eventName];
12699
+
12700
+ for (var styleProp in prefixMap) {
12701
+ if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
12702
+ return prefixedEventNames[eventName] = prefixMap[styleProp];
12703
+ }
12704
+ }
12705
+
12706
+ return '';
12707
+ }
12708
+
12709
+ /**
12710
+ * Types of raw signals from the browser caught at the top level.
12711
+ *
12712
+ * For events like 'submit' which don't consistently bubble (which we
12713
+ * trap at a lower node than `document`), binding at `document` would
12714
+ * cause duplicate events so we don't include them here.
12715
+ */
12716
+ var topLevelTypes$1 = {
12717
+ topAbort: 'abort',
12718
+ topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
12719
+ topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
12720
+ topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
12721
+ topBlur: 'blur',
12722
+ topCancel: 'cancel',
12723
+ topCanPlay: 'canplay',
12724
+ topCanPlayThrough: 'canplaythrough',
12725
+ topChange: 'change',
12726
+ topClick: 'click',
12727
+ topClose: 'close',
12728
+ topCompositionEnd: 'compositionend',
12729
+ topCompositionStart: 'compositionstart',
12730
+ topCompositionUpdate: 'compositionupdate',
12731
+ topContextMenu: 'contextmenu',
12732
+ topCopy: 'copy',
12733
+ topCut: 'cut',
12734
+ topDoubleClick: 'dblclick',
12735
+ topDrag: 'drag',
12736
+ topDragEnd: 'dragend',
12737
+ topDragEnter: 'dragenter',
12738
+ topDragExit: 'dragexit',
12739
+ topDragLeave: 'dragleave',
12740
+ topDragOver: 'dragover',
12741
+ topDragStart: 'dragstart',
12742
+ topDrop: 'drop',
12743
+ topDurationChange: 'durationchange',
12744
+ topEmptied: 'emptied',
12745
+ topEncrypted: 'encrypted',
12746
+ topEnded: 'ended',
12747
+ topError: 'error',
12748
+ topFocus: 'focus',
12749
+ topInput: 'input',
12750
+ topKeyDown: 'keydown',
12751
+ topKeyPress: 'keypress',
12752
+ topKeyUp: 'keyup',
12753
+ topLoadedData: 'loadeddata',
12754
+ topLoad: 'load',
12755
+ topLoadedMetadata: 'loadedmetadata',
12756
+ topLoadStart: 'loadstart',
12757
+ topMouseDown: 'mousedown',
12758
+ topMouseMove: 'mousemove',
12759
+ topMouseOut: 'mouseout',
12760
+ topMouseOver: 'mouseover',
12761
+ topMouseUp: 'mouseup',
12762
+ topPaste: 'paste',
12763
+ topPause: 'pause',
12764
+ topPlay: 'play',
12765
+ topPlaying: 'playing',
12766
+ topProgress: 'progress',
12767
+ topRateChange: 'ratechange',
12768
+ topScroll: 'scroll',
12769
+ topSeeked: 'seeked',
12770
+ topSeeking: 'seeking',
12771
+ topSelectionChange: 'selectionchange',
12772
+ topStalled: 'stalled',
12773
+ topSuspend: 'suspend',
12774
+ topTextInput: 'textInput',
12775
+ topTimeUpdate: 'timeupdate',
12776
+ topToggle: 'toggle',
12777
+ topTouchCancel: 'touchcancel',
12778
+ topTouchEnd: 'touchend',
12779
+ topTouchMove: 'touchmove',
12780
+ topTouchStart: 'touchstart',
12781
+ topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
12782
+ topVolumeChange: 'volumechange',
12783
+ topWaiting: 'waiting',
12784
+ topWheel: 'wheel'
12785
+ };
12786
+
12787
+ var BrowserEventConstants = {
12788
+ topLevelTypes: topLevelTypes$1
12789
+ };
12790
+
12791
+ function runEventQueueInBatch(events) {
12792
+ enqueueEvents(events);
12793
+ processEventQueue(false);
12794
+ }
12795
+
12796
+ /**
12797
+ * Streams a fired top-level event to `EventPluginHub` where plugins have the
12798
+ * opportunity to create `ReactEvent`s to be dispatched.
12799
+ */
12800
+ function handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
12801
+ var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
12802
+ runEventQueueInBatch(events);
12803
+ }
12804
+
12805
+ var topLevelTypes = BrowserEventConstants.topLevelTypes;
12806
+
12807
+ /**
12808
+ * Summary of `ReactBrowserEventEmitter` event handling:
12809
+ *
12810
+ * - Top-level delegation is used to trap most native browser events. This
12811
+ * may only occur in the main thread and is the responsibility of
12812
+ * ReactDOMEventListener, which is injected and can therefore support
12813
+ * pluggable event sources. This is the only work that occurs in the main
12814
+ * thread.
12815
+ *
12816
+ * - We normalize and de-duplicate events to account for browser quirks. This
12817
+ * may be done in the worker thread.
12818
+ *
12819
+ * - Forward these native events (with the associated top-level type used to
12820
+ * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
12821
+ * to extract any synthetic events.
12822
+ *
12823
+ * - The `EventPluginHub` will then process each event by annotating them with
12824
+ * "dispatches", a sequence of listeners and IDs that care about that event.
12825
+ *
12826
+ * - The `EventPluginHub` then dispatches the events.
12827
+ *
12828
+ * Overview of React and the event system:
12829
+ *
12830
+ * +------------+ .
12831
+ * | DOM | .
12832
+ * +------------+ .
12833
+ * | .
12834
+ * v .
12835
+ * +------------+ .
12836
+ * | ReactEvent | .
12837
+ * | Listener | .
12838
+ * +------------+ . +-----------+
12839
+ * | . +--------+|SimpleEvent|
12840
+ * | . | |Plugin |
12841
+ * +-----|------+ . v +-----------+
12842
+ * | | | . +--------------+ +------------+
12843
+ * | +-----------.--->|EventPluginHub| | Event |
12844
+ * | | . | | +-----------+ | Propagators|
12845
+ * | ReactEvent | . | | |TapEvent | |------------|
12846
+ * | Emitter | . | |<---+|Plugin | |other plugin|
12847
+ * | | . | | +-----------+ | utilities |
12848
+ * | +-----------.--->| | +------------+
12849
+ * | | | . +--------------+
12850
+ * +-----|------+ . ^ +-----------+
12851
+ * | . | |Enter/Leave|
12852
+ * + . +-------+|Plugin |
12853
+ * +-------------+ . +-----------+
12854
+ * | application | .
12855
+ * |-------------| .
12856
+ * | | .
12857
+ * | | .
12858
+ * +-------------+ .
12859
+ * .
12860
+ * React Core . General Purpose Event Plugin System
12861
+ */
12862
+
12863
+ var alreadyListeningTo = {};
12864
+ var reactTopListenersCounter = 0;
12865
+
12866
+ /**
12867
+ * To ensure no conflicts with other potential React instances on the page
12868
+ */
12869
+ var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2);
12870
+
12871
+ function getListeningForDocument(mountAt) {
12872
+ // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
12873
+ // directly.
12874
+ if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
12875
+ mountAt[topListenersIDKey] = reactTopListenersCounter++;
12876
+ alreadyListeningTo[mountAt[topListenersIDKey]] = {};
12877
+ }
12878
+ return alreadyListeningTo[mountAt[topListenersIDKey]];
12879
+ }
12880
+
12881
+ /**
12882
+ * We listen for bubbled touch events on the document object.
12883
+ *
12884
+ * Firefox v8.01 (and possibly others) exhibited strange behavior when
12885
+ * mounting `onmousemove` events at some node that was not the document
12886
+ * element. The symptoms were that if your mouse is not moving over something
12887
+ * contained within that mount point (for example on the background) the
12888
+ * top-level listeners for `onmousemove` won't be called. However, if you
12889
+ * register the `mousemove` on the document object, then it will of course
12890
+ * catch all `mousemove`s. This along with iOS quirks, justifies restricting
12891
+ * top-level listeners to the document object only, at least for these
12892
+ * movement types of events and possibly all events.
12893
+ *
12894
+ * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
12895
+ *
12896
+ * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
12897
+ * they bubble to document.
12898
+ *
12899
+ * @param {string} registrationName Name of listener (e.g. `onClick`).
12900
+ * @param {object} contentDocumentHandle Document which owns the container
12901
+ */
12902
+ function listenTo(registrationName, contentDocumentHandle) {
12903
+ var mountAt = contentDocumentHandle;
12904
+ var isListening = getListeningForDocument(mountAt);
12905
+ var dependencies = registrationNameDependencies[registrationName];
12906
+
12907
+ for (var i = 0; i < dependencies.length; i++) {
12908
+ var dependency = dependencies[i];
12909
+ if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
12910
+ if (dependency === 'topScroll') {
12911
+ trapCapturedEvent('topScroll', 'scroll', mountAt);
12912
+ } else if (dependency === 'topFocus' || dependency === 'topBlur') {
12913
+ trapCapturedEvent('topFocus', 'focus', mountAt);
12914
+ trapCapturedEvent('topBlur', 'blur', mountAt);
12915
+
12916
+ // to make sure blur and focus event listeners are only attached once
12917
+ isListening.topBlur = true;
12918
+ isListening.topFocus = true;
12919
+ } else if (dependency === 'topCancel') {
12920
+ if (isEventSupported('cancel', true)) {
12921
+ trapCapturedEvent('topCancel', 'cancel', mountAt);
12922
+ }
12923
+ isListening.topCancel = true;
12924
+ } else if (dependency === 'topClose') {
12925
+ if (isEventSupported('close', true)) {
12926
+ trapCapturedEvent('topClose', 'close', mountAt);
12927
+ }
12928
+ isListening.topClose = true;
12929
+ } else if (topLevelTypes.hasOwnProperty(dependency)) {
12930
+ trapBubbledEvent(dependency, topLevelTypes[dependency], mountAt);
12931
+ }
12932
+
12933
+ isListening[dependency] = true;
12934
+ }
12935
+ }
12936
+ }
12937
+
12938
+ function isListeningToAllDependencies(registrationName, mountAt) {
12939
+ var isListening = getListeningForDocument(mountAt);
12940
+ var dependencies = registrationNameDependencies[registrationName];
12941
+ for (var i = 0; i < dependencies.length; i++) {
12942
+ var dependency = dependencies[i];
12943
+ if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
12944
+ return false;
12945
+ }
12946
+ }
12947
+ return true;
12948
+ }
12949
+
12950
+ /**
12951
+ * Given any node return the first leaf node without children.
12952
+ *
12953
+ * @param {DOMElement|DOMTextNode} node
12954
+ * @return {DOMElement|DOMTextNode}
12955
+ */
12956
+ function getLeafNode(node) {
12957
+ while (node && node.firstChild) {
12958
+ node = node.firstChild;
12959
+ }
12960
+ return node;
12961
+ }
12962
+
12963
+ /**
12964
+ * Get the next sibling within a container. This will walk up the
12965
+ * DOM if a node's siblings have been exhausted.
12966
+ *
12967
+ * @param {DOMElement|DOMTextNode} node
12968
+ * @return {?DOMElement|DOMTextNode}
12969
+ */
12970
+ function getSiblingNode(node) {
12971
+ while (node) {
12972
+ if (node.nextSibling) {
12973
+ return node.nextSibling;
12974
+ }
12975
+ node = node.parentNode;
12976
+ }
12977
+ }
12978
+
12979
+ /**
12980
+ * Get object describing the nodes which contain characters at offset.
12981
+ *
12982
+ * @param {DOMElement|DOMTextNode} root
12983
+ * @param {number} offset
12984
+ * @return {?object}
12985
+ */
12986
+ function getNodeForCharacterOffset(root, offset) {
12987
+ var node = getLeafNode(root);
12988
+ var nodeStart = 0;
12989
+ var nodeEnd = 0;
12990
+
12991
+ while (node) {
12992
+ if (node.nodeType === TEXT_NODE) {
12993
+ nodeEnd = nodeStart + node.textContent.length;
12994
+
12995
+ if (nodeStart <= offset && nodeEnd >= offset) {
12996
+ return {
12997
+ node: node,
12998
+ offset: offset - nodeStart
12999
+ };
13000
+ }
13001
+
13002
+ nodeStart = nodeEnd;
13003
+ }
13004
+
13005
+ node = getLeafNode(getSiblingNode(node));
13006
+ }
13007
+ }
13008
+
13009
+ /**
13010
+ * @param {DOMElement} outerNode
13011
+ * @return {?object}
13012
+ */
13013
+ function getOffsets(outerNode) {
13014
+ var selection = window.getSelection && window.getSelection();
13015
+
13016
+ if (!selection || selection.rangeCount === 0) {
13017
+ return null;
13018
+ }
13019
+
13020
+ var anchorNode = selection.anchorNode,
13021
+ anchorOffset = selection.anchorOffset,
13022
+ focusNode$$1 = selection.focusNode,
13023
+ focusOffset = selection.focusOffset;
13024
+
13025
+ // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
13026
+ // up/down buttons on an <input type="number">. Anonymous divs do not seem to
13027
+ // expose properties, triggering a "Permission denied error" if any of its
13028
+ // properties are accessed. The only seemingly possible way to avoid erroring
13029
+ // is to access a property that typically works for non-anonymous divs and
13030
+ // catch any error that may otherwise arise. See
13031
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
13032
+
13033
+ try {
13034
+ /* eslint-disable no-unused-expressions */
13035
+ anchorNode.nodeType;
13036
+ focusNode$$1.nodeType;
13037
+ /* eslint-enable no-unused-expressions */
13038
+ } catch (e) {
13039
+ return null;
13040
+ }
13041
+
13042
+ return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset);
13043
+ }
13044
+
13045
+ /**
13046
+ * Returns {start, end} where `start` is the character/codepoint index of
13047
+ * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
13048
+ * `end` is the index of (focusNode, focusOffset).
13049
+ *
13050
+ * Returns null if you pass in garbage input but we should probably just crash.
13051
+ *
13052
+ * Exported only for testing.
13053
+ */
13054
+ function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset) {
13055
+ var length = 0;
13056
+ var start = -1;
13057
+ var end = -1;
13058
+ var indexWithinAnchor = 0;
13059
+ var indexWithinFocus = 0;
13060
+ var node = outerNode;
13061
+ var parentNode = null;
13062
+
13063
+ outer: while (true) {
13064
+ var next = null;
13065
+
13066
+ while (true) {
13067
+ if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
13068
+ start = length + anchorOffset;
13069
+ }
13070
+ if (node === focusNode$$1 && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
13071
+ end = length + focusOffset;
13072
+ }
13073
+
13074
+ if (node.nodeType === TEXT_NODE) {
13075
+ length += node.nodeValue.length;
13076
+ }
13077
+
13078
+ if ((next = node.firstChild) === null) {
13079
+ break;
13080
+ }
13081
+ // Moving from `node` to its first child `next`.
13082
+ parentNode = node;
13083
+ node = next;
13084
+ }
13085
+
13086
+ while (true) {
13087
+ if (node === outerNode) {
13088
+ // If `outerNode` has children, this is always the second time visiting
13089
+ // it. If it has no children, this is still the first loop, and the only
13090
+ // valid selection is anchorNode and focusNode both equal to this node
13091
+ // and both offsets 0, in which case we will have handled above.
13092
+ break outer;
13093
+ }
13094
+ if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
13095
+ start = length;
13096
+ }
13097
+ if (parentNode === focusNode$$1 && ++indexWithinFocus === focusOffset) {
13098
+ end = length;
13099
+ }
13100
+ if ((next = node.nextSibling) !== null) {
13101
+ break;
13102
+ }
13103
+ node = parentNode;
13104
+ parentNode = node.parentNode;
13105
+ }
13106
+
13107
+ // Moving from `node` to its next sibling `next`.
13108
+ node = next;
13109
+ }
13110
+
13111
+ if (start === -1 || end === -1) {
13112
+ // This should never happen. (Would happen if the anchor/focus nodes aren't
13113
+ // actually inside the passed-in node.)
13114
+ return null;
13115
+ }
13116
+
13117
+ return {
13118
+ start: start,
13119
+ end: end
13120
+ };
13121
+ }
13122
+
13123
+ /**
13124
+ * In modern non-IE browsers, we can support both forward and backward
13125
+ * selections.
13126
+ *
13127
+ * Note: IE10+ supports the Selection object, but it does not support
13128
+ * the `extend` method, which means that even in modern IE, it's not possible
13129
+ * to programmatically create a backward selection. Thus, for all IE
13130
+ * versions, we use the old IE API to create our selections.
13131
+ *
13132
+ * @param {DOMElement|DOMTextNode} node
13133
+ * @param {object} offsets
13134
+ */
13135
+ function setOffsets(node, offsets) {
13136
+ if (!window.getSelection) {
13137
+ return;
13138
+ }
13139
+
13140
+ var selection = window.getSelection();
13141
+ var length = node[getTextContentAccessor()].length;
13142
+ var start = Math.min(offsets.start, length);
13143
+ var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
13144
+
13145
+ // IE 11 uses modern selection, but doesn't support the extend method.
13146
+ // Flip backward selections, so we can set with a single range.
13147
+ if (!selection.extend && start > end) {
13148
+ var temp = end;
13149
+ end = start;
13150
+ start = temp;
13151
+ }
13152
+
13153
+ var startMarker = getNodeForCharacterOffset(node, start);
13154
+ var endMarker = getNodeForCharacterOffset(node, end);
13155
+
13156
+ if (startMarker && endMarker) {
13157
+ if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
13158
+ return;
13159
+ }
13160
+ var range = document.createRange();
13161
+ range.setStart(startMarker.node, startMarker.offset);
13162
+ selection.removeAllRanges();
13163
+
13164
+ if (start > end) {
13165
+ selection.addRange(range);
13166
+ selection.extend(endMarker.node, endMarker.offset);
13167
+ } else {
13168
+ range.setEnd(endMarker.node, endMarker.offset);
13169
+ selection.addRange(range);
13170
+ }
13171
+ }
13172
+ }
13173
+
13174
+ function isInDocument(node) {
13175
+ return containsNode(document.documentElement, node);
13176
+ }
13177
+
13178
+ /**
13179
+ * @ReactInputSelection: React input selection module. Based on Selection.js,
13180
+ * but modified to be suitable for react and has a couple of bug fixes (doesn't
13181
+ * assume buttons have range selections allowed).
13182
+ * Input selection module for React.
13183
+ */
13184
+
13185
+ function hasSelectionCapabilities(elem) {
13186
+ var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
13187
+ return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
13188
+ }
13189
+
13190
+ function getSelectionInformation() {
13191
+ var focusedElem = getActiveElement();
13192
+ return {
13193
+ focusedElem: focusedElem,
13194
+ selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null
13195
+ };
13196
+ }
13197
+
13198
+ /**
13199
+ * @restoreSelection: If any selection information was potentially lost,
13200
+ * restore it. This is useful when performing operations that could remove dom
13201
+ * nodes and place them back in, resulting in focus being lost.
13202
+ */
13203
+ function restoreSelection(priorSelectionInformation) {
13204
+ var curFocusedElem = getActiveElement();
13205
+ var priorFocusedElem = priorSelectionInformation.focusedElem;
13206
+ var priorSelectionRange = priorSelectionInformation.selectionRange;
13207
+ if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
13208
+ if (hasSelectionCapabilities(priorFocusedElem)) {
13209
+ setSelection(priorFocusedElem, priorSelectionRange);
13210
+ }
13211
+
13212
+ // Focusing a node can change the scroll position, which is undesirable
13213
+ var ancestors = [];
13214
+ var ancestor = priorFocusedElem;
13215
+ while (ancestor = ancestor.parentNode) {
13216
+ if (ancestor.nodeType === ELEMENT_NODE) {
13217
+ ancestors.push({
13218
+ element: ancestor,
13219
+ left: ancestor.scrollLeft,
13220
+ top: ancestor.scrollTop
13221
+ });
13222
+ }
13223
+ }
13224
+
13225
+ focusNode(priorFocusedElem);
13226
+
13227
+ for (var i = 0; i < ancestors.length; i++) {
13228
+ var info = ancestors[i];
13229
+ info.element.scrollLeft = info.left;
13230
+ info.element.scrollTop = info.top;
13231
+ }
13232
+ }
13233
+ }
13234
+
13235
+ /**
13236
+ * @getSelection: Gets the selection bounds of a focused textarea, input or
13237
+ * contentEditable node.
13238
+ * -@input: Look up selection bounds of this input
13239
+ * -@return {start: selectionStart, end: selectionEnd}
13240
+ */
13241
+ function getSelection$1(input) {
13242
+ var selection = void 0;
13243
+
13244
+ if ('selectionStart' in input) {
13245
+ // Modern browser with input or textarea.
13246
+ selection = {
13247
+ start: input.selectionStart,
13248
+ end: input.selectionEnd
13249
+ };
13250
+ } else {
13251
+ // Content editable or old IE textarea.
13252
+ selection = getOffsets(input);
13253
+ }
13254
+
13255
+ return selection || { start: 0, end: 0 };
13256
+ }
13257
+
13258
+ /**
13259
+ * @setSelection: Sets the selection bounds of a textarea or input and focuses
13260
+ * the input.
13261
+ * -@input Set selection bounds of this input or textarea
13262
+ * -@offsets Object of same form that is returned from get*
13263
+ */
13264
+ function setSelection(input, offsets) {
13265
+ var start = offsets.start,
13266
+ end = offsets.end;
13267
+
13268
+ if (end === undefined) {
13269
+ end = start;
13270
+ }
13271
+
13272
+ if ('selectionStart' in input) {
13273
+ input.selectionStart = start;
13274
+ input.selectionEnd = Math.min(end, input.value.length);
13275
+ } else {
13276
+ setOffsets(input, offsets);
13277
+ }
13278
+ }
13279
+
13280
+ var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
13281
+
13282
+ var eventTypes$3 = {
13283
+ select: {
13284
+ phasedRegistrationNames: {
13285
+ bubbled: 'onSelect',
13286
+ captured: 'onSelectCapture'
13287
+ },
13288
+ dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
13289
+ }
13290
+ };
13291
+
13292
+ var activeElement$1 = null;
13293
+ var activeElementInst$1 = null;
13294
+ var lastSelection = null;
13295
+ var mouseDown = false;
13296
+
13297
+ /**
13298
+ * Get an object which is a unique representation of the current selection.
13299
+ *
13300
+ * The return value will not be consistent across nodes or browsers, but
13301
+ * two identical selections on the same node will return identical objects.
13302
+ *
13303
+ * @param {DOMElement} node
13304
+ * @return {object}
13305
+ */
13306
+ function getSelection(node) {
13307
+ if ('selectionStart' in node && hasSelectionCapabilities(node)) {
13308
+ return {
13309
+ start: node.selectionStart,
13310
+ end: node.selectionEnd
13311
+ };
13312
+ } else if (window.getSelection) {
13313
+ var selection = window.getSelection();
13314
+ return {
13315
+ anchorNode: selection.anchorNode,
13316
+ anchorOffset: selection.anchorOffset,
13317
+ focusNode: selection.focusNode,
13318
+ focusOffset: selection.focusOffset
13319
+ };
13320
+ }
13321
+ }
13322
+
13323
+ /**
13324
+ * Poll selection to see whether it's changed.
13325
+ *
13326
+ * @param {object} nativeEvent
13327
+ * @return {?SyntheticEvent}
13328
+ */
13329
+ function constructSelectEvent(nativeEvent, nativeEventTarget) {
13330
+ // Ensure we have the right element, and that the user is not dragging a
13331
+ // selection (this matches native `select` event behavior). In HTML5, select
13332
+ // fires only on input and textarea thus if there's no focused element we
13333
+ // won't dispatch.
13334
+ if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement()) {
13335
+ return null;
13336
+ }
13337
+
13338
+ // Only fire when selection has actually changed.
13339
+ var currentSelection = getSelection(activeElement$1);
13340
+ if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
13341
+ lastSelection = currentSelection;
13342
+
13343
+ var syntheticEvent = SyntheticEvent$1.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
13344
+
13345
+ syntheticEvent.type = 'select';
13346
+ syntheticEvent.target = activeElement$1;
13347
+
13348
+ accumulateTwoPhaseDispatches(syntheticEvent);
13349
+
13350
+ return syntheticEvent;
13351
+ }
13352
+
13353
+ return null;
13354
+ }
13355
+
13356
+ /**
13357
+ * This plugin creates an `onSelect` event that normalizes select events
13358
+ * across form elements.
13359
+ *
13360
+ * Supported elements are:
13361
+ * - input (see `isTextInputElement`)
13362
+ * - textarea
13363
+ * - contentEditable
13364
+ *
13365
+ * This differs from native browser implementations in the following ways:
13366
+ * - Fires on contentEditable fields as well as inputs.
13367
+ * - Fires for collapsed selection.
13368
+ * - Fires after user input.
13369
+ */
13370
+ var SelectEventPlugin = {
13371
+ eventTypes: eventTypes$3,
13372
+
13373
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
13374
+ var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === DOCUMENT_NODE ? nativeEventTarget : nativeEventTarget.ownerDocument;
13375
+ // Track whether all listeners exists for this plugin. If none exist, we do
13376
+ // not extract events. See #3639.
13377
+ if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
13378
+ return null;
13379
+ }
13380
+
13381
+ var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
13382
+
13383
+ switch (topLevelType) {
13384
+ // Track the input node that has focus.
13385
+ case 'topFocus':
13386
+ if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
13387
+ activeElement$1 = targetNode;
13388
+ activeElementInst$1 = targetInst;
13389
+ lastSelection = null;
13390
+ }
13391
+ break;
13392
+ case 'topBlur':
13393
+ activeElement$1 = null;
13394
+ activeElementInst$1 = null;
13395
+ lastSelection = null;
13396
+ break;
13397
+ // Don't fire the event while the user is dragging. This matches the
13398
+ // semantics of the native select event.
13399
+ case 'topMouseDown':
13400
+ mouseDown = true;
13401
+ break;
13402
+ case 'topContextMenu':
13403
+ case 'topMouseUp':
13404
+ mouseDown = false;
13405
+ return constructSelectEvent(nativeEvent, nativeEventTarget);
13406
+ // Chrome and IE fire non-standard event when selection is changed (and
13407
+ // sometimes when it hasn't). IE's event fires out of order with respect
13408
+ // to key and input events on deletion, so we discard it.
13409
+ //
13410
+ // Firefox doesn't support selectionchange, so check selection status
13411
+ // after each key entry. The selection changes after keydown and before
13412
+ // keyup, but we check on keydown as well in the case of holding down a
13413
+ // key, when multiple keydown events are fired but only one keyup is.
13414
+ // This is also our approach for IE handling, for the reason above.
13415
+ case 'topSelectionChange':
13416
+ if (skipSelectionChangeEvent) {
13417
+ break;
13418
+ }
13419
+ // falls through
13420
+ case 'topKeyDown':
13421
+ case 'topKeyUp':
13422
+ return constructSelectEvent(nativeEvent, nativeEventTarget);
13423
+ }
13424
+
13425
+ return null;
13426
+ }
13427
+ };
13428
+
13429
+ /**
13430
+ * @interface Event
13431
+ * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
13432
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
13433
+ */
13434
+ var AnimationEventInterface = {
13435
+ animationName: null,
13436
+ elapsedTime: null,
13437
+ pseudoElement: null
13438
+ };
13439
+
13440
+ /**
13441
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13442
+ * @param {string} dispatchMarker Marker identifying the event target.
13443
+ * @param {object} nativeEvent Native browser event.
13444
+ * @extends {SyntheticEvent}
13445
+ */
13446
+ function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13447
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13448
+ }
13449
+
13450
+ SyntheticEvent$1.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
13451
+
13452
+ /**
13453
+ * @interface Event
13454
+ * @see http://www.w3.org/TR/clipboard-apis/
13455
+ */
13456
+ var ClipboardEventInterface = {
13457
+ clipboardData: function (event) {
13458
+ return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
13459
+ }
13460
+ };
13461
+
13462
+ /**
13463
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13464
+ * @param {string} dispatchMarker Marker identifying the event target.
13465
+ * @param {object} nativeEvent Native browser event.
13466
+ * @extends {SyntheticEvent}
13467
+ */
13468
+ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13469
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13470
+ }
13471
+
13472
+ SyntheticEvent$1.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
13473
+
13474
+ /**
13475
+ * @interface FocusEvent
13476
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
13477
+ */
13478
+ var FocusEventInterface = {
13479
+ relatedTarget: null
13480
+ };
13481
+
13482
+ /**
13483
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13484
+ * @param {string} dispatchMarker Marker identifying the event target.
13485
+ * @param {object} nativeEvent Native browser event.
13486
+ * @extends {SyntheticUIEvent}
13487
+ */
13488
+ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13489
+ return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13490
+ }
13491
+
13492
+ SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
13493
+
13494
+ /**
13495
+ * `charCode` represents the actual "character code" and is safe to use with
13496
+ * `String.fromCharCode`. As such, only keys that correspond to printable
13497
+ * characters produce a valid `charCode`, the only exception to this is Enter.
13498
+ * The Tab-key is considered non-printable and does not have a `charCode`,
13499
+ * presumably because it does not produce a tab-character in browsers.
13500
+ *
13501
+ * @param {object} nativeEvent Native browser event.
13502
+ * @return {number} Normalized `charCode` property.
13503
+ */
13504
+ function getEventCharCode(nativeEvent) {
13505
+ var charCode;
13506
+ var keyCode = nativeEvent.keyCode;
13507
+
13508
+ if ('charCode' in nativeEvent) {
13509
+ charCode = nativeEvent.charCode;
13510
+
13511
+ // FF does not set `charCode` for the Enter-key, check against `keyCode`.
13512
+ if (charCode === 0 && keyCode === 13) {
13513
+ charCode = 13;
13514
+ }
13515
+ } else {
13516
+ // IE8 does not implement `charCode`, but `keyCode` has the correct value.
13517
+ charCode = keyCode;
13518
+ }
13519
+
13520
+ // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
13521
+ // Must not discard the (non-)printable Enter-key.
13522
+ if (charCode >= 32 || charCode === 13) {
13523
+ return charCode;
13524
+ }
13525
+
13526
+ return 0;
13527
+ }
13528
+
13529
+ /**
13530
+ * Normalization of deprecated HTML5 `key` values
13531
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
13532
+ */
13533
+ var normalizeKey = {
13534
+ Esc: 'Escape',
13535
+ Spacebar: ' ',
13536
+ Left: 'ArrowLeft',
13537
+ Up: 'ArrowUp',
13538
+ Right: 'ArrowRight',
13539
+ Down: 'ArrowDown',
13540
+ Del: 'Delete',
13541
+ Win: 'OS',
13542
+ Menu: 'ContextMenu',
13543
+ Apps: 'ContextMenu',
13544
+ Scroll: 'ScrollLock',
13545
+ MozPrintableKey: 'Unidentified'
13546
+ };
13547
+
13548
+ /**
13549
+ * Translation from legacy `keyCode` to HTML5 `key`
13550
+ * Only special keys supported, all others depend on keyboard layout or browser
13551
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
13552
+ */
13553
+ var translateToKey = {
13554
+ '8': 'Backspace',
13555
+ '9': 'Tab',
13556
+ '12': 'Clear',
13557
+ '13': 'Enter',
13558
+ '16': 'Shift',
13559
+ '17': 'Control',
13560
+ '18': 'Alt',
13561
+ '19': 'Pause',
13562
+ '20': 'CapsLock',
13563
+ '27': 'Escape',
13564
+ '32': ' ',
13565
+ '33': 'PageUp',
13566
+ '34': 'PageDown',
13567
+ '35': 'End',
13568
+ '36': 'Home',
13569
+ '37': 'ArrowLeft',
13570
+ '38': 'ArrowUp',
13571
+ '39': 'ArrowRight',
13572
+ '40': 'ArrowDown',
13573
+ '45': 'Insert',
13574
+ '46': 'Delete',
13575
+ '112': 'F1',
13576
+ '113': 'F2',
13577
+ '114': 'F3',
13578
+ '115': 'F4',
13579
+ '116': 'F5',
13580
+ '117': 'F6',
13581
+ '118': 'F7',
13582
+ '119': 'F8',
13583
+ '120': 'F9',
13584
+ '121': 'F10',
13585
+ '122': 'F11',
13586
+ '123': 'F12',
13587
+ '144': 'NumLock',
13588
+ '145': 'ScrollLock',
13589
+ '224': 'Meta'
13590
+ };
13591
+
13592
+ /**
13593
+ * @param {object} nativeEvent Native browser event.
13594
+ * @return {string} Normalized `key` property.
13595
+ */
13596
+ function getEventKey(nativeEvent) {
13597
+ if (nativeEvent.key) {
13598
+ // Normalize inconsistent values reported by browsers due to
13599
+ // implementations of a working draft specification.
13600
+
13601
+ // FireFox implements `key` but returns `MozPrintableKey` for all
13602
+ // printable characters (normalized to `Unidentified`), ignore it.
13603
+ var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
13604
+ if (key !== 'Unidentified') {
13605
+ return key;
13606
+ }
13607
+ }
13608
+
13609
+ // Browser does not implement `key`, polyfill as much of it as we can.
13610
+ if (nativeEvent.type === 'keypress') {
13611
+ var charCode = getEventCharCode(nativeEvent);
13612
+
13613
+ // The enter-key is technically both printable and non-printable and can
13614
+ // thus be captured by `keypress`, no other non-printable key should.
13615
+ return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
13616
+ }
13617
+ if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
13618
+ // While user keyboard layout determines the actual meaning of each
13619
+ // `keyCode` value, almost all function keys have a universal value.
13620
+ return translateToKey[nativeEvent.keyCode] || 'Unidentified';
13621
+ }
13622
+ return '';
13623
+ }
13624
+
13625
+ /**
13626
+ * @interface KeyboardEvent
13627
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
13628
+ */
13629
+ var KeyboardEventInterface = {
13630
+ key: getEventKey,
13631
+ location: null,
13632
+ ctrlKey: null,
13633
+ shiftKey: null,
13634
+ altKey: null,
13635
+ metaKey: null,
13636
+ repeat: null,
13637
+ locale: null,
13638
+ getModifierState: getEventModifierState,
13639
+ // Legacy Interface
13640
+ charCode: function (event) {
13641
+ // `charCode` is the result of a KeyPress event and represents the value of
13642
+ // the actual printable character.
13643
+
13644
+ // KeyPress is deprecated, but its replacement is not yet final and not
13645
+ // implemented in any major browser. Only KeyPress has charCode.
13646
+ if (event.type === 'keypress') {
13647
+ return getEventCharCode(event);
13648
+ }
13649
+ return 0;
13650
+ },
13651
+ keyCode: function (event) {
13652
+ // `keyCode` is the result of a KeyDown/Up event and represents the value of
13653
+ // physical keyboard key.
13654
+
13655
+ // The actual meaning of the value depends on the users' keyboard layout
13656
+ // which cannot be detected. Assuming that it is a US keyboard layout
13657
+ // provides a surprisingly accurate mapping for US and European users.
13658
+ // Due to this, it is left to the user to implement at this time.
13659
+ if (event.type === 'keydown' || event.type === 'keyup') {
13660
+ return event.keyCode;
13661
+ }
13662
+ return 0;
13663
+ },
13664
+ which: function (event) {
13665
+ // `which` is an alias for either `keyCode` or `charCode` depending on the
13666
+ // type of the event.
13667
+ if (event.type === 'keypress') {
13668
+ return getEventCharCode(event);
13669
+ }
13670
+ if (event.type === 'keydown' || event.type === 'keyup') {
13671
+ return event.keyCode;
13672
+ }
13673
+ return 0;
13674
+ }
13675
+ };
13676
+
13677
+ /**
13678
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13679
+ * @param {string} dispatchMarker Marker identifying the event target.
13680
+ * @param {object} nativeEvent Native browser event.
13681
+ * @extends {SyntheticUIEvent}
13682
+ */
13683
+ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13684
+ return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13685
+ }
13686
+
13687
+ SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
13688
+
13689
+ /**
13690
+ * @interface DragEvent
13691
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
13692
+ */
13693
+ var DragEventInterface = {
13694
+ dataTransfer: null
13695
+ };
13696
+
13697
+ /**
13698
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13699
+ * @param {string} dispatchMarker Marker identifying the event target.
13700
+ * @param {object} nativeEvent Native browser event.
13701
+ * @extends {SyntheticMouseEvent}
13702
+ */
13703
+ function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13704
+ return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13705
+ }
13706
+
13707
+ SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
13708
+
13709
+ /**
13710
+ * @interface TouchEvent
13711
+ * @see http://www.w3.org/TR/touch-events/
13712
+ */
13713
+ var TouchEventInterface = {
13714
+ touches: null,
13715
+ targetTouches: null,
13716
+ changedTouches: null,
13717
+ altKey: null,
13718
+ metaKey: null,
13719
+ ctrlKey: null,
13720
+ shiftKey: null,
13721
+ getModifierState: getEventModifierState
13722
+ };
13723
+
13724
+ /**
13725
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13726
+ * @param {string} dispatchMarker Marker identifying the event target.
13727
+ * @param {object} nativeEvent Native browser event.
13728
+ * @extends {SyntheticUIEvent}
13729
+ */
13730
+ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13731
+ return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13732
+ }
13733
+
13734
+ SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
13735
+
13736
+ /**
13737
+ * @interface Event
13738
+ * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
13739
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
13740
+ */
13741
+ var TransitionEventInterface = {
13742
+ propertyName: null,
13743
+ elapsedTime: null,
13744
+ pseudoElement: null
13745
+ };
13746
+
13747
+ /**
13748
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13749
+ * @param {string} dispatchMarker Marker identifying the event target.
13750
+ * @param {object} nativeEvent Native browser event.
13751
+ * @extends {SyntheticEvent}
13752
+ */
13753
+ function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13754
+ return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13755
+ }
13756
+
13757
+ SyntheticEvent$1.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
13758
+
13759
+ /**
13760
+ * @interface WheelEvent
13761
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
13762
+ */
13763
+ var WheelEventInterface = {
13764
+ deltaX: function (event) {
13765
+ return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
13766
+ 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
13767
+ },
13768
+ deltaY: function (event) {
13769
+ return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
13770
+ 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
13771
+ 'wheelDelta' in event ? -event.wheelDelta : 0;
13772
+ },
13773
+ deltaZ: null,
13774
+
13775
+ // Browsers without "deltaMode" is reporting in raw wheel delta where one
13776
+ // notch on the scroll is always +/- 120, roughly equivalent to pixels.
13777
+ // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
13778
+ // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
13779
+ deltaMode: null
13780
+ };
13781
+
13782
+ /**
13783
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
13784
+ * @param {string} dispatchMarker Marker identifying the event target.
13785
+ * @param {object} nativeEvent Native browser event.
13786
+ * @extends {SyntheticMouseEvent}
13787
+ */
13788
+ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
13789
+ return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
13790
+ }
13791
+
13792
+ SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
13793
+
13794
+ /**
13795
+ * Turns
13796
+ * ['abort', ...]
13797
+ * into
13798
+ * eventTypes = {
13799
+ * 'abort': {
13800
+ * phasedRegistrationNames: {
13801
+ * bubbled: 'onAbort',
13802
+ * captured: 'onAbortCapture',
13803
+ * },
13804
+ * dependencies: ['topAbort'],
13805
+ * },
13806
+ * ...
13807
+ * };
13808
+ * topLevelEventsToDispatchConfig = {
13809
+ * 'topAbort': { sameConfig }
13810
+ * };
13811
+ */
13812
+ var eventTypes$4 = {};
13813
+ var topLevelEventsToDispatchConfig = {};
13814
+ ['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'toggle', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
13815
+ var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
13816
+ var onEvent = 'on' + capitalizedEvent;
13817
+ var topEvent = 'top' + capitalizedEvent;
13818
+
13819
+ var type = {
13820
+ phasedRegistrationNames: {
13821
+ bubbled: onEvent,
13822
+ captured: onEvent + 'Capture'
13823
+ },
13824
+ dependencies: [topEvent]
13825
+ };
13826
+ eventTypes$4[event] = type;
13827
+ topLevelEventsToDispatchConfig[topEvent] = type;
13828
+ });
13829
+
13830
+ // Only used in DEV for exhaustiveness validation.
13831
+ var knownHTMLTopLevelTypes = ['topAbort', 'topCancel', 'topCanPlay', 'topCanPlayThrough', 'topClose', 'topDurationChange', 'topEmptied', 'topEncrypted', 'topEnded', 'topError', 'topInput', 'topInvalid', 'topLoad', 'topLoadedData', 'topLoadedMetadata', 'topLoadStart', 'topPause', 'topPlay', 'topPlaying', 'topProgress', 'topRateChange', 'topReset', 'topSeeked', 'topSeeking', 'topStalled', 'topSubmit', 'topSuspend', 'topTimeUpdate', 'topToggle', 'topVolumeChange', 'topWaiting'];
13832
+
13833
+ var SimpleEventPlugin = {
13834
+ eventTypes: eventTypes$4,
13835
+
13836
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
13837
+ var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
13838
+ if (!dispatchConfig) {
13839
+ return null;
13840
+ }
13841
+ var EventConstructor;
13842
+ switch (topLevelType) {
13843
+ case 'topKeyPress':
13844
+ // Firefox creates a keypress event for function keys too. This removes
13845
+ // the unwanted keypress events. Enter is however both printable and
13846
+ // non-printable. One would expect Tab to be as well (but it isn't).
13847
+ if (getEventCharCode(nativeEvent) === 0) {
13848
+ return null;
13849
+ }
13850
+ /* falls through */
13851
+ case 'topKeyDown':
13852
+ case 'topKeyUp':
13853
+ EventConstructor = SyntheticKeyboardEvent;
13854
+ break;
13855
+ case 'topBlur':
13856
+ case 'topFocus':
13857
+ EventConstructor = SyntheticFocusEvent;
13858
+ break;
13859
+ case 'topClick':
13860
+ // Firefox creates a click event on right mouse clicks. This removes the
13861
+ // unwanted click events.
13862
+ if (nativeEvent.button === 2) {
13863
+ return null;
13864
+ }
13865
+ /* falls through */
13866
+ case 'topDoubleClick':
13867
+ case 'topMouseDown':
13868
+ case 'topMouseMove':
13869
+ case 'topMouseUp':
13870
+ // TODO: Disabled elements should not respond to mouse events
13871
+ /* falls through */
13872
+ case 'topMouseOut':
13873
+ case 'topMouseOver':
13874
+ case 'topContextMenu':
13875
+ EventConstructor = SyntheticMouseEvent;
13876
+ break;
13877
+ case 'topDrag':
13878
+ case 'topDragEnd':
13879
+ case 'topDragEnter':
13880
+ case 'topDragExit':
13881
+ case 'topDragLeave':
13882
+ case 'topDragOver':
13883
+ case 'topDragStart':
13884
+ case 'topDrop':
13885
+ EventConstructor = SyntheticDragEvent;
13886
+ break;
13887
+ case 'topTouchCancel':
13888
+ case 'topTouchEnd':
13889
+ case 'topTouchMove':
13890
+ case 'topTouchStart':
13891
+ EventConstructor = SyntheticTouchEvent;
13892
+ break;
13893
+ case 'topAnimationEnd':
13894
+ case 'topAnimationIteration':
13895
+ case 'topAnimationStart':
13896
+ EventConstructor = SyntheticAnimationEvent;
13897
+ break;
13898
+ case 'topTransitionEnd':
13899
+ EventConstructor = SyntheticTransitionEvent;
13900
+ break;
13901
+ case 'topScroll':
13902
+ EventConstructor = SyntheticUIEvent;
13903
+ break;
13904
+ case 'topWheel':
13905
+ EventConstructor = SyntheticWheelEvent;
13906
+ break;
13907
+ case 'topCopy':
13908
+ case 'topCut':
13909
+ case 'topPaste':
13910
+ EventConstructor = SyntheticClipboardEvent;
13911
+ break;
13912
+ default:
13913
+ {
13914
+ if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
13915
+ warning(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
13916
+ }
13917
+ }
13918
+ // HTML Events
13919
+ // @see http://www.w3.org/TR/html5/index.html#events-0
13920
+ EventConstructor = SyntheticEvent$1;
13921
+ break;
13922
+ }
13923
+ var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
13924
+ accumulateTwoPhaseDispatches(event);
13925
+ return event;
13926
+ }
13927
+ };
13928
+
13929
+ setHandleTopLevel(handleTopLevel);
13930
+
13931
+ /**
13932
+ * Inject modules for resolving DOM hierarchy and plugin ordering.
13933
+ */
13934
+ injection$1.injectEventPluginOrder(DOMEventPluginOrder);
13935
+ injection$2.injectComponentTree(ReactDOMComponentTree);
13936
+
13937
+ /**
13938
+ * Some important event plugins included by default (without having to require
13939
+ * them).
13940
+ */
13941
+ injection$1.injectEventPluginsByName({
13942
+ SimpleEventPlugin: SimpleEventPlugin,
13943
+ EnterLeaveEventPlugin: EnterLeaveEventPlugin,
13944
+ ChangeEventPlugin: ChangeEventPlugin,
13945
+ SelectEventPlugin: SelectEventPlugin,
13946
+ BeforeInputEventPlugin: BeforeInputEventPlugin
13947
+ });
13948
+
13949
+ var enableAsyncSubtreeAPI = true;
13950
+ var enableAsyncSchedulingByDefaultInReactDOM = false;
13951
+ // Exports ReactDOM.createRoot
13952
+ var enableCreateRoot = false;
13953
+ var enableUserTimingAPI = true;
13954
+
13955
+ // Mutating mode (React DOM, React ART, React Native):
13956
+ var enableMutatingReconciler = true;
13957
+ // Experimental noop mode (currently unused):
13958
+ var enableNoopReconciler = false;
13959
+ // Experimental persistent mode (CS):
13960
+ var enablePersistentReconciler = false;
13961
+
13962
+ // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
13963
+ var debugRenderPhaseSideEffects = false;
13964
+
13965
+ // Only used in www builds.
13966
+
13967
+ var valueStack = [];
13968
+
13969
+ {
13970
+ var fiberStack = [];
13971
+ }
13972
+
13973
+ var index = -1;
13974
+
13975
+ function createCursor(defaultValue) {
13976
+ return {
13977
+ current: defaultValue
13978
+ };
13979
+ }
13980
+
13981
+
13982
+
13983
+ function pop(cursor, fiber) {
13984
+ if (index < 0) {
13985
+ {
13986
+ warning(false, 'Unexpected pop.');
13987
+ }
13988
+ return;
13989
+ }
13990
+
13991
+ {
13992
+ if (fiber !== fiberStack[index]) {
13993
+ warning(false, 'Unexpected Fiber popped.');
13994
+ }
13995
+ }
13996
+
13997
+ cursor.current = valueStack[index];
13998
+
13999
+ valueStack[index] = null;
14000
+
14001
+ {
14002
+ fiberStack[index] = null;
14003
+ }
14004
+
14005
+ index--;
14006
+ }
14007
+
14008
+ function push(cursor, value, fiber) {
14009
+ index++;
14010
+
14011
+ valueStack[index] = cursor.current;
14012
+
14013
+ {
14014
+ fiberStack[index] = fiber;
14015
+ }
14016
+
14017
+ cursor.current = value;
14018
+ }
14019
+
14020
+ function reset$1() {
14021
+ while (index > -1) {
14022
+ valueStack[index] = null;
14023
+
14024
+ {
14025
+ fiberStack[index] = null;
14026
+ }
14027
+
14028
+ index--;
14029
+ }
14030
+ }
14031
+
14032
+ var describeComponentFrame = function (name, source, ownerName) {
14033
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
14034
+ };
14035
+
14036
+ function describeFiber(fiber) {
14037
+ switch (fiber.tag) {
14038
+ case IndeterminateComponent:
14039
+ case FunctionalComponent:
14040
+ case ClassComponent:
14041
+ case HostComponent:
14042
+ var owner = fiber._debugOwner;
14043
+ var source = fiber._debugSource;
14044
+ var name = getComponentName(fiber);
14045
+ var ownerName = null;
14046
+ if (owner) {
14047
+ ownerName = getComponentName(owner);
14048
+ }
14049
+ return describeComponentFrame(name, source, ownerName);
14050
+ default:
14051
+ return '';
14052
+ }
14053
+ }
14054
+
14055
+ // This function can only be called with a work-in-progress fiber and
14056
+ // only during begin or complete phase. Do not call it under any other
14057
+ // circumstances.
14058
+ function getStackAddendumByWorkInProgressFiber(workInProgress) {
14059
+ var info = '';
14060
+ var node = workInProgress;
14061
+ do {
14062
+ info += describeFiber(node);
14063
+ // Otherwise this return pointer might point to the wrong tree:
14064
+ node = node['return'];
14065
+ } while (node);
14066
+ return info;
14067
+ }
14068
+
14069
+ function getCurrentFiberOwnerName() {
14070
+ {
14071
+ var fiber = ReactDebugCurrentFiber.current;
14072
+ if (fiber === null) {
14073
+ return null;
14074
+ }
14075
+ var owner = fiber._debugOwner;
14076
+ if (owner !== null && typeof owner !== 'undefined') {
14077
+ return getComponentName(owner);
14078
+ }
14079
+ }
14080
+ return null;
14081
+ }
14082
+
14083
+ function getCurrentFiberStackAddendum() {
14084
+ {
14085
+ var fiber = ReactDebugCurrentFiber.current;
14086
+ if (fiber === null) {
14087
+ return null;
14088
+ }
14089
+ // Safe because if current fiber exists, we are reconciling,
14090
+ // and it is guaranteed to be the work-in-progress version.
14091
+ return getStackAddendumByWorkInProgressFiber(fiber);
14092
+ }
14093
+ return null;
14094
+ }
14095
+
14096
+ function resetCurrentFiber() {
14097
+ ReactDebugCurrentFrame.getCurrentStack = null;
14098
+ ReactDebugCurrentFiber.current = null;
14099
+ ReactDebugCurrentFiber.phase = null;
14100
+ }
14101
+
14102
+ function setCurrentFiber(fiber) {
14103
+ ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum;
14104
+ ReactDebugCurrentFiber.current = fiber;
14105
+ ReactDebugCurrentFiber.phase = null;
14106
+ }
14107
+
14108
+ function setCurrentPhase(phase) {
14109
+ ReactDebugCurrentFiber.phase = phase;
14110
+ }
14111
+
14112
+ var ReactDebugCurrentFiber = {
14113
+ current: null,
14114
+ phase: null,
14115
+ resetCurrentFiber: resetCurrentFiber,
14116
+ setCurrentFiber: setCurrentFiber,
14117
+ setCurrentPhase: setCurrentPhase,
14118
+ getCurrentFiberOwnerName: getCurrentFiberOwnerName,
14119
+ getCurrentFiberStackAddendum: getCurrentFiberStackAddendum
14120
+ };
14121
+
14122
+ // Prefix measurements so that it's possible to filter them.
14123
+ // Longer prefixes are hard to read in DevTools.
14124
+ var reactEmoji = '\u269B';
14125
+ var warningEmoji = '\u26D4';
14126
+ var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
14127
+
14128
+ // Keep track of current fiber so that we know the path to unwind on pause.
14129
+ // TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
14130
+ var currentFiber = null;
14131
+ // If we're in the middle of user code, which fiber and method is it?
14132
+ // Reusing `currentFiber` would be confusing for this because user code fiber
14133
+ // can change during commit phase too, but we don't need to unwind it (since
14134
+ // lifecycles in the commit phase don't resemble a tree).
14135
+ var currentPhase = null;
14136
+ var currentPhaseFiber = null;
14137
+ // Did lifecycle hook schedule an update? This is often a performance problem,
14138
+ // so we will keep track of it, and include it in the report.
14139
+ // Track commits caused by cascading updates.
14140
+ var isCommitting = false;
14141
+ var hasScheduledUpdateInCurrentCommit = false;
14142
+ var hasScheduledUpdateInCurrentPhase = false;
14143
+ var commitCountInCurrentWorkLoop = 0;
14144
+ var effectCountInCurrentCommit = 0;
14145
+ var isWaitingForCallback = false;
14146
+ // During commits, we only show a measurement once per method name
14147
+ // to avoid stretch the commit phase with measurement overhead.
14148
+ var labelsInCurrentCommit = new Set();
14149
+
14150
+ var formatMarkName = function (markName) {
14151
+ return reactEmoji + ' ' + markName;
14152
+ };
14153
+
14154
+ var formatLabel = function (label, warning$$1) {
14155
+ var prefix = warning$$1 ? warningEmoji + ' ' : reactEmoji + ' ';
14156
+ var suffix = warning$$1 ? ' Warning: ' + warning$$1 : '';
14157
+ return '' + prefix + label + suffix;
14158
+ };
14159
+
14160
+ var beginMark = function (markName) {
14161
+ performance.mark(formatMarkName(markName));
14162
+ };
14163
+
14164
+ var clearMark = function (markName) {
14165
+ performance.clearMarks(formatMarkName(markName));
14166
+ };
14167
+
14168
+ var endMark = function (label, markName, warning$$1) {
14169
+ var formattedMarkName = formatMarkName(markName);
14170
+ var formattedLabel = formatLabel(label, warning$$1);
14171
+ try {
14172
+ performance.measure(formattedLabel, formattedMarkName);
14173
+ } catch (err) {}
14174
+ // If previous mark was missing for some reason, this will throw.
14175
+ // This could only happen if React crashed in an unexpected place earlier.
14176
+ // Don't pile on with more errors.
14177
+
14178
+ // Clear marks immediately to avoid growing buffer.
14179
+ performance.clearMarks(formattedMarkName);
14180
+ performance.clearMeasures(formattedLabel);
14181
+ };
14182
+
14183
+ var getFiberMarkName = function (label, debugID) {
14184
+ return label + ' (#' + debugID + ')';
14185
+ };
14186
+
14187
+ var getFiberLabel = function (componentName, isMounted, phase) {
14188
+ if (phase === null) {
14189
+ // These are composite component total time measurements.
14190
+ return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']';
14191
+ } else {
14192
+ // Composite component methods.
14193
+ return componentName + '.' + phase;
14194
+ }
14195
+ };
14196
+
14197
+ var beginFiberMark = function (fiber, phase) {
14198
+ var componentName = getComponentName(fiber) || 'Unknown';
14199
+ var debugID = fiber._debugID;
14200
+ var isMounted = fiber.alternate !== null;
14201
+ var label = getFiberLabel(componentName, isMounted, phase);
14202
+
14203
+ if (isCommitting && labelsInCurrentCommit.has(label)) {
14204
+ // During the commit phase, we don't show duplicate labels because
14205
+ // there is a fixed overhead for every measurement, and we don't
14206
+ // want to stretch the commit phase beyond necessary.
14207
+ return false;
14208
+ }
14209
+ labelsInCurrentCommit.add(label);
14210
+
14211
+ var markName = getFiberMarkName(label, debugID);
14212
+ beginMark(markName);
14213
+ return true;
14214
+ };
14215
+
14216
+ var clearFiberMark = function (fiber, phase) {
14217
+ var componentName = getComponentName(fiber) || 'Unknown';
14218
+ var debugID = fiber._debugID;
14219
+ var isMounted = fiber.alternate !== null;
14220
+ var label = getFiberLabel(componentName, isMounted, phase);
14221
+ var markName = getFiberMarkName(label, debugID);
14222
+ clearMark(markName);
14223
+ };
14224
+
14225
+ var endFiberMark = function (fiber, phase, warning$$1) {
14226
+ var componentName = getComponentName(fiber) || 'Unknown';
14227
+ var debugID = fiber._debugID;
14228
+ var isMounted = fiber.alternate !== null;
14229
+ var label = getFiberLabel(componentName, isMounted, phase);
14230
+ var markName = getFiberMarkName(label, debugID);
14231
+ endMark(label, markName, warning$$1);
14232
+ };
14233
+
14234
+ var shouldIgnoreFiber = function (fiber) {
14235
+ // Host components should be skipped in the timeline.
14236
+ // We could check typeof fiber.type, but does this work with RN?
14237
+ switch (fiber.tag) {
14238
+ case HostRoot:
14239
+ case HostComponent:
14240
+ case HostText:
14241
+ case HostPortal:
14242
+ case ReturnComponent:
14243
+ case Fragment:
14244
+ return true;
14245
+ default:
14246
+ return false;
14247
+ }
14248
+ };
14249
+
14250
+ var clearPendingPhaseMeasurement = function () {
14251
+ if (currentPhase !== null && currentPhaseFiber !== null) {
14252
+ clearFiberMark(currentPhaseFiber, currentPhase);
14253
+ }
14254
+ currentPhaseFiber = null;
14255
+ currentPhase = null;
14256
+ hasScheduledUpdateInCurrentPhase = false;
14257
+ };
14258
+
14259
+ var pauseTimers = function () {
14260
+ // Stops all currently active measurements so that they can be resumed
14261
+ // if we continue in a later deferred loop from the same unit of work.
14262
+ var fiber = currentFiber;
14263
+ while (fiber) {
14264
+ if (fiber._debugIsCurrentlyTiming) {
14265
+ endFiberMark(fiber, null, null);
14266
+ }
14267
+ fiber = fiber['return'];
14268
+ }
14269
+ };
14270
+
14271
+ var resumeTimersRecursively = function (fiber) {
14272
+ if (fiber['return'] !== null) {
14273
+ resumeTimersRecursively(fiber['return']);
14274
+ }
14275
+ if (fiber._debugIsCurrentlyTiming) {
14276
+ beginFiberMark(fiber, null);
14277
+ }
14278
+ };
14279
+
14280
+ var resumeTimers = function () {
14281
+ // Resumes all measurements that were active during the last deferred loop.
14282
+ if (currentFiber !== null) {
14283
+ resumeTimersRecursively(currentFiber);
14284
+ }
14285
+ };
14286
+
14287
+ function recordEffect() {
14288
+ if (enableUserTimingAPI) {
14289
+ effectCountInCurrentCommit++;
14290
+ }
14291
+ }
14292
+
14293
+ function recordScheduleUpdate() {
14294
+ if (enableUserTimingAPI) {
14295
+ if (isCommitting) {
14296
+ hasScheduledUpdateInCurrentCommit = true;
14297
+ }
14298
+ if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
14299
+ hasScheduledUpdateInCurrentPhase = true;
14300
+ }
14301
+ }
14302
+ }
14303
+
14304
+ function startRequestCallbackTimer() {
14305
+ if (enableUserTimingAPI) {
14306
+ if (supportsUserTiming && !isWaitingForCallback) {
14307
+ isWaitingForCallback = true;
14308
+ beginMark('(Waiting for async callback...)');
14309
+ }
14310
+ }
14311
+ }
14312
+
14313
+ function stopRequestCallbackTimer(didExpire) {
14314
+ if (enableUserTimingAPI) {
14315
+ if (supportsUserTiming) {
14316
+ isWaitingForCallback = false;
14317
+ var warning$$1 = didExpire ? 'React was blocked by main thread' : null;
14318
+ endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning$$1);
14319
+ }
14320
+ }
14321
+ }
14322
+
14323
+ function startWorkTimer(fiber) {
14324
+ if (enableUserTimingAPI) {
14325
+ if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
14326
+ return;
14327
+ }
14328
+ // If we pause, this is the fiber to unwind from.
14329
+ currentFiber = fiber;
14330
+ if (!beginFiberMark(fiber, null)) {
14331
+ return;
14332
+ }
14333
+ fiber._debugIsCurrentlyTiming = true;
14334
+ }
14335
+ }
14336
+
14337
+ function cancelWorkTimer(fiber) {
14338
+ if (enableUserTimingAPI) {
14339
+ if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
14340
+ return;
14341
+ }
14342
+ // Remember we shouldn't complete measurement for this fiber.
14343
+ // Otherwise flamechart will be deep even for small updates.
14344
+ fiber._debugIsCurrentlyTiming = false;
14345
+ clearFiberMark(fiber, null);
14346
+ }
14347
+ }
14348
+
14349
+ function stopWorkTimer(fiber) {
14350
+ if (enableUserTimingAPI) {
14351
+ if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
14352
+ return;
14353
+ }
14354
+ // If we pause, its parent is the fiber to unwind from.
14355
+ currentFiber = fiber['return'];
14356
+ if (!fiber._debugIsCurrentlyTiming) {
14357
+ return;
14358
+ }
14359
+ fiber._debugIsCurrentlyTiming = false;
14360
+ endFiberMark(fiber, null, null);
14361
+ }
14362
+ }
14363
+
14364
+ function stopFailedWorkTimer(fiber) {
14365
+ if (enableUserTimingAPI) {
14366
+ if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
14367
+ return;
14368
+ }
14369
+ // If we pause, its parent is the fiber to unwind from.
14370
+ currentFiber = fiber['return'];
14371
+ if (!fiber._debugIsCurrentlyTiming) {
14372
+ return;
14373
+ }
14374
+ fiber._debugIsCurrentlyTiming = false;
14375
+ var warning$$1 = 'An error was thrown inside this error boundary';
14376
+ endFiberMark(fiber, null, warning$$1);
14377
+ }
14378
+ }
14379
+
14380
+ function startPhaseTimer(fiber, phase) {
14381
+ if (enableUserTimingAPI) {
14382
+ if (!supportsUserTiming) {
14383
+ return;
14384
+ }
14385
+ clearPendingPhaseMeasurement();
14386
+ if (!beginFiberMark(fiber, phase)) {
14387
+ return;
14388
+ }
14389
+ currentPhaseFiber = fiber;
14390
+ currentPhase = phase;
14391
+ }
14392
+ }
14393
+
14394
+ function stopPhaseTimer() {
14395
+ if (enableUserTimingAPI) {
14396
+ if (!supportsUserTiming) {
14397
+ return;
14398
+ }
14399
+ if (currentPhase !== null && currentPhaseFiber !== null) {
14400
+ var warning$$1 = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
14401
+ endFiberMark(currentPhaseFiber, currentPhase, warning$$1);
14402
+ }
14403
+ currentPhase = null;
14404
+ currentPhaseFiber = null;
14405
+ }
14406
+ }
14407
+
14408
+ function startWorkLoopTimer(nextUnitOfWork) {
14409
+ if (enableUserTimingAPI) {
14410
+ currentFiber = nextUnitOfWork;
14411
+ if (!supportsUserTiming) {
14412
+ return;
14413
+ }
14414
+ commitCountInCurrentWorkLoop = 0;
14415
+ // This is top level call.
14416
+ // Any other measurements are performed within.
14417
+ beginMark('(React Tree Reconciliation)');
14418
+ // Resume any measurements that were in progress during the last loop.
14419
+ resumeTimers();
14420
+ }
14421
+ }
14422
+
14423
+ function stopWorkLoopTimer(interruptedBy) {
14424
+ if (enableUserTimingAPI) {
14425
+ if (!supportsUserTiming) {
14426
+ return;
14427
+ }
14428
+ var warning$$1 = null;
14429
+ if (interruptedBy !== null) {
14430
+ if (interruptedBy.tag === HostRoot) {
14431
+ warning$$1 = 'A top-level update interrupted the previous render';
14432
+ } else {
14433
+ var componentName = getComponentName(interruptedBy) || 'Unknown';
14434
+ warning$$1 = 'An update to ' + componentName + ' interrupted the previous render';
14435
+ }
14436
+ } else if (commitCountInCurrentWorkLoop > 1) {
14437
+ warning$$1 = 'There were cascading updates';
14438
+ }
14439
+ commitCountInCurrentWorkLoop = 0;
14440
+ // Pause any measurements until the next loop.
14441
+ pauseTimers();
14442
+ endMark('(React Tree Reconciliation)', '(React Tree Reconciliation)', warning$$1);
14443
+ }
14444
+ }
14445
+
14446
+ function startCommitTimer() {
14447
+ if (enableUserTimingAPI) {
14448
+ if (!supportsUserTiming) {
14449
+ return;
14450
+ }
14451
+ isCommitting = true;
14452
+ hasScheduledUpdateInCurrentCommit = false;
14453
+ labelsInCurrentCommit.clear();
14454
+ beginMark('(Committing Changes)');
14455
+ }
14456
+ }
14457
+
14458
+ function stopCommitTimer() {
14459
+ if (enableUserTimingAPI) {
14460
+ if (!supportsUserTiming) {
14461
+ return;
14462
+ }
14463
+
14464
+ var warning$$1 = null;
14465
+ if (hasScheduledUpdateInCurrentCommit) {
14466
+ warning$$1 = 'Lifecycle hook scheduled a cascading update';
14467
+ } else if (commitCountInCurrentWorkLoop > 0) {
14468
+ warning$$1 = 'Caused by a cascading update in earlier commit';
14469
+ }
14470
+ hasScheduledUpdateInCurrentCommit = false;
14471
+ commitCountInCurrentWorkLoop++;
14472
+ isCommitting = false;
14473
+ labelsInCurrentCommit.clear();
14474
+
14475
+ endMark('(Committing Changes)', '(Committing Changes)', warning$$1);
14476
+ }
14477
+ }
14478
+
14479
+ function startCommitHostEffectsTimer() {
14480
+ if (enableUserTimingAPI) {
14481
+ if (!supportsUserTiming) {
14482
+ return;
14483
+ }
14484
+ effectCountInCurrentCommit = 0;
14485
+ beginMark('(Committing Host Effects)');
14486
+ }
14487
+ }
14488
+
14489
+ function stopCommitHostEffectsTimer() {
14490
+ if (enableUserTimingAPI) {
14491
+ if (!supportsUserTiming) {
14492
+ return;
14493
+ }
14494
+ var count = effectCountInCurrentCommit;
14495
+ effectCountInCurrentCommit = 0;
14496
+ endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null);
14497
+ }
14498
+ }
14499
+
14500
+ function startCommitLifeCyclesTimer() {
14501
+ if (enableUserTimingAPI) {
14502
+ if (!supportsUserTiming) {
14503
+ return;
14504
+ }
14505
+ effectCountInCurrentCommit = 0;
14506
+ beginMark('(Calling Lifecycle Methods)');
14507
+ }
14508
+ }
14509
+
14510
+ function stopCommitLifeCyclesTimer() {
14511
+ if (enableUserTimingAPI) {
14512
+ if (!supportsUserTiming) {
14513
+ return;
14514
+ }
14515
+ var count = effectCountInCurrentCommit;
14516
+ effectCountInCurrentCommit = 0;
14517
+ endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null);
14518
+ }
14519
+ }
14520
+
14521
+ {
14522
+ var warnedAboutMissingGetChildContext = {};
14523
+ }
14524
+
14525
+ // A cursor to the current merged context object on the stack.
14526
+ var contextStackCursor = createCursor(emptyObject);
14527
+ // A cursor to a boolean indicating whether the context has changed.
14528
+ var didPerformWorkStackCursor = createCursor(false);
14529
+ // Keep track of the previous context object that was on the stack.
14530
+ // We use this to get access to the parent context after we have already
14531
+ // pushed the next context provider, and now need to merge their contexts.
14532
+ var previousContext = emptyObject;
14533
+
14534
+ function getUnmaskedContext(workInProgress) {
14535
+ var hasOwnContext = isContextProvider(workInProgress);
14536
+ if (hasOwnContext) {
14537
+ // If the fiber is a context provider itself, when we read its context
14538
+ // we have already pushed its own child context on the stack. A context
14539
+ // provider should not "see" its own child context. Therefore we read the
14540
+ // previous (parent) context instead for a context provider.
14541
+ return previousContext;
14542
+ }
14543
+ return contextStackCursor.current;
14544
+ }
14545
+
14546
+ function cacheContext(workInProgress, unmaskedContext, maskedContext) {
14547
+ var instance = workInProgress.stateNode;
14548
+ instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
14549
+ instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
14550
+ }
14551
+
14552
+ function getMaskedContext(workInProgress, unmaskedContext) {
14553
+ var type = workInProgress.type;
14554
+ var contextTypes = type.contextTypes;
14555
+ if (!contextTypes) {
14556
+ return emptyObject;
14557
+ }
14558
+
14559
+ // Avoid recreating masked context unless unmasked context has changed.
14560
+ // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
14561
+ // This may trigger infinite loops if componentWillReceiveProps calls setState.
14562
+ var instance = workInProgress.stateNode;
14563
+ if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
14564
+ return instance.__reactInternalMemoizedMaskedChildContext;
14565
+ }
14566
+
14567
+ var context = {};
14568
+ for (var key in contextTypes) {
14569
+ context[key] = unmaskedContext[key];
14570
+ }
14571
+
14572
+ {
14573
+ var name = getComponentName(workInProgress) || 'Unknown';
14574
+ checkPropTypes(contextTypes, context, 'context', name, ReactDebugCurrentFiber.getCurrentFiberStackAddendum);
14575
+ }
14576
+
14577
+ // Cache unmasked context so we can avoid recreating masked context unless necessary.
14578
+ // Context is created before the class component is instantiated so check for instance.
14579
+ if (instance) {
14580
+ cacheContext(workInProgress, unmaskedContext, context);
14581
+ }
14582
+
14583
+ return context;
14584
+ }
14585
+
14586
+ function hasContextChanged() {
14587
+ return didPerformWorkStackCursor.current;
14588
+ }
14589
+
14590
+ function isContextConsumer(fiber) {
14591
+ return fiber.tag === ClassComponent && fiber.type.contextTypes != null;
14592
+ }
14593
+
14594
+ function isContextProvider(fiber) {
14595
+ return fiber.tag === ClassComponent && fiber.type.childContextTypes != null;
14596
+ }
14597
+
14598
+ function popContextProvider(fiber) {
14599
+ if (!isContextProvider(fiber)) {
14600
+ return;
14601
+ }
14602
+
14603
+ pop(didPerformWorkStackCursor, fiber);
14604
+ pop(contextStackCursor, fiber);
14605
+ }
14606
+
14607
+ function popTopLevelContextObject(fiber) {
14608
+ pop(didPerformWorkStackCursor, fiber);
14609
+ pop(contextStackCursor, fiber);
14610
+ }
14611
+
14612
+ function pushTopLevelContextObject(fiber, context, didChange) {
14613
+ !(contextStackCursor.cursor == null) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0;
14614
+
14615
+ push(contextStackCursor, context, fiber);
14616
+ push(didPerformWorkStackCursor, didChange, fiber);
14617
+ }
14618
+
14619
+ function processChildContext(fiber, parentContext) {
14620
+ var instance = fiber.stateNode;
14621
+ var childContextTypes = fiber.type.childContextTypes;
14622
+
14623
+ // TODO (bvaughn) Replace this behavior with an invariant() in the future.
14624
+ // It has only been added in Fiber to match the (unintentional) behavior in Stack.
14625
+ if (typeof instance.getChildContext !== 'function') {
14626
+ {
14627
+ var componentName = getComponentName(fiber) || 'Unknown';
14628
+
14629
+ if (!warnedAboutMissingGetChildContext[componentName]) {
14630
+ warnedAboutMissingGetChildContext[componentName] = true;
14631
+ warning(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
14632
+ }
14633
+ }
14634
+ return parentContext;
14635
+ }
14636
+
14637
+ var childContext = void 0;
14638
+ {
14639
+ ReactDebugCurrentFiber.setCurrentPhase('getChildContext');
14640
+ }
14641
+ startPhaseTimer(fiber, 'getChildContext');
14642
+ childContext = instance.getChildContext();
14643
+ stopPhaseTimer();
14644
+ {
14645
+ ReactDebugCurrentFiber.setCurrentPhase(null);
14646
+ }
14647
+ for (var contextKey in childContext) {
14648
+ !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(fiber) || 'Unknown', contextKey) : void 0;
14649
+ }
14650
+ {
14651
+ var name = getComponentName(fiber) || 'Unknown';
14652
+ checkPropTypes(childContextTypes, childContext, 'child context', name,
14653
+ // In practice, there is one case in which we won't get a stack. It's when
14654
+ // somebody calls unstable_renderSubtreeIntoContainer() and we process
14655
+ // context from the parent component instance. The stack will be missing
14656
+ // because it's outside of the reconciliation, and so the pointer has not
14657
+ // been set. This is rare and doesn't matter. We'll also remove that API.
14658
+ ReactDebugCurrentFiber.getCurrentFiberStackAddendum);
14659
+ }
14660
+
14661
+ return _assign({}, parentContext, childContext);
14662
+ }
14663
+
14664
+ function pushContextProvider(workInProgress) {
14665
+ if (!isContextProvider(workInProgress)) {
14666
+ return false;
14667
+ }
14668
+
14669
+ var instance = workInProgress.stateNode;
14670
+ // We push the context as early as possible to ensure stack integrity.
14671
+ // If the instance does not exist yet, we will push null at first,
14672
+ // and replace it on the stack later when invalidating the context.
14673
+ var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
14674
+
14675
+ // Remember the parent context so we can merge with it later.
14676
+ // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
14677
+ previousContext = contextStackCursor.current;
14678
+ push(contextStackCursor, memoizedMergedChildContext, workInProgress);
14679
+ push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
14680
+
14681
+ return true;
14682
+ }
14683
+
14684
+ function invalidateContextProvider(workInProgress, didChange) {
14685
+ var instance = workInProgress.stateNode;
14686
+ !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0;
14687
+
14688
+ if (didChange) {
14689
+ // Merge parent and own context.
14690
+ // Skip this if we're not updating due to sCU.
14691
+ // This avoids unnecessarily recomputing memoized values.
14692
+ var mergedContext = processChildContext(workInProgress, previousContext);
14693
+ instance.__reactInternalMemoizedMergedChildContext = mergedContext;
14694
+
14695
+ // Replace the old (or empty) context with the new one.
14696
+ // It is important to unwind the context in the reverse order.
14697
+ pop(didPerformWorkStackCursor, workInProgress);
14698
+ pop(contextStackCursor, workInProgress);
14699
+ // Now push the new context and mark that it has changed.
14700
+ push(contextStackCursor, mergedContext, workInProgress);
14701
+ push(didPerformWorkStackCursor, didChange, workInProgress);
14702
+ } else {
14703
+ pop(didPerformWorkStackCursor, workInProgress);
14704
+ push(didPerformWorkStackCursor, didChange, workInProgress);
14705
+ }
14706
+ }
14707
+
14708
+ function resetContext() {
14709
+ previousContext = emptyObject;
14710
+ contextStackCursor.current = emptyObject;
14711
+ didPerformWorkStackCursor.current = false;
14712
+ }
14713
+
14714
+ function findCurrentUnmaskedContext(fiber) {
14715
+ // Currently this is only used with renderSubtreeIntoContainer; not sure if it
14716
+ // makes sense elsewhere
14717
+ !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0;
14718
+
14719
+ var node = fiber;
14720
+ while (node.tag !== HostRoot) {
14721
+ if (isContextProvider(node)) {
14722
+ return node.stateNode.__reactInternalMemoizedMergedChildContext;
14723
+ }
14724
+ var parent = node['return'];
14725
+ !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
14726
+ node = parent;
14727
+ }
14728
+ return node.stateNode.context;
14729
+ }
14730
+
14731
+ var NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax
14732
+
14733
+ var Sync = 1;
14734
+ var Never = 2147483647; // Max int32: Math.pow(2, 31) - 1
14735
+
14736
+ var UNIT_SIZE = 10;
14737
+ var MAGIC_NUMBER_OFFSET = 2;
14738
+
14739
+ // 1 unit of expiration time represents 10ms.
14740
+ function msToExpirationTime(ms) {
14741
+ // Always add an offset so that we don't clash with the magic number for NoWork.
14742
+ return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;
14743
+ }
14744
+
14745
+ function expirationTimeToMs(expirationTime) {
14746
+ return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE;
14747
+ }
14748
+
14749
+ function ceiling(num, precision) {
14750
+ return ((num / precision | 0) + 1) * precision;
14751
+ }
14752
+
14753
+ function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
14754
+ return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
14755
+ }
14756
+
14757
+ var NoContext = 0;
14758
+ var AsyncUpdates = 1;
14759
+
14760
+ {
14761
+ var hasBadMapPolyfill = false;
14762
+ try {
14763
+ var nonExtensibleObject = Object.preventExtensions({});
14764
+ /* eslint-disable no-new */
14765
+
14766
+ /* eslint-enable no-new */
14767
+ } catch (e) {
14768
+ // TODO: Consider warning about bad polyfills
14769
+ hasBadMapPolyfill = true;
14770
+ }
14771
+ }
14772
+
14773
+ // A Fiber is work on a Component that needs to be done or was done. There can
14774
+ // be more than one per component.
14775
+
14776
+
14777
+ {
14778
+ var debugCounter = 1;
14779
+ }
14780
+
14781
+ function FiberNode(tag, key, internalContextTag) {
14782
+ // Instance
14783
+ this.tag = tag;
14784
+ this.key = key;
14785
+ this.type = null;
14786
+ this.stateNode = null;
14787
+
14788
+ // Fiber
14789
+ this['return'] = null;
14790
+ this.child = null;
14791
+ this.sibling = null;
14792
+ this.index = 0;
14793
+
14794
+ this.ref = null;
14795
+
14796
+ this.pendingProps = null;
14797
+ this.memoizedProps = null;
14798
+ this.updateQueue = null;
14799
+ this.memoizedState = null;
14800
+
14801
+ this.internalContextTag = internalContextTag;
14802
+
14803
+ // Effects
14804
+ this.effectTag = NoEffect;
14805
+ this.nextEffect = null;
14806
+
14807
+ this.firstEffect = null;
14808
+ this.lastEffect = null;
14809
+
14810
+ this.expirationTime = NoWork;
14811
+
14812
+ this.alternate = null;
14813
+
14814
+ {
14815
+ this._debugID = debugCounter++;
14816
+ this._debugSource = null;
14817
+ this._debugOwner = null;
14818
+ this._debugIsCurrentlyTiming = false;
14819
+ if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
14820
+ Object.preventExtensions(this);
14821
+ }
14822
+ }
14823
+ }
14824
+
14825
+ // This is a constructor function, rather than a POJO constructor, still
14826
+ // please ensure we do the following:
14827
+ // 1) Nobody should add any instance methods on this. Instance methods can be
14828
+ // more difficult to predict when they get optimized and they are almost
14829
+ // never inlined properly in static compilers.
14830
+ // 2) Nobody should rely on `instanceof Fiber` for type testing. We should
14831
+ // always know when it is a fiber.
14832
+ // 3) We might want to experiment with using numeric keys since they are easier
14833
+ // to optimize in a non-JIT environment.
14834
+ // 4) We can easily go from a constructor to a createFiber object literal if that
14835
+ // is faster.
14836
+ // 5) It should be easy to port this to a C struct and keep a C implementation
14837
+ // compatible.
14838
+ var createFiber = function (tag, key, internalContextTag) {
14839
+ // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
14840
+ return new FiberNode(tag, key, internalContextTag);
14841
+ };
14842
+
14843
+ function shouldConstruct(Component) {
14844
+ return !!(Component.prototype && Component.prototype.isReactComponent);
14845
+ }
14846
+
14847
+ // This is used to create an alternate fiber to do work on.
14848
+ function createWorkInProgress(current, pendingProps, expirationTime) {
14849
+ var workInProgress = current.alternate;
14850
+ if (workInProgress === null) {
14851
+ // We use a double buffering pooling technique because we know that we'll
14852
+ // only ever need at most two versions of a tree. We pool the "other" unused
14853
+ // node that we're free to reuse. This is lazily created to avoid allocating
14854
+ // extra objects for things that are never updated. It also allow us to
14855
+ // reclaim the extra memory if needed.
14856
+ workInProgress = createFiber(current.tag, current.key, current.internalContextTag);
14857
+ workInProgress.type = current.type;
14858
+ workInProgress.stateNode = current.stateNode;
14859
+
14860
+ {
14861
+ // DEV-only fields
14862
+ workInProgress._debugID = current._debugID;
14863
+ workInProgress._debugSource = current._debugSource;
14864
+ workInProgress._debugOwner = current._debugOwner;
14865
+ }
14866
+
14867
+ workInProgress.alternate = current;
14868
+ current.alternate = workInProgress;
14869
+ } else {
14870
+ // We already have an alternate.
14871
+ // Reset the effect tag.
14872
+ workInProgress.effectTag = NoEffect;
14873
+
14874
+ // The effect list is no longer valid.
14875
+ workInProgress.nextEffect = null;
14876
+ workInProgress.firstEffect = null;
14877
+ workInProgress.lastEffect = null;
14878
+ }
14879
+
14880
+ workInProgress.expirationTime = expirationTime;
14881
+ workInProgress.pendingProps = pendingProps;
14882
+
14883
+ workInProgress.child = current.child;
14884
+ workInProgress.memoizedProps = current.memoizedProps;
14885
+ workInProgress.memoizedState = current.memoizedState;
14886
+ workInProgress.updateQueue = current.updateQueue;
14887
+
14888
+ // These will be overridden during the parent's reconciliation
14889
+ workInProgress.sibling = current.sibling;
14890
+ workInProgress.index = current.index;
14891
+ workInProgress.ref = current.ref;
14892
+
14893
+ return workInProgress;
14894
+ }
14895
+
14896
+ function createHostRootFiber() {
14897
+ var fiber = createFiber(HostRoot, null, NoContext);
14898
+ return fiber;
14899
+ }
14900
+
14901
+ function createFiberFromElement(element, internalContextTag, expirationTime) {
14902
+ var owner = null;
14903
+ {
14904
+ owner = element._owner;
14905
+ }
14906
+
14907
+ var fiber = void 0;
14908
+ var type = element.type,
14909
+ key = element.key;
14910
+
14911
+ if (typeof type === 'function') {
14912
+ fiber = shouldConstruct(type) ? createFiber(ClassComponent, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag);
14913
+ fiber.type = type;
14914
+ fiber.pendingProps = element.props;
14915
+ } else if (typeof type === 'string') {
14916
+ fiber = createFiber(HostComponent, key, internalContextTag);
14917
+ fiber.type = type;
14918
+ fiber.pendingProps = element.props;
14919
+ } else if (typeof type === 'object' && type !== null && typeof type.tag === 'number') {
14920
+ // Currently assumed to be a continuation and therefore is a fiber already.
14921
+ // TODO: The yield system is currently broken for updates in some cases.
14922
+ // The reified yield stores a fiber, but we don't know which fiber that is;
14923
+ // the current or a workInProgress? When the continuation gets rendered here
14924
+ // we don't know if we can reuse that fiber or if we need to clone it.
14925
+ // There is probably a clever way to restructure this.
14926
+ fiber = type;
14927
+ fiber.pendingProps = element.props;
14928
+ } else {
14929
+ var info = '';
14930
+ {
14931
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
14932
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
14933
+ }
14934
+ var ownerName = owner ? getComponentName(owner) : null;
14935
+ if (ownerName) {
14936
+ info += '\n\nCheck the render method of `' + ownerName + '`.';
14937
+ }
14938
+ }
14939
+ invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info);
14940
+ }
14941
+
14942
+ {
14943
+ fiber._debugSource = element._source;
14944
+ fiber._debugOwner = element._owner;
14945
+ }
14946
+
14947
+ fiber.expirationTime = expirationTime;
14948
+
14949
+ return fiber;
14950
+ }
14951
+
14952
+ function createFiberFromFragment(elements, internalContextTag, expirationTime, key) {
14953
+ var fiber = createFiber(Fragment, key, internalContextTag);
14954
+ fiber.pendingProps = elements;
14955
+ fiber.expirationTime = expirationTime;
14956
+ return fiber;
14957
+ }
14958
+
14959
+ function createFiberFromText(content, internalContextTag, expirationTime) {
14960
+ var fiber = createFiber(HostText, null, internalContextTag);
14961
+ fiber.pendingProps = content;
14962
+ fiber.expirationTime = expirationTime;
14963
+ return fiber;
14964
+ }
14965
+
14966
+ function createFiberFromHostInstanceForDeletion() {
14967
+ var fiber = createFiber(HostComponent, null, NoContext);
14968
+ fiber.type = 'DELETED';
14969
+ return fiber;
14970
+ }
14971
+
14972
+ function createFiberFromCall(call, internalContextTag, expirationTime) {
14973
+ var fiber = createFiber(CallComponent, call.key, internalContextTag);
14974
+ fiber.type = call.handler;
14975
+ fiber.pendingProps = call;
14976
+ fiber.expirationTime = expirationTime;
14977
+ return fiber;
14978
+ }
14979
+
14980
+ function createFiberFromReturn(returnNode, internalContextTag, expirationTime) {
14981
+ var fiber = createFiber(ReturnComponent, null, internalContextTag);
14982
+ fiber.expirationTime = expirationTime;
14983
+ return fiber;
14984
+ }
14985
+
14986
+ function createFiberFromPortal(portal, internalContextTag, expirationTime) {
14987
+ var fiber = createFiber(HostPortal, portal.key, internalContextTag);
14988
+ fiber.pendingProps = portal.children || [];
14989
+ fiber.expirationTime = expirationTime;
14990
+ fiber.stateNode = {
14991
+ containerInfo: portal.containerInfo,
14992
+ pendingChildren: null, // Used by persistent updates
14993
+ implementation: portal.implementation
14994
+ };
14995
+ return fiber;
14996
+ }
14997
+
14998
+ function createFiberRoot(containerInfo, hydrate) {
14999
+ // Cyclic construction. This cheats the type system right now because
15000
+ // stateNode is any.
15001
+ var uninitializedFiber = createHostRootFiber();
15002
+ var root = {
15003
+ current: uninitializedFiber,
15004
+ containerInfo: containerInfo,
15005
+ pendingChildren: null,
15006
+ remainingExpirationTime: NoWork,
15007
+ isReadyForCommit: false,
15008
+ finishedWork: null,
15009
+ context: null,
15010
+ pendingContext: null,
15011
+ hydrate: hydrate,
15012
+ nextScheduledRoot: null
15013
+ };
15014
+ uninitializedFiber.stateNode = root;
15015
+ return root;
15016
+ }
15017
+
15018
+ var onCommitFiberRoot = null;
15019
+ var onCommitFiberUnmount = null;
15020
+ var hasLoggedError = false;
15021
+
15022
+ function catchErrors(fn) {
15023
+ return function (arg) {
15024
+ try {
15025
+ return fn(arg);
15026
+ } catch (err) {
15027
+ if (true && !hasLoggedError) {
15028
+ hasLoggedError = true;
15029
+ warning(false, 'React DevTools encountered an error: %s', err);
15030
+ }
15031
+ }
15032
+ };
15033
+ }
15034
+
15035
+ function injectInternals(internals) {
15036
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
15037
+ // No DevTools
15038
+ return false;
15039
+ }
15040
+ var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
15041
+ if (hook.isDisabled) {
15042
+ // This isn't a real property on the hook, but it can be set to opt out
15043
+ // of DevTools integration and associated warnings and logs.
15044
+ // https://github.com/facebook/react/issues/3877
15045
+ return true;
15046
+ }
15047
+ if (!hook.supportsFiber) {
15048
+ {
15049
+ warning(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
15050
+ }
15051
+ // DevTools exists, even though it doesn't support Fiber.
15052
+ return true;
15053
+ }
15054
+ try {
15055
+ var rendererID = hook.inject(internals);
15056
+ // We have successfully injected, so now it is safe to set up hooks.
15057
+ onCommitFiberRoot = catchErrors(function (root) {
15058
+ return hook.onCommitFiberRoot(rendererID, root);
15059
+ });
15060
+ onCommitFiberUnmount = catchErrors(function (fiber) {
15061
+ return hook.onCommitFiberUnmount(rendererID, fiber);
15062
+ });
15063
+ } catch (err) {
15064
+ // Catch all errors because it is unsafe to throw during initialization.
15065
+ {
15066
+ warning(false, 'React DevTools encountered an error: %s.', err);
15067
+ }
15068
+ }
15069
+ // DevTools exists
15070
+ return true;
15071
+ }
15072
+
15073
+ function onCommitRoot(root) {
15074
+ if (typeof onCommitFiberRoot === 'function') {
15075
+ onCommitFiberRoot(root);
15076
+ }
15077
+ }
15078
+
15079
+ function onCommitUnmount(fiber) {
15080
+ if (typeof onCommitFiberUnmount === 'function') {
15081
+ onCommitFiberUnmount(fiber);
15082
+ }
15083
+ }
15084
+
15085
+ {
15086
+ var didWarnUpdateInsideUpdate = false;
15087
+ }
15088
+
15089
+ // Callbacks are not validated until invocation
15090
+
15091
+
15092
+ // Singly linked-list of updates. When an update is scheduled, it is added to
15093
+ // the queue of the current fiber and the work-in-progress fiber. The two queues
15094
+ // are separate but they share a persistent structure.
15095
+ //
15096
+ // During reconciliation, updates are removed from the work-in-progress fiber,
15097
+ // but they remain on the current fiber. That ensures that if a work-in-progress
15098
+ // is aborted, the aborted updates are recovered by cloning from current.
15099
+ //
15100
+ // The work-in-progress queue is always a subset of the current queue.
15101
+ //
15102
+ // When the tree is committed, the work-in-progress becomes the current.
15103
+
15104
+
15105
+ function createUpdateQueue(baseState) {
15106
+ var queue = {
15107
+ baseState: baseState,
15108
+ expirationTime: NoWork,
15109
+ first: null,
15110
+ last: null,
15111
+ callbackList: null,
15112
+ hasForceUpdate: false,
15113
+ isInitialized: false
15114
+ };
15115
+ {
15116
+ queue.isProcessing = false;
15117
+ }
15118
+ return queue;
15119
+ }
15120
+
15121
+ function insertUpdateIntoQueue(queue, update) {
15122
+ // Append the update to the end of the list.
15123
+ if (queue.last === null) {
15124
+ // Queue is empty
15125
+ queue.first = queue.last = update;
15126
+ } else {
15127
+ queue.last.next = update;
15128
+ queue.last = update;
15129
+ }
15130
+ if (queue.expirationTime === NoWork || queue.expirationTime > update.expirationTime) {
15131
+ queue.expirationTime = update.expirationTime;
15132
+ }
15133
+ }
15134
+
15135
+ function insertUpdateIntoFiber(fiber, update) {
15136
+ // We'll have at least one and at most two distinct update queues.
15137
+ var alternateFiber = fiber.alternate;
15138
+ var queue1 = fiber.updateQueue;
15139
+ if (queue1 === null) {
15140
+ // TODO: We don't know what the base state will be until we begin work.
15141
+ // It depends on which fiber is the next current. Initialize with an empty
15142
+ // base state, then set to the memoizedState when rendering. Not super
15143
+ // happy with this approach.
15144
+ queue1 = fiber.updateQueue = createUpdateQueue(null);
15145
+ }
15146
+
15147
+ var queue2 = void 0;
15148
+ if (alternateFiber !== null) {
15149
+ queue2 = alternateFiber.updateQueue;
15150
+ if (queue2 === null) {
15151
+ queue2 = alternateFiber.updateQueue = createUpdateQueue(null);
15152
+ }
15153
+ } else {
15154
+ queue2 = null;
15155
+ }
15156
+ queue2 = queue2 !== queue1 ? queue2 : null;
15157
+
15158
+ // Warn if an update is scheduled from inside an updater function.
15159
+ {
15160
+ if ((queue1.isProcessing || queue2 !== null && queue2.isProcessing) && !didWarnUpdateInsideUpdate) {
15161
+ warning(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
15162
+ didWarnUpdateInsideUpdate = true;
15163
+ }
15164
+ }
15165
+
15166
+ // If there's only one queue, add the update to that queue and exit.
15167
+ if (queue2 === null) {
15168
+ insertUpdateIntoQueue(queue1, update);
15169
+ return;
15170
+ }
15171
+
15172
+ // If either queue is empty, we need to add to both queues.
15173
+ if (queue1.last === null || queue2.last === null) {
15174
+ insertUpdateIntoQueue(queue1, update);
15175
+ insertUpdateIntoQueue(queue2, update);
15176
+ return;
15177
+ }
15178
+
15179
+ // If both lists are not empty, the last update is the same for both lists
15180
+ // because of structural sharing. So, we should only append to one of
15181
+ // the lists.
15182
+ insertUpdateIntoQueue(queue1, update);
15183
+ // But we still need to update the `last` pointer of queue2.
15184
+ queue2.last = update;
15185
+ }
15186
+
15187
+ function getUpdateExpirationTime(fiber) {
15188
+ if (fiber.tag !== ClassComponent && fiber.tag !== HostRoot) {
15189
+ return NoWork;
15190
+ }
15191
+ var updateQueue = fiber.updateQueue;
15192
+ if (updateQueue === null) {
15193
+ return NoWork;
15194
+ }
15195
+ return updateQueue.expirationTime;
15196
+ }
15197
+
15198
+ function getStateFromUpdate(update, instance, prevState, props) {
15199
+ var partialState = update.partialState;
15200
+ if (typeof partialState === 'function') {
15201
+ var updateFn = partialState;
15202
+
15203
+ // Invoke setState callback an extra time to help detect side-effects.
15204
+ if (debugRenderPhaseSideEffects) {
15205
+ updateFn.call(instance, prevState, props);
15206
+ }
15207
+
15208
+ return updateFn.call(instance, prevState, props);
15209
+ } else {
15210
+ return partialState;
15211
+ }
15212
+ }
15213
+
15214
+ function processUpdateQueue(current, workInProgress, queue, instance, props, renderExpirationTime) {
15215
+ if (current !== null && current.updateQueue === queue) {
15216
+ // We need to create a work-in-progress queue, by cloning the current queue.
15217
+ var currentQueue = queue;
15218
+ queue = workInProgress.updateQueue = {
15219
+ baseState: currentQueue.baseState,
15220
+ expirationTime: currentQueue.expirationTime,
15221
+ first: currentQueue.first,
15222
+ last: currentQueue.last,
15223
+ isInitialized: currentQueue.isInitialized,
15224
+ // These fields are no longer valid because they were already committed.
15225
+ // Reset them.
15226
+ callbackList: null,
15227
+ hasForceUpdate: false
15228
+ };
15229
+ }
15230
+
15231
+ {
15232
+ // Set this flag so we can warn if setState is called inside the update
15233
+ // function of another setState.
15234
+ queue.isProcessing = true;
15235
+ }
15236
+
15237
+ // Reset the remaining expiration time. If we skip over any updates, we'll
15238
+ // increase this accordingly.
15239
+ queue.expirationTime = NoWork;
15240
+
15241
+ // TODO: We don't know what the base state will be until we begin work.
15242
+ // It depends on which fiber is the next current. Initialize with an empty
15243
+ // base state, then set to the memoizedState when rendering. Not super
15244
+ // happy with this approach.
15245
+ var state = void 0;
15246
+ if (queue.isInitialized) {
15247
+ state = queue.baseState;
15248
+ } else {
15249
+ state = queue.baseState = workInProgress.memoizedState;
15250
+ queue.isInitialized = true;
15251
+ }
15252
+ var dontMutatePrevState = true;
15253
+ var update = queue.first;
15254
+ var didSkip = false;
15255
+ while (update !== null) {
15256
+ var updateExpirationTime = update.expirationTime;
15257
+ if (updateExpirationTime > renderExpirationTime) {
15258
+ // This update does not have sufficient priority. Skip it.
15259
+ var remainingExpirationTime = queue.expirationTime;
15260
+ if (remainingExpirationTime === NoWork || remainingExpirationTime > updateExpirationTime) {
15261
+ // Update the remaining expiration time.
15262
+ queue.expirationTime = updateExpirationTime;
15263
+ }
15264
+ if (!didSkip) {
15265
+ didSkip = true;
15266
+ queue.baseState = state;
15267
+ }
15268
+ // Continue to the next update.
15269
+ update = update.next;
15270
+ continue;
15271
+ }
15272
+
15273
+ // This update does have sufficient priority.
15274
+
15275
+ // If no previous updates were skipped, drop this update from the queue by
15276
+ // advancing the head of the list.
15277
+ if (!didSkip) {
15278
+ queue.first = update.next;
15279
+ if (queue.first === null) {
15280
+ queue.last = null;
15281
+ }
15282
+ }
15283
+
15284
+ // Process the update
15285
+ var _partialState = void 0;
15286
+ if (update.isReplace) {
15287
+ state = getStateFromUpdate(update, instance, state, props);
15288
+ dontMutatePrevState = true;
15289
+ } else {
15290
+ _partialState = getStateFromUpdate(update, instance, state, props);
15291
+ if (_partialState) {
15292
+ if (dontMutatePrevState) {
15293
+ // $FlowFixMe: Idk how to type this properly.
15294
+ state = _assign({}, state, _partialState);
15295
+ } else {
15296
+ state = _assign(state, _partialState);
15297
+ }
15298
+ dontMutatePrevState = false;
15299
+ }
15300
+ }
15301
+ if (update.isForced) {
15302
+ queue.hasForceUpdate = true;
15303
+ }
15304
+ if (update.callback !== null) {
15305
+ // Append to list of callbacks.
15306
+ var _callbackList = queue.callbackList;
15307
+ if (_callbackList === null) {
15308
+ _callbackList = queue.callbackList = [];
15309
+ }
15310
+ _callbackList.push(update);
15311
+ }
15312
+ update = update.next;
15313
+ }
15314
+
15315
+ if (queue.callbackList !== null) {
15316
+ workInProgress.effectTag |= Callback;
15317
+ } else if (queue.first === null && !queue.hasForceUpdate) {
15318
+ // The queue is empty. We can reset it.
15319
+ workInProgress.updateQueue = null;
15320
+ }
15321
+
15322
+ if (!didSkip) {
15323
+ didSkip = true;
15324
+ queue.baseState = state;
15325
+ }
15326
+
15327
+ {
15328
+ // No longer processing.
15329
+ queue.isProcessing = false;
15330
+ }
15331
+
15332
+ return state;
15333
+ }
15334
+
15335
+ function commitCallbacks(queue, context) {
15336
+ var callbackList = queue.callbackList;
15337
+ if (callbackList === null) {
15338
+ return;
15339
+ }
15340
+ // Set the list to null to make sure they don't get called more than once.
15341
+ queue.callbackList = null;
15342
+ for (var i = 0; i < callbackList.length; i++) {
15343
+ var update = callbackList[i];
15344
+ var _callback = update.callback;
15345
+ // This update might be processed again. Clear the callback so it's only
15346
+ // called once.
15347
+ update.callback = null;
15348
+ !(typeof _callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback) : void 0;
15349
+ _callback.call(context);
15350
+ }
15351
+ }
15352
+
15353
+ var fakeInternalInstance = {};
15354
+ var isArray = Array.isArray;
15355
+
15356
+ {
15357
+ var didWarnAboutStateAssignmentForComponent = {};
15358
+
15359
+ var warnOnInvalidCallback = function (callback, callerName) {
15360
+ warning(callback === null || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
15361
+ };
15362
+
15363
+ // This is so gross but it's at least non-critical and can be removed if
15364
+ // it causes problems. This is meant to give a nicer error message for
15365
+ // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
15366
+ // ...)) which otherwise throws a "_processChildContext is not a function"
15367
+ // exception.
15368
+ Object.defineProperty(fakeInternalInstance, '_processChildContext', {
15369
+ enumerable: false,
15370
+ value: function () {
15371
+ invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).');
15372
+ }
15373
+ });
15374
+ Object.freeze(fakeInternalInstance);
15375
+ }
15376
+
15377
+ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) {
15378
+ // Class component state updater
15379
+ var updater = {
15380
+ isMounted: isMounted,
15381
+ enqueueSetState: function (instance, partialState, callback) {
15382
+ var fiber = get(instance);
15383
+ callback = callback === undefined ? null : callback;
15384
+ {
15385
+ warnOnInvalidCallback(callback, 'setState');
15386
+ }
15387
+ var expirationTime = computeExpirationForFiber(fiber);
15388
+ var update = {
15389
+ expirationTime: expirationTime,
15390
+ partialState: partialState,
15391
+ callback: callback,
15392
+ isReplace: false,
15393
+ isForced: false,
15394
+ nextCallback: null,
15395
+ next: null
15396
+ };
15397
+ insertUpdateIntoFiber(fiber, update);
15398
+ scheduleWork(fiber, expirationTime);
15399
+ },
15400
+ enqueueReplaceState: function (instance, state, callback) {
15401
+ var fiber = get(instance);
15402
+ callback = callback === undefined ? null : callback;
15403
+ {
15404
+ warnOnInvalidCallback(callback, 'replaceState');
15405
+ }
15406
+ var expirationTime = computeExpirationForFiber(fiber);
15407
+ var update = {
15408
+ expirationTime: expirationTime,
15409
+ partialState: state,
15410
+ callback: callback,
15411
+ isReplace: true,
15412
+ isForced: false,
15413
+ nextCallback: null,
15414
+ next: null
15415
+ };
15416
+ insertUpdateIntoFiber(fiber, update);
15417
+ scheduleWork(fiber, expirationTime);
15418
+ },
15419
+ enqueueForceUpdate: function (instance, callback) {
15420
+ var fiber = get(instance);
15421
+ callback = callback === undefined ? null : callback;
15422
+ {
15423
+ warnOnInvalidCallback(callback, 'forceUpdate');
15424
+ }
15425
+ var expirationTime = computeExpirationForFiber(fiber);
15426
+ var update = {
15427
+ expirationTime: expirationTime,
15428
+ partialState: null,
15429
+ callback: callback,
15430
+ isReplace: false,
15431
+ isForced: true,
15432
+ nextCallback: null,
15433
+ next: null
15434
+ };
15435
+ insertUpdateIntoFiber(fiber, update);
15436
+ scheduleWork(fiber, expirationTime);
15437
+ }
15438
+ };
15439
+
15440
+ function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) {
15441
+ if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) {
15442
+ // If the workInProgress already has an Update effect, return true
15443
+ return true;
15444
+ }
15445
+
15446
+ var instance = workInProgress.stateNode;
15447
+ var type = workInProgress.type;
15448
+ if (typeof instance.shouldComponentUpdate === 'function') {
15449
+ startPhaseTimer(workInProgress, 'shouldComponentUpdate');
15450
+ var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext);
15451
+ stopPhaseTimer();
15452
+
15453
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
15454
+ if (debugRenderPhaseSideEffects) {
15455
+ instance.shouldComponentUpdate(newProps, newState, newContext);
15456
+ }
15457
+
15458
+ {
15459
+ warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown');
15460
+ }
15461
+
15462
+ return shouldUpdate;
15463
+ }
15464
+
15465
+ if (type.prototype && type.prototype.isPureReactComponent) {
15466
+ return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
15467
+ }
15468
+
15469
+ return true;
15470
+ }
15471
+
15472
+ function checkClassInstance(workInProgress) {
15473
+ var instance = workInProgress.stateNode;
15474
+ var type = workInProgress.type;
15475
+ {
15476
+ var name = getComponentName(workInProgress);
15477
+ var renderPresent = instance.render;
15478
+
15479
+ if (!renderPresent) {
15480
+ if (type.prototype && typeof type.prototype.render === 'function') {
15481
+ warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
15482
+ } else {
15483
+ warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
15484
+ }
15485
+ }
15486
+
15487
+ var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
15488
+ warning(noGetInitialStateOnES6, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);
15489
+ var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
15490
+ warning(noGetDefaultPropsOnES6, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);
15491
+ var noInstancePropTypes = !instance.propTypes;
15492
+ warning(noInstancePropTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);
15493
+ var noInstanceContextTypes = !instance.contextTypes;
15494
+ warning(noInstanceContextTypes, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);
15495
+ var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
15496
+ warning(noComponentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);
15497
+ if (type.prototype && type.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
15498
+ warning(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(workInProgress) || 'A pure component');
15499
+ }
15500
+ var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
15501
+ warning(noComponentDidUnmount, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);
15502
+ var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
15503
+ warning(noComponentDidReceiveProps, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);
15504
+ var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
15505
+ warning(noComponentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);
15506
+ var hasMutatedProps = instance.props !== workInProgress.pendingProps;
15507
+ warning(instance.props === undefined || !hasMutatedProps, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name);
15508
+ var noInstanceDefaultProps = !instance.defaultProps;
15509
+ warning(noInstanceDefaultProps, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);
15510
+ }
15511
+
15512
+ var state = instance.state;
15513
+ if (state && (typeof state !== 'object' || isArray(state))) {
15514
+ warning(false, '%s.state: must be set to an object or null', getComponentName(workInProgress));
15515
+ }
15516
+ if (typeof instance.getChildContext === 'function') {
15517
+ warning(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress));
15518
+ }
15519
+ }
15520
+
15521
+ function resetInputPointers(workInProgress, instance) {
15522
+ instance.props = workInProgress.memoizedProps;
15523
+ instance.state = workInProgress.memoizedState;
15524
+ }
15525
+
15526
+ function adoptClassInstance(workInProgress, instance) {
15527
+ instance.updater = updater;
15528
+ workInProgress.stateNode = instance;
15529
+ // The instance needs access to the fiber so that it can schedule updates
15530
+ set(instance, workInProgress);
15531
+ {
15532
+ instance._reactInternalInstance = fakeInternalInstance;
15533
+ }
15534
+ }
15535
+
15536
+ function constructClassInstance(workInProgress, props) {
15537
+ var ctor = workInProgress.type;
15538
+ var unmaskedContext = getUnmaskedContext(workInProgress);
15539
+ var needsContext = isContextConsumer(workInProgress);
15540
+ var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject;
15541
+ var instance = new ctor(props, context);
15542
+ adoptClassInstance(workInProgress, instance);
15543
+
15544
+ // Cache unmasked context so we can avoid recreating masked context unless necessary.
15545
+ // ReactFiberContext usually updates this cache but can't for newly-created instances.
15546
+ if (needsContext) {
15547
+ cacheContext(workInProgress, unmaskedContext, context);
15548
+ }
15549
+
15550
+ return instance;
15551
+ }
15552
+
15553
+ function callComponentWillMount(workInProgress, instance) {
15554
+ startPhaseTimer(workInProgress, 'componentWillMount');
15555
+ var oldState = instance.state;
15556
+ instance.componentWillMount();
15557
+ stopPhaseTimer();
15558
+
15559
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
15560
+ if (debugRenderPhaseSideEffects) {
15561
+ instance.componentWillMount();
15562
+ }
15563
+
15564
+ if (oldState !== instance.state) {
15565
+ {
15566
+ warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress));
15567
+ }
15568
+ updater.enqueueReplaceState(instance, instance.state, null);
15569
+ }
15570
+ }
15571
+
15572
+ function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
15573
+ startPhaseTimer(workInProgress, 'componentWillReceiveProps');
15574
+ var oldState = instance.state;
15575
+ instance.componentWillReceiveProps(newProps, newContext);
15576
+ stopPhaseTimer();
15577
+
15578
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
15579
+ if (debugRenderPhaseSideEffects) {
15580
+ instance.componentWillReceiveProps(newProps, newContext);
15581
+ }
15582
+
15583
+ if (instance.state !== oldState) {
15584
+ {
15585
+ var componentName = getComponentName(workInProgress) || 'Component';
15586
+ if (!didWarnAboutStateAssignmentForComponent[componentName]) {
15587
+ warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
15588
+ didWarnAboutStateAssignmentForComponent[componentName] = true;
15589
+ }
15590
+ }
15591
+ updater.enqueueReplaceState(instance, instance.state, null);
15592
+ }
15593
+ }
15594
+
15595
+ // Invokes the mount life-cycles on a previously never rendered instance.
15596
+ function mountClassInstance(workInProgress, renderExpirationTime) {
15597
+ var current = workInProgress.alternate;
15598
+
15599
+ {
15600
+ checkClassInstance(workInProgress);
15601
+ }
15602
+
15603
+ var instance = workInProgress.stateNode;
15604
+ var state = instance.state || null;
15605
+
15606
+ var props = workInProgress.pendingProps;
15607
+ !props ? invariant(false, 'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.') : void 0;
15608
+
15609
+ var unmaskedContext = getUnmaskedContext(workInProgress);
15610
+
15611
+ instance.props = props;
15612
+ instance.state = workInProgress.memoizedState = state;
15613
+ instance.refs = emptyObject;
15614
+ instance.context = getMaskedContext(workInProgress, unmaskedContext);
15615
+
15616
+ if (enableAsyncSubtreeAPI && workInProgress.type != null && workInProgress.type.prototype != null && workInProgress.type.prototype.unstable_isAsyncReactComponent === true) {
15617
+ workInProgress.internalContextTag |= AsyncUpdates;
15618
+ }
15619
+
15620
+ if (typeof instance.componentWillMount === 'function') {
15621
+ callComponentWillMount(workInProgress, instance);
15622
+ // If we had additional state updates during this life-cycle, let's
15623
+ // process them now.
15624
+ var updateQueue = workInProgress.updateQueue;
15625
+ if (updateQueue !== null) {
15626
+ instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);
15627
+ }
15628
+ }
15629
+ if (typeof instance.componentDidMount === 'function') {
15630
+ workInProgress.effectTag |= Update;
15631
+ }
15632
+ }
15633
+
15634
+ // Called on a preexisting class instance. Returns false if a resumed render
15635
+ // could be reused.
15636
+ // function resumeMountClassInstance(
15637
+ // workInProgress: Fiber,
15638
+ // priorityLevel: PriorityLevel,
15639
+ // ): boolean {
15640
+ // const instance = workInProgress.stateNode;
15641
+ // resetInputPointers(workInProgress, instance);
15642
+
15643
+ // let newState = workInProgress.memoizedState;
15644
+ // let newProps = workInProgress.pendingProps;
15645
+ // if (!newProps) {
15646
+ // // If there isn't any new props, then we'll reuse the memoized props.
15647
+ // // This could be from already completed work.
15648
+ // newProps = workInProgress.memoizedProps;
15649
+ // invariant(
15650
+ // newProps != null,
15651
+ // 'There should always be pending or memoized props. This error is ' +
15652
+ // 'likely caused by a bug in React. Please file an issue.',
15653
+ // );
15654
+ // }
15655
+ // const newUnmaskedContext = getUnmaskedContext(workInProgress);
15656
+ // const newContext = getMaskedContext(workInProgress, newUnmaskedContext);
15657
+
15658
+ // const oldContext = instance.context;
15659
+ // const oldProps = workInProgress.memoizedProps;
15660
+
15661
+ // if (
15662
+ // typeof instance.componentWillReceiveProps === 'function' &&
15663
+ // (oldProps !== newProps || oldContext !== newContext)
15664
+ // ) {
15665
+ // callComponentWillReceiveProps(
15666
+ // workInProgress,
15667
+ // instance,
15668
+ // newProps,
15669
+ // newContext,
15670
+ // );
15671
+ // }
15672
+
15673
+ // // Process the update queue before calling shouldComponentUpdate
15674
+ // const updateQueue = workInProgress.updateQueue;
15675
+ // if (updateQueue !== null) {
15676
+ // newState = processUpdateQueue(
15677
+ // workInProgress,
15678
+ // updateQueue,
15679
+ // instance,
15680
+ // newState,
15681
+ // newProps,
15682
+ // priorityLevel,
15683
+ // );
15684
+ // }
15685
+
15686
+ // // TODO: Should we deal with a setState that happened after the last
15687
+ // // componentWillMount and before this componentWillMount? Probably
15688
+ // // unsupported anyway.
15689
+
15690
+ // if (
15691
+ // !checkShouldComponentUpdate(
15692
+ // workInProgress,
15693
+ // workInProgress.memoizedProps,
15694
+ // newProps,
15695
+ // workInProgress.memoizedState,
15696
+ // newState,
15697
+ // newContext,
15698
+ // )
15699
+ // ) {
15700
+ // // Update the existing instance's state, props, and context pointers even
15701
+ // // though we're bailing out.
15702
+ // instance.props = newProps;
15703
+ // instance.state = newState;
15704
+ // instance.context = newContext;
15705
+ // return false;
15706
+ // }
15707
+
15708
+ // // Update the input pointers now so that they are correct when we call
15709
+ // // componentWillMount
15710
+ // instance.props = newProps;
15711
+ // instance.state = newState;
15712
+ // instance.context = newContext;
15713
+
15714
+ // if (typeof instance.componentWillMount === 'function') {
15715
+ // callComponentWillMount(workInProgress, instance);
15716
+ // // componentWillMount may have called setState. Process the update queue.
15717
+ // const newUpdateQueue = workInProgress.updateQueue;
15718
+ // if (newUpdateQueue !== null) {
15719
+ // newState = processUpdateQueue(
15720
+ // workInProgress,
15721
+ // newUpdateQueue,
15722
+ // instance,
15723
+ // newState,
15724
+ // newProps,
15725
+ // priorityLevel,
15726
+ // );
15727
+ // }
15728
+ // }
15729
+
15730
+ // if (typeof instance.componentDidMount === 'function') {
15731
+ // workInProgress.effectTag |= Update;
15732
+ // }
15733
+
15734
+ // instance.state = newState;
15735
+
15736
+ // return true;
15737
+ // }
15738
+
15739
+ // Invokes the update life-cycles and returns false if it shouldn't rerender.
15740
+ function updateClassInstance(current, workInProgress, renderExpirationTime) {
15741
+ var instance = workInProgress.stateNode;
15742
+ resetInputPointers(workInProgress, instance);
15743
+
15744
+ var oldProps = workInProgress.memoizedProps;
15745
+ var newProps = workInProgress.pendingProps;
15746
+ if (!newProps) {
15747
+ // If there aren't any new props, then we'll reuse the memoized props.
15748
+ // This could be from already completed work.
15749
+ newProps = oldProps;
15750
+ !(newProps != null) ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
15751
+ }
15752
+ var oldContext = instance.context;
15753
+ var newUnmaskedContext = getUnmaskedContext(workInProgress);
15754
+ var newContext = getMaskedContext(workInProgress, newUnmaskedContext);
15755
+
15756
+ // Note: During these life-cycles, instance.props/instance.state are what
15757
+ // ever the previously attempted to render - not the "current". However,
15758
+ // during componentDidUpdate we pass the "current" props.
15759
+
15760
+ if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) {
15761
+ callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);
15762
+ }
15763
+
15764
+ // Compute the next state using the memoized state and the update queue.
15765
+ var oldState = workInProgress.memoizedState;
15766
+ // TODO: Previous state can be null.
15767
+ var newState = void 0;
15768
+ if (workInProgress.updateQueue !== null) {
15769
+ newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime);
15770
+ } else {
15771
+ newState = oldState;
15772
+ }
15773
+
15774
+ if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) {
15775
+ // If an update was already in progress, we should schedule an Update
15776
+ // effect even though we're bailing out, so that cWU/cDU are called.
15777
+ if (typeof instance.componentDidUpdate === 'function') {
15778
+ if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
15779
+ workInProgress.effectTag |= Update;
15780
+ }
15781
+ }
15782
+ return false;
15783
+ }
15784
+
15785
+ var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);
15786
+
15787
+ if (shouldUpdate) {
15788
+ if (typeof instance.componentWillUpdate === 'function') {
15789
+ startPhaseTimer(workInProgress, 'componentWillUpdate');
15790
+ instance.componentWillUpdate(newProps, newState, newContext);
15791
+ stopPhaseTimer();
15792
+
15793
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
15794
+ if (debugRenderPhaseSideEffects) {
15795
+ instance.componentWillUpdate(newProps, newState, newContext);
15796
+ }
15797
+ }
15798
+ if (typeof instance.componentDidUpdate === 'function') {
15799
+ workInProgress.effectTag |= Update;
15800
+ }
15801
+ } else {
15802
+ // If an update was already in progress, we should schedule an Update
15803
+ // effect even though we're bailing out, so that cWU/cDU are called.
15804
+ if (typeof instance.componentDidUpdate === 'function') {
15805
+ if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
15806
+ workInProgress.effectTag |= Update;
15807
+ }
15808
+ }
15809
+
15810
+ // If shouldComponentUpdate returned false, we should still update the
15811
+ // memoized props/state to indicate that this work can be reused.
15812
+ memoizeProps(workInProgress, newProps);
15813
+ memoizeState(workInProgress, newState);
15814
+ }
15815
+
15816
+ // Update the existing instance's state, props, and context pointers even
15817
+ // if shouldComponentUpdate returns false.
15818
+ instance.props = newProps;
15819
+ instance.state = newState;
15820
+ instance.context = newContext;
15821
+
15822
+ return shouldUpdate;
15823
+ }
15824
+
15825
+ return {
15826
+ adoptClassInstance: adoptClassInstance,
15827
+ constructClassInstance: constructClassInstance,
15828
+ mountClassInstance: mountClassInstance,
15829
+ // resumeMountClassInstance,
15830
+ updateClassInstance: updateClassInstance
15831
+ };
15832
+ };
15833
+
15834
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
15835
+ // nor polyfill, then a plain number is used for performance.
15836
+ var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
15837
+
15838
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7;
15839
+ var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
15840
+ var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
15841
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
15842
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
15843
+
15844
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
15845
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
15846
+
15847
+ function getIteratorFn(maybeIterable) {
15848
+ if (maybeIterable === null || typeof maybeIterable === 'undefined') {
15849
+ return null;
15850
+ }
15851
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
15852
+ if (typeof maybeIterator === 'function') {
15853
+ return maybeIterator;
15854
+ }
15855
+ return null;
15856
+ }
15857
+
15858
+ var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
15859
+
15860
+
15861
+ {
15862
+ var didWarnAboutMaps = false;
15863
+ /**
15864
+ * Warn if there's no key explicitly set on dynamic arrays of children or
15865
+ * object keys are not valid. This allows us to keep track of children between
15866
+ * updates.
15867
+ */
15868
+ var ownerHasKeyUseWarning = {};
15869
+ var ownerHasFunctionTypeWarning = {};
15870
+
15871
+ var warnForMissingKey = function (child) {
15872
+ if (child === null || typeof child !== 'object') {
15873
+ return;
15874
+ }
15875
+ if (!child._store || child._store.validated || child.key != null) {
15876
+ return;
15877
+ }
15878
+ !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0;
15879
+ child._store.validated = true;
15880
+
15881
+ var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + (getCurrentFiberStackAddendum$1() || '');
15882
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
15883
+ return;
15884
+ }
15885
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
15886
+
15887
+ warning(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.%s', getCurrentFiberStackAddendum$1());
15888
+ };
15889
+ }
15890
+
15891
+ var isArray$1 = Array.isArray;
15892
+
15893
+ function coerceRef(current, element) {
15894
+ var mixedRef = element.ref;
15895
+ if (mixedRef !== null && typeof mixedRef !== 'function') {
15896
+ if (element._owner) {
15897
+ var owner = element._owner;
15898
+ var inst = void 0;
15899
+ if (owner) {
15900
+ var ownerFiber = owner;
15901
+ !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Stateless function components cannot have refs.') : void 0;
15902
+ inst = ownerFiber.stateNode;
15903
+ }
15904
+ !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0;
15905
+ var stringRef = '' + mixedRef;
15906
+ // Check if previous string ref matches new string ref
15907
+ if (current !== null && current.ref !== null && current.ref._stringRef === stringRef) {
15908
+ return current.ref;
15909
+ }
15910
+ var ref = function (value) {
15911
+ var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
15912
+ if (value === null) {
15913
+ delete refs[stringRef];
15914
+ } else {
15915
+ refs[stringRef] = value;
15916
+ }
15917
+ };
15918
+ ref._stringRef = stringRef;
15919
+ return ref;
15920
+ } else {
15921
+ !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function or a string.') : void 0;
15922
+ !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).', mixedRef) : void 0;
15923
+ }
15924
+ }
15925
+ return mixedRef;
15926
+ }
15927
+
15928
+ function throwOnInvalidObjectType(returnFiber, newChild) {
15929
+ if (returnFiber.type !== 'textarea') {
15930
+ var addendum = '';
15931
+ {
15932
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + (getCurrentFiberStackAddendum$1() || '');
15933
+ }
15934
+ invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum);
15935
+ }
15936
+ }
15937
+
15938
+ function warnOnFunctionType() {
15939
+ var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + (getCurrentFiberStackAddendum$1() || '');
15940
+
15941
+ if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
15942
+ return;
15943
+ }
15944
+ ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
15945
+
15946
+ warning(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.%s', getCurrentFiberStackAddendum$1() || '');
15947
+ }
15948
+
15949
+ // This wrapper function exists because I expect to clone the code in each path
15950
+ // to be able to optimize each path individually by branching early. This needs
15951
+ // a compiler or we can do it manually. Helpers that don't need this branching
15952
+ // live outside of this function.
15953
+ function ChildReconciler(shouldTrackSideEffects) {
15954
+ function deleteChild(returnFiber, childToDelete) {
15955
+ if (!shouldTrackSideEffects) {
15956
+ // Noop.
15957
+ return;
15958
+ }
15959
+ // Deletions are added in reversed order so we add it to the front.
15960
+ // At this point, the return fiber's effect list is empty except for
15961
+ // deletions, so we can just append the deletion to the list. The remaining
15962
+ // effects aren't added until the complete phase. Once we implement
15963
+ // resuming, this may not be true.
15964
+ var last = returnFiber.lastEffect;
15965
+ if (last !== null) {
15966
+ last.nextEffect = childToDelete;
15967
+ returnFiber.lastEffect = childToDelete;
15968
+ } else {
15969
+ returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
15970
+ }
15971
+ childToDelete.nextEffect = null;
15972
+ childToDelete.effectTag = Deletion;
15973
+ }
15974
+
15975
+ function deleteRemainingChildren(returnFiber, currentFirstChild) {
15976
+ if (!shouldTrackSideEffects) {
15977
+ // Noop.
15978
+ return null;
15979
+ }
15980
+
15981
+ // TODO: For the shouldClone case, this could be micro-optimized a bit by
15982
+ // assuming that after the first child we've already added everything.
15983
+ var childToDelete = currentFirstChild;
15984
+ while (childToDelete !== null) {
15985
+ deleteChild(returnFiber, childToDelete);
15986
+ childToDelete = childToDelete.sibling;
15987
+ }
15988
+ return null;
15989
+ }
15990
+
15991
+ function mapRemainingChildren(returnFiber, currentFirstChild) {
15992
+ // Add the remaining children to a temporary map so that we can find them by
15993
+ // keys quickly. Implicit (null) keys get added to this set with their index
15994
+ var existingChildren = new Map();
15995
+
15996
+ var existingChild = currentFirstChild;
15997
+ while (existingChild !== null) {
15998
+ if (existingChild.key !== null) {
15999
+ existingChildren.set(existingChild.key, existingChild);
16000
+ } else {
16001
+ existingChildren.set(existingChild.index, existingChild);
16002
+ }
16003
+ existingChild = existingChild.sibling;
16004
+ }
16005
+ return existingChildren;
16006
+ }
16007
+
16008
+ function useFiber(fiber, pendingProps, expirationTime) {
16009
+ // We currently set sibling to null and index to 0 here because it is easy
16010
+ // to forget to do before returning it. E.g. for the single child case.
16011
+ var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
16012
+ clone.index = 0;
16013
+ clone.sibling = null;
16014
+ return clone;
16015
+ }
16016
+
16017
+ function placeChild(newFiber, lastPlacedIndex, newIndex) {
16018
+ newFiber.index = newIndex;
16019
+ if (!shouldTrackSideEffects) {
16020
+ // Noop.
16021
+ return lastPlacedIndex;
16022
+ }
16023
+ var current = newFiber.alternate;
16024
+ if (current !== null) {
16025
+ var oldIndex = current.index;
16026
+ if (oldIndex < lastPlacedIndex) {
16027
+ // This is a move.
16028
+ newFiber.effectTag = Placement;
16029
+ return lastPlacedIndex;
16030
+ } else {
16031
+ // This item can stay in place.
16032
+ return oldIndex;
16033
+ }
16034
+ } else {
16035
+ // This is an insertion.
16036
+ newFiber.effectTag = Placement;
16037
+ return lastPlacedIndex;
16038
+ }
16039
+ }
16040
+
16041
+ function placeSingleChild(newFiber) {
16042
+ // This is simpler for the single child case. We only need to do a
16043
+ // placement for inserting new children.
16044
+ if (shouldTrackSideEffects && newFiber.alternate === null) {
16045
+ newFiber.effectTag = Placement;
16046
+ }
16047
+ return newFiber;
16048
+ }
16049
+
16050
+ function updateTextNode(returnFiber, current, textContent, expirationTime) {
16051
+ if (current === null || current.tag !== HostText) {
16052
+ // Insert
16053
+ var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime);
16054
+ created['return'] = returnFiber;
16055
+ return created;
16056
+ } else {
16057
+ // Update
16058
+ var existing = useFiber(current, textContent, expirationTime);
16059
+ existing['return'] = returnFiber;
16060
+ return existing;
16061
+ }
16062
+ }
16063
+
16064
+ function updateElement(returnFiber, current, element, expirationTime) {
16065
+ if (current !== null && current.type === element.type) {
16066
+ // Move based on index
16067
+ var existing = useFiber(current, element.props, expirationTime);
16068
+ existing.ref = coerceRef(current, element);
16069
+ existing['return'] = returnFiber;
16070
+ {
16071
+ existing._debugSource = element._source;
16072
+ existing._debugOwner = element._owner;
16073
+ }
16074
+ return existing;
16075
+ } else {
16076
+ // Insert
16077
+ var created = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime);
16078
+ created.ref = coerceRef(current, element);
16079
+ created['return'] = returnFiber;
16080
+ return created;
16081
+ }
16082
+ }
16083
+
16084
+ function updateCall(returnFiber, current, call, expirationTime) {
16085
+ // TODO: Should this also compare handler to determine whether to reuse?
16086
+ if (current === null || current.tag !== CallComponent) {
16087
+ // Insert
16088
+ var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime);
16089
+ created['return'] = returnFiber;
16090
+ return created;
16091
+ } else {
16092
+ // Move based on index
16093
+ var existing = useFiber(current, call, expirationTime);
16094
+ existing['return'] = returnFiber;
16095
+ return existing;
16096
+ }
16097
+ }
16098
+
16099
+ function updateReturn(returnFiber, current, returnNode, expirationTime) {
16100
+ if (current === null || current.tag !== ReturnComponent) {
16101
+ // Insert
16102
+ var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime);
16103
+ created.type = returnNode.value;
16104
+ created['return'] = returnFiber;
16105
+ return created;
16106
+ } else {
16107
+ // Move based on index
16108
+ var existing = useFiber(current, null, expirationTime);
16109
+ existing.type = returnNode.value;
16110
+ existing['return'] = returnFiber;
16111
+ return existing;
16112
+ }
16113
+ }
16114
+
16115
+ function updatePortal(returnFiber, current, portal, expirationTime) {
16116
+ if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
16117
+ // Insert
16118
+ var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime);
16119
+ created['return'] = returnFiber;
16120
+ return created;
16121
+ } else {
16122
+ // Update
16123
+ var existing = useFiber(current, portal.children || [], expirationTime);
16124
+ existing['return'] = returnFiber;
16125
+ return existing;
16126
+ }
16127
+ }
16128
+
16129
+ function updateFragment(returnFiber, current, fragment, expirationTime, key) {
16130
+ if (current === null || current.tag !== Fragment) {
16131
+ // Insert
16132
+ var created = createFiberFromFragment(fragment, returnFiber.internalContextTag, expirationTime, key);
16133
+ created['return'] = returnFiber;
16134
+ return created;
16135
+ } else {
16136
+ // Update
16137
+ var existing = useFiber(current, fragment, expirationTime);
16138
+ existing['return'] = returnFiber;
16139
+ return existing;
16140
+ }
16141
+ }
16142
+
16143
+ function createChild(returnFiber, newChild, expirationTime) {
16144
+ if (typeof newChild === 'string' || typeof newChild === 'number') {
16145
+ // Text nodes don't have keys. If the previous node is implicitly keyed
16146
+ // we can continue to replace it without aborting even if it is not a text
16147
+ // node.
16148
+ var created = createFiberFromText('' + newChild, returnFiber.internalContextTag, expirationTime);
16149
+ created['return'] = returnFiber;
16150
+ return created;
16151
+ }
16152
+
16153
+ if (typeof newChild === 'object' && newChild !== null) {
16154
+ switch (newChild.$$typeof) {
16155
+ case REACT_ELEMENT_TYPE:
16156
+ {
16157
+ if (newChild.type === REACT_FRAGMENT_TYPE) {
16158
+ var _created = createFiberFromFragment(newChild.props.children, returnFiber.internalContextTag, expirationTime, newChild.key);
16159
+ _created['return'] = returnFiber;
16160
+ return _created;
16161
+ } else {
16162
+ var _created2 = createFiberFromElement(newChild, returnFiber.internalContextTag, expirationTime);
16163
+ _created2.ref = coerceRef(null, newChild);
16164
+ _created2['return'] = returnFiber;
16165
+ return _created2;
16166
+ }
16167
+ }
16168
+
16169
+ case REACT_CALL_TYPE:
16170
+ {
16171
+ var _created3 = createFiberFromCall(newChild, returnFiber.internalContextTag, expirationTime);
16172
+ _created3['return'] = returnFiber;
16173
+ return _created3;
16174
+ }
16175
+
16176
+ case REACT_RETURN_TYPE:
16177
+ {
16178
+ var _created4 = createFiberFromReturn(newChild, returnFiber.internalContextTag, expirationTime);
16179
+ _created4.type = newChild.value;
16180
+ _created4['return'] = returnFiber;
16181
+ return _created4;
16182
+ }
16183
+
16184
+ case REACT_PORTAL_TYPE:
16185
+ {
16186
+ var _created5 = createFiberFromPortal(newChild, returnFiber.internalContextTag, expirationTime);
16187
+ _created5['return'] = returnFiber;
16188
+ return _created5;
16189
+ }
16190
+ }
16191
+
16192
+ if (isArray$1(newChild) || getIteratorFn(newChild)) {
16193
+ var _created6 = createFiberFromFragment(newChild, returnFiber.internalContextTag, expirationTime, null);
16194
+ _created6['return'] = returnFiber;
16195
+ return _created6;
16196
+ }
16197
+
16198
+ throwOnInvalidObjectType(returnFiber, newChild);
16199
+ }
16200
+
16201
+ {
16202
+ if (typeof newChild === 'function') {
16203
+ warnOnFunctionType();
16204
+ }
16205
+ }
16206
+
16207
+ return null;
16208
+ }
16209
+
16210
+ function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
16211
+ // Update the fiber if the keys match, otherwise return null.
16212
+
16213
+ var key = oldFiber !== null ? oldFiber.key : null;
16214
+
16215
+ if (typeof newChild === 'string' || typeof newChild === 'number') {
16216
+ // Text nodes don't have keys. If the previous node is implicitly keyed
16217
+ // we can continue to replace it without aborting even if it is not a text
16218
+ // node.
16219
+ if (key !== null) {
16220
+ return null;
16221
+ }
16222
+ return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
16223
+ }
16224
+
16225
+ if (typeof newChild === 'object' && newChild !== null) {
16226
+ switch (newChild.$$typeof) {
16227
+ case REACT_ELEMENT_TYPE:
16228
+ {
16229
+ if (newChild.key === key) {
16230
+ if (newChild.type === REACT_FRAGMENT_TYPE) {
16231
+ return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
16232
+ }
16233
+ return updateElement(returnFiber, oldFiber, newChild, expirationTime);
16234
+ } else {
16235
+ return null;
16236
+ }
16237
+ }
16238
+
16239
+ case REACT_CALL_TYPE:
16240
+ {
16241
+ if (newChild.key === key) {
16242
+ return updateCall(returnFiber, oldFiber, newChild, expirationTime);
16243
+ } else {
16244
+ return null;
16245
+ }
16246
+ }
16247
+
16248
+ case REACT_RETURN_TYPE:
16249
+ {
16250
+ // Returns don't have keys. If the previous node is implicitly keyed
16251
+ // we can continue to replace it without aborting even if it is not a
16252
+ // yield.
16253
+ if (key === null) {
16254
+ return updateReturn(returnFiber, oldFiber, newChild, expirationTime);
16255
+ } else {
16256
+ return null;
16257
+ }
16258
+ }
16259
+
16260
+ case REACT_PORTAL_TYPE:
16261
+ {
16262
+ if (newChild.key === key) {
16263
+ return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
16264
+ } else {
16265
+ return null;
16266
+ }
16267
+ }
16268
+ }
16269
+
16270
+ if (isArray$1(newChild) || getIteratorFn(newChild)) {
16271
+ if (key !== null) {
16272
+ return null;
16273
+ }
16274
+
16275
+ return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
16276
+ }
16277
+
16278
+ throwOnInvalidObjectType(returnFiber, newChild);
16279
+ }
16280
+
16281
+ {
16282
+ if (typeof newChild === 'function') {
16283
+ warnOnFunctionType();
16284
+ }
16285
+ }
16286
+
16287
+ return null;
16288
+ }
16289
+
16290
+ function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
16291
+ if (typeof newChild === 'string' || typeof newChild === 'number') {
16292
+ // Text nodes don't have keys, so we neither have to check the old nor
16293
+ // new node for the key. If both are text nodes, they match.
16294
+ var matchedFiber = existingChildren.get(newIdx) || null;
16295
+ return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
16296
+ }
16297
+
16298
+ if (typeof newChild === 'object' && newChild !== null) {
16299
+ switch (newChild.$$typeof) {
16300
+ case REACT_ELEMENT_TYPE:
16301
+ {
16302
+ var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
16303
+ if (newChild.type === REACT_FRAGMENT_TYPE) {
16304
+ return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
16305
+ }
16306
+ return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
16307
+ }
16308
+
16309
+ case REACT_CALL_TYPE:
16310
+ {
16311
+ var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
16312
+ return updateCall(returnFiber, _matchedFiber2, newChild, expirationTime);
16313
+ }
16314
+
16315
+ case REACT_RETURN_TYPE:
16316
+ {
16317
+ // Returns don't have keys, so we neither have to check the old nor
16318
+ // new node for the key. If both are returns, they match.
16319
+ var _matchedFiber3 = existingChildren.get(newIdx) || null;
16320
+ return updateReturn(returnFiber, _matchedFiber3, newChild, expirationTime);
16321
+ }
16322
+
16323
+ case REACT_PORTAL_TYPE:
16324
+ {
16325
+ var _matchedFiber4 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
16326
+ return updatePortal(returnFiber, _matchedFiber4, newChild, expirationTime);
16327
+ }
16328
+ }
16329
+
16330
+ if (isArray$1(newChild) || getIteratorFn(newChild)) {
16331
+ var _matchedFiber5 = existingChildren.get(newIdx) || null;
16332
+ return updateFragment(returnFiber, _matchedFiber5, newChild, expirationTime, null);
16333
+ }
16334
+
16335
+ throwOnInvalidObjectType(returnFiber, newChild);
16336
+ }
16337
+
16338
+ {
16339
+ if (typeof newChild === 'function') {
16340
+ warnOnFunctionType();
16341
+ }
16342
+ }
16343
+
16344
+ return null;
16345
+ }
16346
+
16347
+ /**
16348
+ * Warns if there is a duplicate or missing key
16349
+ */
16350
+ function warnOnInvalidKey(child, knownKeys) {
16351
+ {
16352
+ if (typeof child !== 'object' || child === null) {
16353
+ return knownKeys;
16354
+ }
16355
+ switch (child.$$typeof) {
16356
+ case REACT_ELEMENT_TYPE:
16357
+ case REACT_CALL_TYPE:
16358
+ case REACT_PORTAL_TYPE:
16359
+ warnForMissingKey(child);
16360
+ var key = child.key;
16361
+ if (typeof key !== 'string') {
16362
+ break;
16363
+ }
16364
+ if (knownKeys === null) {
16365
+ knownKeys = new Set();
16366
+ knownKeys.add(key);
16367
+ break;
16368
+ }
16369
+ if (!knownKeys.has(key)) {
16370
+ knownKeys.add(key);
16371
+ break;
16372
+ }
16373
+ warning(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.%s', key, getCurrentFiberStackAddendum$1());
16374
+ break;
16375
+ default:
16376
+ break;
16377
+ }
16378
+ }
16379
+ return knownKeys;
16380
+ }
16381
+
16382
+ function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
16383
+ // This algorithm can't optimize by searching from boths ends since we
16384
+ // don't have backpointers on fibers. I'm trying to see how far we can get
16385
+ // with that model. If it ends up not being worth the tradeoffs, we can
16386
+ // add it later.
16387
+
16388
+ // Even with a two ended optimization, we'd want to optimize for the case
16389
+ // where there are few changes and brute force the comparison instead of
16390
+ // going for the Map. It'd like to explore hitting that path first in
16391
+ // forward-only mode and only go for the Map once we notice that we need
16392
+ // lots of look ahead. This doesn't handle reversal as well as two ended
16393
+ // search but that's unusual. Besides, for the two ended optimization to
16394
+ // work on Iterables, we'd need to copy the whole set.
16395
+
16396
+ // In this first iteration, we'll just live with hitting the bad case
16397
+ // (adding everything to a Map) in for every insert/move.
16398
+
16399
+ // If you change this code, also update reconcileChildrenIterator() which
16400
+ // uses the same algorithm.
16401
+
16402
+ {
16403
+ // First, validate keys.
16404
+ var knownKeys = null;
16405
+ for (var i = 0; i < newChildren.length; i++) {
16406
+ var child = newChildren[i];
16407
+ knownKeys = warnOnInvalidKey(child, knownKeys);
16408
+ }
16409
+ }
16410
+
16411
+ var resultingFirstChild = null;
16412
+ var previousNewFiber = null;
16413
+
16414
+ var oldFiber = currentFirstChild;
16415
+ var lastPlacedIndex = 0;
16416
+ var newIdx = 0;
16417
+ var nextOldFiber = null;
16418
+ for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
16419
+ if (oldFiber.index > newIdx) {
16420
+ nextOldFiber = oldFiber;
16421
+ oldFiber = null;
16422
+ } else {
16423
+ nextOldFiber = oldFiber.sibling;
16424
+ }
16425
+ var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
16426
+ if (newFiber === null) {
16427
+ // TODO: This breaks on empty slots like null children. That's
16428
+ // unfortunate because it triggers the slow path all the time. We need
16429
+ // a better way to communicate whether this was a miss or null,
16430
+ // boolean, undefined, etc.
16431
+ if (oldFiber === null) {
16432
+ oldFiber = nextOldFiber;
16433
+ }
16434
+ break;
16435
+ }
16436
+ if (shouldTrackSideEffects) {
16437
+ if (oldFiber && newFiber.alternate === null) {
16438
+ // We matched the slot, but we didn't reuse the existing fiber, so we
16439
+ // need to delete the existing child.
16440
+ deleteChild(returnFiber, oldFiber);
16441
+ }
16442
+ }
16443
+ lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
16444
+ if (previousNewFiber === null) {
16445
+ // TODO: Move out of the loop. This only happens for the first run.
16446
+ resultingFirstChild = newFiber;
16447
+ } else {
16448
+ // TODO: Defer siblings if we're not at the right index for this slot.
16449
+ // I.e. if we had null values before, then we want to defer this
16450
+ // for each null value. However, we also don't want to call updateSlot
16451
+ // with the previous one.
16452
+ previousNewFiber.sibling = newFiber;
16453
+ }
16454
+ previousNewFiber = newFiber;
16455
+ oldFiber = nextOldFiber;
16456
+ }
16457
+
16458
+ if (newIdx === newChildren.length) {
16459
+ // We've reached the end of the new children. We can delete the rest.
16460
+ deleteRemainingChildren(returnFiber, oldFiber);
16461
+ return resultingFirstChild;
16462
+ }
16463
+
16464
+ if (oldFiber === null) {
16465
+ // If we don't have any more existing children we can choose a fast path
16466
+ // since the rest will all be insertions.
16467
+ for (; newIdx < newChildren.length; newIdx++) {
16468
+ var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
16469
+ if (!_newFiber) {
16470
+ continue;
16471
+ }
16472
+ lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
16473
+ if (previousNewFiber === null) {
16474
+ // TODO: Move out of the loop. This only happens for the first run.
16475
+ resultingFirstChild = _newFiber;
16476
+ } else {
16477
+ previousNewFiber.sibling = _newFiber;
16478
+ }
16479
+ previousNewFiber = _newFiber;
16480
+ }
16481
+ return resultingFirstChild;
16482
+ }
16483
+
16484
+ // Add all children to a key map for quick lookups.
16485
+ var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
16486
+
16487
+ // Keep scanning and use the map to restore deleted items as moves.
16488
+ for (; newIdx < newChildren.length; newIdx++) {
16489
+ var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
16490
+ if (_newFiber2) {
16491
+ if (shouldTrackSideEffects) {
16492
+ if (_newFiber2.alternate !== null) {
16493
+ // The new fiber is a work in progress, but if there exists a
16494
+ // current, that means that we reused the fiber. We need to delete
16495
+ // it from the child list so that we don't add it to the deletion
16496
+ // list.
16497
+ existingChildren['delete'](_newFiber2.key === null ? newIdx : _newFiber2.key);
16498
+ }
16499
+ }
16500
+ lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
16501
+ if (previousNewFiber === null) {
16502
+ resultingFirstChild = _newFiber2;
16503
+ } else {
16504
+ previousNewFiber.sibling = _newFiber2;
16505
+ }
16506
+ previousNewFiber = _newFiber2;
16507
+ }
16508
+ }
16509
+
16510
+ if (shouldTrackSideEffects) {
16511
+ // Any existing children that weren't consumed above were deleted. We need
16512
+ // to add them to the deletion list.
16513
+ existingChildren.forEach(function (child) {
16514
+ return deleteChild(returnFiber, child);
16515
+ });
16516
+ }
16517
+
16518
+ return resultingFirstChild;
16519
+ }
16520
+
16521
+ function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
16522
+ // This is the same implementation as reconcileChildrenArray(),
16523
+ // but using the iterator instead.
16524
+
16525
+ var iteratorFn = getIteratorFn(newChildrenIterable);
16526
+ !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0;
16527
+
16528
+ {
16529
+ // Warn about using Maps as children
16530
+ if (typeof newChildrenIterable.entries === 'function') {
16531
+ var possibleMap = newChildrenIterable;
16532
+ if (possibleMap.entries === iteratorFn) {
16533
+ warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$1());
16534
+ didWarnAboutMaps = true;
16535
+ }
16536
+ }
16537
+
16538
+ // First, validate keys.
16539
+ // We'll get a different iterator later for the main pass.
16540
+ var _newChildren = iteratorFn.call(newChildrenIterable);
16541
+ if (_newChildren) {
16542
+ var knownKeys = null;
16543
+ var _step = _newChildren.next();
16544
+ for (; !_step.done; _step = _newChildren.next()) {
16545
+ var child = _step.value;
16546
+ knownKeys = warnOnInvalidKey(child, knownKeys);
16547
+ }
16548
+ }
16549
+ }
16550
+
16551
+ var newChildren = iteratorFn.call(newChildrenIterable);
16552
+ !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0;
16553
+
16554
+ var resultingFirstChild = null;
16555
+ var previousNewFiber = null;
16556
+
16557
+ var oldFiber = currentFirstChild;
16558
+ var lastPlacedIndex = 0;
16559
+ var newIdx = 0;
16560
+ var nextOldFiber = null;
16561
+
16562
+ var step = newChildren.next();
16563
+ for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
16564
+ if (oldFiber.index > newIdx) {
16565
+ nextOldFiber = oldFiber;
16566
+ oldFiber = null;
16567
+ } else {
16568
+ nextOldFiber = oldFiber.sibling;
16569
+ }
16570
+ var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
16571
+ if (newFiber === null) {
16572
+ // TODO: This breaks on empty slots like null children. That's
16573
+ // unfortunate because it triggers the slow path all the time. We need
16574
+ // a better way to communicate whether this was a miss or null,
16575
+ // boolean, undefined, etc.
16576
+ if (!oldFiber) {
16577
+ oldFiber = nextOldFiber;
16578
+ }
16579
+ break;
16580
+ }
16581
+ if (shouldTrackSideEffects) {
16582
+ if (oldFiber && newFiber.alternate === null) {
16583
+ // We matched the slot, but we didn't reuse the existing fiber, so we
16584
+ // need to delete the existing child.
16585
+ deleteChild(returnFiber, oldFiber);
16586
+ }
16587
+ }
16588
+ lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
16589
+ if (previousNewFiber === null) {
16590
+ // TODO: Move out of the loop. This only happens for the first run.
16591
+ resultingFirstChild = newFiber;
16592
+ } else {
16593
+ // TODO: Defer siblings if we're not at the right index for this slot.
16594
+ // I.e. if we had null values before, then we want to defer this
16595
+ // for each null value. However, we also don't want to call updateSlot
16596
+ // with the previous one.
16597
+ previousNewFiber.sibling = newFiber;
16598
+ }
16599
+ previousNewFiber = newFiber;
16600
+ oldFiber = nextOldFiber;
16601
+ }
16602
+
16603
+ if (step.done) {
16604
+ // We've reached the end of the new children. We can delete the rest.
16605
+ deleteRemainingChildren(returnFiber, oldFiber);
16606
+ return resultingFirstChild;
16607
+ }
16608
+
16609
+ if (oldFiber === null) {
16610
+ // If we don't have any more existing children we can choose a fast path
16611
+ // since the rest will all be insertions.
16612
+ for (; !step.done; newIdx++, step = newChildren.next()) {
16613
+ var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
16614
+ if (_newFiber3 === null) {
16615
+ continue;
16616
+ }
16617
+ lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
16618
+ if (previousNewFiber === null) {
16619
+ // TODO: Move out of the loop. This only happens for the first run.
16620
+ resultingFirstChild = _newFiber3;
16621
+ } else {
16622
+ previousNewFiber.sibling = _newFiber3;
16623
+ }
16624
+ previousNewFiber = _newFiber3;
16625
+ }
16626
+ return resultingFirstChild;
16627
+ }
16628
+
16629
+ // Add all children to a key map for quick lookups.
16630
+ var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
16631
+
16632
+ // Keep scanning and use the map to restore deleted items as moves.
16633
+ for (; !step.done; newIdx++, step = newChildren.next()) {
16634
+ var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
16635
+ if (_newFiber4 !== null) {
16636
+ if (shouldTrackSideEffects) {
16637
+ if (_newFiber4.alternate !== null) {
16638
+ // The new fiber is a work in progress, but if there exists a
16639
+ // current, that means that we reused the fiber. We need to delete
16640
+ // it from the child list so that we don't add it to the deletion
16641
+ // list.
16642
+ existingChildren['delete'](_newFiber4.key === null ? newIdx : _newFiber4.key);
16643
+ }
16644
+ }
16645
+ lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
16646
+ if (previousNewFiber === null) {
16647
+ resultingFirstChild = _newFiber4;
16648
+ } else {
16649
+ previousNewFiber.sibling = _newFiber4;
16650
+ }
16651
+ previousNewFiber = _newFiber4;
16652
+ }
16653
+ }
16654
+
16655
+ if (shouldTrackSideEffects) {
16656
+ // Any existing children that weren't consumed above were deleted. We need
16657
+ // to add them to the deletion list.
16658
+ existingChildren.forEach(function (child) {
16659
+ return deleteChild(returnFiber, child);
16660
+ });
16661
+ }
16662
+
16663
+ return resultingFirstChild;
16664
+ }
16665
+
16666
+ function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
16667
+ // There's no need to check for keys on text nodes since we don't have a
16668
+ // way to define them.
16669
+ if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
16670
+ // We already have an existing node so let's just update it and delete
16671
+ // the rest.
16672
+ deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
16673
+ var existing = useFiber(currentFirstChild, textContent, expirationTime);
16674
+ existing['return'] = returnFiber;
16675
+ return existing;
16676
+ }
16677
+ // The existing first child is not a text node so we need to create one
16678
+ // and delete the existing ones.
16679
+ deleteRemainingChildren(returnFiber, currentFirstChild);
16680
+ var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime);
16681
+ created['return'] = returnFiber;
16682
+ return created;
16683
+ }
16684
+
16685
+ function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
16686
+ var key = element.key;
16687
+ var child = currentFirstChild;
16688
+ while (child !== null) {
16689
+ // TODO: If key === null and child.key === null, then this only applies to
16690
+ // the first item in the list.
16691
+ if (child.key === key) {
16692
+ if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) {
16693
+ deleteRemainingChildren(returnFiber, child.sibling);
16694
+ var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
16695
+ existing.ref = coerceRef(child, element);
16696
+ existing['return'] = returnFiber;
16697
+ {
16698
+ existing._debugSource = element._source;
16699
+ existing._debugOwner = element._owner;
16700
+ }
16701
+ return existing;
16702
+ } else {
16703
+ deleteRemainingChildren(returnFiber, child);
16704
+ break;
16705
+ }
16706
+ } else {
16707
+ deleteChild(returnFiber, child);
16708
+ }
16709
+ child = child.sibling;
16710
+ }
16711
+
16712
+ if (element.type === REACT_FRAGMENT_TYPE) {
16713
+ var created = createFiberFromFragment(element.props.children, returnFiber.internalContextTag, expirationTime, element.key);
16714
+ created['return'] = returnFiber;
16715
+ return created;
16716
+ } else {
16717
+ var _created7 = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime);
16718
+ _created7.ref = coerceRef(currentFirstChild, element);
16719
+ _created7['return'] = returnFiber;
16720
+ return _created7;
16721
+ }
16722
+ }
16723
+
16724
+ function reconcileSingleCall(returnFiber, currentFirstChild, call, expirationTime) {
16725
+ var key = call.key;
16726
+ var child = currentFirstChild;
16727
+ while (child !== null) {
16728
+ // TODO: If key === null and child.key === null, then this only applies to
16729
+ // the first item in the list.
16730
+ if (child.key === key) {
16731
+ if (child.tag === CallComponent) {
16732
+ deleteRemainingChildren(returnFiber, child.sibling);
16733
+ var existing = useFiber(child, call, expirationTime);
16734
+ existing['return'] = returnFiber;
16735
+ return existing;
16736
+ } else {
16737
+ deleteRemainingChildren(returnFiber, child);
16738
+ break;
16739
+ }
16740
+ } else {
16741
+ deleteChild(returnFiber, child);
16742
+ }
16743
+ child = child.sibling;
16744
+ }
16745
+
16746
+ var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime);
16747
+ created['return'] = returnFiber;
16748
+ return created;
16749
+ }
16750
+
16751
+ function reconcileSingleReturn(returnFiber, currentFirstChild, returnNode, expirationTime) {
16752
+ // There's no need to check for keys on yields since they're stateless.
16753
+ var child = currentFirstChild;
16754
+ if (child !== null) {
16755
+ if (child.tag === ReturnComponent) {
16756
+ deleteRemainingChildren(returnFiber, child.sibling);
16757
+ var existing = useFiber(child, null, expirationTime);
16758
+ existing.type = returnNode.value;
16759
+ existing['return'] = returnFiber;
16760
+ return existing;
16761
+ } else {
16762
+ deleteRemainingChildren(returnFiber, child);
16763
+ }
16764
+ }
16765
+
16766
+ var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime);
16767
+ created.type = returnNode.value;
16768
+ created['return'] = returnFiber;
16769
+ return created;
16770
+ }
16771
+
16772
+ function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
16773
+ var key = portal.key;
16774
+ var child = currentFirstChild;
16775
+ while (child !== null) {
16776
+ // TODO: If key === null and child.key === null, then this only applies to
16777
+ // the first item in the list.
16778
+ if (child.key === key) {
16779
+ if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
16780
+ deleteRemainingChildren(returnFiber, child.sibling);
16781
+ var existing = useFiber(child, portal.children || [], expirationTime);
16782
+ existing['return'] = returnFiber;
16783
+ return existing;
16784
+ } else {
16785
+ deleteRemainingChildren(returnFiber, child);
16786
+ break;
16787
+ }
16788
+ } else {
16789
+ deleteChild(returnFiber, child);
16790
+ }
16791
+ child = child.sibling;
16792
+ }
16793
+
16794
+ var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime);
16795
+ created['return'] = returnFiber;
16796
+ return created;
16797
+ }
16798
+
16799
+ // This API will tag the children with the side-effect of the reconciliation
16800
+ // itself. They will be added to the side-effect list as we pass through the
16801
+ // children and the parent.
16802
+ function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
16803
+ // This function is not recursive.
16804
+ // If the top level item is an array, we treat it as a set of children,
16805
+ // not as a fragment. Nested arrays on the other hand will be treated as
16806
+ // fragment nodes. Recursion happens at the normal flow.
16807
+
16808
+ // Handle top level unkeyed fragments as if they were arrays.
16809
+ // This leads to an ambiguity between <>{[...]}</> and <>...</>.
16810
+ // We treat the ambiguous cases above the same.
16811
+ if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {
16812
+ newChild = newChild.props.children;
16813
+ }
16814
+
16815
+ // Handle object types
16816
+ var isObject = typeof newChild === 'object' && newChild !== null;
16817
+
16818
+ if (isObject) {
16819
+ switch (newChild.$$typeof) {
16820
+ case REACT_ELEMENT_TYPE:
16821
+ return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
16822
+
16823
+ case REACT_CALL_TYPE:
16824
+ return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));
16825
+ case REACT_RETURN_TYPE:
16826
+ return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));
16827
+ case REACT_PORTAL_TYPE:
16828
+ return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
16829
+ }
16830
+ }
16831
+
16832
+ if (typeof newChild === 'string' || typeof newChild === 'number') {
16833
+ return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
16834
+ }
16835
+
16836
+ if (isArray$1(newChild)) {
16837
+ return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
16838
+ }
16839
+
16840
+ if (getIteratorFn(newChild)) {
16841
+ return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
16842
+ }
16843
+
16844
+ if (isObject) {
16845
+ throwOnInvalidObjectType(returnFiber, newChild);
16846
+ }
16847
+
16848
+ {
16849
+ if (typeof newChild === 'function') {
16850
+ warnOnFunctionType();
16851
+ }
16852
+ }
16853
+ if (typeof newChild === 'undefined') {
16854
+ // If the new child is undefined, and the return fiber is a composite
16855
+ // component, throw an error. If Fiber return types are disabled,
16856
+ // we already threw above.
16857
+ switch (returnFiber.tag) {
16858
+ case ClassComponent:
16859
+ {
16860
+ {
16861
+ var instance = returnFiber.stateNode;
16862
+ if (instance.render._isMockFunction) {
16863
+ // We allow auto-mocks to proceed as if they're returning null.
16864
+ break;
16865
+ }
16866
+ }
16867
+ }
16868
+ // Intentionally fall through to the next case, which handles both
16869
+ // functions and classes
16870
+ // eslint-disable-next-lined no-fallthrough
16871
+ case FunctionalComponent:
16872
+ {
16873
+ var Component = returnFiber.type;
16874
+ invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');
16875
+ }
16876
+ }
16877
+ }
16878
+
16879
+ // Remaining cases are all treated as empty.
16880
+ return deleteRemainingChildren(returnFiber, currentFirstChild);
16881
+ }
16882
+
16883
+ return reconcileChildFibers;
16884
+ }
16885
+
16886
+ var reconcileChildFibers = ChildReconciler(true);
16887
+ var mountChildFibers = ChildReconciler(false);
16888
+
16889
+ function cloneChildFibers(current, workInProgress) {
16890
+ !(current === null || workInProgress.child === current.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0;
16891
+
16892
+ if (workInProgress.child === null) {
16893
+ return;
16894
+ }
16895
+
16896
+ var currentChild = workInProgress.child;
16897
+ var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
16898
+ workInProgress.child = newChild;
16899
+
16900
+ newChild['return'] = workInProgress;
16901
+ while (currentChild.sibling !== null) {
16902
+ currentChild = currentChild.sibling;
16903
+ newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
16904
+ newChild['return'] = workInProgress;
16905
+ }
16906
+ newChild.sibling = null;
16907
+ }
16908
+
16909
+ {
16910
+ var warnedAboutStatelessRefs = {};
16911
+ }
16912
+
16913
+ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber) {
16914
+ var shouldSetTextContent = config.shouldSetTextContent,
16915
+ useSyncScheduling = config.useSyncScheduling,
16916
+ shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree;
16917
+ var pushHostContext = hostContext.pushHostContext,
16918
+ pushHostContainer = hostContext.pushHostContainer;
16919
+ var enterHydrationState = hydrationContext.enterHydrationState,
16920
+ resetHydrationState = hydrationContext.resetHydrationState,
16921
+ tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance;
16922
+
16923
+ var _ReactFiberClassCompo = ReactFiberClassComponent(scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState),
16924
+ adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,
16925
+ constructClassInstance = _ReactFiberClassCompo.constructClassInstance,
16926
+ mountClassInstance = _ReactFiberClassCompo.mountClassInstance,
16927
+ updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
16928
+
16929
+ // TODO: Remove this and use reconcileChildrenAtExpirationTime directly.
16930
+
16931
+
16932
+ function reconcileChildren(current, workInProgress, nextChildren) {
16933
+ reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime);
16934
+ }
16935
+
16936
+ function reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime) {
16937
+ if (current === null) {
16938
+ // If this is a fresh new component that hasn't been rendered yet, we
16939
+ // won't update its child set by applying minimal side-effects. Instead,
16940
+ // we will add them all to the child before it gets rendered. That means
16941
+ // we can optimize this reconciliation pass by not tracking side-effects.
16942
+ workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
16943
+ } else {
16944
+ // If the current child is the same as the work in progress, it means that
16945
+ // we haven't yet started any work on these children. Therefore, we use
16946
+ // the clone algorithm to create a copy of all the current children.
16947
+
16948
+ // If we had any progressed work already, that is invalid at this point so
16949
+ // let's throw it out.
16950
+ workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
16951
+ }
16952
+ }
16953
+
16954
+ function updateFragment(current, workInProgress) {
16955
+ var nextChildren = workInProgress.pendingProps;
16956
+ if (hasContextChanged()) {
16957
+ // Normally we can bail out on props equality but if context has changed
16958
+ // we don't do the bailout and we have to reuse existing props instead.
16959
+ if (nextChildren === null) {
16960
+ nextChildren = workInProgress.memoizedProps;
16961
+ }
16962
+ } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {
16963
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
16964
+ }
16965
+ reconcileChildren(current, workInProgress, nextChildren);
16966
+ memoizeProps(workInProgress, nextChildren);
16967
+ return workInProgress.child;
16968
+ }
16969
+
16970
+ function markRef(current, workInProgress) {
16971
+ var ref = workInProgress.ref;
16972
+ if (ref !== null && (!current || current.ref !== ref)) {
16973
+ // Schedule a Ref effect
16974
+ workInProgress.effectTag |= Ref;
16975
+ }
16976
+ }
16977
+
16978
+ function updateFunctionalComponent(current, workInProgress) {
16979
+ var fn = workInProgress.type;
16980
+ var nextProps = workInProgress.pendingProps;
16981
+
16982
+ var memoizedProps = workInProgress.memoizedProps;
16983
+ if (hasContextChanged()) {
16984
+ // Normally we can bail out on props equality but if context has changed
16985
+ // we don't do the bailout and we have to reuse existing props instead.
16986
+ if (nextProps === null) {
16987
+ nextProps = memoizedProps;
16988
+ }
16989
+ } else {
16990
+ if (nextProps === null || memoizedProps === nextProps) {
16991
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
16992
+ }
16993
+ // TODO: consider bringing fn.shouldComponentUpdate() back.
16994
+ // It used to be here.
16995
+ }
16996
+
16997
+ var unmaskedContext = getUnmaskedContext(workInProgress);
16998
+ var context = getMaskedContext(workInProgress, unmaskedContext);
16999
+
17000
+ var nextChildren;
17001
+
17002
+ {
17003
+ ReactCurrentOwner.current = workInProgress;
17004
+ ReactDebugCurrentFiber.setCurrentPhase('render');
17005
+ nextChildren = fn(nextProps, context);
17006
+ ReactDebugCurrentFiber.setCurrentPhase(null);
17007
+ }
17008
+ // React DevTools reads this flag.
17009
+ workInProgress.effectTag |= PerformedWork;
17010
+ reconcileChildren(current, workInProgress, nextChildren);
17011
+ memoizeProps(workInProgress, nextProps);
17012
+ return workInProgress.child;
17013
+ }
17014
+
17015
+ function updateClassComponent(current, workInProgress, renderExpirationTime) {
17016
+ // Push context providers early to prevent context stack mismatches.
17017
+ // During mounting we don't know the child context yet as the instance doesn't exist.
17018
+ // We will invalidate the child context in finishClassComponent() right after rendering.
17019
+ var hasContext = pushContextProvider(workInProgress);
17020
+
17021
+ var shouldUpdate = void 0;
17022
+ if (current === null) {
17023
+ if (!workInProgress.stateNode) {
17024
+ // In the initial pass we might need to construct the instance.
17025
+ constructClassInstance(workInProgress, workInProgress.pendingProps);
17026
+ mountClassInstance(workInProgress, renderExpirationTime);
17027
+ shouldUpdate = true;
17028
+ } else {
17029
+ invariant(false, 'Resuming work not yet implemented.');
17030
+ // In a resume, we'll already have an instance we can reuse.
17031
+ // shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime);
17032
+ }
17033
+ } else {
17034
+ shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime);
17035
+ }
17036
+ return finishClassComponent(current, workInProgress, shouldUpdate, hasContext);
17037
+ }
17038
+
17039
+ function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) {
17040
+ // Refs should update even if shouldComponentUpdate returns false
17041
+ markRef(current, workInProgress);
17042
+
17043
+ if (!shouldUpdate) {
17044
+ // Context providers should defer to sCU for rendering
17045
+ if (hasContext) {
17046
+ invalidateContextProvider(workInProgress, false);
17047
+ }
17048
+
17049
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
17050
+ }
17051
+
17052
+ var instance = workInProgress.stateNode;
17053
+
17054
+ // Rerender
17055
+ ReactCurrentOwner.current = workInProgress;
17056
+ var nextChildren = void 0;
17057
+ {
17058
+ ReactDebugCurrentFiber.setCurrentPhase('render');
17059
+ nextChildren = instance.render();
17060
+ if (debugRenderPhaseSideEffects) {
17061
+ instance.render();
17062
+ }
17063
+ ReactDebugCurrentFiber.setCurrentPhase(null);
17064
+ }
17065
+ // React DevTools reads this flag.
17066
+ workInProgress.effectTag |= PerformedWork;
17067
+ reconcileChildren(current, workInProgress, nextChildren);
17068
+ // Memoize props and state using the values we just used to render.
17069
+ // TODO: Restructure so we never read values from the instance.
17070
+ memoizeState(workInProgress, instance.state);
17071
+ memoizeProps(workInProgress, instance.props);
17072
+
17073
+ // The context might have changed so we need to recalculate it.
17074
+ if (hasContext) {
17075
+ invalidateContextProvider(workInProgress, true);
17076
+ }
17077
+
17078
+ return workInProgress.child;
17079
+ }
17080
+
17081
+ function pushHostRootContext(workInProgress) {
17082
+ var root = workInProgress.stateNode;
17083
+ if (root.pendingContext) {
17084
+ pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
17085
+ } else if (root.context) {
17086
+ // Should always be set
17087
+ pushTopLevelContextObject(workInProgress, root.context, false);
17088
+ }
17089
+ pushHostContainer(workInProgress, root.containerInfo);
17090
+ }
17091
+
17092
+ function updateHostRoot(current, workInProgress, renderExpirationTime) {
17093
+ pushHostRootContext(workInProgress);
17094
+ var updateQueue = workInProgress.updateQueue;
17095
+ if (updateQueue !== null) {
17096
+ var prevState = workInProgress.memoizedState;
17097
+ var state = processUpdateQueue(current, workInProgress, updateQueue, null, null, renderExpirationTime);
17098
+ if (prevState === state) {
17099
+ // If the state is the same as before, that's a bailout because we had
17100
+ // no work that expires at this time.
17101
+ resetHydrationState();
17102
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
17103
+ }
17104
+ var element = state.element;
17105
+ var root = workInProgress.stateNode;
17106
+ if ((current === null || current.child === null) && root.hydrate && enterHydrationState(workInProgress)) {
17107
+ // If we don't have any current children this might be the first pass.
17108
+ // We always try to hydrate. If this isn't a hydration pass there won't
17109
+ // be any children to hydrate which is effectively the same thing as
17110
+ // not hydrating.
17111
+
17112
+ // This is a bit of a hack. We track the host root as a placement to
17113
+ // know that we're currently in a mounting state. That way isMounted
17114
+ // works as expected. We must reset this before committing.
17115
+ // TODO: Delete this when we delete isMounted and findDOMNode.
17116
+ workInProgress.effectTag |= Placement;
17117
+
17118
+ // Ensure that children mount into this root without tracking
17119
+ // side-effects. This ensures that we don't store Placement effects on
17120
+ // nodes that will be hydrated.
17121
+ workInProgress.child = mountChildFibers(workInProgress, null, element, renderExpirationTime);
17122
+ } else {
17123
+ // Otherwise reset hydration state in case we aborted and resumed another
17124
+ // root.
17125
+ resetHydrationState();
17126
+ reconcileChildren(current, workInProgress, element);
17127
+ }
17128
+ memoizeState(workInProgress, state);
17129
+ return workInProgress.child;
17130
+ }
17131
+ resetHydrationState();
17132
+ // If there is no update queue, that's a bailout because the root has no props.
17133
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
17134
+ }
17135
+
17136
+ function updateHostComponent(current, workInProgress, renderExpirationTime) {
17137
+ pushHostContext(workInProgress);
17138
+
17139
+ if (current === null) {
17140
+ tryToClaimNextHydratableInstance(workInProgress);
17141
+ }
17142
+
17143
+ var type = workInProgress.type;
17144
+ var memoizedProps = workInProgress.memoizedProps;
17145
+ var nextProps = workInProgress.pendingProps;
17146
+ if (nextProps === null) {
17147
+ nextProps = memoizedProps;
17148
+ !(nextProps !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17149
+ }
17150
+ var prevProps = current !== null ? current.memoizedProps : null;
17151
+
17152
+ if (hasContextChanged()) {
17153
+ // Normally we can bail out on props equality but if context has changed
17154
+ // we don't do the bailout and we have to reuse existing props instead.
17155
+ } else if (nextProps === null || memoizedProps === nextProps) {
17156
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
17157
+ }
17158
+
17159
+ var nextChildren = nextProps.children;
17160
+ var isDirectTextChild = shouldSetTextContent(type, nextProps);
17161
+
17162
+ if (isDirectTextChild) {
17163
+ // We special case a direct text child of a host node. This is a common
17164
+ // case. We won't handle it as a reified child. We will instead handle
17165
+ // this in the host environment that also have access to this prop. That
17166
+ // avoids allocating another HostText fiber and traversing it.
17167
+ nextChildren = null;
17168
+ } else if (prevProps && shouldSetTextContent(type, prevProps)) {
17169
+ // If we're switching from a direct text child to a normal child, or to
17170
+ // empty, we need to schedule the text content to be reset.
17171
+ workInProgress.effectTag |= ContentReset;
17172
+ }
17173
+
17174
+ markRef(current, workInProgress);
17175
+
17176
+ // Check the host config to see if the children are offscreen/hidden.
17177
+ if (renderExpirationTime !== Never && !useSyncScheduling && shouldDeprioritizeSubtree(type, nextProps)) {
17178
+ // Down-prioritize the children.
17179
+ workInProgress.expirationTime = Never;
17180
+ // Bailout and come back to this fiber later.
17181
+ return null;
17182
+ }
17183
+
17184
+ reconcileChildren(current, workInProgress, nextChildren);
17185
+ memoizeProps(workInProgress, nextProps);
17186
+ return workInProgress.child;
17187
+ }
17188
+
17189
+ function updateHostText(current, workInProgress) {
17190
+ if (current === null) {
17191
+ tryToClaimNextHydratableInstance(workInProgress);
17192
+ }
17193
+ var nextProps = workInProgress.pendingProps;
17194
+ if (nextProps === null) {
17195
+ nextProps = workInProgress.memoizedProps;
17196
+ }
17197
+ memoizeProps(workInProgress, nextProps);
17198
+ // Nothing to do here. This is terminal. We'll do the completion step
17199
+ // immediately after.
17200
+ return null;
17201
+ }
17202
+
17203
+ function mountIndeterminateComponent(current, workInProgress, renderExpirationTime) {
17204
+ !(current === null) ? invariant(false, 'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17205
+ var fn = workInProgress.type;
17206
+ var props = workInProgress.pendingProps;
17207
+ var unmaskedContext = getUnmaskedContext(workInProgress);
17208
+ var context = getMaskedContext(workInProgress, unmaskedContext);
17209
+
17210
+ var value;
17211
+
17212
+ {
17213
+ if (fn.prototype && typeof fn.prototype.render === 'function') {
17214
+ var componentName = getComponentName(workInProgress);
17215
+ warning(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
17216
+ }
17217
+ ReactCurrentOwner.current = workInProgress;
17218
+ value = fn(props, context);
17219
+ }
17220
+ // React DevTools reads this flag.
17221
+ workInProgress.effectTag |= PerformedWork;
17222
+
17223
+ if (typeof value === 'object' && value !== null && typeof value.render === 'function') {
17224
+ // Proceed under the assumption that this is a class instance
17225
+ workInProgress.tag = ClassComponent;
17226
+
17227
+ // Push context providers early to prevent context stack mismatches.
17228
+ // During mounting we don't know the child context yet as the instance doesn't exist.
17229
+ // We will invalidate the child context in finishClassComponent() right after rendering.
17230
+ var hasContext = pushContextProvider(workInProgress);
17231
+ adoptClassInstance(workInProgress, value);
17232
+ mountClassInstance(workInProgress, renderExpirationTime);
17233
+ return finishClassComponent(current, workInProgress, true, hasContext);
17234
+ } else {
17235
+ // Proceed under the assumption that this is a functional component
17236
+ workInProgress.tag = FunctionalComponent;
17237
+ {
17238
+ var Component = workInProgress.type;
17239
+
17240
+ if (Component) {
17241
+ warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component');
17242
+ }
17243
+ if (workInProgress.ref !== null) {
17244
+ var info = '';
17245
+ var ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName();
17246
+ if (ownerName) {
17247
+ info += '\n\nCheck the render method of `' + ownerName + '`.';
17248
+ }
17249
+
17250
+ var warningKey = ownerName || workInProgress._debugID || '';
17251
+ var debugSource = workInProgress._debugSource;
17252
+ if (debugSource) {
17253
+ warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
17254
+ }
17255
+ if (!warnedAboutStatelessRefs[warningKey]) {
17256
+ warnedAboutStatelessRefs[warningKey] = true;
17257
+ warning(false, 'Stateless function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s%s', info, ReactDebugCurrentFiber.getCurrentFiberStackAddendum());
17258
+ }
17259
+ }
17260
+ }
17261
+ reconcileChildren(current, workInProgress, value);
17262
+ memoizeProps(workInProgress, props);
17263
+ return workInProgress.child;
17264
+ }
17265
+ }
17266
+
17267
+ function updateCallComponent(current, workInProgress, renderExpirationTime) {
17268
+ var nextCall = workInProgress.pendingProps;
17269
+ if (hasContextChanged()) {
17270
+ // Normally we can bail out on props equality but if context has changed
17271
+ // we don't do the bailout and we have to reuse existing props instead.
17272
+ if (nextCall === null) {
17273
+ nextCall = current && current.memoizedProps;
17274
+ !(nextCall !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17275
+ }
17276
+ } else if (nextCall === null || workInProgress.memoizedProps === nextCall) {
17277
+ nextCall = workInProgress.memoizedProps;
17278
+ // TODO: When bailing out, we might need to return the stateNode instead
17279
+ // of the child. To check it for work.
17280
+ // return bailoutOnAlreadyFinishedWork(current, workInProgress);
17281
+ }
17282
+
17283
+ var nextChildren = nextCall.children;
17284
+
17285
+ // The following is a fork of reconcileChildrenAtExpirationTime but using
17286
+ // stateNode to store the child.
17287
+ if (current === null) {
17288
+ workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
17289
+ } else {
17290
+ workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
17291
+ }
17292
+
17293
+ memoizeProps(workInProgress, nextCall);
17294
+ // This doesn't take arbitrary time so we could synchronously just begin
17295
+ // eagerly do the work of workInProgress.child as an optimization.
17296
+ return workInProgress.stateNode;
17297
+ }
17298
+
17299
+ function updatePortalComponent(current, workInProgress, renderExpirationTime) {
17300
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
17301
+ var nextChildren = workInProgress.pendingProps;
17302
+ if (hasContextChanged()) {
17303
+ // Normally we can bail out on props equality but if context has changed
17304
+ // we don't do the bailout and we have to reuse existing props instead.
17305
+ if (nextChildren === null) {
17306
+ nextChildren = current && current.memoizedProps;
17307
+ !(nextChildren != null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17308
+ }
17309
+ } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {
17310
+ return bailoutOnAlreadyFinishedWork(current, workInProgress);
17311
+ }
17312
+
17313
+ if (current === null) {
17314
+ // Portals are special because we don't append the children during mount
17315
+ // but at commit. Therefore we need to track insertions which the normal
17316
+ // flow doesn't do during mount. This doesn't happen at the root because
17317
+ // the root always starts with a "current" with a null child.
17318
+ // TODO: Consider unifying this with how the root works.
17319
+ workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
17320
+ memoizeProps(workInProgress, nextChildren);
17321
+ } else {
17322
+ reconcileChildren(current, workInProgress, nextChildren);
17323
+ memoizeProps(workInProgress, nextChildren);
17324
+ }
17325
+ return workInProgress.child;
17326
+ }
17327
+
17328
+ /*
17329
+ function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) {
17330
+ let child = firstChild;
17331
+ do {
17332
+ // Ensure that the first and last effect of the parent corresponds
17333
+ // to the children's first and last effect.
17334
+ if (!returnFiber.firstEffect) {
17335
+ returnFiber.firstEffect = child.firstEffect;
17336
+ }
17337
+ if (child.lastEffect) {
17338
+ if (returnFiber.lastEffect) {
17339
+ returnFiber.lastEffect.nextEffect = child.firstEffect;
17340
+ }
17341
+ returnFiber.lastEffect = child.lastEffect;
17342
+ }
17343
+ } while (child = child.sibling);
17344
+ }
17345
+ */
17346
+
17347
+ function bailoutOnAlreadyFinishedWork(current, workInProgress) {
17348
+ cancelWorkTimer(workInProgress);
17349
+
17350
+ // TODO: We should ideally be able to bail out early if the children have no
17351
+ // more work to do. However, since we don't have a separation of this
17352
+ // Fiber's priority and its children yet - we don't know without doing lots
17353
+ // of the same work we do anyway. Once we have that separation we can just
17354
+ // bail out here if the children has no more work at this priority level.
17355
+ // if (workInProgress.priorityOfChildren <= priorityLevel) {
17356
+ // // If there are side-effects in these children that have not yet been
17357
+ // // committed we need to ensure that they get properly transferred up.
17358
+ // if (current && current.child !== workInProgress.child) {
17359
+ // reuseChildrenEffects(workInProgress, child);
17360
+ // }
17361
+ // return null;
17362
+ // }
17363
+
17364
+ cloneChildFibers(current, workInProgress);
17365
+ return workInProgress.child;
17366
+ }
17367
+
17368
+ function bailoutOnLowPriority(current, workInProgress) {
17369
+ cancelWorkTimer(workInProgress);
17370
+
17371
+ // TODO: Handle HostComponent tags here as well and call pushHostContext()?
17372
+ // See PR 8590 discussion for context
17373
+ switch (workInProgress.tag) {
17374
+ case HostRoot:
17375
+ pushHostRootContext(workInProgress);
17376
+ break;
17377
+ case ClassComponent:
17378
+ pushContextProvider(workInProgress);
17379
+ break;
17380
+ case HostPortal:
17381
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
17382
+ break;
17383
+ }
17384
+ // TODO: What if this is currently in progress?
17385
+ // How can that happen? How is this not being cloned?
17386
+ return null;
17387
+ }
17388
+
17389
+ // TODO: Delete memoizeProps/State and move to reconcile/bailout instead
17390
+ function memoizeProps(workInProgress, nextProps) {
17391
+ workInProgress.memoizedProps = nextProps;
17392
+ }
17393
+
17394
+ function memoizeState(workInProgress, nextState) {
17395
+ workInProgress.memoizedState = nextState;
17396
+ // Don't reset the updateQueue, in case there are pending updates. Resetting
17397
+ // is handled by processUpdateQueue.
17398
+ }
17399
+
17400
+ function beginWork(current, workInProgress, renderExpirationTime) {
17401
+ if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
17402
+ return bailoutOnLowPriority(current, workInProgress);
17403
+ }
17404
+
17405
+ switch (workInProgress.tag) {
17406
+ case IndeterminateComponent:
17407
+ return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
17408
+ case FunctionalComponent:
17409
+ return updateFunctionalComponent(current, workInProgress);
17410
+ case ClassComponent:
17411
+ return updateClassComponent(current, workInProgress, renderExpirationTime);
17412
+ case HostRoot:
17413
+ return updateHostRoot(current, workInProgress, renderExpirationTime);
17414
+ case HostComponent:
17415
+ return updateHostComponent(current, workInProgress, renderExpirationTime);
17416
+ case HostText:
17417
+ return updateHostText(current, workInProgress);
17418
+ case CallHandlerPhase:
17419
+ // This is a restart. Reset the tag to the initial phase.
17420
+ workInProgress.tag = CallComponent;
17421
+ // Intentionally fall through since this is now the same.
17422
+ case CallComponent:
17423
+ return updateCallComponent(current, workInProgress, renderExpirationTime);
17424
+ case ReturnComponent:
17425
+ // A return component is just a placeholder, we can just run through the
17426
+ // next one immediately.
17427
+ return null;
17428
+ case HostPortal:
17429
+ return updatePortalComponent(current, workInProgress, renderExpirationTime);
17430
+ case Fragment:
17431
+ return updateFragment(current, workInProgress);
17432
+ default:
17433
+ invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
17434
+ }
17435
+ }
17436
+
17437
+ function beginFailedWork(current, workInProgress, renderExpirationTime) {
17438
+ // Push context providers here to avoid a push/pop context mismatch.
17439
+ switch (workInProgress.tag) {
17440
+ case ClassComponent:
17441
+ pushContextProvider(workInProgress);
17442
+ break;
17443
+ case HostRoot:
17444
+ pushHostRootContext(workInProgress);
17445
+ break;
17446
+ default:
17447
+ invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.');
17448
+ }
17449
+
17450
+ // Add an error effect so we can handle the error during the commit phase
17451
+ workInProgress.effectTag |= Err;
17452
+
17453
+ // This is a weird case where we do "resume" work — work that failed on
17454
+ // our first attempt. Because we no longer have a notion of "progressed
17455
+ // deletions," reset the child to the current child to make sure we delete
17456
+ // it again. TODO: Find a better way to handle this, perhaps during a more
17457
+ // general overhaul of error handling.
17458
+ if (current === null) {
17459
+ workInProgress.child = null;
17460
+ } else if (workInProgress.child !== current.child) {
17461
+ workInProgress.child = current.child;
17462
+ }
17463
+
17464
+ if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
17465
+ return bailoutOnLowPriority(current, workInProgress);
17466
+ }
17467
+
17468
+ // If we don't bail out, we're going be recomputing our children so we need
17469
+ // to drop our effect list.
17470
+ workInProgress.firstEffect = null;
17471
+ workInProgress.lastEffect = null;
17472
+
17473
+ // Unmount the current children as if the component rendered null
17474
+ var nextChildren = null;
17475
+ reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime);
17476
+
17477
+ if (workInProgress.tag === ClassComponent) {
17478
+ var instance = workInProgress.stateNode;
17479
+ workInProgress.memoizedProps = instance.props;
17480
+ workInProgress.memoizedState = instance.state;
17481
+ }
17482
+
17483
+ return workInProgress.child;
17484
+ }
17485
+
17486
+ return {
17487
+ beginWork: beginWork,
17488
+ beginFailedWork: beginFailedWork
17489
+ };
17490
+ };
17491
+
17492
+ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) {
17493
+ var createInstance = config.createInstance,
17494
+ createTextInstance = config.createTextInstance,
17495
+ appendInitialChild = config.appendInitialChild,
17496
+ finalizeInitialChildren = config.finalizeInitialChildren,
17497
+ prepareUpdate = config.prepareUpdate,
17498
+ mutation = config.mutation,
17499
+ persistence = config.persistence;
17500
+ var getRootHostContainer = hostContext.getRootHostContainer,
17501
+ popHostContext = hostContext.popHostContext,
17502
+ getHostContext = hostContext.getHostContext,
17503
+ popHostContainer = hostContext.popHostContainer;
17504
+ var prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance,
17505
+ prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance,
17506
+ popHydrationState = hydrationContext.popHydrationState;
17507
+
17508
+
17509
+ function markUpdate(workInProgress) {
17510
+ // Tag the fiber with an update effect. This turns a Placement into
17511
+ // an UpdateAndPlacement.
17512
+ workInProgress.effectTag |= Update;
17513
+ }
17514
+
17515
+ function markRef(workInProgress) {
17516
+ workInProgress.effectTag |= Ref;
17517
+ }
17518
+
17519
+ function appendAllReturns(returns, workInProgress) {
17520
+ var node = workInProgress.stateNode;
17521
+ if (node) {
17522
+ node['return'] = workInProgress;
17523
+ }
17524
+ while (node !== null) {
17525
+ if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) {
17526
+ invariant(false, 'A call cannot have host component children.');
17527
+ } else if (node.tag === ReturnComponent) {
17528
+ returns.push(node.type);
17529
+ } else if (node.child !== null) {
17530
+ node.child['return'] = node;
17531
+ node = node.child;
17532
+ continue;
17533
+ }
17534
+ while (node.sibling === null) {
17535
+ if (node['return'] === null || node['return'] === workInProgress) {
17536
+ return;
17537
+ }
17538
+ node = node['return'];
17539
+ }
17540
+ node.sibling['return'] = node['return'];
17541
+ node = node.sibling;
17542
+ }
17543
+ }
17544
+
17545
+ function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) {
17546
+ var call = workInProgress.memoizedProps;
17547
+ !call ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17548
+
17549
+ // First step of the call has completed. Now we need to do the second.
17550
+ // TODO: It would be nice to have a multi stage call represented by a
17551
+ // single component, or at least tail call optimize nested ones. Currently
17552
+ // that requires additional fields that we don't want to add to the fiber.
17553
+ // So this requires nested handlers.
17554
+ // Note: This doesn't mutate the alternate node. I don't think it needs to
17555
+ // since this stage is reset for every pass.
17556
+ workInProgress.tag = CallHandlerPhase;
17557
+
17558
+ // Build up the returns.
17559
+ // TODO: Compare this to a generator or opaque helpers like Children.
17560
+ var returns = [];
17561
+ appendAllReturns(returns, workInProgress);
17562
+ var fn = call.handler;
17563
+ var props = call.props;
17564
+ var nextChildren = fn(props, returns);
17565
+
17566
+ var currentFirstChild = current !== null ? current.child : null;
17567
+ workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, renderExpirationTime);
17568
+ return workInProgress.child;
17569
+ }
17570
+
17571
+ function appendAllChildren(parent, workInProgress) {
17572
+ // We only have the top Fiber that was created but we need recurse down its
17573
+ // children to find all the terminal nodes.
17574
+ var node = workInProgress.child;
17575
+ while (node !== null) {
17576
+ if (node.tag === HostComponent || node.tag === HostText) {
17577
+ appendInitialChild(parent, node.stateNode);
17578
+ } else if (node.tag === HostPortal) {
17579
+ // If we have a portal child, then we don't want to traverse
17580
+ // down its children. Instead, we'll get insertions from each child in
17581
+ // the portal directly.
17582
+ } else if (node.child !== null) {
17583
+ node.child['return'] = node;
17584
+ node = node.child;
17585
+ continue;
17586
+ }
17587
+ if (node === workInProgress) {
17588
+ return;
17589
+ }
17590
+ while (node.sibling === null) {
17591
+ if (node['return'] === null || node['return'] === workInProgress) {
17592
+ return;
17593
+ }
17594
+ node = node['return'];
17595
+ }
17596
+ node.sibling['return'] = node['return'];
17597
+ node = node.sibling;
17598
+ }
17599
+ }
17600
+
17601
+ var updateHostContainer = void 0;
17602
+ var updateHostComponent = void 0;
17603
+ var updateHostText = void 0;
17604
+ if (mutation) {
17605
+ if (enableMutatingReconciler) {
17606
+ // Mutation mode
17607
+ updateHostContainer = function (workInProgress) {
17608
+ // Noop
17609
+ };
17610
+ updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {
17611
+ // TODO: Type this specific to this type of component.
17612
+ workInProgress.updateQueue = updatePayload;
17613
+ // If the update payload indicates that there is a change or if there
17614
+ // is a new ref we mark this as an update. All the work is done in commitWork.
17615
+ if (updatePayload) {
17616
+ markUpdate(workInProgress);
17617
+ }
17618
+ };
17619
+ updateHostText = function (current, workInProgress, oldText, newText) {
17620
+ // If the text differs, mark it as an update. All the work in done in commitWork.
17621
+ if (oldText !== newText) {
17622
+ markUpdate(workInProgress);
17623
+ }
17624
+ };
17625
+ } else {
17626
+ invariant(false, 'Mutating reconciler is disabled.');
17627
+ }
17628
+ } else if (persistence) {
17629
+ if (enablePersistentReconciler) {
17630
+ // Persistent host tree mode
17631
+ var cloneInstance = persistence.cloneInstance,
17632
+ createContainerChildSet = persistence.createContainerChildSet,
17633
+ appendChildToContainerChildSet = persistence.appendChildToContainerChildSet,
17634
+ finalizeContainerChildren = persistence.finalizeContainerChildren;
17635
+
17636
+ // An unfortunate fork of appendAllChildren because we have two different parent types.
17637
+
17638
+ var appendAllChildrenToContainer = function (containerChildSet, workInProgress) {
17639
+ // We only have the top Fiber that was created but we need recurse down its
17640
+ // children to find all the terminal nodes.
17641
+ var node = workInProgress.child;
17642
+ while (node !== null) {
17643
+ if (node.tag === HostComponent || node.tag === HostText) {
17644
+ appendChildToContainerChildSet(containerChildSet, node.stateNode);
17645
+ } else if (node.tag === HostPortal) {
17646
+ // If we have a portal child, then we don't want to traverse
17647
+ // down its children. Instead, we'll get insertions from each child in
17648
+ // the portal directly.
17649
+ } else if (node.child !== null) {
17650
+ node.child['return'] = node;
17651
+ node = node.child;
17652
+ continue;
17653
+ }
17654
+ if (node === workInProgress) {
17655
+ return;
17656
+ }
17657
+ while (node.sibling === null) {
17658
+ if (node['return'] === null || node['return'] === workInProgress) {
17659
+ return;
17660
+ }
17661
+ node = node['return'];
17662
+ }
17663
+ node.sibling['return'] = node['return'];
17664
+ node = node.sibling;
17665
+ }
17666
+ };
17667
+ updateHostContainer = function (workInProgress) {
17668
+ var portalOrRoot = workInProgress.stateNode;
17669
+ var childrenUnchanged = workInProgress.firstEffect === null;
17670
+ if (childrenUnchanged) {
17671
+ // No changes, just reuse the existing instance.
17672
+ } else {
17673
+ var container = portalOrRoot.containerInfo;
17674
+ var newChildSet = createContainerChildSet(container);
17675
+ if (finalizeContainerChildren(container, newChildSet)) {
17676
+ markUpdate(workInProgress);
17677
+ }
17678
+ portalOrRoot.pendingChildren = newChildSet;
17679
+ // If children might have changed, we have to add them all to the set.
17680
+ appendAllChildrenToContainer(newChildSet, workInProgress);
17681
+ // Schedule an update on the container to swap out the container.
17682
+ markUpdate(workInProgress);
17683
+ }
17684
+ };
17685
+ updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {
17686
+ // If there are no effects associated with this node, then none of our children had any updates.
17687
+ // This guarantees that we can reuse all of them.
17688
+ var childrenUnchanged = workInProgress.firstEffect === null;
17689
+ var currentInstance = current.stateNode;
17690
+ if (childrenUnchanged && updatePayload === null) {
17691
+ // No changes, just reuse the existing instance.
17692
+ // Note that this might release a previous clone.
17693
+ workInProgress.stateNode = currentInstance;
17694
+ } else {
17695
+ var recyclableInstance = workInProgress.stateNode;
17696
+ var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
17697
+ if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance)) {
17698
+ markUpdate(workInProgress);
17699
+ }
17700
+ workInProgress.stateNode = newInstance;
17701
+ if (childrenUnchanged) {
17702
+ // If there are no other effects in this tree, we need to flag this node as having one.
17703
+ // Even though we're not going to use it for anything.
17704
+ // Otherwise parents won't know that there are new children to propagate upwards.
17705
+ markUpdate(workInProgress);
17706
+ } else {
17707
+ // If children might have changed, we have to add them all to the set.
17708
+ appendAllChildren(newInstance, workInProgress);
17709
+ }
17710
+ }
17711
+ };
17712
+ updateHostText = function (current, workInProgress, oldText, newText) {
17713
+ if (oldText !== newText) {
17714
+ // If the text content differs, we'll create a new text instance for it.
17715
+ var rootContainerInstance = getRootHostContainer();
17716
+ var currentHostContext = getHostContext();
17717
+ workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress);
17718
+ // We'll have to mark it as having an effect, even though we won't use the effect for anything.
17719
+ // This lets the parents know that at least one of their children has changed.
17720
+ markUpdate(workInProgress);
17721
+ }
17722
+ };
17723
+ } else {
17724
+ invariant(false, 'Persistent reconciler is disabled.');
17725
+ }
17726
+ } else {
17727
+ if (enableNoopReconciler) {
17728
+ // No host operations
17729
+ updateHostContainer = function (workInProgress) {
17730
+ // Noop
17731
+ };
17732
+ updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {
17733
+ // Noop
17734
+ };
17735
+ updateHostText = function (current, workInProgress, oldText, newText) {
17736
+ // Noop
17737
+ };
17738
+ } else {
17739
+ invariant(false, 'Noop reconciler is disabled.');
17740
+ }
17741
+ }
17742
+
17743
+ function completeWork(current, workInProgress, renderExpirationTime) {
17744
+ // Get the latest props.
17745
+ var newProps = workInProgress.pendingProps;
17746
+ if (newProps === null) {
17747
+ newProps = workInProgress.memoizedProps;
17748
+ } else if (workInProgress.expirationTime !== Never || renderExpirationTime === Never) {
17749
+ // Reset the pending props, unless this was a down-prioritization.
17750
+ workInProgress.pendingProps = null;
17751
+ }
17752
+
17753
+ switch (workInProgress.tag) {
17754
+ case FunctionalComponent:
17755
+ return null;
17756
+ case ClassComponent:
17757
+ {
17758
+ // We are leaving this subtree, so pop context if any.
17759
+ popContextProvider(workInProgress);
17760
+ return null;
17761
+ }
17762
+ case HostRoot:
17763
+ {
17764
+ popHostContainer(workInProgress);
17765
+ popTopLevelContextObject(workInProgress);
17766
+ var fiberRoot = workInProgress.stateNode;
17767
+ if (fiberRoot.pendingContext) {
17768
+ fiberRoot.context = fiberRoot.pendingContext;
17769
+ fiberRoot.pendingContext = null;
17770
+ }
17771
+
17772
+ if (current === null || current.child === null) {
17773
+ // If we hydrated, pop so that we can delete any remaining children
17774
+ // that weren't hydrated.
17775
+ popHydrationState(workInProgress);
17776
+ // This resets the hacky state to fix isMounted before committing.
17777
+ // TODO: Delete this when we delete isMounted and findDOMNode.
17778
+ workInProgress.effectTag &= ~Placement;
17779
+ }
17780
+ updateHostContainer(workInProgress);
17781
+ return null;
17782
+ }
17783
+ case HostComponent:
17784
+ {
17785
+ popHostContext(workInProgress);
17786
+ var rootContainerInstance = getRootHostContainer();
17787
+ var type = workInProgress.type;
17788
+ if (current !== null && workInProgress.stateNode != null) {
17789
+ // If we have an alternate, that means this is an update and we need to
17790
+ // schedule a side-effect to do the updates.
17791
+ var oldProps = current.memoizedProps;
17792
+ // If we get updated because one of our children updated, we don't
17793
+ // have newProps so we'll have to reuse them.
17794
+ // TODO: Split the update API as separate for the props vs. children.
17795
+ // Even better would be if children weren't special cased at all tho.
17796
+ var instance = workInProgress.stateNode;
17797
+ var currentHostContext = getHostContext();
17798
+ var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
17799
+
17800
+ updateHostComponent(current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance);
17801
+
17802
+ if (current.ref !== workInProgress.ref) {
17803
+ markRef(workInProgress);
17804
+ }
17805
+ } else {
17806
+ if (!newProps) {
17807
+ !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17808
+ // This can happen when we abort work.
17809
+ return null;
17810
+ }
17811
+
17812
+ var _currentHostContext = getHostContext();
17813
+ // TODO: Move createInstance to beginWork and keep it on a context
17814
+ // "stack" as the parent. Then append children as we go in beginWork
17815
+ // or completeWork depending on we want to add then top->down or
17816
+ // bottom->up. Top->down is faster in IE11.
17817
+ var wasHydrated = popHydrationState(workInProgress);
17818
+ if (wasHydrated) {
17819
+ // TODO: Move this and createInstance step into the beginPhase
17820
+ // to consolidate.
17821
+ if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, _currentHostContext)) {
17822
+ // If changes to the hydrated node needs to be applied at the
17823
+ // commit-phase we mark this as such.
17824
+ markUpdate(workInProgress);
17825
+ }
17826
+ } else {
17827
+ var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress);
17828
+
17829
+ appendAllChildren(_instance, workInProgress);
17830
+
17831
+ // Certain renderers require commit-time effects for initial mount.
17832
+ // (eg DOM renderer supports auto-focus for certain elements).
17833
+ // Make sure such renderers get scheduled for later work.
17834
+ if (finalizeInitialChildren(_instance, type, newProps, rootContainerInstance)) {
17835
+ markUpdate(workInProgress);
17836
+ }
17837
+ workInProgress.stateNode = _instance;
17838
+ }
17839
+
17840
+ if (workInProgress.ref !== null) {
17841
+ // If there is a ref on a host node we need to schedule a callback
17842
+ markRef(workInProgress);
17843
+ }
17844
+ }
17845
+ return null;
17846
+ }
17847
+ case HostText:
17848
+ {
17849
+ var newText = newProps;
17850
+ if (current && workInProgress.stateNode != null) {
17851
+ var oldText = current.memoizedProps;
17852
+ // If we have an alternate, that means this is an update and we need
17853
+ // to schedule a side-effect to do the updates.
17854
+ updateHostText(current, workInProgress, oldText, newText);
17855
+ } else {
17856
+ if (typeof newText !== 'string') {
17857
+ !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
17858
+ // This can happen when we abort work.
17859
+ return null;
17860
+ }
17861
+ var _rootContainerInstance = getRootHostContainer();
17862
+ var _currentHostContext2 = getHostContext();
17863
+ var _wasHydrated = popHydrationState(workInProgress);
17864
+ if (_wasHydrated) {
17865
+ if (prepareToHydrateHostTextInstance(workInProgress)) {
17866
+ markUpdate(workInProgress);
17867
+ }
17868
+ } else {
17869
+ workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress);
17870
+ }
17871
+ }
17872
+ return null;
17873
+ }
17874
+ case CallComponent:
17875
+ return moveCallToHandlerPhase(current, workInProgress, renderExpirationTime);
17876
+ case CallHandlerPhase:
17877
+ // Reset the tag to now be a first phase call.
17878
+ workInProgress.tag = CallComponent;
17879
+ return null;
17880
+ case ReturnComponent:
17881
+ // Does nothing.
17882
+ return null;
17883
+ case Fragment:
17884
+ return null;
17885
+ case HostPortal:
17886
+ popHostContainer(workInProgress);
17887
+ updateHostContainer(workInProgress);
17888
+ return null;
17889
+ // Error cases
17890
+ case IndeterminateComponent:
17891
+ invariant(false, 'An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.');
17892
+ // eslint-disable-next-line no-fallthrough
17893
+ default:
17894
+ invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
17895
+ }
17896
+ }
17897
+
17898
+ return {
17899
+ completeWork: completeWork
17900
+ };
17901
+ };
17902
+
17903
+ var invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback;
17904
+ var hasCaughtError$1 = ReactErrorUtils.hasCaughtError;
17905
+ var clearCaughtError$1 = ReactErrorUtils.clearCaughtError;
17906
+
17907
+
17908
+ var ReactFiberCommitWork = function (config, captureError) {
17909
+ var getPublicInstance = config.getPublicInstance,
17910
+ mutation = config.mutation,
17911
+ persistence = config.persistence;
17912
+
17913
+
17914
+ var callComponentWillUnmountWithTimer = function (current, instance) {
17915
+ startPhaseTimer(current, 'componentWillUnmount');
17916
+ instance.props = current.memoizedProps;
17917
+ instance.state = current.memoizedState;
17918
+ instance.componentWillUnmount();
17919
+ stopPhaseTimer();
17920
+ };
17921
+
17922
+ // Capture errors so they don't interrupt unmounting.
17923
+ function safelyCallComponentWillUnmount(current, instance) {
17924
+ {
17925
+ invokeGuardedCallback$2(null, callComponentWillUnmountWithTimer, null, current, instance);
17926
+ if (hasCaughtError$1()) {
17927
+ var unmountError = clearCaughtError$1();
17928
+ captureError(current, unmountError);
17929
+ }
17930
+ }
17931
+ }
17932
+
17933
+ function safelyDetachRef(current) {
17934
+ var ref = current.ref;
17935
+ if (ref !== null) {
17936
+ {
17937
+ invokeGuardedCallback$2(null, ref, null, null);
17938
+ if (hasCaughtError$1()) {
17939
+ var refError = clearCaughtError$1();
17940
+ captureError(current, refError);
17941
+ }
17942
+ }
17943
+ }
17944
+ }
17945
+
17946
+ function commitLifeCycles(current, finishedWork) {
17947
+ switch (finishedWork.tag) {
17948
+ case ClassComponent:
17949
+ {
17950
+ var instance = finishedWork.stateNode;
17951
+ if (finishedWork.effectTag & Update) {
17952
+ if (current === null) {
17953
+ startPhaseTimer(finishedWork, 'componentDidMount');
17954
+ instance.props = finishedWork.memoizedProps;
17955
+ instance.state = finishedWork.memoizedState;
17956
+ instance.componentDidMount();
17957
+ stopPhaseTimer();
17958
+ } else {
17959
+ var prevProps = current.memoizedProps;
17960
+ var prevState = current.memoizedState;
17961
+ startPhaseTimer(finishedWork, 'componentDidUpdate');
17962
+ instance.props = finishedWork.memoizedProps;
17963
+ instance.state = finishedWork.memoizedState;
17964
+ instance.componentDidUpdate(prevProps, prevState);
17965
+ stopPhaseTimer();
17966
+ }
17967
+ }
17968
+ var updateQueue = finishedWork.updateQueue;
17969
+ if (updateQueue !== null) {
17970
+ commitCallbacks(updateQueue, instance);
17971
+ }
17972
+ return;
17973
+ }
17974
+ case HostRoot:
17975
+ {
17976
+ var _updateQueue = finishedWork.updateQueue;
17977
+ if (_updateQueue !== null) {
17978
+ var _instance = finishedWork.child !== null ? finishedWork.child.stateNode : null;
17979
+ commitCallbacks(_updateQueue, _instance);
17980
+ }
17981
+ return;
17982
+ }
17983
+ case HostComponent:
17984
+ {
17985
+ var _instance2 = finishedWork.stateNode;
17986
+
17987
+ // Renderers may schedule work to be done after host components are mounted
17988
+ // (eg DOM renderer may schedule auto-focus for inputs and form controls).
17989
+ // These effects should only be committed when components are first mounted,
17990
+ // aka when there is no current/alternate.
17991
+ if (current === null && finishedWork.effectTag & Update) {
17992
+ var type = finishedWork.type;
17993
+ var props = finishedWork.memoizedProps;
17994
+ commitMount(_instance2, type, props, finishedWork);
17995
+ }
17996
+
17997
+ return;
17998
+ }
17999
+ case HostText:
18000
+ {
18001
+ // We have no life-cycles associated with text.
18002
+ return;
18003
+ }
18004
+ case HostPortal:
18005
+ {
18006
+ // We have no life-cycles associated with portals.
18007
+ return;
18008
+ }
18009
+ default:
18010
+ {
18011
+ invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
18012
+ }
18013
+ }
18014
+ }
18015
+
18016
+ function commitAttachRef(finishedWork) {
18017
+ var ref = finishedWork.ref;
18018
+ if (ref !== null) {
18019
+ var instance = finishedWork.stateNode;
18020
+ switch (finishedWork.tag) {
18021
+ case HostComponent:
18022
+ ref(getPublicInstance(instance));
18023
+ break;
18024
+ default:
18025
+ ref(instance);
18026
+ }
18027
+ }
18028
+ }
18029
+
18030
+ function commitDetachRef(current) {
18031
+ var currentRef = current.ref;
18032
+ if (currentRef !== null) {
18033
+ currentRef(null);
18034
+ }
18035
+ }
18036
+
18037
+ // User-originating errors (lifecycles and refs) should not interrupt
18038
+ // deletion, so don't let them throw. Host-originating errors should
18039
+ // interrupt deletion, so it's okay
18040
+ function commitUnmount(current) {
18041
+ if (typeof onCommitUnmount === 'function') {
18042
+ onCommitUnmount(current);
18043
+ }
18044
+
18045
+ switch (current.tag) {
18046
+ case ClassComponent:
18047
+ {
18048
+ safelyDetachRef(current);
18049
+ var instance = current.stateNode;
18050
+ if (typeof instance.componentWillUnmount === 'function') {
18051
+ safelyCallComponentWillUnmount(current, instance);
18052
+ }
18053
+ return;
18054
+ }
18055
+ case HostComponent:
18056
+ {
18057
+ safelyDetachRef(current);
18058
+ return;
18059
+ }
18060
+ case CallComponent:
18061
+ {
18062
+ commitNestedUnmounts(current.stateNode);
18063
+ return;
18064
+ }
18065
+ case HostPortal:
18066
+ {
18067
+ // TODO: this is recursive.
18068
+ // We are also not using this parent because
18069
+ // the portal will get pushed immediately.
18070
+ if (enableMutatingReconciler && mutation) {
18071
+ unmountHostComponents(current);
18072
+ } else if (enablePersistentReconciler && persistence) {
18073
+ emptyPortalContainer(current);
18074
+ }
18075
+ return;
18076
+ }
18077
+ }
18078
+ }
18079
+
18080
+ function commitNestedUnmounts(root) {
18081
+ // While we're inside a removed host node we don't want to call
18082
+ // removeChild on the inner nodes because they're removed by the top
18083
+ // call anyway. We also want to call componentWillUnmount on all
18084
+ // composites before this host node is removed from the tree. Therefore
18085
+ var node = root;
18086
+ while (true) {
18087
+ commitUnmount(node);
18088
+ // Visit children because they may contain more composite or host nodes.
18089
+ // Skip portals because commitUnmount() currently visits them recursively.
18090
+ if (node.child !== null && (
18091
+ // If we use mutation we drill down into portals using commitUnmount above.
18092
+ // If we don't use mutation we drill down into portals here instead.
18093
+ !mutation || node.tag !== HostPortal)) {
18094
+ node.child['return'] = node;
18095
+ node = node.child;
18096
+ continue;
18097
+ }
18098
+ if (node === root) {
18099
+ return;
18100
+ }
18101
+ while (node.sibling === null) {
18102
+ if (node['return'] === null || node['return'] === root) {
18103
+ return;
18104
+ }
18105
+ node = node['return'];
18106
+ }
18107
+ node.sibling['return'] = node['return'];
18108
+ node = node.sibling;
18109
+ }
18110
+ }
18111
+
18112
+ function detachFiber(current) {
18113
+ // Cut off the return pointers to disconnect it from the tree. Ideally, we
18114
+ // should clear the child pointer of the parent alternate to let this
18115
+ // get GC:ed but we don't know which for sure which parent is the current
18116
+ // one so we'll settle for GC:ing the subtree of this child. This child
18117
+ // itself will be GC:ed when the parent updates the next time.
18118
+ current['return'] = null;
18119
+ current.child = null;
18120
+ if (current.alternate) {
18121
+ current.alternate.child = null;
18122
+ current.alternate['return'] = null;
18123
+ }
18124
+ }
18125
+
18126
+ if (!mutation) {
18127
+ var commitContainer = void 0;
18128
+ if (persistence) {
18129
+ var replaceContainerChildren = persistence.replaceContainerChildren,
18130
+ createContainerChildSet = persistence.createContainerChildSet;
18131
+
18132
+ var emptyPortalContainer = function (current) {
18133
+ var portal = current.stateNode;
18134
+ var containerInfo = portal.containerInfo;
18135
+
18136
+ var emptyChildSet = createContainerChildSet(containerInfo);
18137
+ replaceContainerChildren(containerInfo, emptyChildSet);
18138
+ };
18139
+ commitContainer = function (finishedWork) {
18140
+ switch (finishedWork.tag) {
18141
+ case ClassComponent:
18142
+ {
18143
+ return;
18144
+ }
18145
+ case HostComponent:
18146
+ {
18147
+ return;
18148
+ }
18149
+ case HostText:
18150
+ {
18151
+ return;
18152
+ }
18153
+ case HostRoot:
18154
+ case HostPortal:
18155
+ {
18156
+ var portalOrRoot = finishedWork.stateNode;
18157
+ var containerInfo = portalOrRoot.containerInfo,
18158
+ _pendingChildren = portalOrRoot.pendingChildren;
18159
+
18160
+ replaceContainerChildren(containerInfo, _pendingChildren);
18161
+ return;
18162
+ }
18163
+ default:
18164
+ {
18165
+ invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
18166
+ }
18167
+ }
18168
+ };
18169
+ } else {
18170
+ commitContainer = function (finishedWork) {
18171
+ // Noop
18172
+ };
18173
+ }
18174
+ if (enablePersistentReconciler || enableNoopReconciler) {
18175
+ return {
18176
+ commitResetTextContent: function (finishedWork) {},
18177
+ commitPlacement: function (finishedWork) {},
18178
+ commitDeletion: function (current) {
18179
+ // Detach refs and call componentWillUnmount() on the whole subtree.
18180
+ commitNestedUnmounts(current);
18181
+ detachFiber(current);
18182
+ },
18183
+ commitWork: function (current, finishedWork) {
18184
+ commitContainer(finishedWork);
18185
+ },
18186
+
18187
+ commitLifeCycles: commitLifeCycles,
18188
+ commitAttachRef: commitAttachRef,
18189
+ commitDetachRef: commitDetachRef
18190
+ };
18191
+ } else if (persistence) {
18192
+ invariant(false, 'Persistent reconciler is disabled.');
18193
+ } else {
18194
+ invariant(false, 'Noop reconciler is disabled.');
18195
+ }
18196
+ }
18197
+ var commitMount = mutation.commitMount,
18198
+ commitUpdate = mutation.commitUpdate,
18199
+ resetTextContent = mutation.resetTextContent,
18200
+ commitTextUpdate = mutation.commitTextUpdate,
18201
+ appendChild = mutation.appendChild,
18202
+ appendChildToContainer = mutation.appendChildToContainer,
18203
+ insertBefore = mutation.insertBefore,
18204
+ insertInContainerBefore = mutation.insertInContainerBefore,
18205
+ removeChild = mutation.removeChild,
18206
+ removeChildFromContainer = mutation.removeChildFromContainer;
18207
+
18208
+
18209
+ function getHostParentFiber(fiber) {
18210
+ var parent = fiber['return'];
18211
+ while (parent !== null) {
18212
+ if (isHostParent(parent)) {
18213
+ return parent;
18214
+ }
18215
+ parent = parent['return'];
18216
+ }
18217
+ invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.');
18218
+ }
18219
+
18220
+ function isHostParent(fiber) {
18221
+ return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
18222
+ }
18223
+
18224
+ function getHostSibling(fiber) {
18225
+ // We're going to search forward into the tree until we find a sibling host
18226
+ // node. Unfortunately, if multiple insertions are done in a row we have to
18227
+ // search past them. This leads to exponential search for the next sibling.
18228
+ var node = fiber;
18229
+ siblings: while (true) {
18230
+ // If we didn't find anything, let's try the next sibling.
18231
+ while (node.sibling === null) {
18232
+ if (node['return'] === null || isHostParent(node['return'])) {
18233
+ // If we pop out of the root or hit the parent the fiber we are the
18234
+ // last sibling.
18235
+ return null;
18236
+ }
18237
+ node = node['return'];
18238
+ }
18239
+ node.sibling['return'] = node['return'];
18240
+ node = node.sibling;
18241
+ while (node.tag !== HostComponent && node.tag !== HostText) {
18242
+ // If it is not host node and, we might have a host node inside it.
18243
+ // Try to search down until we find one.
18244
+ if (node.effectTag & Placement) {
18245
+ // If we don't have a child, try the siblings instead.
18246
+ continue siblings;
18247
+ }
18248
+ // If we don't have a child, try the siblings instead.
18249
+ // We also skip portals because they are not part of this host tree.
18250
+ if (node.child === null || node.tag === HostPortal) {
18251
+ continue siblings;
18252
+ } else {
18253
+ node.child['return'] = node;
18254
+ node = node.child;
18255
+ }
18256
+ }
18257
+ // Check if this host node is stable or about to be placed.
18258
+ if (!(node.effectTag & Placement)) {
18259
+ // Found it!
18260
+ return node.stateNode;
18261
+ }
18262
+ }
18263
+ }
18264
+
18265
+ function commitPlacement(finishedWork) {
18266
+ // Recursively insert all host nodes into the parent.
18267
+ var parentFiber = getHostParentFiber(finishedWork);
18268
+ var parent = void 0;
18269
+ var isContainer = void 0;
18270
+ switch (parentFiber.tag) {
18271
+ case HostComponent:
18272
+ parent = parentFiber.stateNode;
18273
+ isContainer = false;
18274
+ break;
18275
+ case HostRoot:
18276
+ parent = parentFiber.stateNode.containerInfo;
18277
+ isContainer = true;
18278
+ break;
18279
+ case HostPortal:
18280
+ parent = parentFiber.stateNode.containerInfo;
18281
+ isContainer = true;
18282
+ break;
18283
+ default:
18284
+ invariant(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.');
18285
+ }
18286
+ if (parentFiber.effectTag & ContentReset) {
18287
+ // Reset the text content of the parent before doing any insertions
18288
+ resetTextContent(parent);
18289
+ // Clear ContentReset from the effect tag
18290
+ parentFiber.effectTag &= ~ContentReset;
18291
+ }
18292
+
18293
+ var before = getHostSibling(finishedWork);
18294
+ // We only have the top Fiber that was inserted but we need recurse down its
18295
+ // children to find all the terminal nodes.
18296
+ var node = finishedWork;
18297
+ while (true) {
18298
+ if (node.tag === HostComponent || node.tag === HostText) {
18299
+ if (before) {
18300
+ if (isContainer) {
18301
+ insertInContainerBefore(parent, node.stateNode, before);
18302
+ } else {
18303
+ insertBefore(parent, node.stateNode, before);
18304
+ }
18305
+ } else {
18306
+ if (isContainer) {
18307
+ appendChildToContainer(parent, node.stateNode);
18308
+ } else {
18309
+ appendChild(parent, node.stateNode);
18310
+ }
18311
+ }
18312
+ } else if (node.tag === HostPortal) {
18313
+ // If the insertion itself is a portal, then we don't want to traverse
18314
+ // down its children. Instead, we'll get insertions from each child in
18315
+ // the portal directly.
18316
+ } else if (node.child !== null) {
18317
+ node.child['return'] = node;
18318
+ node = node.child;
18319
+ continue;
18320
+ }
18321
+ if (node === finishedWork) {
18322
+ return;
18323
+ }
18324
+ while (node.sibling === null) {
18325
+ if (node['return'] === null || node['return'] === finishedWork) {
18326
+ return;
18327
+ }
18328
+ node = node['return'];
18329
+ }
18330
+ node.sibling['return'] = node['return'];
18331
+ node = node.sibling;
18332
+ }
18333
+ }
18334
+
18335
+ function unmountHostComponents(current) {
18336
+ // We only have the top Fiber that was inserted but we need recurse down its
18337
+ var node = current;
18338
+
18339
+ // Each iteration, currentParent is populated with node's host parent if not
18340
+ // currentParentIsValid.
18341
+ var currentParentIsValid = false;
18342
+ var currentParent = void 0;
18343
+ var currentParentIsContainer = void 0;
18344
+
18345
+ while (true) {
18346
+ if (!currentParentIsValid) {
18347
+ var parent = node['return'];
18348
+ findParent: while (true) {
18349
+ !(parent !== null) ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
18350
+ switch (parent.tag) {
18351
+ case HostComponent:
18352
+ currentParent = parent.stateNode;
18353
+ currentParentIsContainer = false;
18354
+ break findParent;
18355
+ case HostRoot:
18356
+ currentParent = parent.stateNode.containerInfo;
18357
+ currentParentIsContainer = true;
18358
+ break findParent;
18359
+ case HostPortal:
18360
+ currentParent = parent.stateNode.containerInfo;
18361
+ currentParentIsContainer = true;
18362
+ break findParent;
18363
+ }
18364
+ parent = parent['return'];
18365
+ }
18366
+ currentParentIsValid = true;
18367
+ }
18368
+
18369
+ if (node.tag === HostComponent || node.tag === HostText) {
18370
+ commitNestedUnmounts(node);
18371
+ // After all the children have unmounted, it is now safe to remove the
18372
+ // node from the tree.
18373
+ if (currentParentIsContainer) {
18374
+ removeChildFromContainer(currentParent, node.stateNode);
18375
+ } else {
18376
+ removeChild(currentParent, node.stateNode);
18377
+ }
18378
+ // Don't visit children because we already visited them.
18379
+ } else if (node.tag === HostPortal) {
18380
+ // When we go into a portal, it becomes the parent to remove from.
18381
+ // We will reassign it back when we pop the portal on the way up.
18382
+ currentParent = node.stateNode.containerInfo;
18383
+ // Visit children because portals might contain host components.
18384
+ if (node.child !== null) {
18385
+ node.child['return'] = node;
18386
+ node = node.child;
18387
+ continue;
18388
+ }
18389
+ } else {
18390
+ commitUnmount(node);
18391
+ // Visit children because we may find more host components below.
18392
+ if (node.child !== null) {
18393
+ node.child['return'] = node;
18394
+ node = node.child;
18395
+ continue;
18396
+ }
18397
+ }
18398
+ if (node === current) {
18399
+ return;
18400
+ }
18401
+ while (node.sibling === null) {
18402
+ if (node['return'] === null || node['return'] === current) {
18403
+ return;
18404
+ }
18405
+ node = node['return'];
18406
+ if (node.tag === HostPortal) {
18407
+ // When we go out of the portal, we need to restore the parent.
18408
+ // Since we don't keep a stack of them, we will search for it.
18409
+ currentParentIsValid = false;
18410
+ }
18411
+ }
18412
+ node.sibling['return'] = node['return'];
18413
+ node = node.sibling;
18414
+ }
18415
+ }
18416
+
18417
+ function commitDeletion(current) {
18418
+ // Recursively delete all host nodes from the parent.
18419
+ // Detach refs and call componentWillUnmount() on the whole subtree.
18420
+ unmountHostComponents(current);
18421
+ detachFiber(current);
18422
+ }
18423
+
18424
+ function commitWork(current, finishedWork) {
18425
+ switch (finishedWork.tag) {
18426
+ case ClassComponent:
18427
+ {
18428
+ return;
18429
+ }
18430
+ case HostComponent:
18431
+ {
18432
+ var instance = finishedWork.stateNode;
18433
+ if (instance != null) {
18434
+ // Commit the work prepared earlier.
18435
+ var newProps = finishedWork.memoizedProps;
18436
+ // For hydration we reuse the update path but we treat the oldProps
18437
+ // as the newProps. The updatePayload will contain the real change in
18438
+ // this case.
18439
+ var oldProps = current !== null ? current.memoizedProps : newProps;
18440
+ var type = finishedWork.type;
18441
+ // TODO: Type the updateQueue to be specific to host components.
18442
+ var updatePayload = finishedWork.updateQueue;
18443
+ finishedWork.updateQueue = null;
18444
+ if (updatePayload !== null) {
18445
+ commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
18446
+ }
18447
+ }
18448
+ return;
18449
+ }
18450
+ case HostText:
18451
+ {
18452
+ !(finishedWork.stateNode !== null) ? invariant(false, 'This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.') : void 0;
18453
+ var textInstance = finishedWork.stateNode;
18454
+ var newText = finishedWork.memoizedProps;
18455
+ // For hydration we reuse the update path but we treat the oldProps
18456
+ // as the newProps. The updatePayload will contain the real change in
18457
+ // this case.
18458
+ var oldText = current !== null ? current.memoizedProps : newText;
18459
+ commitTextUpdate(textInstance, oldText, newText);
18460
+ return;
18461
+ }
18462
+ case HostRoot:
18463
+ {
18464
+ return;
18465
+ }
18466
+ default:
18467
+ {
18468
+ invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
18469
+ }
18470
+ }
18471
+ }
18472
+
18473
+ function commitResetTextContent(current) {
18474
+ resetTextContent(current.stateNode);
18475
+ }
18476
+
18477
+ if (enableMutatingReconciler) {
18478
+ return {
18479
+ commitResetTextContent: commitResetTextContent,
18480
+ commitPlacement: commitPlacement,
18481
+ commitDeletion: commitDeletion,
18482
+ commitWork: commitWork,
18483
+ commitLifeCycles: commitLifeCycles,
18484
+ commitAttachRef: commitAttachRef,
18485
+ commitDetachRef: commitDetachRef
18486
+ };
18487
+ } else {
18488
+ invariant(false, 'Mutating reconciler is disabled.');
18489
+ }
18490
+ };
18491
+
18492
+ var NO_CONTEXT = {};
18493
+
18494
+ var ReactFiberHostContext = function (config) {
18495
+ var getChildHostContext = config.getChildHostContext,
18496
+ getRootHostContext = config.getRootHostContext;
18497
+
18498
+
18499
+ var contextStackCursor = createCursor(NO_CONTEXT);
18500
+ var contextFiberStackCursor = createCursor(NO_CONTEXT);
18501
+ var rootInstanceStackCursor = createCursor(NO_CONTEXT);
18502
+
18503
+ function requiredContext(c) {
18504
+ !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0;
18505
+ return c;
18506
+ }
18507
+
18508
+ function getRootHostContainer() {
18509
+ var rootInstance = requiredContext(rootInstanceStackCursor.current);
18510
+ return rootInstance;
18511
+ }
18512
+
18513
+ function pushHostContainer(fiber, nextRootInstance) {
18514
+ // Push current root instance onto the stack;
18515
+ // This allows us to reset root when portals are popped.
18516
+ push(rootInstanceStackCursor, nextRootInstance, fiber);
18517
+
18518
+ var nextRootContext = getRootHostContext(nextRootInstance);
18519
+
18520
+ // Track the context and the Fiber that provided it.
18521
+ // This enables us to pop only Fibers that provide unique contexts.
18522
+ push(contextFiberStackCursor, fiber, fiber);
18523
+ push(contextStackCursor, nextRootContext, fiber);
18524
+ }
18525
+
18526
+ function popHostContainer(fiber) {
18527
+ pop(contextStackCursor, fiber);
18528
+ pop(contextFiberStackCursor, fiber);
18529
+ pop(rootInstanceStackCursor, fiber);
18530
+ }
18531
+
18532
+ function getHostContext() {
18533
+ var context = requiredContext(contextStackCursor.current);
18534
+ return context;
18535
+ }
18536
+
18537
+ function pushHostContext(fiber) {
18538
+ var rootInstance = requiredContext(rootInstanceStackCursor.current);
18539
+ var context = requiredContext(contextStackCursor.current);
18540
+ var nextContext = getChildHostContext(context, fiber.type, rootInstance);
18541
+
18542
+ // Don't push this Fiber's context unless it's unique.
18543
+ if (context === nextContext) {
18544
+ return;
18545
+ }
18546
+
18547
+ // Track the context and the Fiber that provided it.
18548
+ // This enables us to pop only Fibers that provide unique contexts.
18549
+ push(contextFiberStackCursor, fiber, fiber);
18550
+ push(contextStackCursor, nextContext, fiber);
18551
+ }
18552
+
18553
+ function popHostContext(fiber) {
18554
+ // Do not pop unless this Fiber provided the current context.
18555
+ // pushHostContext() only pushes Fibers that provide unique contexts.
18556
+ if (contextFiberStackCursor.current !== fiber) {
18557
+ return;
18558
+ }
18559
+
18560
+ pop(contextStackCursor, fiber);
18561
+ pop(contextFiberStackCursor, fiber);
18562
+ }
18563
+
18564
+ function resetHostContainer() {
18565
+ contextStackCursor.current = NO_CONTEXT;
18566
+ rootInstanceStackCursor.current = NO_CONTEXT;
18567
+ }
18568
+
18569
+ return {
18570
+ getHostContext: getHostContext,
18571
+ getRootHostContainer: getRootHostContainer,
18572
+ popHostContainer: popHostContainer,
18573
+ popHostContext: popHostContext,
18574
+ pushHostContainer: pushHostContainer,
18575
+ pushHostContext: pushHostContext,
18576
+ resetHostContainer: resetHostContainer
18577
+ };
18578
+ };
18579
+
18580
+ var ReactFiberHydrationContext = function (config) {
18581
+ var shouldSetTextContent = config.shouldSetTextContent,
18582
+ hydration = config.hydration;
18583
+
18584
+ // If this doesn't have hydration mode.
18585
+
18586
+ if (!hydration) {
18587
+ return {
18588
+ enterHydrationState: function () {
18589
+ return false;
18590
+ },
18591
+ resetHydrationState: function () {},
18592
+ tryToClaimNextHydratableInstance: function () {},
18593
+ prepareToHydrateHostInstance: function () {
18594
+ invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
18595
+ },
18596
+ prepareToHydrateHostTextInstance: function () {
18597
+ invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
18598
+ },
18599
+ popHydrationState: function (fiber) {
18600
+ return false;
18601
+ }
18602
+ };
18603
+ }
18604
+
18605
+ var canHydrateInstance = hydration.canHydrateInstance,
18606
+ canHydrateTextInstance = hydration.canHydrateTextInstance,
18607
+ getNextHydratableSibling = hydration.getNextHydratableSibling,
18608
+ getFirstHydratableChild = hydration.getFirstHydratableChild,
18609
+ hydrateInstance = hydration.hydrateInstance,
18610
+ hydrateTextInstance = hydration.hydrateTextInstance,
18611
+ didNotMatchHydratedContainerTextInstance = hydration.didNotMatchHydratedContainerTextInstance,
18612
+ didNotMatchHydratedTextInstance = hydration.didNotMatchHydratedTextInstance,
18613
+ didNotHydrateContainerInstance = hydration.didNotHydrateContainerInstance,
18614
+ didNotHydrateInstance = hydration.didNotHydrateInstance,
18615
+ didNotFindHydratableContainerInstance = hydration.didNotFindHydratableContainerInstance,
18616
+ didNotFindHydratableContainerTextInstance = hydration.didNotFindHydratableContainerTextInstance,
18617
+ didNotFindHydratableInstance = hydration.didNotFindHydratableInstance,
18618
+ didNotFindHydratableTextInstance = hydration.didNotFindHydratableTextInstance;
18619
+
18620
+ // The deepest Fiber on the stack involved in a hydration context.
18621
+ // This may have been an insertion or a hydration.
18622
+
18623
+ var hydrationParentFiber = null;
18624
+ var nextHydratableInstance = null;
18625
+ var isHydrating = false;
18626
+
18627
+ function enterHydrationState(fiber) {
18628
+ var parentInstance = fiber.stateNode.containerInfo;
18629
+ nextHydratableInstance = getFirstHydratableChild(parentInstance);
18630
+ hydrationParentFiber = fiber;
18631
+ isHydrating = true;
18632
+ return true;
18633
+ }
18634
+
18635
+ function deleteHydratableInstance(returnFiber, instance) {
18636
+ {
18637
+ switch (returnFiber.tag) {
18638
+ case HostRoot:
18639
+ didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
18640
+ break;
18641
+ case HostComponent:
18642
+ didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
18643
+ break;
18644
+ }
18645
+ }
18646
+
18647
+ var childToDelete = createFiberFromHostInstanceForDeletion();
18648
+ childToDelete.stateNode = instance;
18649
+ childToDelete['return'] = returnFiber;
18650
+ childToDelete.effectTag = Deletion;
18651
+
18652
+ // This might seem like it belongs on progressedFirstDeletion. However,
18653
+ // these children are not part of the reconciliation list of children.
18654
+ // Even if we abort and rereconcile the children, that will try to hydrate
18655
+ // again and the nodes are still in the host tree so these will be
18656
+ // recreated.
18657
+ if (returnFiber.lastEffect !== null) {
18658
+ returnFiber.lastEffect.nextEffect = childToDelete;
18659
+ returnFiber.lastEffect = childToDelete;
18660
+ } else {
18661
+ returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
18662
+ }
18663
+ }
18664
+
18665
+ function insertNonHydratedInstance(returnFiber, fiber) {
18666
+ fiber.effectTag |= Placement;
18667
+ {
18668
+ switch (returnFiber.tag) {
18669
+ case HostRoot:
18670
+ {
18671
+ var parentContainer = returnFiber.stateNode.containerInfo;
18672
+ switch (fiber.tag) {
18673
+ case HostComponent:
18674
+ var type = fiber.type;
18675
+ var props = fiber.pendingProps;
18676
+ didNotFindHydratableContainerInstance(parentContainer, type, props);
18677
+ break;
18678
+ case HostText:
18679
+ var text = fiber.pendingProps;
18680
+ didNotFindHydratableContainerTextInstance(parentContainer, text);
18681
+ break;
18682
+ }
18683
+ break;
18684
+ }
18685
+ case HostComponent:
18686
+ {
18687
+ var parentType = returnFiber.type;
18688
+ var parentProps = returnFiber.memoizedProps;
18689
+ var parentInstance = returnFiber.stateNode;
18690
+ switch (fiber.tag) {
18691
+ case HostComponent:
18692
+ var _type = fiber.type;
18693
+ var _props = fiber.pendingProps;
18694
+ didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
18695
+ break;
18696
+ case HostText:
18697
+ var _text = fiber.pendingProps;
18698
+ didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
18699
+ break;
18700
+ }
18701
+ break;
18702
+ }
18703
+ default:
18704
+ return;
18705
+ }
18706
+ }
18707
+ }
18708
+
18709
+ function tryHydrate(fiber, nextInstance) {
18710
+ switch (fiber.tag) {
18711
+ case HostComponent:
18712
+ {
18713
+ var type = fiber.type;
18714
+ var props = fiber.pendingProps;
18715
+ var instance = canHydrateInstance(nextInstance, type, props);
18716
+ if (instance !== null) {
18717
+ fiber.stateNode = instance;
18718
+ return true;
18719
+ }
18720
+ return false;
18721
+ }
18722
+ case HostText:
18723
+ {
18724
+ var text = fiber.pendingProps;
18725
+ var textInstance = canHydrateTextInstance(nextInstance, text);
18726
+ if (textInstance !== null) {
18727
+ fiber.stateNode = textInstance;
18728
+ return true;
18729
+ }
18730
+ return false;
18731
+ }
18732
+ default:
18733
+ return false;
18734
+ }
18735
+ }
18736
+
18737
+ function tryToClaimNextHydratableInstance(fiber) {
18738
+ if (!isHydrating) {
18739
+ return;
18740
+ }
18741
+ var nextInstance = nextHydratableInstance;
18742
+ if (!nextInstance) {
18743
+ // Nothing to hydrate. Make it an insertion.
18744
+ insertNonHydratedInstance(hydrationParentFiber, fiber);
18745
+ isHydrating = false;
18746
+ hydrationParentFiber = fiber;
18747
+ return;
18748
+ }
18749
+ if (!tryHydrate(fiber, nextInstance)) {
18750
+ // If we can't hydrate this instance let's try the next one.
18751
+ // We use this as a heuristic. It's based on intuition and not data so it
18752
+ // might be flawed or unnecessary.
18753
+ nextInstance = getNextHydratableSibling(nextInstance);
18754
+ if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
18755
+ // Nothing to hydrate. Make it an insertion.
18756
+ insertNonHydratedInstance(hydrationParentFiber, fiber);
18757
+ isHydrating = false;
18758
+ hydrationParentFiber = fiber;
18759
+ return;
18760
+ }
18761
+ // We matched the next one, we'll now assume that the first one was
18762
+ // superfluous and we'll delete it. Since we can't eagerly delete it
18763
+ // we'll have to schedule a deletion. To do that, this node needs a dummy
18764
+ // fiber associated with it.
18765
+ deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);
18766
+ }
18767
+ hydrationParentFiber = fiber;
18768
+ nextHydratableInstance = getFirstHydratableChild(nextInstance);
18769
+ }
18770
+
18771
+ function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
18772
+ var instance = fiber.stateNode;
18773
+ var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
18774
+ // TODO: Type this specific to this type of component.
18775
+ fiber.updateQueue = updatePayload;
18776
+ // If the update payload indicates that there is a change or if there
18777
+ // is a new ref we mark this as an update.
18778
+ if (updatePayload !== null) {
18779
+ return true;
18780
+ }
18781
+ return false;
18782
+ }
18783
+
18784
+ function prepareToHydrateHostTextInstance(fiber) {
18785
+ var textInstance = fiber.stateNode;
18786
+ var textContent = fiber.memoizedProps;
18787
+ var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
18788
+ {
18789
+ if (shouldUpdate) {
18790
+ // We assume that prepareToHydrateHostTextInstance is called in a context where the
18791
+ // hydration parent is the parent host component of this host text.
18792
+ var returnFiber = hydrationParentFiber;
18793
+ if (returnFiber !== null) {
18794
+ switch (returnFiber.tag) {
18795
+ case HostRoot:
18796
+ {
18797
+ var parentContainer = returnFiber.stateNode.containerInfo;
18798
+ didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
18799
+ break;
18800
+ }
18801
+ case HostComponent:
18802
+ {
18803
+ var parentType = returnFiber.type;
18804
+ var parentProps = returnFiber.memoizedProps;
18805
+ var parentInstance = returnFiber.stateNode;
18806
+ didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
18807
+ break;
18808
+ }
18809
+ }
18810
+ }
18811
+ }
18812
+ }
18813
+ return shouldUpdate;
18814
+ }
18815
+
18816
+ function popToNextHostParent(fiber) {
18817
+ var parent = fiber['return'];
18818
+ while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) {
18819
+ parent = parent['return'];
18820
+ }
18821
+ hydrationParentFiber = parent;
18822
+ }
18823
+
18824
+ function popHydrationState(fiber) {
18825
+ if (fiber !== hydrationParentFiber) {
18826
+ // We're deeper than the current hydration context, inside an inserted
18827
+ // tree.
18828
+ return false;
18829
+ }
18830
+ if (!isHydrating) {
18831
+ // If we're not currently hydrating but we're in a hydration context, then
18832
+ // we were an insertion and now need to pop up reenter hydration of our
18833
+ // siblings.
18834
+ popToNextHostParent(fiber);
18835
+ isHydrating = true;
18836
+ return false;
18837
+ }
18838
+
18839
+ var type = fiber.type;
18840
+
18841
+ // If we have any remaining hydratable nodes, we need to delete them now.
18842
+ // We only do this deeper than head and body since they tend to have random
18843
+ // other nodes in them. We also ignore components with pure text content in
18844
+ // side of them.
18845
+ // TODO: Better heuristic.
18846
+ if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
18847
+ var nextInstance = nextHydratableInstance;
18848
+ while (nextInstance) {
18849
+ deleteHydratableInstance(fiber, nextInstance);
18850
+ nextInstance = getNextHydratableSibling(nextInstance);
18851
+ }
18852
+ }
18853
+
18854
+ popToNextHostParent(fiber);
18855
+ nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
18856
+ return true;
18857
+ }
18858
+
18859
+ function resetHydrationState() {
18860
+ hydrationParentFiber = null;
18861
+ nextHydratableInstance = null;
18862
+ isHydrating = false;
18863
+ }
18864
+
18865
+ return {
18866
+ enterHydrationState: enterHydrationState,
18867
+ resetHydrationState: resetHydrationState,
18868
+ tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance,
18869
+ prepareToHydrateHostInstance: prepareToHydrateHostInstance,
18870
+ prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,
18871
+ popHydrationState: popHydrationState
18872
+ };
18873
+ };
18874
+
18875
+ // This lets us hook into Fiber to debug what it's doing.
18876
+ // See https://github.com/facebook/react/pull/8033.
18877
+ // This is not part of the public API, not even for React DevTools.
18878
+ // You may only inject a debugTool if you work on React Fiber itself.
18879
+ var ReactFiberInstrumentation = {
18880
+ debugTool: null
18881
+ };
18882
+
18883
+ var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;
18884
+
18885
+ var defaultShowDialog = function (capturedError) {
18886
+ return true;
18887
+ };
18888
+
18889
+ var showDialog = defaultShowDialog;
18890
+
18891
+ function logCapturedError(capturedError) {
18892
+ var logError = showDialog(capturedError);
18893
+
18894
+ // Allow injected showDialog() to prevent default console.error logging.
18895
+ // This enables renderers like ReactNative to better manage redbox behavior.
18896
+ if (logError === false) {
18897
+ return;
18898
+ }
18899
+
18900
+ var error = capturedError.error;
18901
+ var suppressLogging = error && error.suppressReactErrorLogging;
18902
+ if (suppressLogging) {
18903
+ return;
18904
+ }
18905
+
18906
+ {
18907
+ var componentName = capturedError.componentName,
18908
+ componentStack = capturedError.componentStack,
18909
+ errorBoundaryName = capturedError.errorBoundaryName,
18910
+ errorBoundaryFound = capturedError.errorBoundaryFound,
18911
+ willRetry = capturedError.willRetry;
18912
+
18913
+
18914
+ var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:';
18915
+
18916
+ var errorBoundaryMessage = void 0;
18917
+ // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
18918
+ if (errorBoundaryFound && errorBoundaryName) {
18919
+ if (willRetry) {
18920
+ errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');
18921
+ } else {
18922
+ errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\n' + 'Recreating the tree from scratch failed so React will unmount the tree.';
18923
+ }
18924
+ } else {
18925
+ errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
18926
+ }
18927
+ var combinedMessage = '' + componentNameMessage + componentStack + '\n\n' + ('' + errorBoundaryMessage);
18928
+
18929
+ // In development, we provide our own message with just the component stack.
18930
+ // We don't include the original error message and JS stack because the browser
18931
+ // has already printed it. Even if the application swallows the error, it is still
18932
+ // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
18933
+ console.error(combinedMessage);
18934
+ }
18935
+ }
18936
+
18937
+ var invokeGuardedCallback$1 = ReactErrorUtils.invokeGuardedCallback;
18938
+ var hasCaughtError = ReactErrorUtils.hasCaughtError;
18939
+ var clearCaughtError = ReactErrorUtils.clearCaughtError;
18940
+
18941
+
18942
+ {
18943
+ var didWarnAboutStateTransition = false;
18944
+ var didWarnSetStateChildContext = false;
18945
+ var didWarnStateUpdateForUnmountedComponent = {};
18946
+
18947
+ var warnAboutUpdateOnUnmounted = function (fiber) {
18948
+ var componentName = getComponentName(fiber) || 'ReactClass';
18949
+ if (didWarnStateUpdateForUnmountedComponent[componentName]) {
18950
+ return;
18951
+ }
18952
+ warning(false, 'Can only update a mounted or mounting ' + 'component. This usually means you called setState, replaceState, ' + 'or forceUpdate on an unmounted component. This is a no-op.\n\nPlease ' + 'check the code for the %s component.', componentName);
18953
+ didWarnStateUpdateForUnmountedComponent[componentName] = true;
18954
+ };
18955
+
18956
+ var warnAboutInvalidUpdates = function (instance) {
18957
+ switch (ReactDebugCurrentFiber.phase) {
18958
+ case 'getChildContext':
18959
+ if (didWarnSetStateChildContext) {
18960
+ return;
18961
+ }
18962
+ warning(false, 'setState(...): Cannot call setState() inside getChildContext()');
18963
+ didWarnSetStateChildContext = true;
18964
+ break;
18965
+ case 'render':
18966
+ if (didWarnAboutStateTransition) {
18967
+ return;
18968
+ }
18969
+ warning(false, 'Cannot update during an existing state transition (such as within ' + "`render` or another component's constructor). Render methods should " + 'be a pure function of props and state; constructor side-effects are ' + 'an anti-pattern, but can be moved to `componentWillMount`.');
18970
+ didWarnAboutStateTransition = true;
18971
+ break;
18972
+ }
18973
+ };
18974
+ }
18975
+
18976
+ var ReactFiberScheduler = function (config) {
18977
+ var hostContext = ReactFiberHostContext(config);
18978
+ var hydrationContext = ReactFiberHydrationContext(config);
18979
+ var popHostContainer = hostContext.popHostContainer,
18980
+ popHostContext = hostContext.popHostContext,
18981
+ resetHostContainer = hostContext.resetHostContainer;
18982
+
18983
+ var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber),
18984
+ beginWork = _ReactFiberBeginWork.beginWork,
18985
+ beginFailedWork = _ReactFiberBeginWork.beginFailedWork;
18986
+
18987
+ var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext),
18988
+ completeWork = _ReactFiberCompleteWo.completeWork;
18989
+
18990
+ var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError),
18991
+ commitResetTextContent = _ReactFiberCommitWork.commitResetTextContent,
18992
+ commitPlacement = _ReactFiberCommitWork.commitPlacement,
18993
+ commitDeletion = _ReactFiberCommitWork.commitDeletion,
18994
+ commitWork = _ReactFiberCommitWork.commitWork,
18995
+ commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles,
18996
+ commitAttachRef = _ReactFiberCommitWork.commitAttachRef,
18997
+ commitDetachRef = _ReactFiberCommitWork.commitDetachRef;
18998
+
18999
+ var now = config.now,
19000
+ scheduleDeferredCallback = config.scheduleDeferredCallback,
19001
+ cancelDeferredCallback = config.cancelDeferredCallback,
19002
+ useSyncScheduling = config.useSyncScheduling,
19003
+ prepareForCommit = config.prepareForCommit,
19004
+ resetAfterCommit = config.resetAfterCommit;
19005
+
19006
+ // Represents the current time in ms.
19007
+
19008
+ var startTime = now();
19009
+ var mostRecentCurrentTime = msToExpirationTime(0);
19010
+
19011
+ // Represents the expiration time that incoming updates should use. (If this
19012
+ // is NoWork, use the default strategy: async updates in async mode, sync
19013
+ // updates in sync mode.)
19014
+ var expirationContext = NoWork;
19015
+
19016
+ var isWorking = false;
19017
+
19018
+ // The next work in progress fiber that we're currently working on.
19019
+ var nextUnitOfWork = null;
19020
+ var nextRoot = null;
19021
+ // The time at which we're currently rendering work.
19022
+ var nextRenderExpirationTime = NoWork;
19023
+
19024
+ // The next fiber with an effect that we're currently committing.
19025
+ var nextEffect = null;
19026
+
19027
+ // Keep track of which fibers have captured an error that need to be handled.
19028
+ // Work is removed from this collection after componentDidCatch is called.
19029
+ var capturedErrors = null;
19030
+ // Keep track of which fibers have failed during the current batch of work.
19031
+ // This is a different set than capturedErrors, because it is not reset until
19032
+ // the end of the batch. This is needed to propagate errors correctly if a
19033
+ // subtree fails more than once.
19034
+ var failedBoundaries = null;
19035
+ // Error boundaries that captured an error during the current commit.
19036
+ var commitPhaseBoundaries = null;
19037
+ var firstUncaughtError = null;
19038
+ var didFatal = false;
19039
+
19040
+ var isCommitting = false;
19041
+ var isUnmounting = false;
19042
+
19043
+ // Used for performance tracking.
19044
+ var interruptedBy = null;
19045
+
19046
+ function resetContextStack() {
19047
+ // Reset the stack
19048
+ reset$1();
19049
+ // Reset the cursors
19050
+ resetContext();
19051
+ resetHostContainer();
19052
+ }
19053
+
19054
+ function commitAllHostEffects() {
19055
+ while (nextEffect !== null) {
19056
+ {
19057
+ ReactDebugCurrentFiber.setCurrentFiber(nextEffect);
19058
+ }
19059
+ recordEffect();
19060
+
19061
+ var effectTag = nextEffect.effectTag;
19062
+ if (effectTag & ContentReset) {
19063
+ commitResetTextContent(nextEffect);
19064
+ }
19065
+
19066
+ if (effectTag & Ref) {
19067
+ var current = nextEffect.alternate;
19068
+ if (current !== null) {
19069
+ commitDetachRef(current);
19070
+ }
19071
+ }
19072
+
19073
+ // The following switch statement is only concerned about placement,
19074
+ // updates, and deletions. To avoid needing to add a case for every
19075
+ // possible bitmap value, we remove the secondary effects from the
19076
+ // effect tag and switch on that value.
19077
+ var primaryEffectTag = effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork);
19078
+ switch (primaryEffectTag) {
19079
+ case Placement:
19080
+ {
19081
+ commitPlacement(nextEffect);
19082
+ // Clear the "placement" from effect tag so that we know that this is inserted, before
19083
+ // any life-cycles like componentDidMount gets called.
19084
+ // TODO: findDOMNode doesn't rely on this any more but isMounted
19085
+ // does and isMounted is deprecated anyway so we should be able
19086
+ // to kill this.
19087
+ nextEffect.effectTag &= ~Placement;
19088
+ break;
19089
+ }
19090
+ case PlacementAndUpdate:
19091
+ {
19092
+ // Placement
19093
+ commitPlacement(nextEffect);
19094
+ // Clear the "placement" from effect tag so that we know that this is inserted, before
19095
+ // any life-cycles like componentDidMount gets called.
19096
+ nextEffect.effectTag &= ~Placement;
19097
+
19098
+ // Update
19099
+ var _current = nextEffect.alternate;
19100
+ commitWork(_current, nextEffect);
19101
+ break;
19102
+ }
19103
+ case Update:
19104
+ {
19105
+ var _current2 = nextEffect.alternate;
19106
+ commitWork(_current2, nextEffect);
19107
+ break;
19108
+ }
19109
+ case Deletion:
19110
+ {
19111
+ isUnmounting = true;
19112
+ commitDeletion(nextEffect);
19113
+ isUnmounting = false;
19114
+ break;
19115
+ }
19116
+ }
19117
+ nextEffect = nextEffect.nextEffect;
19118
+ }
19119
+
19120
+ {
19121
+ ReactDebugCurrentFiber.resetCurrentFiber();
19122
+ }
19123
+ }
19124
+
19125
+ function commitAllLifeCycles() {
19126
+ while (nextEffect !== null) {
19127
+ var effectTag = nextEffect.effectTag;
19128
+
19129
+ if (effectTag & (Update | Callback)) {
19130
+ recordEffect();
19131
+ var current = nextEffect.alternate;
19132
+ commitLifeCycles(current, nextEffect);
19133
+ }
19134
+
19135
+ if (effectTag & Ref) {
19136
+ recordEffect();
19137
+ commitAttachRef(nextEffect);
19138
+ }
19139
+
19140
+ if (effectTag & Err) {
19141
+ recordEffect();
19142
+ commitErrorHandling(nextEffect);
19143
+ }
19144
+
19145
+ var next = nextEffect.nextEffect;
19146
+ // Ensure that we clean these up so that we don't accidentally keep them.
19147
+ // I'm not actually sure this matters because we can't reset firstEffect
19148
+ // and lastEffect since they're on every node, not just the effectful
19149
+ // ones. So we have to clean everything as we reuse nodes anyway.
19150
+ nextEffect.nextEffect = null;
19151
+ // Ensure that we reset the effectTag here so that we can rely on effect
19152
+ // tags to reason about the current life-cycle.
19153
+ nextEffect = next;
19154
+ }
19155
+ }
19156
+
19157
+ function commitRoot(finishedWork) {
19158
+ // We keep track of this so that captureError can collect any boundaries
19159
+ // that capture an error during the commit phase. The reason these aren't
19160
+ // local to this function is because errors that occur during cWU are
19161
+ // captured elsewhere, to prevent the unmount from being interrupted.
19162
+ isWorking = true;
19163
+ isCommitting = true;
19164
+ startCommitTimer();
19165
+
19166
+ var root = finishedWork.stateNode;
19167
+ !(root.current !== finishedWork) ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19168
+ root.isReadyForCommit = false;
19169
+
19170
+ // Reset this to null before calling lifecycles
19171
+ ReactCurrentOwner.current = null;
19172
+
19173
+ var firstEffect = void 0;
19174
+ if (finishedWork.effectTag > PerformedWork) {
19175
+ // A fiber's effect list consists only of its children, not itself. So if
19176
+ // the root has an effect, we need to add it to the end of the list. The
19177
+ // resulting list is the set that would belong to the root's parent, if
19178
+ // it had one; that is, all the effects in the tree including the root.
19179
+ if (finishedWork.lastEffect !== null) {
19180
+ finishedWork.lastEffect.nextEffect = finishedWork;
19181
+ firstEffect = finishedWork.firstEffect;
19182
+ } else {
19183
+ firstEffect = finishedWork;
19184
+ }
19185
+ } else {
19186
+ // There is no effect on the root.
19187
+ firstEffect = finishedWork.firstEffect;
19188
+ }
19189
+
19190
+ prepareForCommit();
19191
+
19192
+ // Commit all the side-effects within a tree. We'll do this in two passes.
19193
+ // The first pass performs all the host insertions, updates, deletions and
19194
+ // ref unmounts.
19195
+ nextEffect = firstEffect;
19196
+ startCommitHostEffectsTimer();
19197
+ while (nextEffect !== null) {
19198
+ var didError = false;
19199
+ var _error = void 0;
19200
+ {
19201
+ invokeGuardedCallback$1(null, commitAllHostEffects, null);
19202
+ if (hasCaughtError()) {
19203
+ didError = true;
19204
+ _error = clearCaughtError();
19205
+ }
19206
+ }
19207
+ if (didError) {
19208
+ !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19209
+ captureError(nextEffect, _error);
19210
+ // Clean-up
19211
+ if (nextEffect !== null) {
19212
+ nextEffect = nextEffect.nextEffect;
19213
+ }
19214
+ }
19215
+ }
19216
+ stopCommitHostEffectsTimer();
19217
+
19218
+ resetAfterCommit();
19219
+
19220
+ // The work-in-progress tree is now the current tree. This must come after
19221
+ // the first pass of the commit phase, so that the previous tree is still
19222
+ // current during componentWillUnmount, but before the second pass, so that
19223
+ // the finished work is current during componentDidMount/Update.
19224
+ root.current = finishedWork;
19225
+
19226
+ // In the second pass we'll perform all life-cycles and ref callbacks.
19227
+ // Life-cycles happen as a separate pass so that all placements, updates,
19228
+ // and deletions in the entire tree have already been invoked.
19229
+ // This pass also triggers any renderer-specific initial effects.
19230
+ nextEffect = firstEffect;
19231
+ startCommitLifeCyclesTimer();
19232
+ while (nextEffect !== null) {
19233
+ var _didError = false;
19234
+ var _error2 = void 0;
19235
+ {
19236
+ invokeGuardedCallback$1(null, commitAllLifeCycles, null);
19237
+ if (hasCaughtError()) {
19238
+ _didError = true;
19239
+ _error2 = clearCaughtError();
19240
+ }
19241
+ }
19242
+ if (_didError) {
19243
+ !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19244
+ captureError(nextEffect, _error2);
19245
+ if (nextEffect !== null) {
19246
+ nextEffect = nextEffect.nextEffect;
19247
+ }
19248
+ }
19249
+ }
19250
+
19251
+ isCommitting = false;
19252
+ isWorking = false;
19253
+ stopCommitLifeCyclesTimer();
19254
+ stopCommitTimer();
19255
+ if (typeof onCommitRoot === 'function') {
19256
+ onCommitRoot(finishedWork.stateNode);
19257
+ }
19258
+ if (true && ReactFiberInstrumentation_1.debugTool) {
19259
+ ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork);
19260
+ }
19261
+
19262
+ // If we caught any errors during this commit, schedule their boundaries
19263
+ // to update.
19264
+ if (commitPhaseBoundaries) {
19265
+ commitPhaseBoundaries.forEach(scheduleErrorRecovery);
19266
+ commitPhaseBoundaries = null;
19267
+ }
19268
+
19269
+ if (firstUncaughtError !== null) {
19270
+ var _error3 = firstUncaughtError;
19271
+ firstUncaughtError = null;
19272
+ onUncaughtError(_error3);
19273
+ }
19274
+
19275
+ var remainingTime = root.current.expirationTime;
19276
+
19277
+ if (remainingTime === NoWork) {
19278
+ capturedErrors = null;
19279
+ failedBoundaries = null;
19280
+ }
19281
+
19282
+ return remainingTime;
19283
+ }
19284
+
19285
+ function resetExpirationTime(workInProgress, renderTime) {
19286
+ if (renderTime !== Never && workInProgress.expirationTime === Never) {
19287
+ // The children of this component are hidden. Don't bubble their
19288
+ // expiration times.
19289
+ return;
19290
+ }
19291
+
19292
+ // Check for pending updates.
19293
+ var newExpirationTime = getUpdateExpirationTime(workInProgress);
19294
+
19295
+ // TODO: Calls need to visit stateNode
19296
+
19297
+ // Bubble up the earliest expiration time.
19298
+ var child = workInProgress.child;
19299
+ while (child !== null) {
19300
+ if (child.expirationTime !== NoWork && (newExpirationTime === NoWork || newExpirationTime > child.expirationTime)) {
19301
+ newExpirationTime = child.expirationTime;
19302
+ }
19303
+ child = child.sibling;
19304
+ }
19305
+ workInProgress.expirationTime = newExpirationTime;
19306
+ }
19307
+
19308
+ function completeUnitOfWork(workInProgress) {
19309
+ while (true) {
19310
+ // The current, flushed, state of this fiber is the alternate.
19311
+ // Ideally nothing should rely on this, but relying on it here
19312
+ // means that we don't need an additional field on the work in
19313
+ // progress.
19314
+ var current = workInProgress.alternate;
19315
+ {
19316
+ ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
19317
+ }
19318
+ var next = completeWork(current, workInProgress, nextRenderExpirationTime);
19319
+ {
19320
+ ReactDebugCurrentFiber.resetCurrentFiber();
19321
+ }
19322
+
19323
+ var returnFiber = workInProgress['return'];
19324
+ var siblingFiber = workInProgress.sibling;
19325
+
19326
+ resetExpirationTime(workInProgress, nextRenderExpirationTime);
19327
+
19328
+ if (next !== null) {
19329
+ stopWorkTimer(workInProgress);
19330
+ if (true && ReactFiberInstrumentation_1.debugTool) {
19331
+ ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
19332
+ }
19333
+ // If completing this work spawned new work, do that next. We'll come
19334
+ // back here again.
19335
+ return next;
19336
+ }
19337
+
19338
+ if (returnFiber !== null) {
19339
+ // Append all the effects of the subtree and this fiber onto the effect
19340
+ // list of the parent. The completion order of the children affects the
19341
+ // side-effect order.
19342
+ if (returnFiber.firstEffect === null) {
19343
+ returnFiber.firstEffect = workInProgress.firstEffect;
19344
+ }
19345
+ if (workInProgress.lastEffect !== null) {
19346
+ if (returnFiber.lastEffect !== null) {
19347
+ returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
19348
+ }
19349
+ returnFiber.lastEffect = workInProgress.lastEffect;
19350
+ }
19351
+
19352
+ // If this fiber had side-effects, we append it AFTER the children's
19353
+ // side-effects. We can perform certain side-effects earlier if
19354
+ // needed, by doing multiple passes over the effect list. We don't want
19355
+ // to schedule our own side-effect on our own list because if end up
19356
+ // reusing children we'll schedule this effect onto itself since we're
19357
+ // at the end.
19358
+ var effectTag = workInProgress.effectTag;
19359
+ // Skip both NoWork and PerformedWork tags when creating the effect list.
19360
+ // PerformedWork effect is read by React DevTools but shouldn't be committed.
19361
+ if (effectTag > PerformedWork) {
19362
+ if (returnFiber.lastEffect !== null) {
19363
+ returnFiber.lastEffect.nextEffect = workInProgress;
19364
+ } else {
19365
+ returnFiber.firstEffect = workInProgress;
19366
+ }
19367
+ returnFiber.lastEffect = workInProgress;
19368
+ }
19369
+ }
19370
+
19371
+ stopWorkTimer(workInProgress);
19372
+ if (true && ReactFiberInstrumentation_1.debugTool) {
19373
+ ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
19374
+ }
19375
+
19376
+ if (siblingFiber !== null) {
19377
+ // If there is more work to do in this returnFiber, do that next.
19378
+ return siblingFiber;
19379
+ } else if (returnFiber !== null) {
19380
+ // If there's no more work in this returnFiber. Complete the returnFiber.
19381
+ workInProgress = returnFiber;
19382
+ continue;
19383
+ } else {
19384
+ // We've reached the root.
19385
+ var root = workInProgress.stateNode;
19386
+ root.isReadyForCommit = true;
19387
+ return null;
19388
+ }
19389
+ }
19390
+
19391
+ // Without this explicit null return Flow complains of invalid return type
19392
+ // TODO Remove the above while(true) loop
19393
+ // eslint-disable-next-line no-unreachable
19394
+ return null;
19395
+ }
19396
+
19397
+ function performUnitOfWork(workInProgress) {
19398
+ // The current, flushed, state of this fiber is the alternate.
19399
+ // Ideally nothing should rely on this, but relying on it here
19400
+ // means that we don't need an additional field on the work in
19401
+ // progress.
19402
+ var current = workInProgress.alternate;
19403
+
19404
+ // See if beginning this work spawns more work.
19405
+ startWorkTimer(workInProgress);
19406
+ {
19407
+ ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
19408
+ }
19409
+
19410
+ var next = beginWork(current, workInProgress, nextRenderExpirationTime);
19411
+ {
19412
+ ReactDebugCurrentFiber.resetCurrentFiber();
19413
+ }
19414
+ if (true && ReactFiberInstrumentation_1.debugTool) {
19415
+ ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
19416
+ }
19417
+
19418
+ if (next === null) {
19419
+ // If this doesn't spawn new work, complete the current work.
19420
+ next = completeUnitOfWork(workInProgress);
19421
+ }
19422
+
19423
+ ReactCurrentOwner.current = null;
19424
+
19425
+ return next;
19426
+ }
19427
+
19428
+ function performFailedUnitOfWork(workInProgress) {
19429
+ // The current, flushed, state of this fiber is the alternate.
19430
+ // Ideally nothing should rely on this, but relying on it here
19431
+ // means that we don't need an additional field on the work in
19432
+ // progress.
19433
+ var current = workInProgress.alternate;
19434
+
19435
+ // See if beginning this work spawns more work.
19436
+ startWorkTimer(workInProgress);
19437
+ {
19438
+ ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
19439
+ }
19440
+ var next = beginFailedWork(current, workInProgress, nextRenderExpirationTime);
19441
+ {
19442
+ ReactDebugCurrentFiber.resetCurrentFiber();
19443
+ }
19444
+ if (true && ReactFiberInstrumentation_1.debugTool) {
19445
+ ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
19446
+ }
19447
+
19448
+ if (next === null) {
19449
+ // If this doesn't spawn new work, complete the current work.
19450
+ next = completeUnitOfWork(workInProgress);
19451
+ }
19452
+
19453
+ ReactCurrentOwner.current = null;
19454
+
19455
+ return next;
19456
+ }
19457
+
19458
+ function workLoop(expirationTime) {
19459
+ if (capturedErrors !== null) {
19460
+ // If there are unhandled errors, switch to the slow work loop.
19461
+ // TODO: How to avoid this check in the fast path? Maybe the renderer
19462
+ // could keep track of which roots have unhandled errors and call a
19463
+ // forked version of renderRoot.
19464
+ slowWorkLoopThatChecksForFailedWork(expirationTime);
19465
+ return;
19466
+ }
19467
+ if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) {
19468
+ return;
19469
+ }
19470
+
19471
+ if (nextRenderExpirationTime <= mostRecentCurrentTime) {
19472
+ // Flush all expired work.
19473
+ while (nextUnitOfWork !== null) {
19474
+ nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
19475
+ }
19476
+ } else {
19477
+ // Flush asynchronous work until the deadline runs out of time.
19478
+ while (nextUnitOfWork !== null && !shouldYield()) {
19479
+ nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
19480
+ }
19481
+ }
19482
+ }
19483
+
19484
+ function slowWorkLoopThatChecksForFailedWork(expirationTime) {
19485
+ if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) {
19486
+ return;
19487
+ }
19488
+
19489
+ if (nextRenderExpirationTime <= mostRecentCurrentTime) {
19490
+ // Flush all expired work.
19491
+ while (nextUnitOfWork !== null) {
19492
+ if (hasCapturedError(nextUnitOfWork)) {
19493
+ // Use a forked version of performUnitOfWork
19494
+ nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);
19495
+ } else {
19496
+ nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
19497
+ }
19498
+ }
19499
+ } else {
19500
+ // Flush asynchronous work until the deadline runs out of time.
19501
+ while (nextUnitOfWork !== null && !shouldYield()) {
19502
+ if (hasCapturedError(nextUnitOfWork)) {
19503
+ // Use a forked version of performUnitOfWork
19504
+ nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);
19505
+ } else {
19506
+ nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
19507
+ }
19508
+ }
19509
+ }
19510
+ }
19511
+
19512
+ function renderRootCatchBlock(root, failedWork, boundary, expirationTime) {
19513
+ // We're going to restart the error boundary that captured the error.
19514
+ // Conceptually, we're unwinding the stack. We need to unwind the
19515
+ // context stack, too.
19516
+ unwindContexts(failedWork, boundary);
19517
+
19518
+ // Restart the error boundary using a forked version of
19519
+ // performUnitOfWork that deletes the boundary's children. The entire
19520
+ // failed subree will be unmounted. During the commit phase, a special
19521
+ // lifecycle method is called on the error boundary, which triggers
19522
+ // a re-render.
19523
+ nextUnitOfWork = performFailedUnitOfWork(boundary);
19524
+
19525
+ // Continue working.
19526
+ workLoop(expirationTime);
19527
+ }
19528
+
19529
+ function renderRoot(root, expirationTime) {
19530
+ !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19531
+ isWorking = true;
19532
+
19533
+ // We're about to mutate the work-in-progress tree. If the root was pending
19534
+ // commit, it no longer is: we'll need to complete it again.
19535
+ root.isReadyForCommit = false;
19536
+
19537
+ // Check if we're starting from a fresh stack, or if we're resuming from
19538
+ // previously yielded work.
19539
+ if (root !== nextRoot || expirationTime !== nextRenderExpirationTime || nextUnitOfWork === null) {
19540
+ // Reset the stack and start working from the root.
19541
+ resetContextStack();
19542
+ nextRoot = root;
19543
+ nextRenderExpirationTime = expirationTime;
19544
+ nextUnitOfWork = createWorkInProgress(nextRoot.current, null, expirationTime);
19545
+ }
19546
+
19547
+ startWorkLoopTimer(nextUnitOfWork);
19548
+
19549
+ var didError = false;
19550
+ var error = null;
19551
+ {
19552
+ invokeGuardedCallback$1(null, workLoop, null, expirationTime);
19553
+ if (hasCaughtError()) {
19554
+ didError = true;
19555
+ error = clearCaughtError();
19556
+ }
19557
+ }
19558
+
19559
+ // An error was thrown during the render phase.
19560
+ while (didError) {
19561
+ if (didFatal) {
19562
+ // This was a fatal error. Don't attempt to recover from it.
19563
+ firstUncaughtError = error;
19564
+ break;
19565
+ }
19566
+
19567
+ var failedWork = nextUnitOfWork;
19568
+ if (failedWork === null) {
19569
+ // An error was thrown but there's no current unit of work. This can
19570
+ // happen during the commit phase if there's a bug in the renderer.
19571
+ didFatal = true;
19572
+ continue;
19573
+ }
19574
+
19575
+ // "Capture" the error by finding the nearest boundary. If there is no
19576
+ // error boundary, we use the root.
19577
+ var boundary = captureError(failedWork, error);
19578
+ !(boundary !== null) ? invariant(false, 'Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19579
+
19580
+ if (didFatal) {
19581
+ // The error we just captured was a fatal error. This happens
19582
+ // when the error propagates to the root more than once.
19583
+ continue;
19584
+ }
19585
+
19586
+ didError = false;
19587
+ error = null;
19588
+ {
19589
+ invokeGuardedCallback$1(null, renderRootCatchBlock, null, root, failedWork, boundary, expirationTime);
19590
+ if (hasCaughtError()) {
19591
+ didError = true;
19592
+ error = clearCaughtError();
19593
+ continue;
19594
+ }
19595
+ }
19596
+ // We're finished working. Exit the error loop.
19597
+ break;
19598
+ }
19599
+
19600
+ var uncaughtError = firstUncaughtError;
19601
+
19602
+ // We're done performing work. Time to clean up.
19603
+ stopWorkLoopTimer(interruptedBy);
19604
+ interruptedBy = null;
19605
+ isWorking = false;
19606
+ didFatal = false;
19607
+ firstUncaughtError = null;
19608
+
19609
+ if (uncaughtError !== null) {
19610
+ onUncaughtError(uncaughtError);
19611
+ }
19612
+
19613
+ return root.isReadyForCommit ? root.current.alternate : null;
19614
+ }
19615
+
19616
+ // Returns the boundary that captured the error, or null if the error is ignored
19617
+ function captureError(failedWork, error) {
19618
+ // It is no longer valid because we exited the user code.
19619
+ ReactCurrentOwner.current = null;
19620
+ {
19621
+ ReactDebugCurrentFiber.resetCurrentFiber();
19622
+ }
19623
+
19624
+ // Search for the nearest error boundary.
19625
+ var boundary = null;
19626
+
19627
+ // Passed to logCapturedError()
19628
+ var errorBoundaryFound = false;
19629
+ var willRetry = false;
19630
+ var errorBoundaryName = null;
19631
+
19632
+ // Host containers are a special case. If the failed work itself is a host
19633
+ // container, then it acts as its own boundary. In all other cases, we
19634
+ // ignore the work itself and only search through the parents.
19635
+ if (failedWork.tag === HostRoot) {
19636
+ boundary = failedWork;
19637
+
19638
+ if (isFailedBoundary(failedWork)) {
19639
+ // If this root already failed, there must have been an error when
19640
+ // attempting to unmount it. This is a worst-case scenario and
19641
+ // should only be possible if there's a bug in the renderer.
19642
+ didFatal = true;
19643
+ }
19644
+ } else {
19645
+ var node = failedWork['return'];
19646
+ while (node !== null && boundary === null) {
19647
+ if (node.tag === ClassComponent) {
19648
+ var instance = node.stateNode;
19649
+ if (typeof instance.componentDidCatch === 'function') {
19650
+ errorBoundaryFound = true;
19651
+ errorBoundaryName = getComponentName(node);
19652
+
19653
+ // Found an error boundary!
19654
+ boundary = node;
19655
+ willRetry = true;
19656
+ }
19657
+ } else if (node.tag === HostRoot) {
19658
+ // Treat the root like a no-op error boundary
19659
+ boundary = node;
19660
+ }
19661
+
19662
+ if (isFailedBoundary(node)) {
19663
+ // This boundary is already in a failed state.
19664
+
19665
+ // If we're currently unmounting, that means this error was
19666
+ // thrown while unmounting a failed subtree. We should ignore
19667
+ // the error.
19668
+ if (isUnmounting) {
19669
+ return null;
19670
+ }
19671
+
19672
+ // If we're in the commit phase, we should check to see if
19673
+ // this boundary already captured an error during this commit.
19674
+ // This case exists because multiple errors can be thrown during
19675
+ // a single commit without interruption.
19676
+ if (commitPhaseBoundaries !== null && (commitPhaseBoundaries.has(node) || node.alternate !== null && commitPhaseBoundaries.has(node.alternate))) {
19677
+ // If so, we should ignore this error.
19678
+ return null;
19679
+ }
19680
+
19681
+ // The error should propagate to the next boundary -— we keep looking.
19682
+ boundary = null;
19683
+ willRetry = false;
19684
+ }
19685
+
19686
+ node = node['return'];
19687
+ }
19688
+ }
19689
+
19690
+ if (boundary !== null) {
19691
+ // Add to the collection of failed boundaries. This lets us know that
19692
+ // subsequent errors in this subtree should propagate to the next boundary.
19693
+ if (failedBoundaries === null) {
19694
+ failedBoundaries = new Set();
19695
+ }
19696
+ failedBoundaries.add(boundary);
19697
+
19698
+ // This method is unsafe outside of the begin and complete phases.
19699
+ // We might be in the commit phase when an error is captured.
19700
+ // The risk is that the return path from this Fiber may not be accurate.
19701
+ // That risk is acceptable given the benefit of providing users more context.
19702
+ var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork);
19703
+ var _componentName = getComponentName(failedWork);
19704
+
19705
+ // Add to the collection of captured errors. This is stored as a global
19706
+ // map of errors and their component stack location keyed by the boundaries
19707
+ // that capture them. We mostly use this Map as a Set; it's a Map only to
19708
+ // avoid adding a field to Fiber to store the error.
19709
+ if (capturedErrors === null) {
19710
+ capturedErrors = new Map();
19711
+ }
19712
+
19713
+ var capturedError = {
19714
+ componentName: _componentName,
19715
+ componentStack: _componentStack,
19716
+ error: error,
19717
+ errorBoundary: errorBoundaryFound ? boundary.stateNode : null,
19718
+ errorBoundaryFound: errorBoundaryFound,
19719
+ errorBoundaryName: errorBoundaryName,
19720
+ willRetry: willRetry
19721
+ };
19722
+
19723
+ capturedErrors.set(boundary, capturedError);
19724
+
19725
+ try {
19726
+ logCapturedError(capturedError);
19727
+ } catch (e) {
19728
+ // Prevent cycle if logCapturedError() throws.
19729
+ // A cycle may still occur if logCapturedError renders a component that throws.
19730
+ var suppressLogging = e && e.suppressReactErrorLogging;
19731
+ if (!suppressLogging) {
19732
+ console.error(e);
19733
+ }
19734
+ }
19735
+
19736
+ // If we're in the commit phase, defer scheduling an update on the
19737
+ // boundary until after the commit is complete
19738
+ if (isCommitting) {
19739
+ if (commitPhaseBoundaries === null) {
19740
+ commitPhaseBoundaries = new Set();
19741
+ }
19742
+ commitPhaseBoundaries.add(boundary);
19743
+ } else {
19744
+ // Otherwise, schedule an update now.
19745
+ // TODO: Is this actually necessary during the render phase? Is it
19746
+ // possible to unwind and continue rendering at the same priority,
19747
+ // without corrupting internal state?
19748
+ scheduleErrorRecovery(boundary);
19749
+ }
19750
+ return boundary;
19751
+ } else if (firstUncaughtError === null) {
19752
+ // If no boundary is found, we'll need to throw the error
19753
+ firstUncaughtError = error;
19754
+ }
19755
+ return null;
19756
+ }
19757
+
19758
+ function hasCapturedError(fiber) {
19759
+ // TODO: capturedErrors should store the boundary instance, to avoid needing
19760
+ // to check the alternate.
19761
+ return capturedErrors !== null && (capturedErrors.has(fiber) || fiber.alternate !== null && capturedErrors.has(fiber.alternate));
19762
+ }
19763
+
19764
+ function isFailedBoundary(fiber) {
19765
+ // TODO: failedBoundaries should store the boundary instance, to avoid
19766
+ // needing to check the alternate.
19767
+ return failedBoundaries !== null && (failedBoundaries.has(fiber) || fiber.alternate !== null && failedBoundaries.has(fiber.alternate));
19768
+ }
19769
+
19770
+ function commitErrorHandling(effectfulFiber) {
19771
+ var capturedError = void 0;
19772
+ if (capturedErrors !== null) {
19773
+ capturedError = capturedErrors.get(effectfulFiber);
19774
+ capturedErrors['delete'](effectfulFiber);
19775
+ if (capturedError == null) {
19776
+ if (effectfulFiber.alternate !== null) {
19777
+ effectfulFiber = effectfulFiber.alternate;
19778
+ capturedError = capturedErrors.get(effectfulFiber);
19779
+ capturedErrors['delete'](effectfulFiber);
19780
+ }
19781
+ }
19782
+ }
19783
+
19784
+ !(capturedError != null) ? invariant(false, 'No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.') : void 0;
19785
+
19786
+ switch (effectfulFiber.tag) {
19787
+ case ClassComponent:
19788
+ var instance = effectfulFiber.stateNode;
19789
+
19790
+ var info = {
19791
+ componentStack: capturedError.componentStack
19792
+ };
19793
+
19794
+ // Allow the boundary to handle the error, usually by scheduling
19795
+ // an update to itself
19796
+ instance.componentDidCatch(capturedError.error, info);
19797
+ return;
19798
+ case HostRoot:
19799
+ if (firstUncaughtError === null) {
19800
+ firstUncaughtError = capturedError.error;
19801
+ }
19802
+ return;
19803
+ default:
19804
+ invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.');
19805
+ }
19806
+ }
19807
+
19808
+ function unwindContexts(from, to) {
19809
+ var node = from;
19810
+ while (node !== null) {
19811
+ switch (node.tag) {
19812
+ case ClassComponent:
19813
+ popContextProvider(node);
19814
+ break;
19815
+ case HostComponent:
19816
+ popHostContext(node);
19817
+ break;
19818
+ case HostRoot:
19819
+ popHostContainer(node);
19820
+ break;
19821
+ case HostPortal:
19822
+ popHostContainer(node);
19823
+ break;
19824
+ }
19825
+ if (node === to || node.alternate === to) {
19826
+ stopFailedWorkTimer(node);
19827
+ break;
19828
+ } else {
19829
+ stopWorkTimer(node);
19830
+ }
19831
+ node = node['return'];
19832
+ }
19833
+ }
19834
+
19835
+ function computeAsyncExpiration() {
19836
+ // Given the current clock time, returns an expiration time. We use rounding
19837
+ // to batch like updates together.
19838
+ // Should complete within ~1000ms. 1200ms max.
19839
+ var currentTime = recalculateCurrentTime();
19840
+ var expirationMs = 1000;
19841
+ var bucketSizeMs = 200;
19842
+ return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);
19843
+ }
19844
+
19845
+ function computeExpirationForFiber(fiber) {
19846
+ var expirationTime = void 0;
19847
+ if (expirationContext !== NoWork) {
19848
+ // An explicit expiration context was set;
19849
+ expirationTime = expirationContext;
19850
+ } else if (isWorking) {
19851
+ if (isCommitting) {
19852
+ // Updates that occur during the commit phase should have sync priority
19853
+ // by default.
19854
+ expirationTime = Sync;
19855
+ } else {
19856
+ // Updates during the render phase should expire at the same time as
19857
+ // the work that is being rendered.
19858
+ expirationTime = nextRenderExpirationTime;
19859
+ }
19860
+ } else {
19861
+ // No explicit expiration context was set, and we're not currently
19862
+ // performing work. Calculate a new expiration time.
19863
+ if (useSyncScheduling && !(fiber.internalContextTag & AsyncUpdates)) {
19864
+ // This is a sync update
19865
+ expirationTime = Sync;
19866
+ } else {
19867
+ // This is an async update
19868
+ expirationTime = computeAsyncExpiration();
19869
+ }
19870
+ }
19871
+ return expirationTime;
19872
+ }
19873
+
19874
+ function scheduleWork(fiber, expirationTime) {
19875
+ return scheduleWorkImpl(fiber, expirationTime, false);
19876
+ }
19877
+
19878
+ function checkRootNeedsClearing(root, fiber, expirationTime) {
19879
+ if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) {
19880
+ // Restart the root from the top.
19881
+ if (nextUnitOfWork !== null) {
19882
+ // This is an interruption. (Used for performance tracking.)
19883
+ interruptedBy = fiber;
19884
+ }
19885
+ nextRoot = null;
19886
+ nextUnitOfWork = null;
19887
+ nextRenderExpirationTime = NoWork;
19888
+ }
19889
+ }
19890
+
19891
+ function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) {
19892
+ recordScheduleUpdate();
19893
+
19894
+ {
19895
+ if (!isErrorRecovery && fiber.tag === ClassComponent) {
19896
+ var instance = fiber.stateNode;
19897
+ warnAboutInvalidUpdates(instance);
19898
+ }
19899
+ }
19900
+
19901
+ var node = fiber;
19902
+ while (node !== null) {
19903
+ // Walk the parent path to the root and update each node's
19904
+ // expiration time.
19905
+ if (node.expirationTime === NoWork || node.expirationTime > expirationTime) {
19906
+ node.expirationTime = expirationTime;
19907
+ }
19908
+ if (node.alternate !== null) {
19909
+ if (node.alternate.expirationTime === NoWork || node.alternate.expirationTime > expirationTime) {
19910
+ node.alternate.expirationTime = expirationTime;
19911
+ }
19912
+ }
19913
+ if (node['return'] === null) {
19914
+ if (node.tag === HostRoot) {
19915
+ var root = node.stateNode;
19916
+
19917
+ checkRootNeedsClearing(root, fiber, expirationTime);
19918
+ requestWork(root, expirationTime);
19919
+ checkRootNeedsClearing(root, fiber, expirationTime);
19920
+ } else {
19921
+ {
19922
+ if (!isErrorRecovery && fiber.tag === ClassComponent) {
19923
+ warnAboutUpdateOnUnmounted(fiber);
19924
+ }
19925
+ }
19926
+ return;
19927
+ }
19928
+ }
19929
+ node = node['return'];
19930
+ }
19931
+ }
19932
+
19933
+ function scheduleErrorRecovery(fiber) {
19934
+ scheduleWorkImpl(fiber, Sync, true);
19935
+ }
19936
+
19937
+ function recalculateCurrentTime() {
19938
+ // Subtract initial time so it fits inside 32bits
19939
+ var ms = now() - startTime;
19940
+ mostRecentCurrentTime = msToExpirationTime(ms);
19941
+ return mostRecentCurrentTime;
19942
+ }
19943
+
19944
+ function deferredUpdates(fn) {
19945
+ var previousExpirationContext = expirationContext;
19946
+ expirationContext = computeAsyncExpiration();
19947
+ try {
19948
+ return fn();
19949
+ } finally {
19950
+ expirationContext = previousExpirationContext;
19951
+ }
19952
+ }
19953
+
19954
+ function syncUpdates(fn) {
19955
+ var previousExpirationContext = expirationContext;
19956
+ expirationContext = Sync;
19957
+ try {
19958
+ return fn();
19959
+ } finally {
19960
+ expirationContext = previousExpirationContext;
19961
+ }
19962
+ }
19963
+
19964
+ // TODO: Everything below this is written as if it has been lifted to the
19965
+ // renderers. I'll do this in a follow-up.
19966
+
19967
+ // Linked-list of roots
19968
+ var firstScheduledRoot = null;
19969
+ var lastScheduledRoot = null;
19970
+
19971
+ var callbackExpirationTime = NoWork;
19972
+ var callbackID = -1;
19973
+ var isRendering = false;
19974
+ var nextFlushedRoot = null;
19975
+ var nextFlushedExpirationTime = NoWork;
19976
+ var deadlineDidExpire = false;
19977
+ var hasUnhandledError = false;
19978
+ var unhandledError = null;
19979
+ var deadline = null;
19980
+
19981
+ var isBatchingUpdates = false;
19982
+ var isUnbatchingUpdates = false;
19983
+
19984
+ // Use these to prevent an infinite loop of nested updates
19985
+ var NESTED_UPDATE_LIMIT = 1000;
19986
+ var nestedUpdateCount = 0;
19987
+
19988
+ var timeHeuristicForUnitOfWork = 1;
19989
+
19990
+ function scheduleCallbackWithExpiration(expirationTime) {
19991
+ if (callbackExpirationTime !== NoWork) {
19992
+ // A callback is already scheduled. Check its expiration time (timeout).
19993
+ if (expirationTime > callbackExpirationTime) {
19994
+ // Existing callback has sufficient timeout. Exit.
19995
+ return;
19996
+ } else {
19997
+ // Existing callback has insufficient timeout. Cancel and schedule a
19998
+ // new one.
19999
+ cancelDeferredCallback(callbackID);
20000
+ }
20001
+ // The request callback timer is already running. Don't start a new one.
20002
+ } else {
20003
+ startRequestCallbackTimer();
20004
+ }
20005
+
20006
+ // Compute a timeout for the given expiration time.
20007
+ var currentMs = now() - startTime;
20008
+ var expirationMs = expirationTimeToMs(expirationTime);
20009
+ var timeout = expirationMs - currentMs;
20010
+
20011
+ callbackExpirationTime = expirationTime;
20012
+ callbackID = scheduleDeferredCallback(performAsyncWork, { timeout: timeout });
20013
+ }
20014
+
20015
+ // requestWork is called by the scheduler whenever a root receives an update.
20016
+ // It's up to the renderer to call renderRoot at some point in the future.
20017
+ function requestWork(root, expirationTime) {
20018
+ if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
20019
+ invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');
20020
+ }
20021
+
20022
+ // Add the root to the schedule.
20023
+ // Check if this root is already part of the schedule.
20024
+ if (root.nextScheduledRoot === null) {
20025
+ // This root is not already scheduled. Add it.
20026
+ root.remainingExpirationTime = expirationTime;
20027
+ if (lastScheduledRoot === null) {
20028
+ firstScheduledRoot = lastScheduledRoot = root;
20029
+ root.nextScheduledRoot = root;
20030
+ } else {
20031
+ lastScheduledRoot.nextScheduledRoot = root;
20032
+ lastScheduledRoot = root;
20033
+ lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
20034
+ }
20035
+ } else {
20036
+ // This root is already scheduled, but its priority may have increased.
20037
+ var remainingExpirationTime = root.remainingExpirationTime;
20038
+ if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {
20039
+ // Update the priority.
20040
+ root.remainingExpirationTime = expirationTime;
20041
+ }
20042
+ }
20043
+
20044
+ if (isRendering) {
20045
+ // Prevent reentrancy. Remaining work will be scheduled at the end of
20046
+ // the currently rendering batch.
20047
+ return;
20048
+ }
20049
+
20050
+ if (isBatchingUpdates) {
20051
+ // Flush work at the end of the batch.
20052
+ if (isUnbatchingUpdates) {
20053
+ // ...unless we're inside unbatchedUpdates, in which case we should
20054
+ // flush it now.
20055
+ nextFlushedRoot = root;
20056
+ nextFlushedExpirationTime = Sync;
20057
+ performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);
20058
+ }
20059
+ return;
20060
+ }
20061
+
20062
+ // TODO: Get rid of Sync and use current time?
20063
+ if (expirationTime === Sync) {
20064
+ performWork(Sync, null);
20065
+ } else {
20066
+ scheduleCallbackWithExpiration(expirationTime);
20067
+ }
20068
+ }
20069
+
20070
+ function findHighestPriorityRoot() {
20071
+ var highestPriorityWork = NoWork;
20072
+ var highestPriorityRoot = null;
20073
+
20074
+ if (lastScheduledRoot !== null) {
20075
+ var previousScheduledRoot = lastScheduledRoot;
20076
+ var root = firstScheduledRoot;
20077
+ while (root !== null) {
20078
+ var remainingExpirationTime = root.remainingExpirationTime;
20079
+ if (remainingExpirationTime === NoWork) {
20080
+ // This root no longer has work. Remove it from the scheduler.
20081
+
20082
+ // TODO: This check is redudant, but Flow is confused by the branch
20083
+ // below where we set lastScheduledRoot to null, even though we break
20084
+ // from the loop right after.
20085
+ !(previousScheduledRoot !== null && lastScheduledRoot !== null) ? invariant(false, 'Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
20086
+ if (root === root.nextScheduledRoot) {
20087
+ // This is the only root in the list.
20088
+ root.nextScheduledRoot = null;
20089
+ firstScheduledRoot = lastScheduledRoot = null;
20090
+ break;
20091
+ } else if (root === firstScheduledRoot) {
20092
+ // This is the first root in the list.
20093
+ var next = root.nextScheduledRoot;
20094
+ firstScheduledRoot = next;
20095
+ lastScheduledRoot.nextScheduledRoot = next;
20096
+ root.nextScheduledRoot = null;
20097
+ } else if (root === lastScheduledRoot) {
20098
+ // This is the last root in the list.
20099
+ lastScheduledRoot = previousScheduledRoot;
20100
+ lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
20101
+ root.nextScheduledRoot = null;
20102
+ break;
20103
+ } else {
20104
+ previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot;
20105
+ root.nextScheduledRoot = null;
20106
+ }
20107
+ root = previousScheduledRoot.nextScheduledRoot;
20108
+ } else {
20109
+ if (highestPriorityWork === NoWork || remainingExpirationTime < highestPriorityWork) {
20110
+ // Update the priority, if it's higher
20111
+ highestPriorityWork = remainingExpirationTime;
20112
+ highestPriorityRoot = root;
20113
+ }
20114
+ if (root === lastScheduledRoot) {
20115
+ break;
20116
+ }
20117
+ previousScheduledRoot = root;
20118
+ root = root.nextScheduledRoot;
20119
+ }
20120
+ }
20121
+ }
20122
+
20123
+ // If the next root is the same as the previous root, this is a nested
20124
+ // update. To prevent an infinite loop, increment the nested update count.
20125
+ var previousFlushedRoot = nextFlushedRoot;
20126
+ if (previousFlushedRoot !== null && previousFlushedRoot === highestPriorityRoot) {
20127
+ nestedUpdateCount++;
20128
+ } else {
20129
+ // Reset whenever we switch roots.
20130
+ nestedUpdateCount = 0;
20131
+ }
20132
+ nextFlushedRoot = highestPriorityRoot;
20133
+ nextFlushedExpirationTime = highestPriorityWork;
20134
+ }
20135
+
20136
+ function performAsyncWork(dl) {
20137
+ performWork(NoWork, dl);
20138
+ }
20139
+
20140
+ function performWork(minExpirationTime, dl) {
20141
+ deadline = dl;
20142
+
20143
+ // Keep working on roots until there's no more work, or until the we reach
20144
+ // the deadline.
20145
+ findHighestPriorityRoot();
20146
+
20147
+ if (enableUserTimingAPI && deadline !== null) {
20148
+ var didExpire = nextFlushedExpirationTime < recalculateCurrentTime();
20149
+ stopRequestCallbackTimer(didExpire);
20150
+ }
20151
+
20152
+ while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) {
20153
+ performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);
20154
+ // Find the next highest priority work.
20155
+ findHighestPriorityRoot();
20156
+ }
20157
+
20158
+ // We're done flushing work. Either we ran out of time in this callback,
20159
+ // or there's no more work left with sufficient priority.
20160
+
20161
+ // If we're inside a callback, set this to false since we just completed it.
20162
+ if (deadline !== null) {
20163
+ callbackExpirationTime = NoWork;
20164
+ callbackID = -1;
20165
+ }
20166
+ // If there's work left over, schedule a new callback.
20167
+ if (nextFlushedExpirationTime !== NoWork) {
20168
+ scheduleCallbackWithExpiration(nextFlushedExpirationTime);
20169
+ }
20170
+
20171
+ // Clean-up.
20172
+ deadline = null;
20173
+ deadlineDidExpire = false;
20174
+ nestedUpdateCount = 0;
20175
+
20176
+ if (hasUnhandledError) {
20177
+ var _error4 = unhandledError;
20178
+ unhandledError = null;
20179
+ hasUnhandledError = false;
20180
+ throw _error4;
20181
+ }
20182
+ }
20183
+
20184
+ function performWorkOnRoot(root, expirationTime) {
20185
+ !!isRendering ? invariant(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;
20186
+
20187
+ isRendering = true;
20188
+
20189
+ // Check if this is async work or sync/expired work.
20190
+ // TODO: Pass current time as argument to renderRoot, commitRoot
20191
+ if (expirationTime <= recalculateCurrentTime()) {
20192
+ // Flush sync work.
20193
+ var finishedWork = root.finishedWork;
20194
+ if (finishedWork !== null) {
20195
+ // This root is already complete. We can commit it.
20196
+ root.finishedWork = null;
20197
+ root.remainingExpirationTime = commitRoot(finishedWork);
20198
+ } else {
20199
+ root.finishedWork = null;
20200
+ finishedWork = renderRoot(root, expirationTime);
20201
+ if (finishedWork !== null) {
20202
+ // We've completed the root. Commit it.
20203
+ root.remainingExpirationTime = commitRoot(finishedWork);
20204
+ }
20205
+ }
20206
+ } else {
20207
+ // Flush async work.
20208
+ var _finishedWork = root.finishedWork;
20209
+ if (_finishedWork !== null) {
20210
+ // This root is already complete. We can commit it.
20211
+ root.finishedWork = null;
20212
+ root.remainingExpirationTime = commitRoot(_finishedWork);
20213
+ } else {
20214
+ root.finishedWork = null;
20215
+ _finishedWork = renderRoot(root, expirationTime);
20216
+ if (_finishedWork !== null) {
20217
+ // We've completed the root. Check the deadline one more time
20218
+ // before committing.
20219
+ if (!shouldYield()) {
20220
+ // Still time left. Commit the root.
20221
+ root.remainingExpirationTime = commitRoot(_finishedWork);
20222
+ } else {
20223
+ // There's no time left. Mark this root as complete. We'll come
20224
+ // back and commit it later.
20225
+ root.finishedWork = _finishedWork;
20226
+ }
20227
+ }
20228
+ }
20229
+ }
20230
+
20231
+ isRendering = false;
20232
+ }
20233
+
20234
+ // When working on async work, the reconciler asks the renderer if it should
20235
+ // yield execution. For DOM, we implement this with requestIdleCallback.
20236
+ function shouldYield() {
20237
+ if (deadline === null) {
20238
+ return false;
20239
+ }
20240
+ if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
20241
+ // Disregard deadline.didTimeout. Only expired work should be flushed
20242
+ // during a timeout. This path is only hit for non-expired work.
20243
+ return false;
20244
+ }
20245
+ deadlineDidExpire = true;
20246
+ return true;
20247
+ }
20248
+
20249
+ // TODO: Not happy about this hook. Conceptually, renderRoot should return a
20250
+ // tuple of (isReadyForCommit, didError, error)
20251
+ function onUncaughtError(error) {
20252
+ !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
20253
+ // Unschedule this root so we don't work on it again until there's
20254
+ // another update.
20255
+ nextFlushedRoot.remainingExpirationTime = NoWork;
20256
+ if (!hasUnhandledError) {
20257
+ hasUnhandledError = true;
20258
+ unhandledError = error;
20259
+ }
20260
+ }
20261
+
20262
+ // TODO: Batching should be implemented at the renderer level, not inside
20263
+ // the reconciler.
20264
+ function batchedUpdates(fn, a) {
20265
+ var previousIsBatchingUpdates = isBatchingUpdates;
20266
+ isBatchingUpdates = true;
20267
+ try {
20268
+ return fn(a);
20269
+ } finally {
20270
+ isBatchingUpdates = previousIsBatchingUpdates;
20271
+ if (!isBatchingUpdates && !isRendering) {
20272
+ performWork(Sync, null);
20273
+ }
20274
+ }
20275
+ }
20276
+
20277
+ // TODO: Batching should be implemented at the renderer level, not inside
20278
+ // the reconciler.
20279
+ function unbatchedUpdates(fn) {
20280
+ if (isBatchingUpdates && !isUnbatchingUpdates) {
20281
+ isUnbatchingUpdates = true;
20282
+ try {
20283
+ return fn();
20284
+ } finally {
20285
+ isUnbatchingUpdates = false;
20286
+ }
20287
+ }
20288
+ return fn();
20289
+ }
20290
+
20291
+ // TODO: Batching should be implemented at the renderer level, not within
20292
+ // the reconciler.
20293
+ function flushSync(fn) {
20294
+ var previousIsBatchingUpdates = isBatchingUpdates;
20295
+ isBatchingUpdates = true;
20296
+ try {
20297
+ return syncUpdates(fn);
20298
+ } finally {
20299
+ isBatchingUpdates = previousIsBatchingUpdates;
20300
+ !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
20301
+ performWork(Sync, null);
20302
+ }
20303
+ }
20304
+
20305
+ return {
20306
+ computeAsyncExpiration: computeAsyncExpiration,
20307
+ computeExpirationForFiber: computeExpirationForFiber,
20308
+ scheduleWork: scheduleWork,
20309
+ batchedUpdates: batchedUpdates,
20310
+ unbatchedUpdates: unbatchedUpdates,
20311
+ flushSync: flushSync,
20312
+ deferredUpdates: deferredUpdates
20313
+ };
20314
+ };
20315
+
20316
+ {
20317
+ var didWarnAboutNestedUpdates = false;
20318
+ }
20319
+
20320
+ // 0 is PROD, 1 is DEV.
20321
+ // Might add PROFILE later.
20322
+
20323
+
20324
+ function getContextForSubtree(parentComponent) {
20325
+ if (!parentComponent) {
20326
+ return emptyObject;
20327
+ }
20328
+
20329
+ var fiber = get(parentComponent);
20330
+ var parentContext = findCurrentUnmaskedContext(fiber);
20331
+ return isContextProvider(fiber) ? processChildContext(fiber, parentContext) : parentContext;
20332
+ }
20333
+
20334
+ var ReactFiberReconciler$1 = function (config) {
20335
+ var getPublicInstance = config.getPublicInstance;
20336
+
20337
+ var _ReactFiberScheduler = ReactFiberScheduler(config),
20338
+ computeAsyncExpiration = _ReactFiberScheduler.computeAsyncExpiration,
20339
+ computeExpirationForFiber = _ReactFiberScheduler.computeExpirationForFiber,
20340
+ scheduleWork = _ReactFiberScheduler.scheduleWork,
20341
+ batchedUpdates = _ReactFiberScheduler.batchedUpdates,
20342
+ unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates,
20343
+ flushSync = _ReactFiberScheduler.flushSync,
20344
+ deferredUpdates = _ReactFiberScheduler.deferredUpdates;
20345
+
20346
+ function scheduleTopLevelUpdate(current, element, callback) {
20347
+ {
20348
+ if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
20349
+ didWarnAboutNestedUpdates = true;
20350
+ warning(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(ReactDebugCurrentFiber.current) || 'Unknown');
20351
+ }
20352
+ }
20353
+
20354
+ callback = callback === undefined ? null : callback;
20355
+ {
20356
+ warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
20357
+ }
20358
+
20359
+ var expirationTime = void 0;
20360
+ // Check if the top-level element is an async wrapper component. If so,
20361
+ // treat updates to the root as async. This is a bit weird but lets us
20362
+ // avoid a separate `renderAsync` API.
20363
+ if (enableAsyncSubtreeAPI && element != null && element.type != null && element.type.prototype != null && element.type.prototype.unstable_isAsyncReactComponent === true) {
20364
+ expirationTime = computeAsyncExpiration();
20365
+ } else {
20366
+ expirationTime = computeExpirationForFiber(current);
20367
+ }
20368
+
20369
+ var update = {
20370
+ expirationTime: expirationTime,
20371
+ partialState: { element: element },
20372
+ callback: callback,
20373
+ isReplace: false,
20374
+ isForced: false,
20375
+ nextCallback: null,
20376
+ next: null
20377
+ };
20378
+ insertUpdateIntoFiber(current, update);
20379
+ scheduleWork(current, expirationTime);
20380
+ }
20381
+
20382
+ function findHostInstance(fiber) {
20383
+ var hostFiber = findCurrentHostFiber(fiber);
20384
+ if (hostFiber === null) {
20385
+ return null;
20386
+ }
20387
+ return hostFiber.stateNode;
20388
+ }
20389
+
20390
+ return {
20391
+ createContainer: function (containerInfo, hydrate) {
20392
+ return createFiberRoot(containerInfo, hydrate);
20393
+ },
20394
+ updateContainer: function (element, container, parentComponent, callback) {
20395
+ // TODO: If this is a nested container, this won't be the root.
20396
+ var current = container.current;
20397
+
20398
+ {
20399
+ if (ReactFiberInstrumentation_1.debugTool) {
20400
+ if (current.alternate === null) {
20401
+ ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
20402
+ } else if (element === null) {
20403
+ ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
20404
+ } else {
20405
+ ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
20406
+ }
20407
+ }
20408
+ }
20409
+
20410
+ var context = getContextForSubtree(parentComponent);
20411
+ if (container.context === null) {
20412
+ container.context = context;
20413
+ } else {
20414
+ container.pendingContext = context;
20415
+ }
20416
+
20417
+ scheduleTopLevelUpdate(current, element, callback);
20418
+ },
20419
+
20420
+
20421
+ batchedUpdates: batchedUpdates,
20422
+
20423
+ unbatchedUpdates: unbatchedUpdates,
20424
+
20425
+ deferredUpdates: deferredUpdates,
20426
+
20427
+ flushSync: flushSync,
20428
+
20429
+ getPublicRootInstance: function (container) {
20430
+ var containerFiber = container.current;
20431
+ if (!containerFiber.child) {
20432
+ return null;
20433
+ }
20434
+ switch (containerFiber.child.tag) {
20435
+ case HostComponent:
20436
+ return getPublicInstance(containerFiber.child.stateNode);
20437
+ default:
20438
+ return containerFiber.child.stateNode;
20439
+ }
20440
+ },
20441
+
20442
+
20443
+ findHostInstance: findHostInstance,
20444
+
20445
+ findHostInstanceWithNoPortals: function (fiber) {
20446
+ var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
20447
+ if (hostFiber === null) {
20448
+ return null;
20449
+ }
20450
+ return hostFiber.stateNode;
20451
+ },
20452
+ injectIntoDevTools: function (devToolsConfig) {
20453
+ var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
20454
+
20455
+ return injectInternals(_assign({}, devToolsConfig, {
20456
+ findHostInstanceByFiber: function (fiber) {
20457
+ return findHostInstance(fiber);
20458
+ },
20459
+ findFiberByHostInstance: function (instance) {
20460
+ if (!findFiberByHostInstance) {
20461
+ // Might not be implemented by the renderer.
20462
+ return null;
20463
+ }
20464
+ return findFiberByHostInstance(instance);
20465
+ }
20466
+ }));
20467
+ }
20468
+ };
20469
+ };
20470
+
20471
+ var ReactFiberReconciler$2 = Object.freeze({
20472
+ default: ReactFiberReconciler$1
20473
+ });
20474
+
20475
+ var ReactFiberReconciler$3 = ( ReactFiberReconciler$2 && ReactFiberReconciler$1 ) || ReactFiberReconciler$2;
20476
+
20477
+ // TODO: bundle Flow types with the package.
20478
+
20479
+
20480
+
20481
+ // TODO: decide on the top-level export form.
20482
+ // This is hacky but makes it work with both Rollup and Jest.
20483
+ var reactReconciler = ReactFiberReconciler$3['default'] ? ReactFiberReconciler$3['default'] : ReactFiberReconciler$3;
20484
+
20485
+ function createPortal$1(children, containerInfo,
20486
+ // TODO: figure out the API for cross-renderer implementation.
20487
+ implementation) {
20488
+ var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
20489
+
20490
+ return {
20491
+ // This tag allow us to uniquely identify this as a React Portal
20492
+ $$typeof: REACT_PORTAL_TYPE,
20493
+ key: key == null ? null : '' + key,
20494
+ children: children,
20495
+ containerInfo: containerInfo,
20496
+ implementation: implementation
20497
+ };
20498
+ }
20499
+
20500
+ // TODO: this is special because it gets imported during build.
20501
+
20502
+ var ReactVersion = '16.2.0';
20503
+
20504
+ // a requestAnimationFrame, storing the time for the start of the frame, then
20505
+ // scheduling a postMessage which gets scheduled after paint. Within the
20506
+ // postMessage handler do as much work as possible until time + frame rate.
20507
+ // By separating the idle call into a separate event tick we ensure that
20508
+ // layout, paint and other browser work is counted against the available time.
20509
+ // The frame rate is dynamically adjusted.
20510
+
20511
+ {
20512
+ if (ExecutionEnvironment.canUseDOM && typeof requestAnimationFrame !== 'function') {
20513
+ warning(false, 'React depends on requestAnimationFrame. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills');
20514
+ }
20515
+ }
20516
+
20517
+ var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
20518
+
20519
+ var now = void 0;
20520
+ if (hasNativePerformanceNow) {
20521
+ now = function () {
20522
+ return performance.now();
20523
+ };
20524
+ } else {
20525
+ now = function () {
20526
+ return Date.now();
20527
+ };
20528
+ }
20529
+
20530
+ // TODO: There's no way to cancel, because Fiber doesn't atm.
20531
+ var rIC = void 0;
20532
+ var cIC = void 0;
20533
+
20534
+ if (!ExecutionEnvironment.canUseDOM) {
20535
+ rIC = function (frameCallback) {
20536
+ return setTimeout(function () {
20537
+ frameCallback({
20538
+ timeRemaining: function () {
20539
+ return Infinity;
20540
+ }
20541
+ });
20542
+ });
20543
+ };
20544
+ cIC = function (timeoutID) {
20545
+ clearTimeout(timeoutID);
20546
+ };
20547
+ } else if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {
20548
+ // Polyfill requestIdleCallback and cancelIdleCallback
20549
+
20550
+ var scheduledRICCallback = null;
20551
+ var isIdleScheduled = false;
20552
+ var timeoutTime = -1;
20553
+
20554
+ var isAnimationFrameScheduled = false;
20555
+
20556
+ var frameDeadline = 0;
20557
+ // We start out assuming that we run at 30fps but then the heuristic tracking
20558
+ // will adjust this value to a faster fps if we get more frequent animation
20559
+ // frames.
20560
+ var previousFrameTime = 33;
20561
+ var activeFrameTime = 33;
20562
+
20563
+ var frameDeadlineObject;
20564
+ if (hasNativePerformanceNow) {
20565
+ frameDeadlineObject = {
20566
+ didTimeout: false,
20567
+ timeRemaining: function () {
20568
+ // We assume that if we have a performance timer that the rAF callback
20569
+ // gets a performance timer value. Not sure if this is always true.
20570
+ var remaining = frameDeadline - performance.now();
20571
+ return remaining > 0 ? remaining : 0;
20572
+ }
20573
+ };
20574
+ } else {
20575
+ frameDeadlineObject = {
20576
+ didTimeout: false,
20577
+ timeRemaining: function () {
20578
+ // Fallback to Date.now()
20579
+ var remaining = frameDeadline - Date.now();
20580
+ return remaining > 0 ? remaining : 0;
20581
+ }
20582
+ };
20583
+ }
20584
+
20585
+ // We use the postMessage trick to defer idle work until after the repaint.
20586
+ var messageKey = '__reactIdleCallback$' + Math.random().toString(36).slice(2);
20587
+ var idleTick = function (event) {
20588
+ if (event.source !== window || event.data !== messageKey) {
20589
+ return;
20590
+ }
20591
+
20592
+ isIdleScheduled = false;
20593
+
20594
+ var currentTime = now();
20595
+ if (frameDeadline - currentTime <= 0) {
20596
+ // There's no time left in this idle period. Check if the callback has
20597
+ // a timeout and whether it's been exceeded.
20598
+ if (timeoutTime !== -1 && timeoutTime <= currentTime) {
20599
+ // Exceeded the timeout. Invoke the callback even though there's no
20600
+ // time left.
20601
+ frameDeadlineObject.didTimeout = true;
20602
+ } else {
20603
+ // No timeout.
20604
+ if (!isAnimationFrameScheduled) {
20605
+ // Schedule another animation callback so we retry later.
20606
+ isAnimationFrameScheduled = true;
20607
+ requestAnimationFrame(animationTick);
20608
+ }
20609
+ // Exit without invoking the callback.
20610
+ return;
20611
+ }
20612
+ } else {
20613
+ // There's still time left in this idle period.
20614
+ frameDeadlineObject.didTimeout = false;
20615
+ }
20616
+
20617
+ timeoutTime = -1;
20618
+ var callback = scheduledRICCallback;
20619
+ scheduledRICCallback = null;
20620
+ if (callback !== null) {
20621
+ callback(frameDeadlineObject);
20622
+ }
20623
+ };
20624
+ // Assumes that we have addEventListener in this environment. Might need
20625
+ // something better for old IE.
20626
+ window.addEventListener('message', idleTick, false);
20627
+
20628
+ var animationTick = function (rafTime) {
20629
+ isAnimationFrameScheduled = false;
20630
+ var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
20631
+ if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
20632
+ if (nextFrameTime < 8) {
20633
+ // Defensive coding. We don't support higher frame rates than 120hz.
20634
+ // If we get lower than that, it is probably a bug.
20635
+ nextFrameTime = 8;
20636
+ }
20637
+ // If one frame goes long, then the next one can be short to catch up.
20638
+ // If two frames are short in a row, then that's an indication that we
20639
+ // actually have a higher frame rate than what we're currently optimizing.
20640
+ // We adjust our heuristic dynamically accordingly. For example, if we're
20641
+ // running on 120hz display or 90hz VR display.
20642
+ // Take the max of the two in case one of them was an anomaly due to
20643
+ // missed frame deadlines.
20644
+ activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;
20645
+ } else {
20646
+ previousFrameTime = nextFrameTime;
20647
+ }
20648
+ frameDeadline = rafTime + activeFrameTime;
20649
+ if (!isIdleScheduled) {
20650
+ isIdleScheduled = true;
20651
+ window.postMessage(messageKey, '*');
20652
+ }
20653
+ };
20654
+
20655
+ rIC = function (callback, options) {
20656
+ // This assumes that we only schedule one callback at a time because that's
20657
+ // how Fiber uses it.
20658
+ scheduledRICCallback = callback;
20659
+ if (options != null && typeof options.timeout === 'number') {
20660
+ timeoutTime = now() + options.timeout;
20661
+ }
20662
+ if (!isAnimationFrameScheduled) {
20663
+ // If rAF didn't already schedule one, we need to schedule a frame.
20664
+ // TODO: If this rAF doesn't materialize because the browser throttles, we
20665
+ // might want to still have setTimeout trigger rIC as a backup to ensure
20666
+ // that we keep performing work.
20667
+ isAnimationFrameScheduled = true;
20668
+ requestAnimationFrame(animationTick);
20669
+ }
20670
+ return 0;
20671
+ };
20672
+
20673
+ cIC = function () {
20674
+ scheduledRICCallback = null;
20675
+ isIdleScheduled = false;
20676
+ timeoutTime = -1;
20677
+ };
20678
+ } else {
20679
+ rIC = window.requestIdleCallback;
20680
+ cIC = window.cancelIdleCallback;
20681
+ }
20682
+
20683
+ /**
20684
+ * Forked from fbjs/warning:
20685
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
20686
+ *
20687
+ * Only change is we use console.warn instead of console.error,
20688
+ * and do nothing when 'console' is not supported.
20689
+ * This really simplifies the code.
20690
+ * ---
20691
+ * Similar to invariant but only logs a warning if the condition is not met.
20692
+ * This can be used to log issues in development environments in critical
20693
+ * paths. Removing the logging code for production environments will keep the
20694
+ * same logic and follow the same code paths.
20695
+ */
20696
+
20697
+ var lowPriorityWarning = function () {};
20698
+
20699
+ {
20700
+ var printWarning = function (format) {
20701
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
20702
+ args[_key - 1] = arguments[_key];
20703
+ }
20704
+
20705
+ var argIndex = 0;
20706
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
20707
+ return args[argIndex++];
20708
+ });
20709
+ if (typeof console !== 'undefined') {
20710
+ console.warn(message);
20711
+ }
20712
+ try {
20713
+ // --- Welcome to debugging React ---
20714
+ // This error was thrown as a convenience so that you can use this stack
20715
+ // to find the callsite that caused this warning to fire.
20716
+ throw new Error(message);
20717
+ } catch (x) {}
20718
+ };
20719
+
20720
+ lowPriorityWarning = function (condition, format) {
20721
+ if (format === undefined) {
20722
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
20723
+ }
20724
+ if (!condition) {
20725
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
20726
+ args[_key2 - 2] = arguments[_key2];
20727
+ }
20728
+
20729
+ printWarning.apply(undefined, [format].concat(args));
20730
+ }
20731
+ };
20732
+ }
20733
+
20734
+ var lowPriorityWarning$1 = lowPriorityWarning;
20735
+
20736
+ // isAttributeNameSafe() is currently duplicated in DOMMarkupOperations.
20737
+ // TODO: Find a better place for this.
20738
+ var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
20739
+ var illegalAttributeNameCache = {};
20740
+ var validatedAttributeNameCache = {};
20741
+ function isAttributeNameSafe(attributeName) {
20742
+ if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
20743
+ return true;
20744
+ }
20745
+ if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
20746
+ return false;
20747
+ }
20748
+ if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
20749
+ validatedAttributeNameCache[attributeName] = true;
20750
+ return true;
20751
+ }
20752
+ illegalAttributeNameCache[attributeName] = true;
20753
+ {
20754
+ warning(false, 'Invalid attribute name: `%s`', attributeName);
20755
+ }
20756
+ return false;
20757
+ }
20758
+
20759
+ // shouldIgnoreValue() is currently duplicated in DOMMarkupOperations.
20760
+ // TODO: Find a better place for this.
20761
+ function shouldIgnoreValue(propertyInfo, value) {
20762
+ return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
20763
+ }
20764
+
20765
+ /**
20766
+ * Operations for dealing with DOM properties.
20767
+ */
20768
+
20769
+
20770
+
20771
+
20772
+
20773
+ /**
20774
+ * Get the value for a property on a node. Only used in DEV for SSR validation.
20775
+ * The "expected" argument is used as a hint of what the expected value is.
20776
+ * Some properties have multiple equivalent values.
20777
+ */
20778
+ function getValueForProperty(node, name, expected) {
20779
+ {
20780
+ var propertyInfo = getPropertyInfo(name);
20781
+ if (propertyInfo) {
20782
+ var mutationMethod = propertyInfo.mutationMethod;
20783
+ if (mutationMethod || propertyInfo.mustUseProperty) {
20784
+ return node[propertyInfo.propertyName];
20785
+ } else {
20786
+ var attributeName = propertyInfo.attributeName;
20787
+
20788
+ var stringValue = null;
20789
+
20790
+ if (propertyInfo.hasOverloadedBooleanValue) {
20791
+ if (node.hasAttribute(attributeName)) {
20792
+ var value = node.getAttribute(attributeName);
20793
+ if (value === '') {
20794
+ return true;
20795
+ }
20796
+ if (shouldIgnoreValue(propertyInfo, expected)) {
20797
+ return value;
20798
+ }
20799
+ if (value === '' + expected) {
20800
+ return expected;
20801
+ }
20802
+ return value;
20803
+ }
20804
+ } else if (node.hasAttribute(attributeName)) {
20805
+ if (shouldIgnoreValue(propertyInfo, expected)) {
20806
+ // We had an attribute but shouldn't have had one, so read it
20807
+ // for the error message.
20808
+ return node.getAttribute(attributeName);
20809
+ }
20810
+ if (propertyInfo.hasBooleanValue) {
20811
+ // If this was a boolean, it doesn't matter what the value is
20812
+ // the fact that we have it is the same as the expected.
20813
+ return expected;
20814
+ }
20815
+ // Even if this property uses a namespace we use getAttribute
20816
+ // because we assume its namespaced name is the same as our config.
20817
+ // To use getAttributeNS we need the local name which we don't have
20818
+ // in our config atm.
20819
+ stringValue = node.getAttribute(attributeName);
20820
+ }
20821
+
20822
+ if (shouldIgnoreValue(propertyInfo, expected)) {
20823
+ return stringValue === null ? expected : stringValue;
20824
+ } else if (stringValue === '' + expected) {
20825
+ return expected;
20826
+ } else {
20827
+ return stringValue;
20828
+ }
20829
+ }
20830
+ }
20831
+ }
20832
+ }
20833
+
20834
+ /**
20835
+ * Get the value for a attribute on a node. Only used in DEV for SSR validation.
20836
+ * The third argument is used as a hint of what the expected value is. Some
20837
+ * attributes have multiple equivalent values.
20838
+ */
20839
+ function getValueForAttribute(node, name, expected) {
20840
+ {
20841
+ if (!isAttributeNameSafe(name)) {
20842
+ return;
20843
+ }
20844
+ if (!node.hasAttribute(name)) {
20845
+ return expected === undefined ? undefined : null;
20846
+ }
20847
+ var value = node.getAttribute(name);
20848
+ if (value === '' + expected) {
20849
+ return expected;
20850
+ }
20851
+ return value;
20852
+ }
20853
+ }
20854
+
20855
+ /**
20856
+ * Sets the value for a property on a node.
20857
+ *
20858
+ * @param {DOMElement} node
20859
+ * @param {string} name
20860
+ * @param {*} value
20861
+ */
20862
+ function setValueForProperty(node, name, value) {
20863
+ var propertyInfo = getPropertyInfo(name);
20864
+
20865
+ if (propertyInfo && shouldSetAttribute(name, value)) {
20866
+ var mutationMethod = propertyInfo.mutationMethod;
20867
+ if (mutationMethod) {
20868
+ mutationMethod(node, value);
20869
+ } else if (shouldIgnoreValue(propertyInfo, value)) {
20870
+ deleteValueForProperty(node, name);
20871
+ return;
20872
+ } else if (propertyInfo.mustUseProperty) {
20873
+ // Contrary to `setAttribute`, object properties are properly
20874
+ // `toString`ed by IE8/9.
20875
+ node[propertyInfo.propertyName] = value;
20876
+ } else {
20877
+ var attributeName = propertyInfo.attributeName;
20878
+ var namespace = propertyInfo.attributeNamespace;
20879
+ // `setAttribute` with objects becomes only `[object]` in IE8/9,
20880
+ // ('' + value) makes it output the correct toString()-value.
20881
+ if (namespace) {
20882
+ node.setAttributeNS(namespace, attributeName, '' + value);
20883
+ } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
20884
+ node.setAttribute(attributeName, '');
20885
+ } else {
20886
+ node.setAttribute(attributeName, '' + value);
20887
+ }
20888
+ }
20889
+ } else {
20890
+ setValueForAttribute(node, name, shouldSetAttribute(name, value) ? value : null);
20891
+ return;
20892
+ }
20893
+
20894
+ {
20895
+
20896
+ }
20897
+ }
20898
+
20899
+ function setValueForAttribute(node, name, value) {
20900
+ if (!isAttributeNameSafe(name)) {
20901
+ return;
20902
+ }
20903
+ if (value == null) {
20904
+ node.removeAttribute(name);
20905
+ } else {
20906
+ node.setAttribute(name, '' + value);
20907
+ }
20908
+
20909
+ {
20910
+
20911
+ }
20912
+ }
20913
+
20914
+ /**
20915
+ * Deletes an attributes from a node.
20916
+ *
20917
+ * @param {DOMElement} node
20918
+ * @param {string} name
20919
+ */
20920
+ function deleteValueForAttribute(node, name) {
20921
+ node.removeAttribute(name);
20922
+ }
20923
+
20924
+ /**
20925
+ * Deletes the value for a property on a node.
20926
+ *
20927
+ * @param {DOMElement} node
20928
+ * @param {string} name
20929
+ */
20930
+ function deleteValueForProperty(node, name) {
20931
+ var propertyInfo = getPropertyInfo(name);
20932
+ if (propertyInfo) {
20933
+ var mutationMethod = propertyInfo.mutationMethod;
20934
+ if (mutationMethod) {
20935
+ mutationMethod(node, undefined);
20936
+ } else if (propertyInfo.mustUseProperty) {
20937
+ var propName = propertyInfo.propertyName;
20938
+ if (propertyInfo.hasBooleanValue) {
20939
+ node[propName] = false;
20940
+ } else {
20941
+ node[propName] = '';
20942
+ }
20943
+ } else {
20944
+ node.removeAttribute(propertyInfo.attributeName);
20945
+ }
20946
+ } else {
20947
+ node.removeAttribute(name);
20948
+ }
20949
+ }
20950
+
20951
+ var ReactControlledValuePropTypes = {
20952
+ checkPropTypes: null
20953
+ };
20954
+
20955
+ {
20956
+ var hasReadOnlyValue = {
20957
+ button: true,
20958
+ checkbox: true,
20959
+ image: true,
20960
+ hidden: true,
20961
+ radio: true,
20962
+ reset: true,
20963
+ submit: true
20964
+ };
20965
+
20966
+ var propTypes = {
20967
+ value: function (props, propName, componentName) {
20968
+ if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
20969
+ return null;
20970
+ }
20971
+ return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
20972
+ },
20973
+ checked: function (props, propName, componentName) {
20974
+ if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
20975
+ return null;
20976
+ }
20977
+ return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
20978
+ }
20979
+ };
20980
+
20981
+ /**
20982
+ * Provide a linked `value` attribute for controlled forms. You should not use
20983
+ * this outside of the ReactDOM controlled form components.
20984
+ */
20985
+ ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) {
20986
+ checkPropTypes(propTypes, props, 'prop', tagName, getStack);
20987
+ };
20988
+ }
20989
+
20990
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
20991
+ var getCurrentFiberOwnerName$2 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;
20992
+ var getCurrentFiberStackAddendum$3 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
20993
+
20994
+ var didWarnValueDefaultValue = false;
20995
+ var didWarnCheckedDefaultChecked = false;
20996
+ var didWarnControlledToUncontrolled = false;
20997
+ var didWarnUncontrolledToControlled = false;
20998
+
20999
+ function isControlled(props) {
21000
+ var usesChecked = props.type === 'checkbox' || props.type === 'radio';
21001
+ return usesChecked ? props.checked != null : props.value != null;
21002
+ }
21003
+
21004
+ /**
21005
+ * Implements an <input> host component that allows setting these optional
21006
+ * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
21007
+ *
21008
+ * If `checked` or `value` are not supplied (or null/undefined), user actions
21009
+ * that affect the checked state or value will trigger updates to the element.
21010
+ *
21011
+ * If they are supplied (and not null/undefined), the rendered element will not
21012
+ * trigger updates to the element. Instead, the props must change in order for
21013
+ * the rendered element to be updated.
21014
+ *
21015
+ * The rendered element will be initialized as unchecked (or `defaultChecked`)
21016
+ * with an empty value (or `defaultValue`).
21017
+ *
21018
+ * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
21019
+ */
21020
+
21021
+ function getHostProps(element, props) {
21022
+ var node = element;
21023
+ var value = props.value;
21024
+ var checked = props.checked;
21025
+
21026
+ var hostProps = _assign({
21027
+ // Make sure we set .type before any other properties (setting .value
21028
+ // before .type means .value is lost in IE11 and below)
21029
+ type: undefined,
21030
+ // Make sure we set .step before .value (setting .value before .step
21031
+ // means .value is rounded on mount, based upon step precision)
21032
+ step: undefined,
21033
+ // Make sure we set .min & .max before .value (to ensure proper order
21034
+ // in corner cases such as min or max deriving from value, e.g. Issue #7170)
21035
+ min: undefined,
21036
+ max: undefined
21037
+ }, props, {
21038
+ defaultChecked: undefined,
21039
+ defaultValue: undefined,
21040
+ value: value != null ? value : node._wrapperState.initialValue,
21041
+ checked: checked != null ? checked : node._wrapperState.initialChecked
21042
+ });
21043
+
21044
+ return hostProps;
21045
+ }
21046
+
21047
+ function initWrapperState(element, props) {
21048
+ {
21049
+ ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum$3);
21050
+
21051
+ if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
21052
+ warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type);
21053
+ didWarnCheckedDefaultChecked = true;
21054
+ }
21055
+ if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
21056
+ warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type);
21057
+ didWarnValueDefaultValue = true;
21058
+ }
21059
+ }
21060
+
21061
+ var defaultValue = props.defaultValue;
21062
+ var node = element;
21063
+ node._wrapperState = {
21064
+ initialChecked: props.checked != null ? props.checked : props.defaultChecked,
21065
+ initialValue: props.value != null ? props.value : defaultValue,
21066
+ controlled: isControlled(props)
21067
+ };
21068
+ }
21069
+
21070
+ function updateChecked(element, props) {
21071
+ var node = element;
21072
+ var checked = props.checked;
21073
+ if (checked != null) {
21074
+ setValueForProperty(node, 'checked', checked);
21075
+ }
21076
+ }
21077
+
21078
+ function updateWrapper(element, props) {
21079
+ var node = element;
21080
+ {
21081
+ var controlled = isControlled(props);
21082
+
21083
+ if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
21084
+ warning(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3());
21085
+ didWarnUncontrolledToControlled = true;
21086
+ }
21087
+ if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
21088
+ warning(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3());
21089
+ didWarnControlledToUncontrolled = true;
21090
+ }
21091
+ }
21092
+
21093
+ updateChecked(element, props);
21094
+
21095
+ var value = props.value;
21096
+ if (value != null) {
21097
+ if (value === 0 && node.value === '') {
21098
+ node.value = '0';
21099
+ // Note: IE9 reports a number inputs as 'text', so check props instead.
21100
+ } else if (props.type === 'number') {
21101
+ // Simulate `input.valueAsNumber`. IE9 does not support it
21102
+ var valueAsNumber = parseFloat(node.value) || 0;
21103
+
21104
+ if (
21105
+ // eslint-disable-next-line
21106
+ value != valueAsNumber ||
21107
+ // eslint-disable-next-line
21108
+ value == valueAsNumber && node.value != value) {
21109
+ // Cast `value` to a string to ensure the value is set correctly. While
21110
+ // browsers typically do this as necessary, jsdom doesn't.
21111
+ node.value = '' + value;
21112
+ }
21113
+ } else if (node.value !== '' + value) {
21114
+ // Cast `value` to a string to ensure the value is set correctly. While
21115
+ // browsers typically do this as necessary, jsdom doesn't.
21116
+ node.value = '' + value;
21117
+ }
21118
+ } else {
21119
+ if (props.value == null && props.defaultValue != null) {
21120
+ // In Chrome, assigning defaultValue to certain input types triggers input validation.
21121
+ // For number inputs, the display value loses trailing decimal points. For email inputs,
21122
+ // Chrome raises "The specified value <x> is not a valid email address".
21123
+ //
21124
+ // Here we check to see if the defaultValue has actually changed, avoiding these problems
21125
+ // when the user is inputting text
21126
+ //
21127
+ // https://github.com/facebook/react/issues/7253
21128
+ if (node.defaultValue !== '' + props.defaultValue) {
21129
+ node.defaultValue = '' + props.defaultValue;
21130
+ }
21131
+ }
21132
+ if (props.checked == null && props.defaultChecked != null) {
21133
+ node.defaultChecked = !!props.defaultChecked;
21134
+ }
21135
+ }
21136
+ }
21137
+
21138
+ function postMountWrapper(element, props) {
21139
+ var node = element;
21140
+
21141
+ // Detach value from defaultValue. We won't do anything if we're working on
21142
+ // submit or reset inputs as those values & defaultValues are linked. They
21143
+ // are not resetable nodes so this operation doesn't matter and actually
21144
+ // removes browser-default values (eg "Submit Query") when no value is
21145
+ // provided.
21146
+
21147
+ switch (props.type) {
21148
+ case 'submit':
21149
+ case 'reset':
21150
+ break;
21151
+ case 'color':
21152
+ case 'date':
21153
+ case 'datetime':
21154
+ case 'datetime-local':
21155
+ case 'month':
21156
+ case 'time':
21157
+ case 'week':
21158
+ // This fixes the no-show issue on iOS Safari and Android Chrome:
21159
+ // https://github.com/facebook/react/issues/7233
21160
+ node.value = '';
21161
+ node.value = node.defaultValue;
21162
+ break;
21163
+ default:
21164
+ node.value = node.value;
21165
+ break;
21166
+ }
21167
+
21168
+ // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
21169
+ // this is needed to work around a chrome bug where setting defaultChecked
21170
+ // will sometimes influence the value of checked (even after detachment).
21171
+ // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
21172
+ // We need to temporarily unset name to avoid disrupting radio button groups.
21173
+ var name = node.name;
21174
+ if (name !== '') {
21175
+ node.name = '';
21176
+ }
21177
+ node.defaultChecked = !node.defaultChecked;
21178
+ node.defaultChecked = !node.defaultChecked;
21179
+ if (name !== '') {
21180
+ node.name = name;
21181
+ }
21182
+ }
21183
+
21184
+ function restoreControlledState$1(element, props) {
21185
+ var node = element;
21186
+ updateWrapper(node, props);
21187
+ updateNamedCousins(node, props);
21188
+ }
21189
+
21190
+ function updateNamedCousins(rootNode, props) {
21191
+ var name = props.name;
21192
+ if (props.type === 'radio' && name != null) {
21193
+ var queryRoot = rootNode;
21194
+
21195
+ while (queryRoot.parentNode) {
21196
+ queryRoot = queryRoot.parentNode;
21197
+ }
21198
+
21199
+ // If `rootNode.form` was non-null, then we could try `form.elements`,
21200
+ // but that sometimes behaves strangely in IE8. We could also try using
21201
+ // `form.getElementsByName`, but that will only return direct children
21202
+ // and won't include inputs that use the HTML5 `form=` attribute. Since
21203
+ // the input might not even be in a form. It might not even be in the
21204
+ // document. Let's just use the local `querySelectorAll` to ensure we don't
21205
+ // miss anything.
21206
+ var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
21207
+
21208
+ for (var i = 0; i < group.length; i++) {
21209
+ var otherNode = group[i];
21210
+ if (otherNode === rootNode || otherNode.form !== rootNode.form) {
21211
+ continue;
21212
+ }
21213
+ // This will throw if radio buttons rendered by different copies of React
21214
+ // and the same name are rendered into the same form (same as #1939).
21215
+ // That's probably okay; we don't support it just as we don't support
21216
+ // mixing React radio buttons with non-React ones.
21217
+ var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
21218
+ !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;
21219
+
21220
+ // We need update the tracked value on the named cousin since the value
21221
+ // was changed but the input saw no event or value set
21222
+ updateValueIfChanged(otherNode);
21223
+
21224
+ // If this is a controlled radio button group, forcing the input that
21225
+ // was previously checked to update will cause it to be come re-checked
21226
+ // as appropriate.
21227
+ updateWrapper(otherNode, otherProps);
21228
+ }
21229
+ }
21230
+ }
21231
+
21232
+ function flattenChildren(children) {
21233
+ var content = '';
21234
+
21235
+ // Flatten children and warn if they aren't strings or numbers;
21236
+ // invalid types are ignored.
21237
+ // We can silently skip them because invalid DOM nesting warning
21238
+ // catches these cases in Fiber.
21239
+ React.Children.forEach(children, function (child) {
21240
+ if (child == null) {
21241
+ return;
21242
+ }
21243
+ if (typeof child === 'string' || typeof child === 'number') {
21244
+ content += child;
21245
+ }
21246
+ });
21247
+
21248
+ return content;
21249
+ }
21250
+
21251
+ /**
21252
+ * Implements an <option> host component that warns when `selected` is set.
21253
+ */
21254
+
21255
+ function validateProps(element, props) {
21256
+ // TODO (yungsters): Remove support for `selected` in <option>.
21257
+ {
21258
+ warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
21259
+ }
21260
+ }
21261
+
21262
+ function postMountWrapper$1(element, props) {
21263
+ // value="" should make a value attribute (#6219)
21264
+ if (props.value != null) {
21265
+ element.setAttribute('value', props.value);
21266
+ }
21267
+ }
21268
+
21269
+ function getHostProps$1(element, props) {
21270
+ var hostProps = _assign({ children: undefined }, props);
21271
+ var content = flattenChildren(props.children);
21272
+
21273
+ if (content) {
21274
+ hostProps.children = content;
21275
+ }
21276
+
21277
+ return hostProps;
21278
+ }
21279
+
21280
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
21281
+ var getCurrentFiberOwnerName$3 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;
21282
+ var getCurrentFiberStackAddendum$4 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
21283
+
21284
+
21285
+ {
21286
+ var didWarnValueDefaultValue$1 = false;
21287
+ }
21288
+
21289
+ function getDeclarationErrorAddendum() {
21290
+ var ownerName = getCurrentFiberOwnerName$3();
21291
+ if (ownerName) {
21292
+ return '\n\nCheck the render method of `' + ownerName + '`.';
21293
+ }
21294
+ return '';
21295
+ }
21296
+
21297
+ var valuePropNames = ['value', 'defaultValue'];
21298
+
21299
+ /**
21300
+ * Validation function for `value` and `defaultValue`.
21301
+ */
21302
+ function checkSelectPropTypes(props) {
21303
+ ReactControlledValuePropTypes.checkPropTypes('select', props, getCurrentFiberStackAddendum$4);
21304
+
21305
+ for (var i = 0; i < valuePropNames.length; i++) {
21306
+ var propName = valuePropNames[i];
21307
+ if (props[propName] == null) {
21308
+ continue;
21309
+ }
21310
+ var isArray = Array.isArray(props[propName]);
21311
+ if (props.multiple && !isArray) {
21312
+ warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
21313
+ } else if (!props.multiple && isArray) {
21314
+ warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
21315
+ }
21316
+ }
21317
+ }
21318
+
21319
+ function updateOptions(node, multiple, propValue, setDefaultSelected) {
21320
+ var options = node.options;
21321
+
21322
+ if (multiple) {
21323
+ var selectedValues = propValue;
21324
+ var selectedValue = {};
21325
+ for (var i = 0; i < selectedValues.length; i++) {
21326
+ // Prefix to avoid chaos with special keys.
21327
+ selectedValue['$' + selectedValues[i]] = true;
21328
+ }
21329
+ for (var _i = 0; _i < options.length; _i++) {
21330
+ var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
21331
+ if (options[_i].selected !== selected) {
21332
+ options[_i].selected = selected;
21333
+ }
21334
+ if (selected && setDefaultSelected) {
21335
+ options[_i].defaultSelected = true;
21336
+ }
21337
+ }
21338
+ } else {
21339
+ // Do not set `select.value` as exact behavior isn't consistent across all
21340
+ // browsers for all cases.
21341
+ var _selectedValue = '' + propValue;
21342
+ var defaultSelected = null;
21343
+ for (var _i2 = 0; _i2 < options.length; _i2++) {
21344
+ if (options[_i2].value === _selectedValue) {
21345
+ options[_i2].selected = true;
21346
+ if (setDefaultSelected) {
21347
+ options[_i2].defaultSelected = true;
21348
+ }
21349
+ return;
21350
+ }
21351
+ if (defaultSelected === null && !options[_i2].disabled) {
21352
+ defaultSelected = options[_i2];
21353
+ }
21354
+ }
21355
+ if (defaultSelected !== null) {
21356
+ defaultSelected.selected = true;
21357
+ }
21358
+ }
21359
+ }
21360
+
21361
+ /**
21362
+ * Implements a <select> host component that allows optionally setting the
21363
+ * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
21364
+ * stringable. If `multiple` is true, the prop must be an array of stringables.
21365
+ *
21366
+ * If `value` is not supplied (or null/undefined), user actions that change the
21367
+ * selected option will trigger updates to the rendered options.
21368
+ *
21369
+ * If it is supplied (and not null/undefined), the rendered options will not
21370
+ * update in response to user actions. Instead, the `value` prop must change in
21371
+ * order for the rendered options to update.
21372
+ *
21373
+ * If `defaultValue` is provided, any options with the supplied values will be
21374
+ * selected.
21375
+ */
21376
+
21377
+ function getHostProps$2(element, props) {
21378
+ return _assign({}, props, {
21379
+ value: undefined
21380
+ });
21381
+ }
21382
+
21383
+ function initWrapperState$1(element, props) {
21384
+ var node = element;
21385
+ {
21386
+ checkSelectPropTypes(props);
21387
+ }
21388
+
21389
+ var value = props.value;
21390
+ node._wrapperState = {
21391
+ initialValue: value != null ? value : props.defaultValue,
21392
+ wasMultiple: !!props.multiple
21393
+ };
21394
+
21395
+ {
21396
+ if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
21397
+ warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
21398
+ didWarnValueDefaultValue$1 = true;
21399
+ }
21400
+ }
21401
+ }
21402
+
21403
+ function postMountWrapper$2(element, props) {
21404
+ var node = element;
21405
+ node.multiple = !!props.multiple;
21406
+ var value = props.value;
21407
+ if (value != null) {
21408
+ updateOptions(node, !!props.multiple, value, false);
21409
+ } else if (props.defaultValue != null) {
21410
+ updateOptions(node, !!props.multiple, props.defaultValue, true);
21411
+ }
21412
+ }
21413
+
21414
+ function postUpdateWrapper(element, props) {
21415
+ var node = element;
21416
+ // After the initial mount, we control selected-ness manually so don't pass
21417
+ // this value down
21418
+ node._wrapperState.initialValue = undefined;
21419
+
21420
+ var wasMultiple = node._wrapperState.wasMultiple;
21421
+ node._wrapperState.wasMultiple = !!props.multiple;
21422
+
21423
+ var value = props.value;
21424
+ if (value != null) {
21425
+ updateOptions(node, !!props.multiple, value, false);
21426
+ } else if (wasMultiple !== !!props.multiple) {
21427
+ // For simplicity, reapply `defaultValue` if `multiple` is toggled.
21428
+ if (props.defaultValue != null) {
21429
+ updateOptions(node, !!props.multiple, props.defaultValue, true);
21430
+ } else {
21431
+ // Revert the select back to its default unselected state.
21432
+ updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
21433
+ }
21434
+ }
21435
+ }
21436
+
21437
+ function restoreControlledState$2(element, props) {
21438
+ var node = element;
21439
+ var value = props.value;
21440
+
21441
+ if (value != null) {
21442
+ updateOptions(node, !!props.multiple, value, false);
21443
+ }
21444
+ }
21445
+
21446
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
21447
+ var getCurrentFiberStackAddendum$5 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
21448
+
21449
+ var didWarnValDefaultVal = false;
21450
+
21451
+ /**
21452
+ * Implements a <textarea> host component that allows setting `value`, and
21453
+ * `defaultValue`. This differs from the traditional DOM API because value is
21454
+ * usually set as PCDATA children.
21455
+ *
21456
+ * If `value` is not supplied (or null/undefined), user actions that affect the
21457
+ * value will trigger updates to the element.
21458
+ *
21459
+ * If `value` is supplied (and not null/undefined), the rendered element will
21460
+ * not trigger updates to the element. Instead, the `value` prop must change in
21461
+ * order for the rendered element to be updated.
21462
+ *
21463
+ * The rendered element will be initialized with an empty value, the prop
21464
+ * `defaultValue` if specified, or the children content (deprecated).
21465
+ */
21466
+
21467
+ function getHostProps$3(element, props) {
21468
+ var node = element;
21469
+ !(props.dangerouslySetInnerHTML == null) ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0;
21470
+
21471
+ // Always set children to the same thing. In IE9, the selection range will
21472
+ // get reset if `textContent` is mutated. We could add a check in setTextContent
21473
+ // to only set the value if/when the value differs from the node value (which would
21474
+ // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
21475
+ // solution. The value can be a boolean or object so that's why it's forced
21476
+ // to be a string.
21477
+ var hostProps = _assign({}, props, {
21478
+ value: undefined,
21479
+ defaultValue: undefined,
21480
+ children: '' + node._wrapperState.initialValue
21481
+ });
21482
+
21483
+ return hostProps;
21484
+ }
21485
+
21486
+ function initWrapperState$2(element, props) {
21487
+ var node = element;
21488
+ {
21489
+ ReactControlledValuePropTypes.checkPropTypes('textarea', props, getCurrentFiberStackAddendum$5);
21490
+ if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
21491
+ warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
21492
+ didWarnValDefaultVal = true;
21493
+ }
21494
+ }
21495
+
21496
+ var initialValue = props.value;
21497
+
21498
+ // Only bother fetching default value if we're going to use it
21499
+ if (initialValue == null) {
21500
+ var defaultValue = props.defaultValue;
21501
+ // TODO (yungsters): Remove support for children content in <textarea>.
21502
+ var children = props.children;
21503
+ if (children != null) {
21504
+ {
21505
+ warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
21506
+ }
21507
+ !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
21508
+ if (Array.isArray(children)) {
21509
+ !(children.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
21510
+ children = children[0];
21511
+ }
21512
+
21513
+ defaultValue = '' + children;
21514
+ }
21515
+ if (defaultValue == null) {
21516
+ defaultValue = '';
21517
+ }
21518
+ initialValue = defaultValue;
21519
+ }
21520
+
21521
+ node._wrapperState = {
21522
+ initialValue: '' + initialValue
21523
+ };
21524
+ }
21525
+
21526
+ function updateWrapper$1(element, props) {
21527
+ var node = element;
21528
+ var value = props.value;
21529
+ if (value != null) {
21530
+ // Cast `value` to a string to ensure the value is set correctly. While
21531
+ // browsers typically do this as necessary, jsdom doesn't.
21532
+ var newValue = '' + value;
21533
+
21534
+ // To avoid side effects (such as losing text selection), only set value if changed
21535
+ if (newValue !== node.value) {
21536
+ node.value = newValue;
21537
+ }
21538
+ if (props.defaultValue == null) {
21539
+ node.defaultValue = newValue;
21540
+ }
21541
+ }
21542
+ if (props.defaultValue != null) {
21543
+ node.defaultValue = props.defaultValue;
21544
+ }
21545
+ }
21546
+
21547
+ function postMountWrapper$3(element, props) {
21548
+ var node = element;
21549
+ // This is in postMount because we need access to the DOM node, which is not
21550
+ // available until after the component has mounted.
21551
+ var textContent = node.textContent;
21552
+
21553
+ // Only set node.value if textContent is equal to the expected
21554
+ // initial value. In IE10/IE11 there is a bug where the placeholder attribute
21555
+ // will populate textContent as well.
21556
+ // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
21557
+ if (textContent === node._wrapperState.initialValue) {
21558
+ node.value = textContent;
21559
+ }
21560
+ }
21561
+
21562
+ function restoreControlledState$3(element, props) {
21563
+ // DOM component is still mounted; update
21564
+ updateWrapper$1(element, props);
21565
+ }
21566
+
21567
+ var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
21568
+ var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
21569
+ var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
21570
+
21571
+ var Namespaces = {
21572
+ html: HTML_NAMESPACE$1,
21573
+ mathml: MATH_NAMESPACE,
21574
+ svg: SVG_NAMESPACE
21575
+ };
21576
+
21577
+ // Assumes there is no parent namespace.
21578
+ function getIntrinsicNamespace(type) {
21579
+ switch (type) {
21580
+ case 'svg':
21581
+ return SVG_NAMESPACE;
21582
+ case 'math':
21583
+ return MATH_NAMESPACE;
21584
+ default:
21585
+ return HTML_NAMESPACE$1;
21586
+ }
21587
+ }
21588
+
21589
+ function getChildNamespace(parentNamespace, type) {
21590
+ if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
21591
+ // No (or default) parent namespace: potential entry point.
21592
+ return getIntrinsicNamespace(type);
21593
+ }
21594
+ if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
21595
+ // We're leaving SVG.
21596
+ return HTML_NAMESPACE$1;
21597
+ }
21598
+ // By default, pass namespace below.
21599
+ return parentNamespace;
21600
+ }
21601
+
21602
+ /* globals MSApp */
21603
+
21604
+ /**
21605
+ * Create a function which has 'unsafe' privileges (required by windows8 apps)
21606
+ */
21607
+ var createMicrosoftUnsafeLocalFunction = function (func) {
21608
+ if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
21609
+ return function (arg0, arg1, arg2, arg3) {
21610
+ MSApp.execUnsafeLocalFunction(function () {
21611
+ return func(arg0, arg1, arg2, arg3);
21612
+ });
21613
+ };
21614
+ } else {
21615
+ return func;
21616
+ }
21617
+ };
21618
+
21619
+ // SVG temp container for IE lacking innerHTML
21620
+ var reusableSVGContainer = void 0;
21621
+
21622
+ /**
21623
+ * Set the innerHTML property of a node
21624
+ *
21625
+ * @param {DOMElement} node
21626
+ * @param {string} html
21627
+ * @internal
21628
+ */
21629
+ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
21630
+ // IE does not have innerHTML for SVG nodes, so instead we inject the
21631
+ // new markup in a temp node and then move the child nodes across into
21632
+ // the target node
21633
+
21634
+ if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) {
21635
+ reusableSVGContainer = reusableSVGContainer || document.createElement('div');
21636
+ reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
21637
+ var svgNode = reusableSVGContainer.firstChild;
21638
+ while (node.firstChild) {
21639
+ node.removeChild(node.firstChild);
21640
+ }
21641
+ while (svgNode.firstChild) {
21642
+ node.appendChild(svgNode.firstChild);
21643
+ }
21644
+ } else {
21645
+ node.innerHTML = html;
21646
+ }
21647
+ });
21648
+
21649
+ /**
21650
+ * Set the textContent property of a node, ensuring that whitespace is preserved
21651
+ * even in IE8. innerText is a poor substitute for textContent and, among many
21652
+ * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
21653
+ * as it should.
21654
+ *
21655
+ * @param {DOMElement} node
21656
+ * @param {string} text
21657
+ * @internal
21658
+ */
21659
+ var setTextContent = function (node, text) {
21660
+ if (text) {
21661
+ var firstChild = node.firstChild;
21662
+
21663
+ if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
21664
+ firstChild.nodeValue = text;
21665
+ return;
21666
+ }
21667
+ }
21668
+ node.textContent = text;
21669
+ };
21670
+
21671
+ /**
21672
+ * CSS properties which accept numbers but are not in units of "px".
21673
+ */
21674
+ var isUnitlessNumber = {
21675
+ animationIterationCount: true,
21676
+ borderImageOutset: true,
21677
+ borderImageSlice: true,
21678
+ borderImageWidth: true,
21679
+ boxFlex: true,
21680
+ boxFlexGroup: true,
21681
+ boxOrdinalGroup: true,
21682
+ columnCount: true,
21683
+ columns: true,
21684
+ flex: true,
21685
+ flexGrow: true,
21686
+ flexPositive: true,
21687
+ flexShrink: true,
21688
+ flexNegative: true,
21689
+ flexOrder: true,
21690
+ gridRow: true,
21691
+ gridRowEnd: true,
21692
+ gridRowSpan: true,
21693
+ gridRowStart: true,
21694
+ gridColumn: true,
21695
+ gridColumnEnd: true,
21696
+ gridColumnSpan: true,
21697
+ gridColumnStart: true,
21698
+ fontWeight: true,
21699
+ lineClamp: true,
21700
+ lineHeight: true,
21701
+ opacity: true,
21702
+ order: true,
21703
+ orphans: true,
21704
+ tabSize: true,
21705
+ widows: true,
21706
+ zIndex: true,
21707
+ zoom: true,
21708
+
21709
+ // SVG-related properties
21710
+ fillOpacity: true,
21711
+ floodOpacity: true,
21712
+ stopOpacity: true,
21713
+ strokeDasharray: true,
21714
+ strokeDashoffset: true,
21715
+ strokeMiterlimit: true,
21716
+ strokeOpacity: true,
21717
+ strokeWidth: true
21718
+ };
21719
+
21720
+ /**
21721
+ * @param {string} prefix vendor-specific prefix, eg: Webkit
21722
+ * @param {string} key style name, eg: transitionDuration
21723
+ * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
21724
+ * WebkitTransitionDuration
21725
+ */
21726
+ function prefixKey(prefix, key) {
21727
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
21728
+ }
21729
+
21730
+ /**
21731
+ * Support style names that may come passed in prefixed by adding permutations
21732
+ * of vendor prefixes.
21733
+ */
21734
+ var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
21735
+
21736
+ // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
21737
+ // infinite loop, because it iterates over the newly added props too.
21738
+ Object.keys(isUnitlessNumber).forEach(function (prop) {
21739
+ prefixes.forEach(function (prefix) {
21740
+ isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
21741
+ });
21742
+ });
21743
+
21744
+ /**
21745
+ * Convert a value into the proper css writable value. The style name `name`
21746
+ * should be logical (no hyphens), as specified
21747
+ * in `CSSProperty.isUnitlessNumber`.
21748
+ *
21749
+ * @param {string} name CSS property name such as `topMargin`.
21750
+ * @param {*} value CSS property value such as `10px`.
21751
+ * @return {string} Normalized style value with dimensions applied.
21752
+ */
21753
+ function dangerousStyleValue(name, value, isCustomProperty) {
21754
+ // Note that we've removed escapeTextForBrowser() calls here since the
21755
+ // whole string will be escaped when the attribute is injected into
21756
+ // the markup. If you provide unsafe user data here they can inject
21757
+ // arbitrary CSS which may be problematic (I couldn't repro this):
21758
+ // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
21759
+ // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
21760
+ // This is not an XSS hole but instead a potential CSS injection issue
21761
+ // which has lead to a greater discussion about how we're going to
21762
+ // trust URLs moving forward. See #2115901
21763
+
21764
+ var isEmpty = value == null || typeof value === 'boolean' || value === '';
21765
+ if (isEmpty) {
21766
+ return '';
21767
+ }
21768
+
21769
+ if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
21770
+ return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
21771
+ }
21772
+
21773
+ return ('' + value).trim();
21774
+ }
21775
+
21776
+ var warnValidStyle = emptyFunction;
21777
+
21778
+ {
21779
+ // 'msTransform' is correct, but the other prefixes should be capitalized
21780
+ var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
21781
+
21782
+ // style values shouldn't contain a semicolon
21783
+ var badStyleValueWithSemicolonPattern = /;\s*$/;
21784
+
21785
+ var warnedStyleNames = {};
21786
+ var warnedStyleValues = {};
21787
+ var warnedForNaNValue = false;
21788
+ var warnedForInfinityValue = false;
21789
+
21790
+ var warnHyphenatedStyleName = function (name, getStack) {
21791
+ if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
21792
+ return;
21793
+ }
21794
+
21795
+ warnedStyleNames[name] = true;
21796
+ warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), getStack());
21797
+ };
21798
+
21799
+ var warnBadVendoredStyleName = function (name, getStack) {
21800
+ if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
21801
+ return;
21802
+ }
21803
+
21804
+ warnedStyleNames[name] = true;
21805
+ warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), getStack());
21806
+ };
21807
+
21808
+ var warnStyleValueWithSemicolon = function (name, value, getStack) {
21809
+ if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
21810
+ return;
21811
+ }
21812
+
21813
+ warnedStyleValues[value] = true;
21814
+ warning(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.%s', name, value.replace(badStyleValueWithSemicolonPattern, ''), getStack());
21815
+ };
21816
+
21817
+ var warnStyleValueIsNaN = function (name, value, getStack) {
21818
+ if (warnedForNaNValue) {
21819
+ return;
21820
+ }
21821
+
21822
+ warnedForNaNValue = true;
21823
+ warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, getStack());
21824
+ };
21825
+
21826
+ var warnStyleValueIsInfinity = function (name, value, getStack) {
21827
+ if (warnedForInfinityValue) {
21828
+ return;
21829
+ }
21830
+
21831
+ warnedForInfinityValue = true;
21832
+ warning(false, '`Infinity` is an invalid value for the `%s` css style property.%s', name, getStack());
21833
+ };
21834
+
21835
+ warnValidStyle = function (name, value, getStack) {
21836
+ if (name.indexOf('-') > -1) {
21837
+ warnHyphenatedStyleName(name, getStack);
21838
+ } else if (badVendoredStyleNamePattern.test(name)) {
21839
+ warnBadVendoredStyleName(name, getStack);
21840
+ } else if (badStyleValueWithSemicolonPattern.test(value)) {
21841
+ warnStyleValueWithSemicolon(name, value, getStack);
21842
+ }
21843
+
21844
+ if (typeof value === 'number') {
21845
+ if (isNaN(value)) {
21846
+ warnStyleValueIsNaN(name, value, getStack);
21847
+ } else if (!isFinite(value)) {
21848
+ warnStyleValueIsInfinity(name, value, getStack);
21849
+ }
21850
+ }
21851
+ };
21852
+ }
21853
+
21854
+ var warnValidStyle$1 = warnValidStyle;
21855
+
21856
+ /**
21857
+ * Operations for dealing with CSS properties.
21858
+ */
21859
+
21860
+ /**
21861
+ * This creates a string that is expected to be equivalent to the style
21862
+ * attribute generated by server-side rendering. It by-passes warnings and
21863
+ * security checks so it's not safe to use this value for anything other than
21864
+ * comparison. It is only used in DEV for SSR validation.
21865
+ */
21866
+ function createDangerousStringForStyles(styles) {
21867
+ {
21868
+ var serialized = '';
21869
+ var delimiter = '';
21870
+ for (var styleName in styles) {
21871
+ if (!styles.hasOwnProperty(styleName)) {
21872
+ continue;
21873
+ }
21874
+ var styleValue = styles[styleName];
21875
+ if (styleValue != null) {
21876
+ var isCustomProperty = styleName.indexOf('--') === 0;
21877
+ serialized += delimiter + hyphenateStyleName(styleName) + ':';
21878
+ serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
21879
+
21880
+ delimiter = ';';
21881
+ }
21882
+ }
21883
+ return serialized || null;
21884
+ }
21885
+ }
21886
+
21887
+ /**
21888
+ * Sets the value for multiple styles on a node. If a value is specified as
21889
+ * '' (empty string), the corresponding style property will be unset.
21890
+ *
21891
+ * @param {DOMElement} node
21892
+ * @param {object} styles
21893
+ */
21894
+ function setValueForStyles(node, styles, getStack) {
21895
+ var style = node.style;
21896
+ for (var styleName in styles) {
21897
+ if (!styles.hasOwnProperty(styleName)) {
21898
+ continue;
21899
+ }
21900
+ var isCustomProperty = styleName.indexOf('--') === 0;
21901
+ {
21902
+ if (!isCustomProperty) {
21903
+ warnValidStyle$1(styleName, styles[styleName], getStack);
21904
+ }
21905
+ }
21906
+ var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
21907
+ if (styleName === 'float') {
21908
+ styleName = 'cssFloat';
21909
+ }
21910
+ if (isCustomProperty) {
21911
+ style.setProperty(styleName, styleValue);
21912
+ } else {
21913
+ style[styleName] = styleValue;
21914
+ }
21915
+ }
21916
+ }
21917
+
21918
+ // For HTML, certain tags should omit their close tag. We keep a whitelist for
21919
+ // those special-case tags.
21920
+
21921
+ var omittedCloseTags = {
21922
+ area: true,
21923
+ base: true,
21924
+ br: true,
21925
+ col: true,
21926
+ embed: true,
21927
+ hr: true,
21928
+ img: true,
21929
+ input: true,
21930
+ keygen: true,
21931
+ link: true,
21932
+ meta: true,
21933
+ param: true,
21934
+ source: true,
21935
+ track: true,
21936
+ wbr: true
21937
+ };
21938
+
21939
+ // For HTML, certain tags cannot have children. This has the same purpose as
21940
+ // `omittedCloseTags` except that `menuitem` should still have its closing tag.
21941
+
21942
+ var voidElementTags = _assign({
21943
+ menuitem: true
21944
+ }, omittedCloseTags);
21945
+
21946
+ var HTML$1 = '__html';
21947
+
21948
+ function assertValidProps(tag, props, getStack) {
21949
+ if (!props) {
21950
+ return;
21951
+ }
21952
+ // Note the use of `==` which checks for null or undefined.
21953
+ if (voidElementTags[tag]) {
21954
+ !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getStack()) : void 0;
21955
+ }
21956
+ if (props.dangerouslySetInnerHTML != null) {
21957
+ !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
21958
+ !(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
21959
+ }
21960
+ {
21961
+ warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.%s', getStack());
21962
+ }
21963
+ !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getStack()) : void 0;
21964
+ }
21965
+
21966
+ function isCustomComponent(tagName, props) {
21967
+ if (tagName.indexOf('-') === -1) {
21968
+ return typeof props.is === 'string';
21969
+ }
21970
+ switch (tagName) {
21971
+ // These are reserved SVG and MathML elements.
21972
+ // We don't mind this whitelist too much because we expect it to never grow.
21973
+ // The alternative is to track the namespace in a few places which is convoluted.
21974
+ // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
21975
+ case 'annotation-xml':
21976
+ case 'color-profile':
21977
+ case 'font-face':
21978
+ case 'font-face-src':
21979
+ case 'font-face-uri':
21980
+ case 'font-face-format':
21981
+ case 'font-face-name':
21982
+ case 'missing-glyph':
21983
+ return false;
21984
+ default:
21985
+ return true;
21986
+ }
21987
+ }
21988
+
21989
+ var ariaProperties = {
21990
+ 'aria-current': 0, // state
21991
+ 'aria-details': 0,
21992
+ 'aria-disabled': 0, // state
21993
+ 'aria-hidden': 0, // state
21994
+ 'aria-invalid': 0, // state
21995
+ 'aria-keyshortcuts': 0,
21996
+ 'aria-label': 0,
21997
+ 'aria-roledescription': 0,
21998
+ // Widget Attributes
21999
+ 'aria-autocomplete': 0,
22000
+ 'aria-checked': 0,
22001
+ 'aria-expanded': 0,
22002
+ 'aria-haspopup': 0,
22003
+ 'aria-level': 0,
22004
+ 'aria-modal': 0,
22005
+ 'aria-multiline': 0,
22006
+ 'aria-multiselectable': 0,
22007
+ 'aria-orientation': 0,
22008
+ 'aria-placeholder': 0,
22009
+ 'aria-pressed': 0,
22010
+ 'aria-readonly': 0,
22011
+ 'aria-required': 0,
22012
+ 'aria-selected': 0,
22013
+ 'aria-sort': 0,
22014
+ 'aria-valuemax': 0,
22015
+ 'aria-valuemin': 0,
22016
+ 'aria-valuenow': 0,
22017
+ 'aria-valuetext': 0,
22018
+ // Live Region Attributes
22019
+ 'aria-atomic': 0,
22020
+ 'aria-busy': 0,
22021
+ 'aria-live': 0,
22022
+ 'aria-relevant': 0,
22023
+ // Drag-and-Drop Attributes
22024
+ 'aria-dropeffect': 0,
22025
+ 'aria-grabbed': 0,
22026
+ // Relationship Attributes
22027
+ 'aria-activedescendant': 0,
22028
+ 'aria-colcount': 0,
22029
+ 'aria-colindex': 0,
22030
+ 'aria-colspan': 0,
22031
+ 'aria-controls': 0,
22032
+ 'aria-describedby': 0,
22033
+ 'aria-errormessage': 0,
22034
+ 'aria-flowto': 0,
22035
+ 'aria-labelledby': 0,
22036
+ 'aria-owns': 0,
22037
+ 'aria-posinset': 0,
22038
+ 'aria-rowcount': 0,
22039
+ 'aria-rowindex': 0,
22040
+ 'aria-rowspan': 0,
22041
+ 'aria-setsize': 0
22042
+ };
22043
+
22044
+ var warnedProperties = {};
22045
+ var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
22046
+ var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
22047
+
22048
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
22049
+
22050
+ function getStackAddendum() {
22051
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
22052
+ return stack != null ? stack : '';
22053
+ }
22054
+
22055
+ function validateProperty(tagName, name) {
22056
+ if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
22057
+ return true;
22058
+ }
22059
+
22060
+ if (rARIACamel.test(name)) {
22061
+ var ariaName = 'aria-' + name.slice(4).toLowerCase();
22062
+ var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
22063
+
22064
+ // If this is an aria-* attribute, but is not listed in the known DOM
22065
+ // DOM properties, then it is an invalid aria-* attribute.
22066
+ if (correctName == null) {
22067
+ warning(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.%s', name, getStackAddendum());
22068
+ warnedProperties[name] = true;
22069
+ return true;
22070
+ }
22071
+ // aria-* attributes should be lowercase; suggest the lowercase version.
22072
+ if (name !== correctName) {
22073
+ warning(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?%s', name, correctName, getStackAddendum());
22074
+ warnedProperties[name] = true;
22075
+ return true;
22076
+ }
22077
+ }
22078
+
22079
+ if (rARIA.test(name)) {
22080
+ var lowerCasedName = name.toLowerCase();
22081
+ var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
22082
+
22083
+ // If this is an aria-* attribute, but is not listed in the known DOM
22084
+ // DOM properties, then it is an invalid aria-* attribute.
22085
+ if (standardName == null) {
22086
+ warnedProperties[name] = true;
22087
+ return false;
22088
+ }
22089
+ // aria-* attributes should be lowercase; suggest the lowercase version.
22090
+ if (name !== standardName) {
22091
+ warning(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum());
22092
+ warnedProperties[name] = true;
22093
+ return true;
22094
+ }
22095
+ }
22096
+
22097
+ return true;
22098
+ }
22099
+
22100
+ function warnInvalidARIAProps(type, props) {
22101
+ var invalidProps = [];
22102
+
22103
+ for (var key in props) {
22104
+ var isValid = validateProperty(type, key);
22105
+ if (!isValid) {
22106
+ invalidProps.push(key);
22107
+ }
22108
+ }
22109
+
22110
+ var unknownPropString = invalidProps.map(function (prop) {
22111
+ return '`' + prop + '`';
22112
+ }).join(', ');
22113
+
22114
+ if (invalidProps.length === 1) {
22115
+ warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
22116
+ } else if (invalidProps.length > 1) {
22117
+ warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
22118
+ }
22119
+ }
22120
+
22121
+ function validateProperties(type, props) {
22122
+ if (isCustomComponent(type, props)) {
22123
+ return;
22124
+ }
22125
+ warnInvalidARIAProps(type, props);
22126
+ }
22127
+
22128
+ var didWarnValueNull = false;
22129
+
22130
+ function getStackAddendum$1() {
22131
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
22132
+ return stack != null ? stack : '';
22133
+ }
22134
+
22135
+ function validateProperties$1(type, props) {
22136
+ if (type !== 'input' && type !== 'textarea' && type !== 'select') {
22137
+ return;
22138
+ }
22139
+
22140
+ if (props != null && props.value === null && !didWarnValueNull) {
22141
+ didWarnValueNull = true;
22142
+ if (type === 'select' && props.multiple) {
22143
+ warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.%s', type, getStackAddendum$1());
22144
+ } else {
22145
+ warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', type, getStackAddendum$1());
22146
+ }
22147
+ }
22148
+ }
22149
+
22150
+ // When adding attributes to the HTML or SVG whitelist, be sure to
22151
+ // also add them to this module to ensure casing and incorrect name
22152
+ // warnings.
22153
+ var possibleStandardNames = {
22154
+ // HTML
22155
+ accept: 'accept',
22156
+ acceptcharset: 'acceptCharset',
22157
+ 'accept-charset': 'acceptCharset',
22158
+ accesskey: 'accessKey',
22159
+ action: 'action',
22160
+ allowfullscreen: 'allowFullScreen',
22161
+ alt: 'alt',
22162
+ as: 'as',
22163
+ async: 'async',
22164
+ autocapitalize: 'autoCapitalize',
22165
+ autocomplete: 'autoComplete',
22166
+ autocorrect: 'autoCorrect',
22167
+ autofocus: 'autoFocus',
22168
+ autoplay: 'autoPlay',
22169
+ autosave: 'autoSave',
22170
+ capture: 'capture',
22171
+ cellpadding: 'cellPadding',
22172
+ cellspacing: 'cellSpacing',
22173
+ challenge: 'challenge',
22174
+ charset: 'charSet',
22175
+ checked: 'checked',
22176
+ children: 'children',
22177
+ cite: 'cite',
22178
+ 'class': 'className',
22179
+ classid: 'classID',
22180
+ classname: 'className',
22181
+ cols: 'cols',
22182
+ colspan: 'colSpan',
22183
+ content: 'content',
22184
+ contenteditable: 'contentEditable',
22185
+ contextmenu: 'contextMenu',
22186
+ controls: 'controls',
22187
+ controlslist: 'controlsList',
22188
+ coords: 'coords',
22189
+ crossorigin: 'crossOrigin',
22190
+ dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
22191
+ data: 'data',
22192
+ datetime: 'dateTime',
22193
+ 'default': 'default',
22194
+ defaultchecked: 'defaultChecked',
22195
+ defaultvalue: 'defaultValue',
22196
+ defer: 'defer',
22197
+ dir: 'dir',
22198
+ disabled: 'disabled',
22199
+ download: 'download',
22200
+ draggable: 'draggable',
22201
+ enctype: 'encType',
22202
+ 'for': 'htmlFor',
22203
+ form: 'form',
22204
+ formmethod: 'formMethod',
22205
+ formaction: 'formAction',
22206
+ formenctype: 'formEncType',
22207
+ formnovalidate: 'formNoValidate',
22208
+ formtarget: 'formTarget',
22209
+ frameborder: 'frameBorder',
22210
+ headers: 'headers',
22211
+ height: 'height',
22212
+ hidden: 'hidden',
22213
+ high: 'high',
22214
+ href: 'href',
22215
+ hreflang: 'hrefLang',
22216
+ htmlfor: 'htmlFor',
22217
+ httpequiv: 'httpEquiv',
22218
+ 'http-equiv': 'httpEquiv',
22219
+ icon: 'icon',
22220
+ id: 'id',
22221
+ innerhtml: 'innerHTML',
22222
+ inputmode: 'inputMode',
22223
+ integrity: 'integrity',
22224
+ is: 'is',
22225
+ itemid: 'itemID',
22226
+ itemprop: 'itemProp',
22227
+ itemref: 'itemRef',
22228
+ itemscope: 'itemScope',
22229
+ itemtype: 'itemType',
22230
+ keyparams: 'keyParams',
22231
+ keytype: 'keyType',
22232
+ kind: 'kind',
22233
+ label: 'label',
22234
+ lang: 'lang',
22235
+ list: 'list',
22236
+ loop: 'loop',
22237
+ low: 'low',
22238
+ manifest: 'manifest',
22239
+ marginwidth: 'marginWidth',
22240
+ marginheight: 'marginHeight',
22241
+ max: 'max',
22242
+ maxlength: 'maxLength',
22243
+ media: 'media',
22244
+ mediagroup: 'mediaGroup',
22245
+ method: 'method',
22246
+ min: 'min',
22247
+ minlength: 'minLength',
22248
+ multiple: 'multiple',
22249
+ muted: 'muted',
22250
+ name: 'name',
22251
+ nonce: 'nonce',
22252
+ novalidate: 'noValidate',
22253
+ open: 'open',
22254
+ optimum: 'optimum',
22255
+ pattern: 'pattern',
22256
+ placeholder: 'placeholder',
22257
+ playsinline: 'playsInline',
22258
+ poster: 'poster',
22259
+ preload: 'preload',
22260
+ profile: 'profile',
22261
+ radiogroup: 'radioGroup',
22262
+ readonly: 'readOnly',
22263
+ referrerpolicy: 'referrerPolicy',
22264
+ rel: 'rel',
22265
+ required: 'required',
22266
+ reversed: 'reversed',
22267
+ role: 'role',
22268
+ rows: 'rows',
22269
+ rowspan: 'rowSpan',
22270
+ sandbox: 'sandbox',
22271
+ scope: 'scope',
22272
+ scoped: 'scoped',
22273
+ scrolling: 'scrolling',
22274
+ seamless: 'seamless',
22275
+ selected: 'selected',
22276
+ shape: 'shape',
22277
+ size: 'size',
22278
+ sizes: 'sizes',
22279
+ span: 'span',
22280
+ spellcheck: 'spellCheck',
22281
+ src: 'src',
22282
+ srcdoc: 'srcDoc',
22283
+ srclang: 'srcLang',
22284
+ srcset: 'srcSet',
22285
+ start: 'start',
22286
+ step: 'step',
22287
+ style: 'style',
22288
+ summary: 'summary',
22289
+ tabindex: 'tabIndex',
22290
+ target: 'target',
22291
+ title: 'title',
22292
+ type: 'type',
22293
+ usemap: 'useMap',
22294
+ value: 'value',
22295
+ width: 'width',
22296
+ wmode: 'wmode',
22297
+ wrap: 'wrap',
22298
+
22299
+ // SVG
22300
+ about: 'about',
22301
+ accentheight: 'accentHeight',
22302
+ 'accent-height': 'accentHeight',
22303
+ accumulate: 'accumulate',
22304
+ additive: 'additive',
22305
+ alignmentbaseline: 'alignmentBaseline',
22306
+ 'alignment-baseline': 'alignmentBaseline',
22307
+ allowreorder: 'allowReorder',
22308
+ alphabetic: 'alphabetic',
22309
+ amplitude: 'amplitude',
22310
+ arabicform: 'arabicForm',
22311
+ 'arabic-form': 'arabicForm',
22312
+ ascent: 'ascent',
22313
+ attributename: 'attributeName',
22314
+ attributetype: 'attributeType',
22315
+ autoreverse: 'autoReverse',
22316
+ azimuth: 'azimuth',
22317
+ basefrequency: 'baseFrequency',
22318
+ baselineshift: 'baselineShift',
22319
+ 'baseline-shift': 'baselineShift',
22320
+ baseprofile: 'baseProfile',
22321
+ bbox: 'bbox',
22322
+ begin: 'begin',
22323
+ bias: 'bias',
22324
+ by: 'by',
22325
+ calcmode: 'calcMode',
22326
+ capheight: 'capHeight',
22327
+ 'cap-height': 'capHeight',
22328
+ clip: 'clip',
22329
+ clippath: 'clipPath',
22330
+ 'clip-path': 'clipPath',
22331
+ clippathunits: 'clipPathUnits',
22332
+ cliprule: 'clipRule',
22333
+ 'clip-rule': 'clipRule',
22334
+ color: 'color',
22335
+ colorinterpolation: 'colorInterpolation',
22336
+ 'color-interpolation': 'colorInterpolation',
22337
+ colorinterpolationfilters: 'colorInterpolationFilters',
22338
+ 'color-interpolation-filters': 'colorInterpolationFilters',
22339
+ colorprofile: 'colorProfile',
22340
+ 'color-profile': 'colorProfile',
22341
+ colorrendering: 'colorRendering',
22342
+ 'color-rendering': 'colorRendering',
22343
+ contentscripttype: 'contentScriptType',
22344
+ contentstyletype: 'contentStyleType',
22345
+ cursor: 'cursor',
22346
+ cx: 'cx',
22347
+ cy: 'cy',
22348
+ d: 'd',
22349
+ datatype: 'datatype',
22350
+ decelerate: 'decelerate',
22351
+ descent: 'descent',
22352
+ diffuseconstant: 'diffuseConstant',
22353
+ direction: 'direction',
22354
+ display: 'display',
22355
+ divisor: 'divisor',
22356
+ dominantbaseline: 'dominantBaseline',
22357
+ 'dominant-baseline': 'dominantBaseline',
22358
+ dur: 'dur',
22359
+ dx: 'dx',
22360
+ dy: 'dy',
22361
+ edgemode: 'edgeMode',
22362
+ elevation: 'elevation',
22363
+ enablebackground: 'enableBackground',
22364
+ 'enable-background': 'enableBackground',
22365
+ end: 'end',
22366
+ exponent: 'exponent',
22367
+ externalresourcesrequired: 'externalResourcesRequired',
22368
+ fill: 'fill',
22369
+ fillopacity: 'fillOpacity',
22370
+ 'fill-opacity': 'fillOpacity',
22371
+ fillrule: 'fillRule',
22372
+ 'fill-rule': 'fillRule',
22373
+ filter: 'filter',
22374
+ filterres: 'filterRes',
22375
+ filterunits: 'filterUnits',
22376
+ floodopacity: 'floodOpacity',
22377
+ 'flood-opacity': 'floodOpacity',
22378
+ floodcolor: 'floodColor',
22379
+ 'flood-color': 'floodColor',
22380
+ focusable: 'focusable',
22381
+ fontfamily: 'fontFamily',
22382
+ 'font-family': 'fontFamily',
22383
+ fontsize: 'fontSize',
22384
+ 'font-size': 'fontSize',
22385
+ fontsizeadjust: 'fontSizeAdjust',
22386
+ 'font-size-adjust': 'fontSizeAdjust',
22387
+ fontstretch: 'fontStretch',
22388
+ 'font-stretch': 'fontStretch',
22389
+ fontstyle: 'fontStyle',
22390
+ 'font-style': 'fontStyle',
22391
+ fontvariant: 'fontVariant',
22392
+ 'font-variant': 'fontVariant',
22393
+ fontweight: 'fontWeight',
22394
+ 'font-weight': 'fontWeight',
22395
+ format: 'format',
22396
+ from: 'from',
22397
+ fx: 'fx',
22398
+ fy: 'fy',
22399
+ g1: 'g1',
22400
+ g2: 'g2',
22401
+ glyphname: 'glyphName',
22402
+ 'glyph-name': 'glyphName',
22403
+ glyphorientationhorizontal: 'glyphOrientationHorizontal',
22404
+ 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
22405
+ glyphorientationvertical: 'glyphOrientationVertical',
22406
+ 'glyph-orientation-vertical': 'glyphOrientationVertical',
22407
+ glyphref: 'glyphRef',
22408
+ gradienttransform: 'gradientTransform',
22409
+ gradientunits: 'gradientUnits',
22410
+ hanging: 'hanging',
22411
+ horizadvx: 'horizAdvX',
22412
+ 'horiz-adv-x': 'horizAdvX',
22413
+ horizoriginx: 'horizOriginX',
22414
+ 'horiz-origin-x': 'horizOriginX',
22415
+ ideographic: 'ideographic',
22416
+ imagerendering: 'imageRendering',
22417
+ 'image-rendering': 'imageRendering',
22418
+ in2: 'in2',
22419
+ 'in': 'in',
22420
+ inlist: 'inlist',
22421
+ intercept: 'intercept',
22422
+ k1: 'k1',
22423
+ k2: 'k2',
22424
+ k3: 'k3',
22425
+ k4: 'k4',
22426
+ k: 'k',
22427
+ kernelmatrix: 'kernelMatrix',
22428
+ kernelunitlength: 'kernelUnitLength',
22429
+ kerning: 'kerning',
22430
+ keypoints: 'keyPoints',
22431
+ keysplines: 'keySplines',
22432
+ keytimes: 'keyTimes',
22433
+ lengthadjust: 'lengthAdjust',
22434
+ letterspacing: 'letterSpacing',
22435
+ 'letter-spacing': 'letterSpacing',
22436
+ lightingcolor: 'lightingColor',
22437
+ 'lighting-color': 'lightingColor',
22438
+ limitingconeangle: 'limitingConeAngle',
22439
+ local: 'local',
22440
+ markerend: 'markerEnd',
22441
+ 'marker-end': 'markerEnd',
22442
+ markerheight: 'markerHeight',
22443
+ markermid: 'markerMid',
22444
+ 'marker-mid': 'markerMid',
22445
+ markerstart: 'markerStart',
22446
+ 'marker-start': 'markerStart',
22447
+ markerunits: 'markerUnits',
22448
+ markerwidth: 'markerWidth',
22449
+ mask: 'mask',
22450
+ maskcontentunits: 'maskContentUnits',
22451
+ maskunits: 'maskUnits',
22452
+ mathematical: 'mathematical',
22453
+ mode: 'mode',
22454
+ numoctaves: 'numOctaves',
22455
+ offset: 'offset',
22456
+ opacity: 'opacity',
22457
+ operator: 'operator',
22458
+ order: 'order',
22459
+ orient: 'orient',
22460
+ orientation: 'orientation',
22461
+ origin: 'origin',
22462
+ overflow: 'overflow',
22463
+ overlineposition: 'overlinePosition',
22464
+ 'overline-position': 'overlinePosition',
22465
+ overlinethickness: 'overlineThickness',
22466
+ 'overline-thickness': 'overlineThickness',
22467
+ paintorder: 'paintOrder',
22468
+ 'paint-order': 'paintOrder',
22469
+ panose1: 'panose1',
22470
+ 'panose-1': 'panose1',
22471
+ pathlength: 'pathLength',
22472
+ patterncontentunits: 'patternContentUnits',
22473
+ patterntransform: 'patternTransform',
22474
+ patternunits: 'patternUnits',
22475
+ pointerevents: 'pointerEvents',
22476
+ 'pointer-events': 'pointerEvents',
22477
+ points: 'points',
22478
+ pointsatx: 'pointsAtX',
22479
+ pointsaty: 'pointsAtY',
22480
+ pointsatz: 'pointsAtZ',
22481
+ prefix: 'prefix',
22482
+ preservealpha: 'preserveAlpha',
22483
+ preserveaspectratio: 'preserveAspectRatio',
22484
+ primitiveunits: 'primitiveUnits',
22485
+ property: 'property',
22486
+ r: 'r',
22487
+ radius: 'radius',
22488
+ refx: 'refX',
22489
+ refy: 'refY',
22490
+ renderingintent: 'renderingIntent',
22491
+ 'rendering-intent': 'renderingIntent',
22492
+ repeatcount: 'repeatCount',
22493
+ repeatdur: 'repeatDur',
22494
+ requiredextensions: 'requiredExtensions',
22495
+ requiredfeatures: 'requiredFeatures',
22496
+ resource: 'resource',
22497
+ restart: 'restart',
22498
+ result: 'result',
22499
+ results: 'results',
22500
+ rotate: 'rotate',
22501
+ rx: 'rx',
22502
+ ry: 'ry',
22503
+ scale: 'scale',
22504
+ security: 'security',
22505
+ seed: 'seed',
22506
+ shaperendering: 'shapeRendering',
22507
+ 'shape-rendering': 'shapeRendering',
22508
+ slope: 'slope',
22509
+ spacing: 'spacing',
22510
+ specularconstant: 'specularConstant',
22511
+ specularexponent: 'specularExponent',
22512
+ speed: 'speed',
22513
+ spreadmethod: 'spreadMethod',
22514
+ startoffset: 'startOffset',
22515
+ stddeviation: 'stdDeviation',
22516
+ stemh: 'stemh',
22517
+ stemv: 'stemv',
22518
+ stitchtiles: 'stitchTiles',
22519
+ stopcolor: 'stopColor',
22520
+ 'stop-color': 'stopColor',
22521
+ stopopacity: 'stopOpacity',
22522
+ 'stop-opacity': 'stopOpacity',
22523
+ strikethroughposition: 'strikethroughPosition',
22524
+ 'strikethrough-position': 'strikethroughPosition',
22525
+ strikethroughthickness: 'strikethroughThickness',
22526
+ 'strikethrough-thickness': 'strikethroughThickness',
22527
+ string: 'string',
22528
+ stroke: 'stroke',
22529
+ strokedasharray: 'strokeDasharray',
22530
+ 'stroke-dasharray': 'strokeDasharray',
22531
+ strokedashoffset: 'strokeDashoffset',
22532
+ 'stroke-dashoffset': 'strokeDashoffset',
22533
+ strokelinecap: 'strokeLinecap',
22534
+ 'stroke-linecap': 'strokeLinecap',
22535
+ strokelinejoin: 'strokeLinejoin',
22536
+ 'stroke-linejoin': 'strokeLinejoin',
22537
+ strokemiterlimit: 'strokeMiterlimit',
22538
+ 'stroke-miterlimit': 'strokeMiterlimit',
22539
+ strokewidth: 'strokeWidth',
22540
+ 'stroke-width': 'strokeWidth',
22541
+ strokeopacity: 'strokeOpacity',
22542
+ 'stroke-opacity': 'strokeOpacity',
22543
+ suppresscontenteditablewarning: 'suppressContentEditableWarning',
22544
+ suppresshydrationwarning: 'suppressHydrationWarning',
22545
+ surfacescale: 'surfaceScale',
22546
+ systemlanguage: 'systemLanguage',
22547
+ tablevalues: 'tableValues',
22548
+ targetx: 'targetX',
22549
+ targety: 'targetY',
22550
+ textanchor: 'textAnchor',
22551
+ 'text-anchor': 'textAnchor',
22552
+ textdecoration: 'textDecoration',
22553
+ 'text-decoration': 'textDecoration',
22554
+ textlength: 'textLength',
22555
+ textrendering: 'textRendering',
22556
+ 'text-rendering': 'textRendering',
22557
+ to: 'to',
22558
+ transform: 'transform',
22559
+ 'typeof': 'typeof',
22560
+ u1: 'u1',
22561
+ u2: 'u2',
22562
+ underlineposition: 'underlinePosition',
22563
+ 'underline-position': 'underlinePosition',
22564
+ underlinethickness: 'underlineThickness',
22565
+ 'underline-thickness': 'underlineThickness',
22566
+ unicode: 'unicode',
22567
+ unicodebidi: 'unicodeBidi',
22568
+ 'unicode-bidi': 'unicodeBidi',
22569
+ unicoderange: 'unicodeRange',
22570
+ 'unicode-range': 'unicodeRange',
22571
+ unitsperem: 'unitsPerEm',
22572
+ 'units-per-em': 'unitsPerEm',
22573
+ unselectable: 'unselectable',
22574
+ valphabetic: 'vAlphabetic',
22575
+ 'v-alphabetic': 'vAlphabetic',
22576
+ values: 'values',
22577
+ vectoreffect: 'vectorEffect',
22578
+ 'vector-effect': 'vectorEffect',
22579
+ version: 'version',
22580
+ vertadvy: 'vertAdvY',
22581
+ 'vert-adv-y': 'vertAdvY',
22582
+ vertoriginx: 'vertOriginX',
22583
+ 'vert-origin-x': 'vertOriginX',
22584
+ vertoriginy: 'vertOriginY',
22585
+ 'vert-origin-y': 'vertOriginY',
22586
+ vhanging: 'vHanging',
22587
+ 'v-hanging': 'vHanging',
22588
+ videographic: 'vIdeographic',
22589
+ 'v-ideographic': 'vIdeographic',
22590
+ viewbox: 'viewBox',
22591
+ viewtarget: 'viewTarget',
22592
+ visibility: 'visibility',
22593
+ vmathematical: 'vMathematical',
22594
+ 'v-mathematical': 'vMathematical',
22595
+ vocab: 'vocab',
22596
+ widths: 'widths',
22597
+ wordspacing: 'wordSpacing',
22598
+ 'word-spacing': 'wordSpacing',
22599
+ writingmode: 'writingMode',
22600
+ 'writing-mode': 'writingMode',
22601
+ x1: 'x1',
22602
+ x2: 'x2',
22603
+ x: 'x',
22604
+ xchannelselector: 'xChannelSelector',
22605
+ xheight: 'xHeight',
22606
+ 'x-height': 'xHeight',
22607
+ xlinkactuate: 'xlinkActuate',
22608
+ 'xlink:actuate': 'xlinkActuate',
22609
+ xlinkarcrole: 'xlinkArcrole',
22610
+ 'xlink:arcrole': 'xlinkArcrole',
22611
+ xlinkhref: 'xlinkHref',
22612
+ 'xlink:href': 'xlinkHref',
22613
+ xlinkrole: 'xlinkRole',
22614
+ 'xlink:role': 'xlinkRole',
22615
+ xlinkshow: 'xlinkShow',
22616
+ 'xlink:show': 'xlinkShow',
22617
+ xlinktitle: 'xlinkTitle',
22618
+ 'xlink:title': 'xlinkTitle',
22619
+ xlinktype: 'xlinkType',
22620
+ 'xlink:type': 'xlinkType',
22621
+ xmlbase: 'xmlBase',
22622
+ 'xml:base': 'xmlBase',
22623
+ xmllang: 'xmlLang',
22624
+ 'xml:lang': 'xmlLang',
22625
+ xmlns: 'xmlns',
22626
+ 'xml:space': 'xmlSpace',
22627
+ xmlnsxlink: 'xmlnsXlink',
22628
+ 'xmlns:xlink': 'xmlnsXlink',
22629
+ xmlspace: 'xmlSpace',
22630
+ y1: 'y1',
22631
+ y2: 'y2',
22632
+ y: 'y',
22633
+ ychannelselector: 'yChannelSelector',
22634
+ z: 'z',
22635
+ zoomandpan: 'zoomAndPan'
22636
+ };
22637
+
22638
+ function getStackAddendum$2() {
22639
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
22640
+ return stack != null ? stack : '';
22641
+ }
22642
+
22643
+ {
22644
+ var warnedProperties$1 = {};
22645
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
22646
+ var EVENT_NAME_REGEX = /^on./;
22647
+ var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
22648
+ var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
22649
+ var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
22650
+
22651
+ var validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
22652
+ if (hasOwnProperty$1.call(warnedProperties$1, name) && warnedProperties$1[name]) {
22653
+ return true;
22654
+ }
22655
+
22656
+ var lowerCasedName = name.toLowerCase();
22657
+ if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
22658
+ warning(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
22659
+ warnedProperties$1[name] = true;
22660
+ return true;
22661
+ }
22662
+
22663
+ // We can't rely on the event system being injected on the server.
22664
+ if (canUseEventSystem) {
22665
+ if (registrationNameModules.hasOwnProperty(name)) {
22666
+ return true;
22667
+ }
22668
+ var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
22669
+ if (registrationName != null) {
22670
+ warning(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$2());
22671
+ warnedProperties$1[name] = true;
22672
+ return true;
22673
+ }
22674
+ if (EVENT_NAME_REGEX.test(name)) {
22675
+ warning(false, 'Unknown event handler property `%s`. It will be ignored.%s', name, getStackAddendum$2());
22676
+ warnedProperties$1[name] = true;
22677
+ return true;
22678
+ }
22679
+ } else if (EVENT_NAME_REGEX.test(name)) {
22680
+ // If no event plugins have been injected, we are in a server environment.
22681
+ // So we can't tell if the event name is correct for sure, but we can filter
22682
+ // out known bad ones like `onclick`. We can't suggest a specific replacement though.
22683
+ if (INVALID_EVENT_NAME_REGEX.test(name)) {
22684
+ warning(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.%s', name, getStackAddendum$2());
22685
+ }
22686
+ warnedProperties$1[name] = true;
22687
+ return true;
22688
+ }
22689
+
22690
+ // Let the ARIA attribute hook validate ARIA attributes
22691
+ if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
22692
+ return true;
22693
+ }
22694
+
22695
+ if (lowerCasedName === 'innerhtml') {
22696
+ warning(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
22697
+ warnedProperties$1[name] = true;
22698
+ return true;
22699
+ }
22700
+
22701
+ if (lowerCasedName === 'aria') {
22702
+ warning(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
22703
+ warnedProperties$1[name] = true;
22704
+ return true;
22705
+ }
22706
+
22707
+ if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
22708
+ warning(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum$2());
22709
+ warnedProperties$1[name] = true;
22710
+ return true;
22711
+ }
22712
+
22713
+ if (typeof value === 'number' && isNaN(value)) {
22714
+ warning(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum$2());
22715
+ warnedProperties$1[name] = true;
22716
+ return true;
22717
+ }
22718
+
22719
+ var isReserved = isReservedProp(name);
22720
+
22721
+ // Known attributes should match the casing specified in the property config.
22722
+ if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
22723
+ var standardName = possibleStandardNames[lowerCasedName];
22724
+ if (standardName !== name) {
22725
+ warning(false, 'Invalid DOM property `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$2());
22726
+ warnedProperties$1[name] = true;
22727
+ return true;
22728
+ }
22729
+ } else if (!isReserved && name !== lowerCasedName) {
22730
+ // Unknown attributes should have lowercase casing since that's how they
22731
+ // will be cased anyway with server rendering.
22732
+ warning(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.%s', name, lowerCasedName, getStackAddendum$2());
22733
+ warnedProperties$1[name] = true;
22734
+ return true;
22735
+ }
22736
+
22737
+ if (typeof value === 'boolean' && !shouldAttributeAcceptBooleanValue(name)) {
22738
+ if (value) {
22739
+ warning(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.%s', value, name, name, value, name, getStackAddendum$2());
22740
+ } else {
22741
+ warning(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.%s', value, name, name, value, name, name, name, getStackAddendum$2());
22742
+ }
22743
+ warnedProperties$1[name] = true;
22744
+ return true;
22745
+ }
22746
+
22747
+ // Now that we've validated casing, do not validate
22748
+ // data types for reserved props
22749
+ if (isReserved) {
22750
+ return true;
22751
+ }
22752
+
22753
+ // Warn when a known attribute is a bad type
22754
+ if (!shouldSetAttribute(name, value)) {
22755
+ warnedProperties$1[name] = true;
22756
+ return false;
22757
+ }
22758
+
22759
+ return true;
22760
+ };
22761
+ }
22762
+
22763
+ var warnUnknownProperties = function (type, props, canUseEventSystem) {
22764
+ var unknownProps = [];
22765
+ for (var key in props) {
22766
+ var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
22767
+ if (!isValid) {
22768
+ unknownProps.push(key);
22769
+ }
22770
+ }
22771
+
22772
+ var unknownPropString = unknownProps.map(function (prop) {
22773
+ return '`' + prop + '`';
22774
+ }).join(', ');
22775
+ if (unknownProps.length === 1) {
22776
+ warning(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());
22777
+ } else if (unknownProps.length > 1) {
22778
+ warning(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());
22779
+ }
22780
+ };
22781
+
22782
+ function validateProperties$2(type, props, canUseEventSystem) {
22783
+ if (isCustomComponent(type, props)) {
22784
+ return;
22785
+ }
22786
+ warnUnknownProperties(type, props, canUseEventSystem);
22787
+ }
22788
+
22789
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
22790
+ var getCurrentFiberOwnerName$1 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;
22791
+ var getCurrentFiberStackAddendum$2 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
22792
+
22793
+ var didWarnInvalidHydration = false;
22794
+ var didWarnShadyDOM = false;
22795
+
22796
+ var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
22797
+ var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
22798
+ var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
22799
+ var AUTOFOCUS = 'autoFocus';
22800
+ var CHILDREN = 'children';
22801
+ var STYLE = 'style';
22802
+ var HTML = '__html';
22803
+
22804
+ var HTML_NAMESPACE = Namespaces.html;
22805
+
22806
+
22807
+ var getStack = emptyFunction.thatReturns('');
22808
+
22809
+ {
22810
+ getStack = getCurrentFiberStackAddendum$2;
22811
+
22812
+ var warnedUnknownTags = {
22813
+ // Chrome is the only major browser not shipping <time>. But as of July
22814
+ // 2017 it intends to ship it due to widespread usage. We intentionally
22815
+ // *don't* warn for <time> even if it's unrecognized by Chrome because
22816
+ // it soon will be, and many apps have been using it anyway.
22817
+ time: true,
22818
+ // There are working polyfills for <dialog>. Let people use it.
22819
+ dialog: true
22820
+ };
22821
+
22822
+ var validatePropertiesInDevelopment = function (type, props) {
22823
+ validateProperties(type, props);
22824
+ validateProperties$1(type, props);
22825
+ validateProperties$2(type, props, /* canUseEventSystem */true);
22826
+ };
22827
+
22828
+ // HTML parsing normalizes CR and CRLF to LF.
22829
+ // It also can turn \u0000 into \uFFFD inside attributes.
22830
+ // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
22831
+ // If we have a mismatch, it might be caused by that.
22832
+ // We will still patch up in this case but not fire the warning.
22833
+ var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
22834
+ var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
22835
+
22836
+ var normalizeMarkupForTextOrAttribute = function (markup) {
22837
+ var markupString = typeof markup === 'string' ? markup : '' + markup;
22838
+ return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
22839
+ };
22840
+
22841
+ var warnForTextDifference = function (serverText, clientText) {
22842
+ if (didWarnInvalidHydration) {
22843
+ return;
22844
+ }
22845
+ var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
22846
+ var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
22847
+ if (normalizedServerText === normalizedClientText) {
22848
+ return;
22849
+ }
22850
+ didWarnInvalidHydration = true;
22851
+ warning(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
22852
+ };
22853
+
22854
+ var warnForPropDifference = function (propName, serverValue, clientValue) {
22855
+ if (didWarnInvalidHydration) {
22856
+ return;
22857
+ }
22858
+ var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
22859
+ var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
22860
+ if (normalizedServerValue === normalizedClientValue) {
22861
+ return;
22862
+ }
22863
+ didWarnInvalidHydration = true;
22864
+ warning(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
22865
+ };
22866
+
22867
+ var warnForExtraAttributes = function (attributeNames) {
22868
+ if (didWarnInvalidHydration) {
22869
+ return;
22870
+ }
22871
+ didWarnInvalidHydration = true;
22872
+ var names = [];
22873
+ attributeNames.forEach(function (name) {
22874
+ names.push(name);
22875
+ });
22876
+ warning(false, 'Extra attributes from the server: %s', names);
22877
+ };
22878
+
22879
+ var warnForInvalidEventListener = function (registrationName, listener) {
22880
+ if (listener === false) {
22881
+ warning(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.%s', registrationName, registrationName, registrationName, getCurrentFiberStackAddendum$2());
22882
+ } else {
22883
+ warning(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.%s', registrationName, typeof listener, getCurrentFiberStackAddendum$2());
22884
+ }
22885
+ };
22886
+
22887
+ // Parse the HTML and read it back to normalize the HTML string so that it
22888
+ // can be used for comparison.
22889
+ var normalizeHTML = function (parent, html) {
22890
+ // We could have created a separate document here to avoid
22891
+ // re-initializing custom elements if they exist. But this breaks
22892
+ // how <noscript> is being handled. So we use the same document.
22893
+ // See the discussion in https://github.com/facebook/react/pull/11157.
22894
+ var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
22895
+ testElement.innerHTML = html;
22896
+ return testElement.innerHTML;
22897
+ };
22898
+ }
22899
+
22900
+ function ensureListeningTo(rootContainerElement, registrationName) {
22901
+ var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
22902
+ var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
22903
+ listenTo(registrationName, doc);
22904
+ }
22905
+
22906
+ function getOwnerDocumentFromRootContainer(rootContainerElement) {
22907
+ return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
22908
+ }
22909
+
22910
+ // There are so many media events, it makes sense to just
22911
+ // maintain a list rather than create a `trapBubbledEvent` for each
22912
+ var mediaEvents = {
22913
+ topAbort: 'abort',
22914
+ topCanPlay: 'canplay',
22915
+ topCanPlayThrough: 'canplaythrough',
22916
+ topDurationChange: 'durationchange',
22917
+ topEmptied: 'emptied',
22918
+ topEncrypted: 'encrypted',
22919
+ topEnded: 'ended',
22920
+ topError: 'error',
22921
+ topLoadedData: 'loadeddata',
22922
+ topLoadedMetadata: 'loadedmetadata',
22923
+ topLoadStart: 'loadstart',
22924
+ topPause: 'pause',
22925
+ topPlay: 'play',
22926
+ topPlaying: 'playing',
22927
+ topProgress: 'progress',
22928
+ topRateChange: 'ratechange',
22929
+ topSeeked: 'seeked',
22930
+ topSeeking: 'seeking',
22931
+ topStalled: 'stalled',
22932
+ topSuspend: 'suspend',
22933
+ topTimeUpdate: 'timeupdate',
22934
+ topVolumeChange: 'volumechange',
22935
+ topWaiting: 'waiting'
22936
+ };
22937
+
22938
+ function trapClickOnNonInteractiveElement(node) {
22939
+ // Mobile Safari does not fire properly bubble click events on
22940
+ // non-interactive elements, which means delegated click listeners do not
22941
+ // fire. The workaround for this bug involves attaching an empty click
22942
+ // listener on the target node.
22943
+ // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
22944
+ // Just set it using the onclick property so that we don't have to manage any
22945
+ // bookkeeping for it. Not sure if we need to clear it when the listener is
22946
+ // removed.
22947
+ // TODO: Only do this for the relevant Safaris maybe?
22948
+ node.onclick = emptyFunction;
22949
+ }
22950
+
22951
+ function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
22952
+ for (var propKey in nextProps) {
22953
+ if (!nextProps.hasOwnProperty(propKey)) {
22954
+ continue;
22955
+ }
22956
+ var nextProp = nextProps[propKey];
22957
+ if (propKey === STYLE) {
22958
+ {
22959
+ if (nextProp) {
22960
+ // Freeze the next style object so that we can assume it won't be
22961
+ // mutated. We have already warned for this in the past.
22962
+ Object.freeze(nextProp);
22963
+ }
22964
+ }
22965
+ // Relies on `updateStylesByID` not mutating `styleUpdates`.
22966
+ setValueForStyles(domElement, nextProp, getStack);
22967
+ } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
22968
+ var nextHtml = nextProp ? nextProp[HTML] : undefined;
22969
+ if (nextHtml != null) {
22970
+ setInnerHTML(domElement, nextHtml);
22971
+ }
22972
+ } else if (propKey === CHILDREN) {
22973
+ if (typeof nextProp === 'string') {
22974
+ // Avoid setting initial textContent when the text is empty. In IE11 setting
22975
+ // textContent on a <textarea> will cause the placeholder to not
22976
+ // show within the <textarea> until it has been focused and blurred again.
22977
+ // https://github.com/facebook/react/issues/6731#issuecomment-254874553
22978
+ var canSetTextContent = tag !== 'textarea' || nextProp !== '';
22979
+ if (canSetTextContent) {
22980
+ setTextContent(domElement, nextProp);
22981
+ }
22982
+ } else if (typeof nextProp === 'number') {
22983
+ setTextContent(domElement, '' + nextProp);
22984
+ }
22985
+ } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
22986
+ // Noop
22987
+ } else if (propKey === AUTOFOCUS) {
22988
+ // We polyfill it separately on the client during commit.
22989
+ // We blacklist it here rather than in the property list because we emit it in SSR.
22990
+ } else if (registrationNameModules.hasOwnProperty(propKey)) {
22991
+ if (nextProp != null) {
22992
+ if (true && typeof nextProp !== 'function') {
22993
+ warnForInvalidEventListener(propKey, nextProp);
22994
+ }
22995
+ ensureListeningTo(rootContainerElement, propKey);
22996
+ }
22997
+ } else if (isCustomComponentTag) {
22998
+ setValueForAttribute(domElement, propKey, nextProp);
22999
+ } else if (nextProp != null) {
23000
+ // If we're updating to null or undefined, we should remove the property
23001
+ // from the DOM node instead of inadvertently setting to a string. This
23002
+ // brings us in line with the same behavior we have on initial render.
23003
+ setValueForProperty(domElement, propKey, nextProp);
23004
+ }
23005
+ }
23006
+ }
23007
+
23008
+ function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
23009
+ // TODO: Handle wasCustomComponentTag
23010
+ for (var i = 0; i < updatePayload.length; i += 2) {
23011
+ var propKey = updatePayload[i];
23012
+ var propValue = updatePayload[i + 1];
23013
+ if (propKey === STYLE) {
23014
+ setValueForStyles(domElement, propValue, getStack);
23015
+ } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
23016
+ setInnerHTML(domElement, propValue);
23017
+ } else if (propKey === CHILDREN) {
23018
+ setTextContent(domElement, propValue);
23019
+ } else if (isCustomComponentTag) {
23020
+ if (propValue != null) {
23021
+ setValueForAttribute(domElement, propKey, propValue);
23022
+ } else {
23023
+ deleteValueForAttribute(domElement, propKey);
23024
+ }
23025
+ } else if (propValue != null) {
23026
+ setValueForProperty(domElement, propKey, propValue);
23027
+ } else {
23028
+ // If we're updating to null or undefined, we should remove the property
23029
+ // from the DOM node instead of inadvertently setting to a string. This
23030
+ // brings us in line with the same behavior we have on initial render.
23031
+ deleteValueForProperty(domElement, propKey);
23032
+ }
23033
+ }
23034
+ }
23035
+
23036
+ function createElement$1(type, props, rootContainerElement, parentNamespace) {
23037
+ // We create tags in the namespace of their parent container, except HTML
23038
+ var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
23039
+ var domElement;
23040
+ var namespaceURI = parentNamespace;
23041
+ if (namespaceURI === HTML_NAMESPACE) {
23042
+ namespaceURI = getIntrinsicNamespace(type);
23043
+ }
23044
+ if (namespaceURI === HTML_NAMESPACE) {
23045
+ {
23046
+ var isCustomComponentTag = isCustomComponent(type, props);
23047
+ // Should this check be gated by parent namespace? Not sure we want to
23048
+ // allow <SVG> or <mATH>.
23049
+ warning(isCustomComponentTag || type === type.toLowerCase(), '<%s /> is using uppercase HTML. Always use lowercase HTML tags ' + 'in React.', type);
23050
+ }
23051
+
23052
+ if (type === 'script') {
23053
+ // Create the script via .innerHTML so its "parser-inserted" flag is
23054
+ // set to true and it does not execute
23055
+ var div = ownerDocument.createElement('div');
23056
+ div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
23057
+ // This is guaranteed to yield a script element.
23058
+ var firstChild = div.firstChild;
23059
+ domElement = div.removeChild(firstChild);
23060
+ } else if (typeof props.is === 'string') {
23061
+ // $FlowIssue `createElement` should be updated for Web Components
23062
+ domElement = ownerDocument.createElement(type, { is: props.is });
23063
+ } else {
23064
+ // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
23065
+ // See discussion in https://github.com/facebook/react/pull/6896
23066
+ // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
23067
+ domElement = ownerDocument.createElement(type);
23068
+ }
23069
+ } else {
23070
+ domElement = ownerDocument.createElementNS(namespaceURI, type);
23071
+ }
23072
+
23073
+ {
23074
+ if (namespaceURI === HTML_NAMESPACE) {
23075
+ if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
23076
+ warnedUnknownTags[type] = true;
23077
+ warning(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
23078
+ }
23079
+ }
23080
+ }
23081
+
23082
+ return domElement;
23083
+ }
23084
+
23085
+ function createTextNode$1(text, rootContainerElement) {
23086
+ return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
23087
+ }
23088
+
23089
+ function setInitialProperties$1(domElement, tag, rawProps, rootContainerElement) {
23090
+ var isCustomComponentTag = isCustomComponent(tag, rawProps);
23091
+ {
23092
+ validatePropertiesInDevelopment(tag, rawProps);
23093
+ if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
23094
+ warning(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerName$1() || 'A component');
23095
+ didWarnShadyDOM = true;
23096
+ }
23097
+ }
23098
+
23099
+ // TODO: Make sure that we check isMounted before firing any of these events.
23100
+ var props;
23101
+ switch (tag) {
23102
+ case 'iframe':
23103
+ case 'object':
23104
+ trapBubbledEvent('topLoad', 'load', domElement);
23105
+ props = rawProps;
23106
+ break;
23107
+ case 'video':
23108
+ case 'audio':
23109
+ // Create listener for each media event
23110
+ for (var event in mediaEvents) {
23111
+ if (mediaEvents.hasOwnProperty(event)) {
23112
+ trapBubbledEvent(event, mediaEvents[event], domElement);
23113
+ }
23114
+ }
23115
+ props = rawProps;
23116
+ break;
23117
+ case 'source':
23118
+ trapBubbledEvent('topError', 'error', domElement);
23119
+ props = rawProps;
23120
+ break;
23121
+ case 'img':
23122
+ case 'image':
23123
+ trapBubbledEvent('topError', 'error', domElement);
23124
+ trapBubbledEvent('topLoad', 'load', domElement);
23125
+ props = rawProps;
23126
+ break;
23127
+ case 'form':
23128
+ trapBubbledEvent('topReset', 'reset', domElement);
23129
+ trapBubbledEvent('topSubmit', 'submit', domElement);
23130
+ props = rawProps;
23131
+ break;
23132
+ case 'details':
23133
+ trapBubbledEvent('topToggle', 'toggle', domElement);
23134
+ props = rawProps;
23135
+ break;
23136
+ case 'input':
23137
+ initWrapperState(domElement, rawProps);
23138
+ props = getHostProps(domElement, rawProps);
23139
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23140
+ // For controlled components we always need to ensure we're listening
23141
+ // to onChange. Even if there is no listener.
23142
+ ensureListeningTo(rootContainerElement, 'onChange');
23143
+ break;
23144
+ case 'option':
23145
+ validateProps(domElement, rawProps);
23146
+ props = getHostProps$1(domElement, rawProps);
23147
+ break;
23148
+ case 'select':
23149
+ initWrapperState$1(domElement, rawProps);
23150
+ props = getHostProps$2(domElement, rawProps);
23151
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23152
+ // For controlled components we always need to ensure we're listening
23153
+ // to onChange. Even if there is no listener.
23154
+ ensureListeningTo(rootContainerElement, 'onChange');
23155
+ break;
23156
+ case 'textarea':
23157
+ initWrapperState$2(domElement, rawProps);
23158
+ props = getHostProps$3(domElement, rawProps);
23159
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23160
+ // For controlled components we always need to ensure we're listening
23161
+ // to onChange. Even if there is no listener.
23162
+ ensureListeningTo(rootContainerElement, 'onChange');
23163
+ break;
23164
+ default:
23165
+ props = rawProps;
23166
+ }
23167
+
23168
+ assertValidProps(tag, props, getStack);
23169
+
23170
+ setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
23171
+
23172
+ switch (tag) {
23173
+ case 'input':
23174
+ // TODO: Make sure we check if this is still unmounted or do any clean
23175
+ // up necessary since we never stop tracking anymore.
23176
+ track(domElement);
23177
+ postMountWrapper(domElement, rawProps);
23178
+ break;
23179
+ case 'textarea':
23180
+ // TODO: Make sure we check if this is still unmounted or do any clean
23181
+ // up necessary since we never stop tracking anymore.
23182
+ track(domElement);
23183
+ postMountWrapper$3(domElement, rawProps);
23184
+ break;
23185
+ case 'option':
23186
+ postMountWrapper$1(domElement, rawProps);
23187
+ break;
23188
+ case 'select':
23189
+ postMountWrapper$2(domElement, rawProps);
23190
+ break;
23191
+ default:
23192
+ if (typeof props.onClick === 'function') {
23193
+ // TODO: This cast may not be sound for SVG, MathML or custom elements.
23194
+ trapClickOnNonInteractiveElement(domElement);
23195
+ }
23196
+ break;
23197
+ }
23198
+ }
23199
+
23200
+ // Calculate the diff between the two objects.
23201
+ function diffProperties$1(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
23202
+ {
23203
+ validatePropertiesInDevelopment(tag, nextRawProps);
23204
+ }
23205
+
23206
+ var updatePayload = null;
23207
+
23208
+ var lastProps;
23209
+ var nextProps;
23210
+ switch (tag) {
23211
+ case 'input':
23212
+ lastProps = getHostProps(domElement, lastRawProps);
23213
+ nextProps = getHostProps(domElement, nextRawProps);
23214
+ updatePayload = [];
23215
+ break;
23216
+ case 'option':
23217
+ lastProps = getHostProps$1(domElement, lastRawProps);
23218
+ nextProps = getHostProps$1(domElement, nextRawProps);
23219
+ updatePayload = [];
23220
+ break;
23221
+ case 'select':
23222
+ lastProps = getHostProps$2(domElement, lastRawProps);
23223
+ nextProps = getHostProps$2(domElement, nextRawProps);
23224
+ updatePayload = [];
23225
+ break;
23226
+ case 'textarea':
23227
+ lastProps = getHostProps$3(domElement, lastRawProps);
23228
+ nextProps = getHostProps$3(domElement, nextRawProps);
23229
+ updatePayload = [];
23230
+ break;
23231
+ default:
23232
+ lastProps = lastRawProps;
23233
+ nextProps = nextRawProps;
23234
+ if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
23235
+ // TODO: This cast may not be sound for SVG, MathML or custom elements.
23236
+ trapClickOnNonInteractiveElement(domElement);
23237
+ }
23238
+ break;
23239
+ }
23240
+
23241
+ assertValidProps(tag, nextProps, getStack);
23242
+
23243
+ var propKey;
23244
+ var styleName;
23245
+ var styleUpdates = null;
23246
+ for (propKey in lastProps) {
23247
+ if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
23248
+ continue;
23249
+ }
23250
+ if (propKey === STYLE) {
23251
+ var lastStyle = lastProps[propKey];
23252
+ for (styleName in lastStyle) {
23253
+ if (lastStyle.hasOwnProperty(styleName)) {
23254
+ if (!styleUpdates) {
23255
+ styleUpdates = {};
23256
+ }
23257
+ styleUpdates[styleName] = '';
23258
+ }
23259
+ }
23260
+ } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {
23261
+ // Noop. This is handled by the clear text mechanism.
23262
+ } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
23263
+ // Noop
23264
+ } else if (propKey === AUTOFOCUS) {
23265
+ // Noop. It doesn't work on updates anyway.
23266
+ } else if (registrationNameModules.hasOwnProperty(propKey)) {
23267
+ // This is a special case. If any listener updates we need to ensure
23268
+ // that the "current" fiber pointer gets updated so we need a commit
23269
+ // to update this element.
23270
+ if (!updatePayload) {
23271
+ updatePayload = [];
23272
+ }
23273
+ } else {
23274
+ // For all other deleted properties we add it to the queue. We use
23275
+ // the whitelist in the commit phase instead.
23276
+ (updatePayload = updatePayload || []).push(propKey, null);
23277
+ }
23278
+ }
23279
+ for (propKey in nextProps) {
23280
+ var nextProp = nextProps[propKey];
23281
+ var lastProp = lastProps != null ? lastProps[propKey] : undefined;
23282
+ if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
23283
+ continue;
23284
+ }
23285
+ if (propKey === STYLE) {
23286
+ {
23287
+ if (nextProp) {
23288
+ // Freeze the next style object so that we can assume it won't be
23289
+ // mutated. We have already warned for this in the past.
23290
+ Object.freeze(nextProp);
23291
+ }
23292
+ }
23293
+ if (lastProp) {
23294
+ // Unset styles on `lastProp` but not on `nextProp`.
23295
+ for (styleName in lastProp) {
23296
+ if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
23297
+ if (!styleUpdates) {
23298
+ styleUpdates = {};
23299
+ }
23300
+ styleUpdates[styleName] = '';
23301
+ }
23302
+ }
23303
+ // Update styles that changed since `lastProp`.
23304
+ for (styleName in nextProp) {
23305
+ if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
23306
+ if (!styleUpdates) {
23307
+ styleUpdates = {};
23308
+ }
23309
+ styleUpdates[styleName] = nextProp[styleName];
23310
+ }
23311
+ }
23312
+ } else {
23313
+ // Relies on `updateStylesByID` not mutating `styleUpdates`.
23314
+ if (!styleUpdates) {
23315
+ if (!updatePayload) {
23316
+ updatePayload = [];
23317
+ }
23318
+ updatePayload.push(propKey, styleUpdates);
23319
+ }
23320
+ styleUpdates = nextProp;
23321
+ }
23322
+ } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
23323
+ var nextHtml = nextProp ? nextProp[HTML] : undefined;
23324
+ var lastHtml = lastProp ? lastProp[HTML] : undefined;
23325
+ if (nextHtml != null) {
23326
+ if (lastHtml !== nextHtml) {
23327
+ (updatePayload = updatePayload || []).push(propKey, '' + nextHtml);
23328
+ }
23329
+ } else {
23330
+ // TODO: It might be too late to clear this if we have children
23331
+ // inserted already.
23332
+ }
23333
+ } else if (propKey === CHILDREN) {
23334
+ if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
23335
+ (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
23336
+ }
23337
+ } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
23338
+ // Noop
23339
+ } else if (registrationNameModules.hasOwnProperty(propKey)) {
23340
+ if (nextProp != null) {
23341
+ // We eagerly listen to this even though we haven't committed yet.
23342
+ if (true && typeof nextProp !== 'function') {
23343
+ warnForInvalidEventListener(propKey, nextProp);
23344
+ }
23345
+ ensureListeningTo(rootContainerElement, propKey);
23346
+ }
23347
+ if (!updatePayload && lastProp !== nextProp) {
23348
+ // This is a special case. If any listener updates we need to ensure
23349
+ // that the "current" props pointer gets updated so we need a commit
23350
+ // to update this element.
23351
+ updatePayload = [];
23352
+ }
23353
+ } else {
23354
+ // For any other property we always add it to the queue and then we
23355
+ // filter it out using the whitelist during the commit.
23356
+ (updatePayload = updatePayload || []).push(propKey, nextProp);
23357
+ }
23358
+ }
23359
+ if (styleUpdates) {
23360
+ (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
23361
+ }
23362
+ return updatePayload;
23363
+ }
23364
+
23365
+ // Apply the diff.
23366
+ function updateProperties$1(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
23367
+ // Update checked *before* name.
23368
+ // In the middle of an update, it is possible to have multiple checked.
23369
+ // When a checked radio tries to change name, browser makes another radio's checked false.
23370
+ if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
23371
+ updateChecked(domElement, nextRawProps);
23372
+ }
23373
+
23374
+ var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
23375
+ var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
23376
+ // Apply the diff.
23377
+ updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
23378
+
23379
+ // TODO: Ensure that an update gets scheduled if any of the special props
23380
+ // changed.
23381
+ switch (tag) {
23382
+ case 'input':
23383
+ // Update the wrapper around inputs *after* updating props. This has to
23384
+ // happen after `updateDOMProperties`. Otherwise HTML5 input validations
23385
+ // raise warnings and prevent the new value from being assigned.
23386
+ updateWrapper(domElement, nextRawProps);
23387
+ break;
23388
+ case 'textarea':
23389
+ updateWrapper$1(domElement, nextRawProps);
23390
+ break;
23391
+ case 'select':
23392
+ // <select> value update needs to occur after <option> children
23393
+ // reconciliation
23394
+ postUpdateWrapper(domElement, nextRawProps);
23395
+ break;
23396
+ }
23397
+ }
23398
+
23399
+ function diffHydratedProperties$1(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
23400
+ {
23401
+ var suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
23402
+ var isCustomComponentTag = isCustomComponent(tag, rawProps);
23403
+ validatePropertiesInDevelopment(tag, rawProps);
23404
+ if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
23405
+ warning(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerName$1() || 'A component');
23406
+ didWarnShadyDOM = true;
23407
+ }
23408
+ }
23409
+
23410
+ // TODO: Make sure that we check isMounted before firing any of these events.
23411
+ switch (tag) {
23412
+ case 'iframe':
23413
+ case 'object':
23414
+ trapBubbledEvent('topLoad', 'load', domElement);
23415
+ break;
23416
+ case 'video':
23417
+ case 'audio':
23418
+ // Create listener for each media event
23419
+ for (var event in mediaEvents) {
23420
+ if (mediaEvents.hasOwnProperty(event)) {
23421
+ trapBubbledEvent(event, mediaEvents[event], domElement);
23422
+ }
23423
+ }
23424
+ break;
23425
+ case 'source':
23426
+ trapBubbledEvent('topError', 'error', domElement);
23427
+ break;
23428
+ case 'img':
23429
+ case 'image':
23430
+ trapBubbledEvent('topError', 'error', domElement);
23431
+ trapBubbledEvent('topLoad', 'load', domElement);
23432
+ break;
23433
+ case 'form':
23434
+ trapBubbledEvent('topReset', 'reset', domElement);
23435
+ trapBubbledEvent('topSubmit', 'submit', domElement);
23436
+ break;
23437
+ case 'details':
23438
+ trapBubbledEvent('topToggle', 'toggle', domElement);
23439
+ break;
23440
+ case 'input':
23441
+ initWrapperState(domElement, rawProps);
23442
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23443
+ // For controlled components we always need to ensure we're listening
23444
+ // to onChange. Even if there is no listener.
23445
+ ensureListeningTo(rootContainerElement, 'onChange');
23446
+ break;
23447
+ case 'option':
23448
+ validateProps(domElement, rawProps);
23449
+ break;
23450
+ case 'select':
23451
+ initWrapperState$1(domElement, rawProps);
23452
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23453
+ // For controlled components we always need to ensure we're listening
23454
+ // to onChange. Even if there is no listener.
23455
+ ensureListeningTo(rootContainerElement, 'onChange');
23456
+ break;
23457
+ case 'textarea':
23458
+ initWrapperState$2(domElement, rawProps);
23459
+ trapBubbledEvent('topInvalid', 'invalid', domElement);
23460
+ // For controlled components we always need to ensure we're listening
23461
+ // to onChange. Even if there is no listener.
23462
+ ensureListeningTo(rootContainerElement, 'onChange');
23463
+ break;
23464
+ }
23465
+
23466
+ assertValidProps(tag, rawProps, getStack);
23467
+
23468
+ {
23469
+ var extraAttributeNames = new Set();
23470
+ var attributes = domElement.attributes;
23471
+ for (var i = 0; i < attributes.length; i++) {
23472
+ var name = attributes[i].name.toLowerCase();
23473
+ switch (name) {
23474
+ // Built-in SSR attribute is whitelisted
23475
+ case 'data-reactroot':
23476
+ break;
23477
+ // Controlled attributes are not validated
23478
+ // TODO: Only ignore them on controlled tags.
23479
+ case 'value':
23480
+ break;
23481
+ case 'checked':
23482
+ break;
23483
+ case 'selected':
23484
+ break;
23485
+ default:
23486
+ // Intentionally use the original name.
23487
+ // See discussion in https://github.com/facebook/react/pull/10676.
23488
+ extraAttributeNames.add(attributes[i].name);
23489
+ }
23490
+ }
23491
+ }
23492
+
23493
+ var updatePayload = null;
23494
+ for (var propKey in rawProps) {
23495
+ if (!rawProps.hasOwnProperty(propKey)) {
23496
+ continue;
23497
+ }
23498
+ var nextProp = rawProps[propKey];
23499
+ if (propKey === CHILDREN) {
23500
+ // For text content children we compare against textContent. This
23501
+ // might match additional HTML that is hidden when we read it using
23502
+ // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
23503
+ // satisfies our requirement. Our requirement is not to produce perfect
23504
+ // HTML and attributes. Ideally we should preserve structure but it's
23505
+ // ok not to if the visible content is still enough to indicate what
23506
+ // even listeners these nodes might be wired up to.
23507
+ // TODO: Warn if there is more than a single textNode as a child.
23508
+ // TODO: Should we use domElement.firstChild.nodeValue to compare?
23509
+ if (typeof nextProp === 'string') {
23510
+ if (domElement.textContent !== nextProp) {
23511
+ if (true && !suppressHydrationWarning) {
23512
+ warnForTextDifference(domElement.textContent, nextProp);
23513
+ }
23514
+ updatePayload = [CHILDREN, nextProp];
23515
+ }
23516
+ } else if (typeof nextProp === 'number') {
23517
+ if (domElement.textContent !== '' + nextProp) {
23518
+ if (true && !suppressHydrationWarning) {
23519
+ warnForTextDifference(domElement.textContent, nextProp);
23520
+ }
23521
+ updatePayload = [CHILDREN, '' + nextProp];
23522
+ }
23523
+ }
23524
+ } else if (registrationNameModules.hasOwnProperty(propKey)) {
23525
+ if (nextProp != null) {
23526
+ if (true && typeof nextProp !== 'function') {
23527
+ warnForInvalidEventListener(propKey, nextProp);
23528
+ }
23529
+ ensureListeningTo(rootContainerElement, propKey);
23530
+ }
23531
+ } else {
23532
+ // Validate that the properties correspond to their expected values.
23533
+ var serverValue;
23534
+ var propertyInfo;
23535
+ if (suppressHydrationWarning) {
23536
+ // Don't bother comparing. We're ignoring all these warnings.
23537
+ } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 ||
23538
+ // Controlled attributes are not validated
23539
+ // TODO: Only ignore them on controlled tags.
23540
+ propKey === 'value' || propKey === 'checked' || propKey === 'selected') {
23541
+ // Noop
23542
+ } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
23543
+ var rawHtml = nextProp ? nextProp[HTML] || '' : '';
23544
+ var serverHTML = domElement.innerHTML;
23545
+ var expectedHTML = normalizeHTML(domElement, rawHtml);
23546
+ if (expectedHTML !== serverHTML) {
23547
+ warnForPropDifference(propKey, serverHTML, expectedHTML);
23548
+ }
23549
+ } else if (propKey === STYLE) {
23550
+ // $FlowFixMe - Should be inferred as not undefined.
23551
+ extraAttributeNames['delete'](propKey);
23552
+ var expectedStyle = createDangerousStringForStyles(nextProp);
23553
+ serverValue = domElement.getAttribute('style');
23554
+ if (expectedStyle !== serverValue) {
23555
+ warnForPropDifference(propKey, serverValue, expectedStyle);
23556
+ }
23557
+ } else if (isCustomComponentTag) {
23558
+ // $FlowFixMe - Should be inferred as not undefined.
23559
+ extraAttributeNames['delete'](propKey.toLowerCase());
23560
+ serverValue = getValueForAttribute(domElement, propKey, nextProp);
23561
+
23562
+ if (nextProp !== serverValue) {
23563
+ warnForPropDifference(propKey, serverValue, nextProp);
23564
+ }
23565
+ } else if (shouldSetAttribute(propKey, nextProp)) {
23566
+ if (propertyInfo = getPropertyInfo(propKey)) {
23567
+ // $FlowFixMe - Should be inferred as not undefined.
23568
+ extraAttributeNames['delete'](propertyInfo.attributeName);
23569
+ serverValue = getValueForProperty(domElement, propKey, nextProp);
23570
+ } else {
23571
+ var ownNamespace = parentNamespace;
23572
+ if (ownNamespace === HTML_NAMESPACE) {
23573
+ ownNamespace = getIntrinsicNamespace(tag);
23574
+ }
23575
+ if (ownNamespace === HTML_NAMESPACE) {
23576
+ // $FlowFixMe - Should be inferred as not undefined.
23577
+ extraAttributeNames['delete'](propKey.toLowerCase());
23578
+ } else {
23579
+ // $FlowFixMe - Should be inferred as not undefined.
23580
+ extraAttributeNames['delete'](propKey);
23581
+ }
23582
+ serverValue = getValueForAttribute(domElement, propKey, nextProp);
23583
+ }
23584
+
23585
+ if (nextProp !== serverValue) {
23586
+ warnForPropDifference(propKey, serverValue, nextProp);
23587
+ }
23588
+ }
23589
+ }
23590
+ }
23591
+
23592
+ {
23593
+ // $FlowFixMe - Should be inferred as not undefined.
23594
+ if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
23595
+ // $FlowFixMe - Should be inferred as not undefined.
23596
+ warnForExtraAttributes(extraAttributeNames);
23597
+ }
23598
+ }
23599
+
23600
+ switch (tag) {
23601
+ case 'input':
23602
+ // TODO: Make sure we check if this is still unmounted or do any clean
23603
+ // up necessary since we never stop tracking anymore.
23604
+ track(domElement);
23605
+ postMountWrapper(domElement, rawProps);
23606
+ break;
23607
+ case 'textarea':
23608
+ // TODO: Make sure we check if this is still unmounted or do any clean
23609
+ // up necessary since we never stop tracking anymore.
23610
+ track(domElement);
23611
+ postMountWrapper$3(domElement, rawProps);
23612
+ break;
23613
+ case 'select':
23614
+ case 'option':
23615
+ // For input and textarea we current always set the value property at
23616
+ // post mount to force it to diverge from attributes. However, for
23617
+ // option and select we don't quite do the same thing and select
23618
+ // is not resilient to the DOM state changing so we don't do that here.
23619
+ // TODO: Consider not doing this for input and textarea.
23620
+ break;
23621
+ default:
23622
+ if (typeof rawProps.onClick === 'function') {
23623
+ // TODO: This cast may not be sound for SVG, MathML or custom elements.
23624
+ trapClickOnNonInteractiveElement(domElement);
23625
+ }
23626
+ break;
23627
+ }
23628
+
23629
+ return updatePayload;
23630
+ }
23631
+
23632
+ function diffHydratedText$1(textNode, text) {
23633
+ var isDifferent = textNode.nodeValue !== text;
23634
+ return isDifferent;
23635
+ }
23636
+
23637
+ function warnForUnmatchedText$1(textNode, text) {
23638
+ {
23639
+ warnForTextDifference(textNode.nodeValue, text);
23640
+ }
23641
+ }
23642
+
23643
+ function warnForDeletedHydratableElement$1(parentNode, child) {
23644
+ {
23645
+ if (didWarnInvalidHydration) {
23646
+ return;
23647
+ }
23648
+ didWarnInvalidHydration = true;
23649
+ warning(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
23650
+ }
23651
+ }
23652
+
23653
+ function warnForDeletedHydratableText$1(parentNode, child) {
23654
+ {
23655
+ if (didWarnInvalidHydration) {
23656
+ return;
23657
+ }
23658
+ didWarnInvalidHydration = true;
23659
+ warning(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
23660
+ }
23661
+ }
23662
+
23663
+ function warnForInsertedHydratedElement$1(parentNode, tag, props) {
23664
+ {
23665
+ if (didWarnInvalidHydration) {
23666
+ return;
23667
+ }
23668
+ didWarnInvalidHydration = true;
23669
+ warning(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
23670
+ }
23671
+ }
23672
+
23673
+ function warnForInsertedHydratedText$1(parentNode, text) {
23674
+ {
23675
+ if (text === '') {
23676
+ // We expect to insert empty text nodes since they're not represented in
23677
+ // the HTML.
23678
+ // TODO: Remove this special case if we can just avoid inserting empty
23679
+ // text nodes.
23680
+ return;
23681
+ }
23682
+ if (didWarnInvalidHydration) {
23683
+ return;
23684
+ }
23685
+ didWarnInvalidHydration = true;
23686
+ warning(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
23687
+ }
23688
+ }
23689
+
23690
+ function restoreControlledState(domElement, tag, props) {
23691
+ switch (tag) {
23692
+ case 'input':
23693
+ restoreControlledState$1(domElement, props);
23694
+ return;
23695
+ case 'textarea':
23696
+ restoreControlledState$3(domElement, props);
23697
+ return;
23698
+ case 'select':
23699
+ restoreControlledState$2(domElement, props);
23700
+ return;
23701
+ }
23702
+ }
23703
+
23704
+ var ReactDOMFiberComponent = Object.freeze({
23705
+ createElement: createElement$1,
23706
+ createTextNode: createTextNode$1,
23707
+ setInitialProperties: setInitialProperties$1,
23708
+ diffProperties: diffProperties$1,
23709
+ updateProperties: updateProperties$1,
23710
+ diffHydratedProperties: diffHydratedProperties$1,
23711
+ diffHydratedText: diffHydratedText$1,
23712
+ warnForUnmatchedText: warnForUnmatchedText$1,
23713
+ warnForDeletedHydratableElement: warnForDeletedHydratableElement$1,
23714
+ warnForDeletedHydratableText: warnForDeletedHydratableText$1,
23715
+ warnForInsertedHydratedElement: warnForInsertedHydratedElement$1,
23716
+ warnForInsertedHydratedText: warnForInsertedHydratedText$1,
23717
+ restoreControlledState: restoreControlledState
23718
+ });
23719
+
23720
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
23721
+ var getCurrentFiberStackAddendum$6 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
23722
+
23723
+ var validateDOMNesting = emptyFunction;
23724
+
23725
+ {
23726
+ // This validation code was written based on the HTML5 parsing spec:
23727
+ // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
23728
+ //
23729
+ // Note: this does not catch all invalid nesting, nor does it try to (as it's
23730
+ // not clear what practical benefit doing so provides); instead, we warn only
23731
+ // for cases where the parser will give a parse tree differing from what React
23732
+ // intended. For example, <b><div></div></b> is invalid but we don't warn
23733
+ // because it still parses correctly; we do warn for other cases like nested
23734
+ // <p> tags where the beginning of the second element implicitly closes the
23735
+ // first, causing a confusing mess.
23736
+
23737
+ // https://html.spec.whatwg.org/multipage/syntax.html#special
23738
+ var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
23739
+
23740
+ // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
23741
+ var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
23742
+
23743
+ // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
23744
+ // TODO: Distinguish by namespace here -- for <title>, including it here
23745
+ // errs on the side of fewer warnings
23746
+ 'foreignObject', 'desc', 'title'];
23747
+
23748
+ // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
23749
+ var buttonScopeTags = inScopeTags.concat(['button']);
23750
+
23751
+ // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
23752
+ var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
23753
+
23754
+ var emptyAncestorInfo = {
23755
+ current: null,
23756
+
23757
+ formTag: null,
23758
+ aTagInScope: null,
23759
+ buttonTagInScope: null,
23760
+ nobrTagInScope: null,
23761
+ pTagInButtonScope: null,
23762
+
23763
+ listItemTagAutoclosing: null,
23764
+ dlItemTagAutoclosing: null
23765
+ };
23766
+
23767
+ var updatedAncestorInfo$1 = function (oldInfo, tag, instance) {
23768
+ var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
23769
+ var info = { tag: tag, instance: instance };
23770
+
23771
+ if (inScopeTags.indexOf(tag) !== -1) {
23772
+ ancestorInfo.aTagInScope = null;
23773
+ ancestorInfo.buttonTagInScope = null;
23774
+ ancestorInfo.nobrTagInScope = null;
23775
+ }
23776
+ if (buttonScopeTags.indexOf(tag) !== -1) {
23777
+ ancestorInfo.pTagInButtonScope = null;
23778
+ }
23779
+
23780
+ // See rules for 'li', 'dd', 'dt' start tags in
23781
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
23782
+ if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
23783
+ ancestorInfo.listItemTagAutoclosing = null;
23784
+ ancestorInfo.dlItemTagAutoclosing = null;
23785
+ }
23786
+
23787
+ ancestorInfo.current = info;
23788
+
23789
+ if (tag === 'form') {
23790
+ ancestorInfo.formTag = info;
23791
+ }
23792
+ if (tag === 'a') {
23793
+ ancestorInfo.aTagInScope = info;
23794
+ }
23795
+ if (tag === 'button') {
23796
+ ancestorInfo.buttonTagInScope = info;
23797
+ }
23798
+ if (tag === 'nobr') {
23799
+ ancestorInfo.nobrTagInScope = info;
23800
+ }
23801
+ if (tag === 'p') {
23802
+ ancestorInfo.pTagInButtonScope = info;
23803
+ }
23804
+ if (tag === 'li') {
23805
+ ancestorInfo.listItemTagAutoclosing = info;
23806
+ }
23807
+ if (tag === 'dd' || tag === 'dt') {
23808
+ ancestorInfo.dlItemTagAutoclosing = info;
23809
+ }
23810
+
23811
+ return ancestorInfo;
23812
+ };
23813
+
23814
+ /**
23815
+ * Returns whether
23816
+ */
23817
+ var isTagValidWithParent = function (tag, parentTag) {
23818
+ // First, let's check if we're in an unusual parsing mode...
23819
+ switch (parentTag) {
23820
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
23821
+ case 'select':
23822
+ return tag === 'option' || tag === 'optgroup' || tag === '#text';
23823
+ case 'optgroup':
23824
+ return tag === 'option' || tag === '#text';
23825
+ // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
23826
+ // but
23827
+ case 'option':
23828
+ return tag === '#text';
23829
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
23830
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
23831
+ // No special behavior since these rules fall back to "in body" mode for
23832
+ // all except special table nodes which cause bad parsing behavior anyway.
23833
+
23834
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
23835
+ case 'tr':
23836
+ return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
23837
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
23838
+ case 'tbody':
23839
+ case 'thead':
23840
+ case 'tfoot':
23841
+ return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
23842
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
23843
+ case 'colgroup':
23844
+ return tag === 'col' || tag === 'template';
23845
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
23846
+ case 'table':
23847
+ return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
23848
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
23849
+ case 'head':
23850
+ return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
23851
+ // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
23852
+ case 'html':
23853
+ return tag === 'head' || tag === 'body';
23854
+ case '#document':
23855
+ return tag === 'html';
23856
+ }
23857
+
23858
+ // Probably in the "in body" parsing mode, so we outlaw only tag combos
23859
+ // where the parsing rules cause implicit opens or closes to be added.
23860
+ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
23861
+ switch (tag) {
23862
+ case 'h1':
23863
+ case 'h2':
23864
+ case 'h3':
23865
+ case 'h4':
23866
+ case 'h5':
23867
+ case 'h6':
23868
+ return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
23869
+
23870
+ case 'rp':
23871
+ case 'rt':
23872
+ return impliedEndTags.indexOf(parentTag) === -1;
23873
+
23874
+ case 'body':
23875
+ case 'caption':
23876
+ case 'col':
23877
+ case 'colgroup':
23878
+ case 'frame':
23879
+ case 'head':
23880
+ case 'html':
23881
+ case 'tbody':
23882
+ case 'td':
23883
+ case 'tfoot':
23884
+ case 'th':
23885
+ case 'thead':
23886
+ case 'tr':
23887
+ // These tags are only valid with a few parents that have special child
23888
+ // parsing rules -- if we're down here, then none of those matched and
23889
+ // so we allow it only if we don't know what the parent is, as all other
23890
+ // cases are invalid.
23891
+ return parentTag == null;
23892
+ }
23893
+
23894
+ return true;
23895
+ };
23896
+
23897
+ /**
23898
+ * Returns whether
23899
+ */
23900
+ var findInvalidAncestorForTag = function (tag, ancestorInfo) {
23901
+ switch (tag) {
23902
+ case 'address':
23903
+ case 'article':
23904
+ case 'aside':
23905
+ case 'blockquote':
23906
+ case 'center':
23907
+ case 'details':
23908
+ case 'dialog':
23909
+ case 'dir':
23910
+ case 'div':
23911
+ case 'dl':
23912
+ case 'fieldset':
23913
+ case 'figcaption':
23914
+ case 'figure':
23915
+ case 'footer':
23916
+ case 'header':
23917
+ case 'hgroup':
23918
+ case 'main':
23919
+ case 'menu':
23920
+ case 'nav':
23921
+ case 'ol':
23922
+ case 'p':
23923
+ case 'section':
23924
+ case 'summary':
23925
+ case 'ul':
23926
+ case 'pre':
23927
+ case 'listing':
23928
+ case 'table':
23929
+ case 'hr':
23930
+ case 'xmp':
23931
+ case 'h1':
23932
+ case 'h2':
23933
+ case 'h3':
23934
+ case 'h4':
23935
+ case 'h5':
23936
+ case 'h6':
23937
+ return ancestorInfo.pTagInButtonScope;
23938
+
23939
+ case 'form':
23940
+ return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
23941
+
23942
+ case 'li':
23943
+ return ancestorInfo.listItemTagAutoclosing;
23944
+
23945
+ case 'dd':
23946
+ case 'dt':
23947
+ return ancestorInfo.dlItemTagAutoclosing;
23948
+
23949
+ case 'button':
23950
+ return ancestorInfo.buttonTagInScope;
23951
+
23952
+ case 'a':
23953
+ // Spec says something about storing a list of markers, but it sounds
23954
+ // equivalent to this check.
23955
+ return ancestorInfo.aTagInScope;
23956
+
23957
+ case 'nobr':
23958
+ return ancestorInfo.nobrTagInScope;
23959
+ }
23960
+
23961
+ return null;
23962
+ };
23963
+
23964
+ var didWarn = {};
23965
+
23966
+ validateDOMNesting = function (childTag, childText, ancestorInfo) {
23967
+ ancestorInfo = ancestorInfo || emptyAncestorInfo;
23968
+ var parentInfo = ancestorInfo.current;
23969
+ var parentTag = parentInfo && parentInfo.tag;
23970
+
23971
+ if (childText != null) {
23972
+ warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null');
23973
+ childTag = '#text';
23974
+ }
23975
+
23976
+ var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
23977
+ var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
23978
+ var invalidParentOrAncestor = invalidParent || invalidAncestor;
23979
+ if (!invalidParentOrAncestor) {
23980
+ return;
23981
+ }
23982
+
23983
+ var ancestorTag = invalidParentOrAncestor.tag;
23984
+ var addendum = getCurrentFiberStackAddendum$6();
23985
+
23986
+ var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
23987
+ if (didWarn[warnKey]) {
23988
+ return;
23989
+ }
23990
+ didWarn[warnKey] = true;
23991
+
23992
+ var tagDisplayName = childTag;
23993
+ var whitespaceInfo = '';
23994
+ if (childTag === '#text') {
23995
+ if (/\S/.test(childText)) {
23996
+ tagDisplayName = 'Text nodes';
23997
+ } else {
23998
+ tagDisplayName = 'Whitespace text nodes';
23999
+ whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
24000
+ }
24001
+ } else {
24002
+ tagDisplayName = '<' + childTag + '>';
24003
+ }
24004
+
24005
+ if (invalidParent) {
24006
+ var info = '';
24007
+ if (ancestorTag === 'table' && childTag === 'tr') {
24008
+ info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
24009
+ }
24010
+ warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
24011
+ } else {
24012
+ warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
24013
+ }
24014
+ };
24015
+
24016
+ // TODO: turn this into a named export
24017
+ validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo$1;
24018
+
24019
+ // For testing
24020
+ validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
24021
+ ancestorInfo = ancestorInfo || emptyAncestorInfo;
24022
+ var parentInfo = ancestorInfo.current;
24023
+ var parentTag = parentInfo && parentInfo.tag;
24024
+ return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
24025
+ };
24026
+ }
24027
+
24028
+ var validateDOMNesting$1 = validateDOMNesting;
24029
+
24030
+ // TODO: direct imports like some-package/src/* are bad. Fix me.
24031
+ var createElement = createElement$1;
24032
+ var createTextNode = createTextNode$1;
24033
+ var setInitialProperties = setInitialProperties$1;
24034
+ var diffProperties = diffProperties$1;
24035
+ var updateProperties = updateProperties$1;
24036
+ var diffHydratedProperties = diffHydratedProperties$1;
24037
+ var diffHydratedText = diffHydratedText$1;
24038
+ var warnForUnmatchedText = warnForUnmatchedText$1;
24039
+ var warnForDeletedHydratableElement = warnForDeletedHydratableElement$1;
24040
+ var warnForDeletedHydratableText = warnForDeletedHydratableText$1;
24041
+ var warnForInsertedHydratedElement = warnForInsertedHydratedElement$1;
24042
+ var warnForInsertedHydratedText = warnForInsertedHydratedText$1;
24043
+ var updatedAncestorInfo = validateDOMNesting$1.updatedAncestorInfo;
24044
+ var precacheFiberNode = precacheFiberNode$1;
24045
+ var updateFiberProps = updateFiberProps$1;
24046
+
24047
+
24048
+ {
24049
+ var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
24050
+ if (typeof Map !== 'function' || Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
24051
+ warning(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills');
24052
+ }
24053
+ }
24054
+
24055
+ injection$3.injectFiberControlledHostComponent(ReactDOMFiberComponent);
24056
+
24057
+ var eventsEnabled = null;
24058
+ var selectionInformation = null;
24059
+
24060
+ /**
24061
+ * True if the supplied DOM node is a valid node element.
24062
+ *
24063
+ * @param {?DOMElement} node The candidate DOM node.
24064
+ * @return {boolean} True if the DOM is a valid DOM node.
24065
+ * @internal
24066
+ */
24067
+ function isValidContainer(node) {
24068
+ return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
24069
+ }
24070
+
24071
+ function getReactRootElementInContainer(container) {
24072
+ if (!container) {
24073
+ return null;
24074
+ }
24075
+
24076
+ if (container.nodeType === DOCUMENT_NODE) {
24077
+ return container.documentElement;
24078
+ } else {
24079
+ return container.firstChild;
24080
+ }
24081
+ }
24082
+
24083
+ function shouldHydrateDueToLegacyHeuristic(container) {
24084
+ var rootElement = getReactRootElementInContainer(container);
24085
+ return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
24086
+ }
24087
+
24088
+ function shouldAutoFocusHostComponent(type, props) {
24089
+ switch (type) {
24090
+ case 'button':
24091
+ case 'input':
24092
+ case 'select':
24093
+ case 'textarea':
24094
+ return !!props.autoFocus;
24095
+ }
24096
+ return false;
24097
+ }
24098
+
24099
+ var DOMRenderer = reactReconciler({
24100
+ getRootHostContext: function (rootContainerInstance) {
24101
+ var type = void 0;
24102
+ var namespace = void 0;
24103
+ var nodeType = rootContainerInstance.nodeType;
24104
+ switch (nodeType) {
24105
+ case DOCUMENT_NODE:
24106
+ case DOCUMENT_FRAGMENT_NODE:
24107
+ {
24108
+ type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
24109
+ var root = rootContainerInstance.documentElement;
24110
+ namespace = root ? root.namespaceURI : getChildNamespace(null, '');
24111
+ break;
24112
+ }
24113
+ default:
24114
+ {
24115
+ var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
24116
+ var ownNamespace = container.namespaceURI || null;
24117
+ type = container.tagName;
24118
+ namespace = getChildNamespace(ownNamespace, type);
24119
+ break;
24120
+ }
24121
+ }
24122
+ {
24123
+ var validatedTag = type.toLowerCase();
24124
+ var _ancestorInfo = updatedAncestorInfo(null, validatedTag, null);
24125
+ return { namespace: namespace, ancestorInfo: _ancestorInfo };
24126
+ }
24127
+ return namespace;
24128
+ },
24129
+ getChildHostContext: function (parentHostContext, type) {
24130
+ {
24131
+ var parentHostContextDev = parentHostContext;
24132
+ var _namespace = getChildNamespace(parentHostContextDev.namespace, type);
24133
+ var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type, null);
24134
+ return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };
24135
+ }
24136
+ var parentNamespace = parentHostContext;
24137
+ return getChildNamespace(parentNamespace, type);
24138
+ },
24139
+ getPublicInstance: function (instance) {
24140
+ return instance;
24141
+ },
24142
+ prepareForCommit: function () {
24143
+ eventsEnabled = isEnabled();
24144
+ selectionInformation = getSelectionInformation();
24145
+ setEnabled(false);
24146
+ },
24147
+ resetAfterCommit: function () {
24148
+ restoreSelection(selectionInformation);
24149
+ selectionInformation = null;
24150
+ setEnabled(eventsEnabled);
24151
+ eventsEnabled = null;
24152
+ },
24153
+ createInstance: function (type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
24154
+ var parentNamespace = void 0;
24155
+ {
24156
+ // TODO: take namespace into account when validating.
24157
+ var hostContextDev = hostContext;
24158
+ validateDOMNesting$1(type, null, hostContextDev.ancestorInfo);
24159
+ if (typeof props.children === 'string' || typeof props.children === 'number') {
24160
+ var string = '' + props.children;
24161
+ var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);
24162
+ validateDOMNesting$1(null, string, ownAncestorInfo);
24163
+ }
24164
+ parentNamespace = hostContextDev.namespace;
24165
+ }
24166
+ var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
24167
+ precacheFiberNode(internalInstanceHandle, domElement);
24168
+ updateFiberProps(domElement, props);
24169
+ return domElement;
24170
+ },
24171
+ appendInitialChild: function (parentInstance, child) {
24172
+ parentInstance.appendChild(child);
24173
+ },
24174
+ finalizeInitialChildren: function (domElement, type, props, rootContainerInstance) {
24175
+ setInitialProperties(domElement, type, props, rootContainerInstance);
24176
+ return shouldAutoFocusHostComponent(type, props);
24177
+ },
24178
+ prepareUpdate: function (domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
24179
+ {
24180
+ var hostContextDev = hostContext;
24181
+ if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
24182
+ var string = '' + newProps.children;
24183
+ var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);
24184
+ validateDOMNesting$1(null, string, ownAncestorInfo);
24185
+ }
24186
+ }
24187
+ return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
24188
+ },
24189
+ shouldSetTextContent: function (type, props) {
24190
+ return type === 'textarea' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && typeof props.dangerouslySetInnerHTML.__html === 'string';
24191
+ },
24192
+ shouldDeprioritizeSubtree: function (type, props) {
24193
+ return !!props.hidden;
24194
+ },
24195
+ createTextInstance: function (text, rootContainerInstance, hostContext, internalInstanceHandle) {
24196
+ {
24197
+ var hostContextDev = hostContext;
24198
+ validateDOMNesting$1(null, text, hostContextDev.ancestorInfo);
24199
+ }
24200
+ var textNode = createTextNode(text, rootContainerInstance);
24201
+ precacheFiberNode(internalInstanceHandle, textNode);
24202
+ return textNode;
24203
+ },
24204
+
24205
+
24206
+ now: now,
24207
+
24208
+ mutation: {
24209
+ commitMount: function (domElement, type, newProps, internalInstanceHandle) {
24210
+ domElement.focus();
24211
+ },
24212
+ commitUpdate: function (domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
24213
+ // Update the props handle so that we know which props are the ones with
24214
+ // with current event handlers.
24215
+ updateFiberProps(domElement, newProps);
24216
+ // Apply the diff to the DOM node.
24217
+ updateProperties(domElement, updatePayload, type, oldProps, newProps);
24218
+ },
24219
+ resetTextContent: function (domElement) {
24220
+ domElement.textContent = '';
24221
+ },
24222
+ commitTextUpdate: function (textInstance, oldText, newText) {
24223
+ textInstance.nodeValue = newText;
24224
+ },
24225
+ appendChild: function (parentInstance, child) {
24226
+ parentInstance.appendChild(child);
24227
+ },
24228
+ appendChildToContainer: function (container, child) {
24229
+ if (container.nodeType === COMMENT_NODE) {
24230
+ container.parentNode.insertBefore(child, container);
24231
+ } else {
24232
+ container.appendChild(child);
24233
+ }
24234
+ },
24235
+ insertBefore: function (parentInstance, child, beforeChild) {
24236
+ parentInstance.insertBefore(child, beforeChild);
24237
+ },
24238
+ insertInContainerBefore: function (container, child, beforeChild) {
24239
+ if (container.nodeType === COMMENT_NODE) {
24240
+ container.parentNode.insertBefore(child, beforeChild);
24241
+ } else {
24242
+ container.insertBefore(child, beforeChild);
24243
+ }
24244
+ },
24245
+ removeChild: function (parentInstance, child) {
24246
+ parentInstance.removeChild(child);
24247
+ },
24248
+ removeChildFromContainer: function (container, child) {
24249
+ if (container.nodeType === COMMENT_NODE) {
24250
+ container.parentNode.removeChild(child);
24251
+ } else {
24252
+ container.removeChild(child);
24253
+ }
24254
+ }
24255
+ },
24256
+
24257
+ hydration: {
24258
+ canHydrateInstance: function (instance, type, props) {
24259
+ if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
24260
+ return null;
24261
+ }
24262
+ // This has now been refined to an element node.
24263
+ return instance;
24264
+ },
24265
+ canHydrateTextInstance: function (instance, text) {
24266
+ if (text === '' || instance.nodeType !== TEXT_NODE) {
24267
+ // Empty strings are not parsed by HTML so there won't be a correct match here.
24268
+ return null;
24269
+ }
24270
+ // This has now been refined to a text node.
24271
+ return instance;
24272
+ },
24273
+ getNextHydratableSibling: function (instance) {
24274
+ var node = instance.nextSibling;
24275
+ // Skip non-hydratable nodes.
24276
+ while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE) {
24277
+ node = node.nextSibling;
24278
+ }
24279
+ return node;
24280
+ },
24281
+ getFirstHydratableChild: function (parentInstance) {
24282
+ var next = parentInstance.firstChild;
24283
+ // Skip non-hydratable nodes.
24284
+ while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE) {
24285
+ next = next.nextSibling;
24286
+ }
24287
+ return next;
24288
+ },
24289
+ hydrateInstance: function (instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
24290
+ precacheFiberNode(internalInstanceHandle, instance);
24291
+ // TODO: Possibly defer this until the commit phase where all the events
24292
+ // get attached.
24293
+ updateFiberProps(instance, props);
24294
+ var parentNamespace = void 0;
24295
+ {
24296
+ var hostContextDev = hostContext;
24297
+ parentNamespace = hostContextDev.namespace;
24298
+ }
24299
+ return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
24300
+ },
24301
+ hydrateTextInstance: function (textInstance, text, internalInstanceHandle) {
24302
+ precacheFiberNode(internalInstanceHandle, textInstance);
24303
+ return diffHydratedText(textInstance, text);
24304
+ },
24305
+ didNotMatchHydratedContainerTextInstance: function (parentContainer, textInstance, text) {
24306
+ {
24307
+ warnForUnmatchedText(textInstance, text);
24308
+ }
24309
+ },
24310
+ didNotMatchHydratedTextInstance: function (parentType, parentProps, parentInstance, textInstance, text) {
24311
+ if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
24312
+ warnForUnmatchedText(textInstance, text);
24313
+ }
24314
+ },
24315
+ didNotHydrateContainerInstance: function (parentContainer, instance) {
24316
+ {
24317
+ if (instance.nodeType === 1) {
24318
+ warnForDeletedHydratableElement(parentContainer, instance);
24319
+ } else {
24320
+ warnForDeletedHydratableText(parentContainer, instance);
24321
+ }
24322
+ }
24323
+ },
24324
+ didNotHydrateInstance: function (parentType, parentProps, parentInstance, instance) {
24325
+ if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
24326
+ if (instance.nodeType === 1) {
24327
+ warnForDeletedHydratableElement(parentInstance, instance);
24328
+ } else {
24329
+ warnForDeletedHydratableText(parentInstance, instance);
24330
+ }
24331
+ }
24332
+ },
24333
+ didNotFindHydratableContainerInstance: function (parentContainer, type, props) {
24334
+ {
24335
+ warnForInsertedHydratedElement(parentContainer, type, props);
24336
+ }
24337
+ },
24338
+ didNotFindHydratableContainerTextInstance: function (parentContainer, text) {
24339
+ {
24340
+ warnForInsertedHydratedText(parentContainer, text);
24341
+ }
24342
+ },
24343
+ didNotFindHydratableInstance: function (parentType, parentProps, parentInstance, type, props) {
24344
+ if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
24345
+ warnForInsertedHydratedElement(parentInstance, type, props);
24346
+ }
24347
+ },
24348
+ didNotFindHydratableTextInstance: function (parentType, parentProps, parentInstance, text) {
24349
+ if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
24350
+ warnForInsertedHydratedText(parentInstance, text);
24351
+ }
24352
+ }
24353
+ },
24354
+
24355
+ scheduleDeferredCallback: rIC,
24356
+ cancelDeferredCallback: cIC,
24357
+
24358
+ useSyncScheduling: !enableAsyncSchedulingByDefaultInReactDOM
24359
+ });
24360
+
24361
+ injection$4.injectFiberBatchedUpdates(DOMRenderer.batchedUpdates);
24362
+
24363
+ var warnedAboutHydrateAPI = false;
24364
+
24365
+ function renderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
24366
+ !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
24367
+
24368
+ {
24369
+ if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
24370
+ var hostInstance = DOMRenderer.findHostInstanceWithNoPortals(container._reactRootContainer.current);
24371
+ if (hostInstance) {
24372
+ warning(hostInstance.parentNode === container, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');
24373
+ }
24374
+ }
24375
+
24376
+ var isRootRenderedBySomeReact = !!container._reactRootContainer;
24377
+ var rootEl = getReactRootElementInContainer(container);
24378
+ var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
24379
+
24380
+ warning(!hasNonRootReactChild || isRootRenderedBySomeReact, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');
24381
+
24382
+ warning(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');
24383
+ }
24384
+
24385
+ var root = container._reactRootContainer;
24386
+ if (!root) {
24387
+ var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
24388
+ // First clear any existing content.
24389
+ if (!shouldHydrate) {
24390
+ var warned = false;
24391
+ var rootSibling = void 0;
24392
+ while (rootSibling = container.lastChild) {
24393
+ {
24394
+ if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
24395
+ warned = true;
24396
+ warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
24397
+ }
24398
+ }
24399
+ container.removeChild(rootSibling);
24400
+ }
24401
+ }
24402
+ {
24403
+ if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
24404
+ warnedAboutHydrateAPI = true;
24405
+ lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
24406
+ }
24407
+ }
24408
+ var newRoot = DOMRenderer.createContainer(container, shouldHydrate);
24409
+ root = container._reactRootContainer = newRoot;
24410
+ // Initial mount should not be batched.
24411
+ DOMRenderer.unbatchedUpdates(function () {
24412
+ DOMRenderer.updateContainer(children, newRoot, parentComponent, callback);
24413
+ });
24414
+ } else {
24415
+ DOMRenderer.updateContainer(children, root, parentComponent, callback);
24416
+ }
24417
+ return DOMRenderer.getPublicRootInstance(root);
24418
+ }
24419
+
24420
+ function createPortal(children, container) {
24421
+ var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
24422
+
24423
+ !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
24424
+ // TODO: pass ReactDOM portal implementation as third argument
24425
+ return createPortal$1(children, container, null, key);
24426
+ }
24427
+
24428
+ function ReactRoot(container, hydrate) {
24429
+ var root = DOMRenderer.createContainer(container, hydrate);
24430
+ this._reactRootContainer = root;
24431
+ }
24432
+ ReactRoot.prototype.render = function (children, callback) {
24433
+ var root = this._reactRootContainer;
24434
+ DOMRenderer.updateContainer(children, root, null, callback);
24435
+ };
24436
+ ReactRoot.prototype.unmount = function (callback) {
24437
+ var root = this._reactRootContainer;
24438
+ DOMRenderer.updateContainer(null, root, null, callback);
24439
+ };
24440
+
24441
+ var ReactDOM = {
24442
+ createPortal: createPortal,
24443
+
24444
+ findDOMNode: function (componentOrElement) {
24445
+ {
24446
+ var owner = ReactCurrentOwner.current;
24447
+ if (owner !== null) {
24448
+ var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
24449
+ warning(warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner) || 'A component');
24450
+ owner.stateNode._warnedAboutRefsInRender = true;
24451
+ }
24452
+ }
24453
+ if (componentOrElement == null) {
24454
+ return null;
24455
+ }
24456
+ if (componentOrElement.nodeType === ELEMENT_NODE) {
24457
+ return componentOrElement;
24458
+ }
24459
+
24460
+ var inst = get(componentOrElement);
24461
+ if (inst) {
24462
+ return DOMRenderer.findHostInstance(inst);
24463
+ }
24464
+
24465
+ if (typeof componentOrElement.render === 'function') {
24466
+ invariant(false, 'Unable to find node on an unmounted component.');
24467
+ } else {
24468
+ invariant(false, 'Element appears to be neither ReactComponent nor DOMNode. Keys: %s', Object.keys(componentOrElement));
24469
+ }
24470
+ },
24471
+ hydrate: function (element, container, callback) {
24472
+ // TODO: throw or warn if we couldn't hydrate?
24473
+ return renderSubtreeIntoContainer(null, element, container, true, callback);
24474
+ },
24475
+ render: function (element, container, callback) {
24476
+ return renderSubtreeIntoContainer(null, element, container, false, callback);
24477
+ },
24478
+ unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {
24479
+ !(parentComponent != null && has(parentComponent)) ? invariant(false, 'parentComponent must be a valid React Component') : void 0;
24480
+ return renderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
24481
+ },
24482
+ unmountComponentAtNode: function (container) {
24483
+ !isValidContainer(container) ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0;
24484
+
24485
+ if (container._reactRootContainer) {
24486
+ {
24487
+ var rootEl = getReactRootElementInContainer(container);
24488
+ var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
24489
+ warning(!renderedByDifferentReact, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.');
24490
+ }
24491
+
24492
+ // Unmount should not be batched.
24493
+ DOMRenderer.unbatchedUpdates(function () {
24494
+ renderSubtreeIntoContainer(null, null, container, false, function () {
24495
+ container._reactRootContainer = null;
24496
+ });
24497
+ });
24498
+ // If you call unmountComponentAtNode twice in quick succession, you'll
24499
+ // get `true` twice. That's probably fine?
24500
+ return true;
24501
+ } else {
24502
+ {
24503
+ var _rootEl = getReactRootElementInContainer(container);
24504
+ var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));
24505
+
24506
+ // Check if the container itself is a React root node.
24507
+ var isContainerReactRoot = container.nodeType === 1 && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
24508
+
24509
+ warning(!hasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');
24510
+ }
24511
+
24512
+ return false;
24513
+ }
24514
+ },
24515
+
24516
+
24517
+ // Temporary alias since we already shipped React 16 RC with it.
24518
+ // TODO: remove in React 17.
24519
+ unstable_createPortal: createPortal,
24520
+
24521
+ unstable_batchedUpdates: batchedUpdates,
24522
+
24523
+ unstable_deferredUpdates: DOMRenderer.deferredUpdates,
24524
+
24525
+ flushSync: DOMRenderer.flushSync,
24526
+
24527
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
24528
+ // For TapEventPlugin which is popular in open source
24529
+ EventPluginHub: EventPluginHub,
24530
+ // Used by test-utils
24531
+ EventPluginRegistry: EventPluginRegistry,
24532
+ EventPropagators: EventPropagators,
24533
+ ReactControlledComponent: ReactControlledComponent,
24534
+ ReactDOMComponentTree: ReactDOMComponentTree,
24535
+ ReactDOMEventListener: ReactDOMEventListener
24536
+ }
24537
+ };
24538
+
24539
+ if (enableCreateRoot) {
24540
+ ReactDOM.createRoot = function createRoot(container, options) {
24541
+ var hydrate = options != null && options.hydrate === true;
24542
+ return new ReactRoot(container, hydrate);
24543
+ };
24544
+ }
24545
+
24546
+ var foundDevTools = DOMRenderer.injectIntoDevTools({
24547
+ findFiberByHostInstance: getClosestInstanceFromNode,
24548
+ bundleType: 1,
24549
+ version: ReactVersion,
24550
+ rendererPackageName: 'react-dom'
24551
+ });
24552
+
24553
+ {
24554
+ if (!foundDevTools && ExecutionEnvironment.canUseDOM && window.top === window.self) {
24555
+ // If we're in Chrome or Firefox, provide a download link if not installed.
24556
+ if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
24557
+ var protocol = window.location.protocol;
24558
+ // Don't warn in exotic cases like chrome-extension://.
24559
+ if (/^(https?|file):$/.test(protocol)) {
24560
+ console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
24561
+ }
24562
+ }
24563
+ }
24564
+ }
24565
+
24566
+
24567
+
24568
+ var ReactDOM$2 = Object.freeze({
24569
+ default: ReactDOM
24570
+ });
24571
+
24572
+ var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;
24573
+
24574
+ // TODO: decide on the top-level export form.
24575
+ // This is hacky but makes it work with both Rollup and Jest.
24576
+ var reactDom = ReactDOM$3['default'] ? ReactDOM$3['default'] : ReactDOM$3;
24577
+
24578
+ module.exports = reactDom;
24579
+ })();
24580
+ }
24581
+
24582
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
24583
+
24584
+ /***/ }),
24585
+ /* 47 */
24586
+ /***/ (function(module, exports, __webpack_require__) {
24587
+
24588
+ "use strict";
24589
+ /**
24590
+ * Copyright (c) 2013-present, Facebook, Inc.
24591
+ *
24592
+ * This source code is licensed under the MIT license found in the
24593
+ * LICENSE file in the root directory of this source tree.
24594
+ *
24595
+ * @typechecks
24596
+ */
24597
+
24598
+
24599
+
24600
+ var hyphenate = __webpack_require__(48);
24601
+
24602
+ var msPattern = /^ms-/;
24603
+
24604
+ /**
24605
+ * Hyphenates a camelcased CSS property name, for example:
24606
+ *
24607
+ * > hyphenateStyleName('backgroundColor')
24608
+ * < "background-color"
24609
+ * > hyphenateStyleName('MozTransition')
24610
+ * < "-moz-transition"
24611
+ * > hyphenateStyleName('msTransition')
24612
+ * < "-ms-transition"
24613
+ *
24614
+ * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
24615
+ * is converted to `-ms-`.
24616
+ *
24617
+ * @param {string} string
24618
+ * @return {string}
24619
+ */
24620
+ function hyphenateStyleName(string) {
24621
+ return hyphenate(string).replace(msPattern, '-ms-');
24622
+ }
24623
+
24624
+ module.exports = hyphenateStyleName;
24625
+
24626
+ /***/ }),
24627
+ /* 48 */
24628
+ /***/ (function(module, exports, __webpack_require__) {
24629
+
24630
+ "use strict";
24631
+
24632
+
24633
+ /**
24634
+ * Copyright (c) 2013-present, Facebook, Inc.
24635
+ *
24636
+ * This source code is licensed under the MIT license found in the
24637
+ * LICENSE file in the root directory of this source tree.
24638
+ *
24639
+ * @typechecks
24640
+ */
24641
+
24642
+ var _uppercasePattern = /([A-Z])/g;
24643
+
24644
+ /**
24645
+ * Hyphenates a camelcased string, for example:
24646
+ *
24647
+ * > hyphenate('backgroundColor')
24648
+ * < "background-color"
24649
+ *
24650
+ * For CSS style names, use `hyphenateStyleName` instead which works properly
24651
+ * with all vendor prefixes, including `ms`.
24652
+ *
24653
+ * @param {string} string
24654
+ * @return {string}
24655
+ */
24656
+ function hyphenate(string) {
24657
+ return string.replace(_uppercasePattern, '-$1').toLowerCase();
24658
+ }
24659
+
24660
+ module.exports = hyphenate;
24661
+
24662
+ /***/ }),
24663
+ /* 49 */
24664
+ /***/ (function(module, exports, __webpack_require__) {
24665
+
24666
+ "use strict";
24667
+ /**
24668
+ * Copyright (c) 2013-present, Facebook, Inc.
24669
+ *
24670
+ * This source code is licensed under the MIT license found in the
24671
+ * LICENSE file in the root directory of this source tree.
24672
+ *
24673
+ * @typechecks
24674
+ */
24675
+
24676
+
24677
+
24678
+ var camelize = __webpack_require__(50);
24679
+
24680
+ var msPattern = /^-ms-/;
24681
+
24682
+ /**
24683
+ * Camelcases a hyphenated CSS property name, for example:
24684
+ *
24685
+ * > camelizeStyleName('background-color')
24686
+ * < "backgroundColor"
24687
+ * > camelizeStyleName('-moz-transition')
24688
+ * < "MozTransition"
24689
+ * > camelizeStyleName('-ms-transition')
24690
+ * < "msTransition"
24691
+ *
24692
+ * As Andi Smith suggests
24693
+ * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
24694
+ * is converted to lowercase `ms`.
24695
+ *
24696
+ * @param {string} string
24697
+ * @return {string}
24698
+ */
24699
+ function camelizeStyleName(string) {
24700
+ return camelize(string.replace(msPattern, 'ms-'));
24701
+ }
24702
+
24703
+ module.exports = camelizeStyleName;
24704
+
24705
+ /***/ }),
24706
+ /* 50 */
24707
+ /***/ (function(module, exports, __webpack_require__) {
24708
+
24709
+ "use strict";
24710
+
24711
+
24712
+ /**
24713
+ * Copyright (c) 2013-present, Facebook, Inc.
24714
+ *
24715
+ * This source code is licensed under the MIT license found in the
24716
+ * LICENSE file in the root directory of this source tree.
24717
+ *
24718
+ * @typechecks
24719
+ */
24720
+
24721
+ var _hyphenPattern = /-(.)/g;
24722
+
24723
+ /**
24724
+ * Camelcases a hyphenated string, for example:
24725
+ *
24726
+ * > camelize('background-color')
24727
+ * < "backgroundColor"
24728
+ *
24729
+ * @param {string} string
24730
+ * @return {string}
24731
+ */
24732
+ function camelize(string) {
24733
+ return string.replace(_hyphenPattern, function (_, character) {
24734
+ return character.toUpperCase();
24735
+ });
24736
+ }
24737
+
24738
+ module.exports = camelize;
24739
+
24740
+ /***/ }),
24741
+ /* 51 */
24742
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
24743
+
24744
+ "use strict";
24745
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = createProvider;
24746
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
24747
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
24748
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(25);
24749
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
24750
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(26);
24751
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(14);
24752
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24753
+
24754
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24755
+
24756
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
24757
+
24758
+
24759
+
24760
+
24761
+
24762
+
24763
+ var didWarnAboutReceivingStore = false;
24764
+ function warnAboutReceivingStore() {
24765
+ if (didWarnAboutReceivingStore) {
24766
+ return;
24767
+ }
24768
+ didWarnAboutReceivingStore = true;
24769
+
24770
+ Object(__WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */])('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
24771
+ }
24772
+
24773
+ function createProvider() {
24774
+ var _Provider$childContex;
24775
+
24776
+ var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store';
24777
+ var subKey = arguments[1];
24778
+
24779
+ var subscriptionKey = subKey || storeKey + 'Subscription';
24780
+
24781
+ var Provider = function (_Component) {
24782
+ _inherits(Provider, _Component);
24783
+
24784
+ Provider.prototype.getChildContext = function getChildContext() {
24785
+ var _ref;
24786
+
24787
+ return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;
24788
+ };
24789
+
24790
+ function Provider(props, context) {
24791
+ _classCallCheck(this, Provider);
24792
+
24793
+ var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
24794
+
24795
+ _this[storeKey] = props.store;
24796
+ return _this;
24797
+ }
24798
+
24799
+ Provider.prototype.render = function render() {
24800
+ return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children);
24801
+ };
24802
+
24803
+ return Provider;
24804
+ }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
24805
+
24806
+ if (process.env.NODE_ENV !== 'production') {
24807
+ Provider.prototype.componentWillReceiveProps = function (nextProps) {
24808
+ if (this[storeKey] !== nextProps.store) {
24809
+ warnAboutReceivingStore();
24810
+ }
24811
+ };
24812
+ }
24813
+
24814
+ Provider.propTypes = {
24815
+ store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired,
24816
+ children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired
24817
+ };
24818
+ Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex);
24819
+
24820
+ return Provider;
24821
+ }
24822
+
24823
+ /* harmony default export */ __webpack_exports__["b"] = (createProvider());
24824
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
24825
+
24826
+ /***/ }),
24827
+ /* 52 */
24828
+ /***/ (function(module, exports, __webpack_require__) {
24829
+
24830
+ "use strict";
24831
+ /* WEBPACK VAR INJECTION */(function(process) {/**
24832
+ * Copyright (c) 2013-present, Facebook, Inc.
24833
+ *
24834
+ * This source code is licensed under the MIT license found in the
24835
+ * LICENSE file in the root directory of this source tree.
24836
+ */
24837
+
24838
+
24839
+
24840
+ var emptyFunction = __webpack_require__(2);
24841
+ var invariant = __webpack_require__(7);
24842
+ var warning = __webpack_require__(9);
24843
+ var assign = __webpack_require__(6);
24844
+
24845
+ var ReactPropTypesSecret = __webpack_require__(13);
24846
+ var checkPropTypes = __webpack_require__(12);
24847
+
24848
+ module.exports = function(isValidElement, throwOnDirectAccess) {
24849
+ /* global Symbol */
24850
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
24851
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
24852
+
24853
+ /**
24854
+ * Returns the iterator method function contained on the iterable object.
24855
+ *
24856
+ * Be sure to invoke the function with the iterable as context:
24857
+ *
24858
+ * var iteratorFn = getIteratorFn(myIterable);
24859
+ * if (iteratorFn) {
24860
+ * var iterator = iteratorFn.call(myIterable);
24861
+ * ...
24862
+ * }
24863
+ *
24864
+ * @param {?object} maybeIterable
24865
+ * @return {?function}
24866
+ */
24867
+ function getIteratorFn(maybeIterable) {
24868
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
24869
+ if (typeof iteratorFn === 'function') {
24870
+ return iteratorFn;
24871
+ }
24872
+ }
24873
+
24874
+ /**
24875
+ * Collection of methods that allow declaration and validation of props that are
24876
+ * supplied to React components. Example usage:
24877
+ *
24878
+ * var Props = require('ReactPropTypes');
24879
+ * var MyArticle = React.createClass({
24880
+ * propTypes: {
24881
+ * // An optional string prop named "description".
24882
+ * description: Props.string,
24883
+ *
24884
+ * // A required enum prop named "category".
24885
+ * category: Props.oneOf(['News','Photos']).isRequired,
24886
+ *
24887
+ * // A prop named "dialog" that requires an instance of Dialog.
24888
+ * dialog: Props.instanceOf(Dialog).isRequired
24889
+ * },
24890
+ * render: function() { ... }
24891
+ * });
24892
+ *
24893
+ * A more formal specification of how these methods are used:
24894
+ *
24895
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
24896
+ * decl := ReactPropTypes.{type}(.isRequired)?
24897
+ *
24898
+ * Each and every declaration produces a function with the same signature. This
24899
+ * allows the creation of custom validation functions. For example:
24900
+ *
24901
+ * var MyLink = React.createClass({
24902
+ * propTypes: {
24903
+ * // An optional string or URI prop named "href".
24904
+ * href: function(props, propName, componentName) {
24905
+ * var propValue = props[propName];
24906
+ * if (propValue != null && typeof propValue !== 'string' &&
24907
+ * !(propValue instanceof URI)) {
24908
+ * return new Error(
24909
+ * 'Expected a string or an URI for ' + propName + ' in ' +
24910
+ * componentName
24911
+ * );
24912
+ * }
24913
+ * }
24914
+ * },
24915
+ * render: function() {...}
24916
+ * });
24917
+ *
24918
+ * @internal
24919
+ */
24920
+
24921
+ var ANONYMOUS = '<<anonymous>>';
24922
+
24923
+ // Important!
24924
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
24925
+ var ReactPropTypes = {
24926
+ array: createPrimitiveTypeChecker('array'),
24927
+ bool: createPrimitiveTypeChecker('boolean'),
24928
+ func: createPrimitiveTypeChecker('function'),
24929
+ number: createPrimitiveTypeChecker('number'),
24930
+ object: createPrimitiveTypeChecker('object'),
24931
+ string: createPrimitiveTypeChecker('string'),
24932
+ symbol: createPrimitiveTypeChecker('symbol'),
24933
+
24934
+ any: createAnyTypeChecker(),
24935
+ arrayOf: createArrayOfTypeChecker,
24936
+ element: createElementTypeChecker(),
24937
+ instanceOf: createInstanceTypeChecker,
24938
+ node: createNodeChecker(),
24939
+ objectOf: createObjectOfTypeChecker,
24940
+ oneOf: createEnumTypeChecker,
24941
+ oneOfType: createUnionTypeChecker,
24942
+ shape: createShapeTypeChecker,
24943
+ exact: createStrictShapeTypeChecker,
24944
+ };
24945
+
24946
+ /**
24947
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
24948
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
24949
+ */
24950
+ /*eslint-disable no-self-compare*/
24951
+ function is(x, y) {
24952
+ // SameValue algorithm
24953
+ if (x === y) {
24954
+ // Steps 1-5, 7-10
24955
+ // Steps 6.b-6.e: +0 != -0
24956
+ return x !== 0 || 1 / x === 1 / y;
24957
+ } else {
24958
+ // Step 6.a: NaN == NaN
24959
+ return x !== x && y !== y;
24960
+ }
24961
+ }
24962
+ /*eslint-enable no-self-compare*/
24963
+
24964
+ /**
24965
+ * We use an Error-like object for backward compatibility as people may call
24966
+ * PropTypes directly and inspect their output. However, we don't use real
24967
+ * Errors anymore. We don't inspect their stack anyway, and creating them
24968
+ * is prohibitively expensive if they are created too often, such as what
24969
+ * happens in oneOfType() for any type before the one that matched.
24970
+ */
24971
+ function PropTypeError(message) {
24972
+ this.message = message;
24973
+ this.stack = '';
24974
+ }
24975
+ // Make `instanceof Error` still work for returned errors.
24976
+ PropTypeError.prototype = Error.prototype;
24977
+
24978
+ function createChainableTypeChecker(validate) {
24979
+ if (process.env.NODE_ENV !== 'production') {
24980
+ var manualPropTypeCallCache = {};
24981
+ var manualPropTypeWarningCount = 0;
24982
+ }
24983
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
24984
+ componentName = componentName || ANONYMOUS;
24985
+ propFullName = propFullName || propName;
24986
+
24987
+ if (secret !== ReactPropTypesSecret) {
24988
+ if (throwOnDirectAccess) {
24989
+ // New behavior only for users of `prop-types` package
24990
+ invariant(
24991
+ false,
24992
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
24993
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
24994
+ 'Read more at http://fb.me/use-check-prop-types'
24995
+ );
24996
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
24997
+ // Old behavior for people using React.PropTypes
24998
+ var cacheKey = componentName + ':' + propName;
24999
+ if (
25000
+ !manualPropTypeCallCache[cacheKey] &&
25001
+ // Avoid spamming the console because they are often not actionable except for lib authors
25002
+ manualPropTypeWarningCount < 3
25003
+ ) {
25004
+ warning(
25005
+ false,
25006
+ 'You are manually calling a React.PropTypes validation ' +
25007
+ 'function for the `%s` prop on `%s`. This is deprecated ' +
25008
+ 'and will throw in the standalone `prop-types` package. ' +
25009
+ 'You may be seeing this warning due to a third-party PropTypes ' +
25010
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
25011
+ propFullName,
25012
+ componentName
25013
+ );
25014
+ manualPropTypeCallCache[cacheKey] = true;
25015
+ manualPropTypeWarningCount++;
25016
+ }
25017
+ }
25018
+ }
25019
+ if (props[propName] == null) {
25020
+ if (isRequired) {
25021
+ if (props[propName] === null) {
25022
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
25023
+ }
25024
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
25025
+ }
25026
+ return null;
25027
+ } else {
25028
+ return validate(props, propName, componentName, location, propFullName);
25029
+ }
25030
+ }
25031
+
25032
+ var chainedCheckType = checkType.bind(null, false);
25033
+ chainedCheckType.isRequired = checkType.bind(null, true);
25034
+
25035
+ return chainedCheckType;
25036
+ }
25037
+
25038
+ function createPrimitiveTypeChecker(expectedType) {
25039
+ function validate(props, propName, componentName, location, propFullName, secret) {
25040
+ var propValue = props[propName];
25041
+ var propType = getPropType(propValue);
25042
+ if (propType !== expectedType) {
25043
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
25044
+ // check, but we can offer a more precise error message here rather than
25045
+ // 'of type `object`'.
25046
+ var preciseType = getPreciseType(propValue);
25047
+
25048
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
25049
+ }
25050
+ return null;
25051
+ }
25052
+ return createChainableTypeChecker(validate);
25053
+ }
25054
+
25055
+ function createAnyTypeChecker() {
25056
+ return createChainableTypeChecker(emptyFunction.thatReturnsNull);
25057
+ }
25058
+
25059
+ function createArrayOfTypeChecker(typeChecker) {
25060
+ function validate(props, propName, componentName, location, propFullName) {
25061
+ if (typeof typeChecker !== 'function') {
25062
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
25063
+ }
25064
+ var propValue = props[propName];
25065
+ if (!Array.isArray(propValue)) {
25066
+ var propType = getPropType(propValue);
25067
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
25068
+ }
25069
+ for (var i = 0; i < propValue.length; i++) {
25070
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
25071
+ if (error instanceof Error) {
25072
+ return error;
25073
+ }
25074
+ }
25075
+ return null;
25076
+ }
25077
+ return createChainableTypeChecker(validate);
25078
+ }
25079
+
25080
+ function createElementTypeChecker() {
25081
+ function validate(props, propName, componentName, location, propFullName) {
25082
+ var propValue = props[propName];
25083
+ if (!isValidElement(propValue)) {
25084
+ var propType = getPropType(propValue);
25085
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
25086
+ }
25087
+ return null;
25088
+ }
25089
+ return createChainableTypeChecker(validate);
25090
+ }
25091
+
25092
+ function createInstanceTypeChecker(expectedClass) {
25093
+ function validate(props, propName, componentName, location, propFullName) {
25094
+ if (!(props[propName] instanceof expectedClass)) {
25095
+ var expectedClassName = expectedClass.name || ANONYMOUS;
25096
+ var actualClassName = getClassName(props[propName]);
25097
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
25098
+ }
25099
+ return null;
25100
+ }
25101
+ return createChainableTypeChecker(validate);
25102
+ }
25103
+
25104
+ function createEnumTypeChecker(expectedValues) {
25105
+ if (!Array.isArray(expectedValues)) {
25106
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
25107
+ return emptyFunction.thatReturnsNull;
25108
+ }
25109
+
25110
+ function validate(props, propName, componentName, location, propFullName) {
25111
+ var propValue = props[propName];
25112
+ for (var i = 0; i < expectedValues.length; i++) {
25113
+ if (is(propValue, expectedValues[i])) {
25114
+ return null;
25115
+ }
25116
+ }
25117
+
25118
+ var valuesString = JSON.stringify(expectedValues);
25119
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
25120
+ }
25121
+ return createChainableTypeChecker(validate);
25122
+ }
25123
+
25124
+ function createObjectOfTypeChecker(typeChecker) {
25125
+ function validate(props, propName, componentName, location, propFullName) {
25126
+ if (typeof typeChecker !== 'function') {
25127
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
25128
+ }
25129
+ var propValue = props[propName];
25130
+ var propType = getPropType(propValue);
25131
+ if (propType !== 'object') {
25132
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
25133
+ }
25134
+ for (var key in propValue) {
25135
+ if (propValue.hasOwnProperty(key)) {
25136
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
25137
+ if (error instanceof Error) {
25138
+ return error;
25139
+ }
25140
+ }
25141
+ }
25142
+ return null;
25143
+ }
25144
+ return createChainableTypeChecker(validate);
25145
+ }
25146
+
25147
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
25148
+ if (!Array.isArray(arrayOfTypeCheckers)) {
25149
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
25150
+ return emptyFunction.thatReturnsNull;
25151
+ }
25152
+
25153
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
25154
+ var checker = arrayOfTypeCheckers[i];
25155
+ if (typeof checker !== 'function') {
25156
+ warning(
25157
+ false,
25158
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
25159
+ 'received %s at index %s.',
25160
+ getPostfixForTypeWarning(checker),
25161
+ i
25162
+ );
25163
+ return emptyFunction.thatReturnsNull;
25164
+ }
25165
+ }
25166
+
25167
+ function validate(props, propName, componentName, location, propFullName) {
25168
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
25169
+ var checker = arrayOfTypeCheckers[i];
25170
+ if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
25171
+ return null;
25172
+ }
25173
+ }
25174
+
25175
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
25176
+ }
25177
+ return createChainableTypeChecker(validate);
25178
+ }
25179
+
25180
+ function createNodeChecker() {
25181
+ function validate(props, propName, componentName, location, propFullName) {
25182
+ if (!isNode(props[propName])) {
25183
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
25184
+ }
25185
+ return null;
25186
+ }
25187
+ return createChainableTypeChecker(validate);
25188
+ }
25189
+
25190
+ function createShapeTypeChecker(shapeTypes) {
25191
+ function validate(props, propName, componentName, location, propFullName) {
25192
+ var propValue = props[propName];
25193
+ var propType = getPropType(propValue);
25194
+ if (propType !== 'object') {
25195
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
25196
+ }
25197
+ for (var key in shapeTypes) {
25198
+ var checker = shapeTypes[key];
25199
+ if (!checker) {
25200
+ continue;
25201
+ }
25202
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
25203
+ if (error) {
25204
+ return error;
25205
+ }
25206
+ }
25207
+ return null;
25208
+ }
25209
+ return createChainableTypeChecker(validate);
25210
+ }
25211
+
25212
+ function createStrictShapeTypeChecker(shapeTypes) {
25213
+ function validate(props, propName, componentName, location, propFullName) {
25214
+ var propValue = props[propName];
25215
+ var propType = getPropType(propValue);
25216
+ if (propType !== 'object') {
25217
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
25218
+ }
25219
+ // We need to check all keys in case some are required but missing from
25220
+ // props.
25221
+ var allKeys = assign({}, props[propName], shapeTypes);
25222
+ for (var key in allKeys) {
25223
+ var checker = shapeTypes[key];
25224
+ if (!checker) {
25225
+ return new PropTypeError(
25226
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
25227
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
25228
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
25229
+ );
25230
+ }
25231
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
25232
+ if (error) {
25233
+ return error;
25234
+ }
25235
+ }
25236
+ return null;
25237
+ }
25238
+
25239
+ return createChainableTypeChecker(validate);
25240
+ }
25241
+
25242
+ function isNode(propValue) {
25243
+ switch (typeof propValue) {
25244
+ case 'number':
25245
+ case 'string':
25246
+ case 'undefined':
25247
+ return true;
25248
+ case 'boolean':
25249
+ return !propValue;
25250
+ case 'object':
25251
+ if (Array.isArray(propValue)) {
25252
+ return propValue.every(isNode);
25253
+ }
25254
+ if (propValue === null || isValidElement(propValue)) {
25255
+ return true;
25256
+ }
25257
+
25258
+ var iteratorFn = getIteratorFn(propValue);
25259
+ if (iteratorFn) {
25260
+ var iterator = iteratorFn.call(propValue);
25261
+ var step;
25262
+ if (iteratorFn !== propValue.entries) {
25263
+ while (!(step = iterator.next()).done) {
25264
+ if (!isNode(step.value)) {
25265
+ return false;
25266
+ }
25267
+ }
25268
+ } else {
25269
+ // Iterator will provide entry [k,v] tuples rather than values.
25270
+ while (!(step = iterator.next()).done) {
25271
+ var entry = step.value;
25272
+ if (entry) {
25273
+ if (!isNode(entry[1])) {
25274
+ return false;
25275
+ }
25276
+ }
25277
+ }
25278
+ }
25279
+ } else {
25280
+ return false;
25281
+ }
25282
+
25283
+ return true;
25284
+ default:
25285
+ return false;
25286
+ }
25287
+ }
25288
+
25289
+ function isSymbol(propType, propValue) {
25290
+ // Native Symbol.
25291
+ if (propType === 'symbol') {
25292
+ return true;
25293
+ }
25294
+
25295
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
25296
+ if (propValue['@@toStringTag'] === 'Symbol') {
25297
+ return true;
25298
+ }
25299
+
25300
+ // Fallback for non-spec compliant Symbols which are polyfilled.
25301
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
25302
+ return true;
25303
+ }
25304
+
25305
+ return false;
25306
+ }
25307
+
25308
+ // Equivalent of `typeof` but with special handling for array and regexp.
25309
+ function getPropType(propValue) {
25310
+ var propType = typeof propValue;
25311
+ if (Array.isArray(propValue)) {
25312
+ return 'array';
25313
+ }
25314
+ if (propValue instanceof RegExp) {
25315
+ // Old webkits (at least until Android 4.0) return 'function' rather than
25316
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
25317
+ // passes PropTypes.object.
25318
+ return 'object';
25319
+ }
25320
+ if (isSymbol(propType, propValue)) {
25321
+ return 'symbol';
25322
+ }
25323
+ return propType;
25324
+ }
25325
+
25326
+ // This handles more types than `getPropType`. Only used for error messages.
25327
+ // See `createPrimitiveTypeChecker`.
25328
+ function getPreciseType(propValue) {
25329
+ if (typeof propValue === 'undefined' || propValue === null) {
25330
+ return '' + propValue;
25331
+ }
25332
+ var propType = getPropType(propValue);
25333
+ if (propType === 'object') {
25334
+ if (propValue instanceof Date) {
25335
+ return 'date';
25336
+ } else if (propValue instanceof RegExp) {
25337
+ return 'regexp';
25338
+ }
25339
+ }
25340
+ return propType;
25341
+ }
25342
+
25343
+ // Returns a string that is postfixed to a warning about an invalid type.
25344
+ // For example, "undefined" or "of type array"
25345
+ function getPostfixForTypeWarning(value) {
25346
+ var type = getPreciseType(value);
25347
+ switch (type) {
25348
+ case 'array':
25349
+ case 'object':
25350
+ return 'an ' + type;
25351
+ case 'boolean':
25352
+ case 'date':
25353
+ case 'regexp':
25354
+ return 'a ' + type;
25355
+ default:
25356
+ return type;
25357
+ }
25358
+ }
25359
+
25360
+ // Returns class name of the object, if any.
25361
+ function getClassName(propValue) {
25362
+ if (!propValue.constructor || !propValue.constructor.name) {
25363
+ return ANONYMOUS;
25364
+ }
25365
+ return propValue.constructor.name;
25366
+ }
25367
+
25368
+ ReactPropTypes.checkPropTypes = checkPropTypes;
25369
+ ReactPropTypes.PropTypes = ReactPropTypes;
25370
+
25371
+ return ReactPropTypes;
25372
+ };
25373
+
25374
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
25375
+
25376
+ /***/ }),
25377
+ /* 53 */
25378
+ /***/ (function(module, exports, __webpack_require__) {
25379
+
25380
+ "use strict";
25381
+ /**
25382
+ * Copyright (c) 2013-present, Facebook, Inc.
25383
+ *
25384
+ * This source code is licensed under the MIT license found in the
25385
+ * LICENSE file in the root directory of this source tree.
25386
+ */
25387
+
25388
+
25389
+
25390
+ var emptyFunction = __webpack_require__(2);
25391
+ var invariant = __webpack_require__(7);
25392
+ var ReactPropTypesSecret = __webpack_require__(13);
25393
+
25394
+ module.exports = function() {
25395
+ function shim(props, propName, componentName, location, propFullName, secret) {
25396
+ if (secret === ReactPropTypesSecret) {
25397
+ // It is still safe when called from React.
25398
+ return;
25399
+ }
25400
+ invariant(
25401
+ false,
25402
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
25403
+ 'Use PropTypes.checkPropTypes() to call them. ' +
25404
+ 'Read more at http://fb.me/use-check-prop-types'
25405
+ );
25406
+ };
25407
+ shim.isRequired = shim;
25408
+ function getShim() {
25409
+ return shim;
25410
+ };
25411
+ // Important!
25412
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
25413
+ var ReactPropTypes = {
25414
+ array: shim,
25415
+ bool: shim,
25416
+ func: shim,
25417
+ number: shim,
25418
+ object: shim,
25419
+ string: shim,
25420
+ symbol: shim,
25421
+
25422
+ any: shim,
25423
+ arrayOf: getShim,
25424
+ element: shim,
25425
+ instanceOf: getShim,
25426
+ node: shim,
25427
+ objectOf: getShim,
25428
+ oneOf: getShim,
25429
+ oneOfType: getShim,
25430
+ shape: getShim,
25431
+ exact: getShim
25432
+ };
25433
+
25434
+ ReactPropTypes.checkPropTypes = emptyFunction;
25435
+ ReactPropTypes.PropTypes = ReactPropTypes;
25436
+
25437
+ return ReactPropTypes;
25438
+ };
25439
+
25440
+
25441
+ /***/ }),
25442
+ /* 54 */
25443
+ /***/ (function(module, exports, __webpack_require__) {
25444
+
25445
+ "use strict";
25446
+ /**
25447
+ * Copyright 2015, Yahoo! Inc.
25448
+ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
25449
+ */
25450
+
25451
+
25452
+ var REACT_STATICS = {
25453
+ childContextTypes: true,
25454
+ contextTypes: true,
25455
+ defaultProps: true,
25456
+ displayName: true,
25457
+ getDefaultProps: true,
25458
+ mixins: true,
25459
+ propTypes: true,
25460
+ type: true
25461
+ };
25462
+
25463
+ var KNOWN_STATICS = {
25464
+ name: true,
25465
+ length: true,
25466
+ prototype: true,
25467
+ caller: true,
25468
+ callee: true,
25469
+ arguments: true,
25470
+ arity: true
25471
+ };
25472
+
25473
+ var defineProperty = Object.defineProperty;
25474
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
25475
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
25476
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
25477
+ var getPrototypeOf = Object.getPrototypeOf;
25478
+ var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
25479
+
25480
+ module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
25481
+ if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
25482
+
25483
+ if (objectPrototype) {
25484
+ var inheritedComponent = getPrototypeOf(sourceComponent);
25485
+ if (inheritedComponent && inheritedComponent !== objectPrototype) {
25486
+ hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
25487
+ }
25488
+ }
25489
+
25490
+ var keys = getOwnPropertyNames(sourceComponent);
25491
+
25492
+ if (getOwnPropertySymbols) {
25493
+ keys = keys.concat(getOwnPropertySymbols(sourceComponent));
25494
+ }
25495
+
25496
+ for (var i = 0; i < keys.length; ++i) {
25497
+ var key = keys[i];
25498
+ if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
25499
+ var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
25500
+ try { // Avoid failures from read-only properties
25501
+ defineProperty(targetComponent, key, descriptor);
25502
+ } catch (e) {}
25503
+ }
25504
+ }
25505
+
25506
+ return targetComponent;
25507
+ }
25508
+
25509
+ return targetComponent;
25510
+ };
25511
+
25512
+
25513
+ /***/ }),
25514
+ /* 55 */
25515
+ /***/ (function(module, exports, __webpack_require__) {
25516
+
25517
+ "use strict";
25518
+ /* WEBPACK VAR INJECTION */(function(process) {/**
25519
+ * Copyright 2013-2015, Facebook, Inc.
25520
+ * All rights reserved.
25521
+ *
25522
+ * This source code is licensed under the BSD-style license found in the
25523
+ * LICENSE file in the root directory of this source tree. An additional grant
25524
+ * of patent rights can be found in the PATENTS file in the same directory.
25525
+ */
25526
+
25527
+
25528
+
25529
+ /**
25530
+ * Use invariant() to assert state which your program assumes to be true.
25531
+ *
25532
+ * Provide sprintf-style format (only %s is supported) and arguments
25533
+ * to provide information about what broke and what you were
25534
+ * expecting.
25535
+ *
25536
+ * The invariant message will be stripped in production, but the invariant
25537
+ * will remain to ensure logic does not differ in production.
25538
+ */
25539
+
25540
+ var invariant = function(condition, format, a, b, c, d, e, f) {
25541
+ if (process.env.NODE_ENV !== 'production') {
25542
+ if (format === undefined) {
25543
+ throw new Error('invariant requires an error message argument');
25544
+ }
25545
+ }
25546
+
25547
+ if (!condition) {
25548
+ var error;
25549
+ if (format === undefined) {
25550
+ error = new Error(
25551
+ 'Minified exception occurred; use the non-minified dev environment ' +
25552
+ 'for the full error message and additional helpful warnings.'
25553
+ );
25554
+ } else {
25555
+ var args = [a, b, c, d, e, f];
25556
+ var argIndex = 0;
25557
+ error = new Error(
25558
+ format.replace(/%s/g, function() { return args[argIndex++]; })
25559
+ );
25560
+ error.name = 'Invariant Violation';
25561
+ }
25562
+
25563
+ error.framesToPop = 1; // we don't care about invariant's own frame
25564
+ throw error;
25565
+ }
25566
+ };
25567
+
25568
+ module.exports = invariant;
25569
+
25570
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
25571
+
25572
+ /***/ }),
25573
+ /* 56 */
25574
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25575
+
25576
+ "use strict";
25577
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; });
25578
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25579
+
25580
+ // encapsulates the subscription logic for connecting a component to the redux store, as
25581
+ // well as nesting subscriptions of descendant components, so that we can ensure the
25582
+ // ancestor components re-render before descendants
25583
+
25584
+ var CLEARED = null;
25585
+ var nullListeners = {
25586
+ notify: function notify() {}
25587
+ };
25588
+
25589
+ function createListenerCollection() {
25590
+ // the current/next pattern is copied from redux's createStore code.
25591
+ // TODO: refactor+expose that code to be reusable here?
25592
+ var current = [];
25593
+ var next = [];
25594
+
25595
+ return {
25596
+ clear: function clear() {
25597
+ next = CLEARED;
25598
+ current = CLEARED;
25599
+ },
25600
+ notify: function notify() {
25601
+ var listeners = current = next;
25602
+ for (var i = 0; i < listeners.length; i++) {
25603
+ listeners[i]();
25604
+ }
25605
+ },
25606
+ get: function get() {
25607
+ return next;
25608
+ },
25609
+ subscribe: function subscribe(listener) {
25610
+ var isSubscribed = true;
25611
+ if (next === current) next = current.slice();
25612
+ next.push(listener);
25613
+
25614
+ return function unsubscribe() {
25615
+ if (!isSubscribed || current === CLEARED) return;
25616
+ isSubscribed = false;
25617
+
25618
+ if (next === current) next = current.slice();
25619
+ next.splice(next.indexOf(listener), 1);
25620
+ };
25621
+ }
25622
+ };
25623
+ }
25624
+
25625
+ var Subscription = function () {
25626
+ function Subscription(store, parentSub, onStateChange) {
25627
+ _classCallCheck(this, Subscription);
25628
+
25629
+ this.store = store;
25630
+ this.parentSub = parentSub;
25631
+ this.onStateChange = onStateChange;
25632
+ this.unsubscribe = null;
25633
+ this.listeners = nullListeners;
25634
+ }
25635
+
25636
+ Subscription.prototype.addNestedSub = function addNestedSub(listener) {
25637
+ this.trySubscribe();
25638
+ return this.listeners.subscribe(listener);
25639
+ };
25640
+
25641
+ Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {
25642
+ this.listeners.notify();
25643
+ };
25644
+
25645
+ Subscription.prototype.isSubscribed = function isSubscribed() {
25646
+ return Boolean(this.unsubscribe);
25647
+ };
25648
+
25649
+ Subscription.prototype.trySubscribe = function trySubscribe() {
25650
+ if (!this.unsubscribe) {
25651
+ this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);
25652
+
25653
+ this.listeners = createListenerCollection();
25654
+ }
25655
+ };
25656
+
25657
+ Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {
25658
+ if (this.unsubscribe) {
25659
+ this.unsubscribe();
25660
+ this.unsubscribe = null;
25661
+ this.listeners.clear();
25662
+ this.listeners = nullListeners;
25663
+ }
25664
+ };
25665
+
25666
+ return Subscription;
25667
+ }();
25668
+
25669
+
25670
+
25671
+ /***/ }),
25672
+ /* 57 */
25673
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25674
+
25675
+ "use strict";
25676
+ /* unused harmony export createConnect */
25677
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(27);
25678
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(58);
25679
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(59);
25680
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(75);
25681
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(76);
25682
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(77);
25683
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
25684
+
25685
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
25686
+
25687
+
25688
+
25689
+
25690
+
25691
+
25692
+
25693
+
25694
+ /*
25695
+ connect is a facade over connectAdvanced. It turns its args into a compatible
25696
+ selectorFactory, which has the signature:
25697
+
25698
+ (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
25699
+
25700
+ connect passes its args to connectAdvanced as options, which will in turn pass them to
25701
+ selectorFactory each time a Connect component instance is instantiated or hot reloaded.
25702
+
25703
+ selectorFactory returns a final props selector from its mapStateToProps,
25704
+ mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
25705
+ mergePropsFactories, and pure args.
25706
+
25707
+ The resulting final props selector is called by the Connect component instance whenever
25708
+ it receives new props or store state.
25709
+ */
25710
+
25711
+ function match(arg, factories, name) {
25712
+ for (var i = factories.length - 1; i >= 0; i--) {
25713
+ var result = factories[i](arg);
25714
+ if (result) return result;
25715
+ }
25716
+
25717
+ return function (dispatch, options) {
25718
+ throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');
25719
+ };
25720
+ }
25721
+
25722
+ function strictEqual(a, b) {
25723
+ return a === b;
25724
+ }
25725
+
25726
+ // createConnect with default args builds the 'official' connect behavior. Calling it with
25727
+ // different options opens up some testing and extensibility scenarios
25728
+ function createConnect() {
25729
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25730
+ _ref$connectHOC = _ref.connectHOC,
25731
+ connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC,
25732
+ _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
25733
+ mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF,
25734
+ _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
25735
+ mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro,
25736
+ _ref$mergePropsFactor = _ref.mergePropsFactories,
25737
+ mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor,
25738
+ _ref$selectorFactory = _ref.selectorFactory,
25739
+ selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory;
25740
+
25741
+ return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {
25742
+ var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
25743
+ _ref2$pure = _ref2.pure,
25744
+ pure = _ref2$pure === undefined ? true : _ref2$pure,
25745
+ _ref2$areStatesEqual = _ref2.areStatesEqual,
25746
+ areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,
25747
+ _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,
25748
+ areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua,
25749
+ _ref2$areStatePropsEq = _ref2.areStatePropsEqual,
25750
+ areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq,
25751
+ _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,
25752
+ areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE,
25753
+ extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);
25754
+
25755
+ var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
25756
+ var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
25757
+ var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
25758
+
25759
+ return connectHOC(selectorFactory, _extends({
25760
+ // used in error messages
25761
+ methodName: 'connect',
25762
+
25763
+ // used to compute Connect's displayName from the wrapped component's displayName.
25764
+ getDisplayName: function getDisplayName(name) {
25765
+ return 'Connect(' + name + ')';
25766
+ },
25767
+
25768
+ // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
25769
+ shouldHandleStateChanges: Boolean(mapStateToProps),
25770
+
25771
+ // passed through to selectorFactory
25772
+ initMapStateToProps: initMapStateToProps,
25773
+ initMapDispatchToProps: initMapDispatchToProps,
25774
+ initMergeProps: initMergeProps,
25775
+ pure: pure,
25776
+ areStatesEqual: areStatesEqual,
25777
+ areOwnPropsEqual: areOwnPropsEqual,
25778
+ areStatePropsEqual: areStatePropsEqual,
25779
+ areMergedPropsEqual: areMergedPropsEqual
25780
+
25781
+ }, extraOptions));
25782
+ };
25783
+ }
25784
+
25785
+ /* harmony default export */ __webpack_exports__["a"] = (createConnect());
25786
+
25787
+ /***/ }),
25788
+ /* 58 */
25789
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25790
+
25791
+ "use strict";
25792
+ /* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual;
25793
+ var hasOwn = Object.prototype.hasOwnProperty;
25794
+
25795
+ function is(x, y) {
25796
+ if (x === y) {
25797
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
25798
+ } else {
25799
+ return x !== x && y !== y;
25800
+ }
25801
+ }
25802
+
25803
+ function shallowEqual(objA, objB) {
25804
+ if (is(objA, objB)) return true;
25805
+
25806
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
25807
+ return false;
25808
+ }
25809
+
25810
+ var keysA = Object.keys(objA);
25811
+ var keysB = Object.keys(objB);
25812
+
25813
+ if (keysA.length !== keysB.length) return false;
25814
+
25815
+ for (var i = 0; i < keysA.length; i++) {
25816
+ if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
25817
+ return false;
25818
+ }
25819
+ }
25820
+
25821
+ return true;
25822
+ }
25823
+
25824
+ /***/ }),
25825
+ /* 59 */
25826
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25827
+
25828
+ "use strict";
25829
+ /* unused harmony export whenMapDispatchToPropsIsFunction */
25830
+ /* unused harmony export whenMapDispatchToPropsIsMissing */
25831
+ /* unused harmony export whenMapDispatchToPropsIsObject */
25832
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(28);
25833
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(34);
25834
+
25835
+
25836
+
25837
+ function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
25838
+ return typeof mapDispatchToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined;
25839
+ }
25840
+
25841
+ function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
25842
+ return !mapDispatchToProps ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) {
25843
+ return { dispatch: dispatch };
25844
+ }) : undefined;
25845
+ }
25846
+
25847
+ function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
25848
+ return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) {
25849
+ return Object(__WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"])(mapDispatchToProps, dispatch);
25850
+ }) : undefined;
25851
+ }
25852
+
25853
+ /* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]);
25854
+
25855
+ /***/ }),
25856
+ /* 60 */
25857
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25858
+
25859
+ "use strict";
25860
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(30);
25861
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(63);
25862
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(64);
25863
+
25864
+
25865
+
25866
+
25867
+ /** `Object#toString` result references. */
25868
+ var nullTag = '[object Null]',
25869
+ undefinedTag = '[object Undefined]';
25870
+
25871
+ /** Built-in value references. */
25872
+ var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined;
25873
+
25874
+ /**
25875
+ * The base implementation of `getTag` without fallbacks for buggy environments.
25876
+ *
25877
+ * @private
25878
+ * @param {*} value The value to query.
25879
+ * @returns {string} Returns the `toStringTag`.
25880
+ */
25881
+ function baseGetTag(value) {
25882
+ if (value == null) {
25883
+ return value === undefined ? undefinedTag : nullTag;
25884
+ }
25885
+ return (symToStringTag && symToStringTag in Object(value))
25886
+ ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value)
25887
+ : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value);
25888
+ }
25889
+
25890
+ /* harmony default export */ __webpack_exports__["a"] = (baseGetTag);
25891
+
25892
+
25893
+ /***/ }),
25894
+ /* 61 */
25895
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25896
+
25897
+ "use strict";
25898
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(62);
25899
+
25900
+
25901
+ /** Detect free variable `self`. */
25902
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
25903
+
25904
+ /** Used as a reference to the global object. */
25905
+ var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')();
25906
+
25907
+ /* harmony default export */ __webpack_exports__["a"] = (root);
25908
+
25909
+
25910
+ /***/ }),
25911
+ /* 62 */
25912
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25913
+
25914
+ "use strict";
25915
+ /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
25916
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
25917
+
25918
+ /* harmony default export */ __webpack_exports__["a"] = (freeGlobal);
25919
+
25920
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(31)))
25921
+
25922
+ /***/ }),
25923
+ /* 63 */
25924
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25925
+
25926
+ "use strict";
25927
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(30);
25928
+
25929
+
25930
+ /** Used for built-in method references. */
25931
+ var objectProto = Object.prototype;
25932
+
25933
+ /** Used to check objects for own properties. */
25934
+ var hasOwnProperty = objectProto.hasOwnProperty;
25935
+
25936
+ /**
25937
+ * Used to resolve the
25938
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
25939
+ * of values.
25940
+ */
25941
+ var nativeObjectToString = objectProto.toString;
25942
+
25943
+ /** Built-in value references. */
25944
+ var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined;
25945
+
25946
+ /**
25947
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
25948
+ *
25949
+ * @private
25950
+ * @param {*} value The value to query.
25951
+ * @returns {string} Returns the raw `toStringTag`.
25952
+ */
25953
+ function getRawTag(value) {
25954
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
25955
+ tag = value[symToStringTag];
25956
+
25957
+ try {
25958
+ value[symToStringTag] = undefined;
25959
+ var unmasked = true;
25960
+ } catch (e) {}
25961
+
25962
+ var result = nativeObjectToString.call(value);
25963
+ if (unmasked) {
25964
+ if (isOwn) {
25965
+ value[symToStringTag] = tag;
25966
+ } else {
25967
+ delete value[symToStringTag];
25968
+ }
25969
+ }
25970
+ return result;
25971
+ }
25972
+
25973
+ /* harmony default export */ __webpack_exports__["a"] = (getRawTag);
25974
+
25975
+
25976
+ /***/ }),
25977
+ /* 64 */
25978
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
25979
+
25980
+ "use strict";
25981
+ /** Used for built-in method references. */
25982
+ var objectProto = Object.prototype;
25983
+
25984
+ /**
25985
+ * Used to resolve the
25986
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
25987
+ * of values.
25988
+ */
25989
+ var nativeObjectToString = objectProto.toString;
25990
+
25991
+ /**
25992
+ * Converts `value` to a string using `Object.prototype.toString`.
25993
+ *
25994
+ * @private
25995
+ * @param {*} value The value to convert.
25996
+ * @returns {string} Returns the converted string.
25997
+ */
25998
+ function objectToString(value) {
25999
+ return nativeObjectToString.call(value);
26000
+ }
26001
+
26002
+ /* harmony default export */ __webpack_exports__["a"] = (objectToString);
26003
+
26004
+
26005
+ /***/ }),
26006
+ /* 65 */
26007
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26008
+
26009
+ "use strict";
26010
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(66);
26011
+
26012
+
26013
+ /** Built-in value references. */
26014
+ var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object);
26015
+
26016
+ /* harmony default export */ __webpack_exports__["a"] = (getPrototype);
26017
+
26018
+
26019
+ /***/ }),
26020
+ /* 66 */
26021
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26022
+
26023
+ "use strict";
26024
+ /**
26025
+ * Creates a unary function that invokes `func` with its argument transformed.
26026
+ *
26027
+ * @private
26028
+ * @param {Function} func The function to wrap.
26029
+ * @param {Function} transform The argument transform.
26030
+ * @returns {Function} Returns the new function.
26031
+ */
26032
+ function overArg(func, transform) {
26033
+ return function(arg) {
26034
+ return func(transform(arg));
26035
+ };
26036
+ }
26037
+
26038
+ /* harmony default export */ __webpack_exports__["a"] = (overArg);
26039
+
26040
+
26041
+ /***/ }),
26042
+ /* 67 */
26043
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26044
+
26045
+ "use strict";
26046
+ /**
26047
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
26048
+ * and has a `typeof` result of "object".
26049
+ *
26050
+ * @static
26051
+ * @memberOf _
26052
+ * @since 4.0.0
26053
+ * @category Lang
26054
+ * @param {*} value The value to check.
26055
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
26056
+ * @example
26057
+ *
26058
+ * _.isObjectLike({});
26059
+ * // => true
26060
+ *
26061
+ * _.isObjectLike([1, 2, 3]);
26062
+ * // => true
26063
+ *
26064
+ * _.isObjectLike(_.noop);
26065
+ * // => false
26066
+ *
26067
+ * _.isObjectLike(null);
26068
+ * // => false
26069
+ */
26070
+ function isObjectLike(value) {
26071
+ return value != null && typeof value == 'object';
26072
+ }
26073
+
26074
+ /* harmony default export */ __webpack_exports__["a"] = (isObjectLike);
26075
+
26076
+
26077
+ /***/ }),
26078
+ /* 68 */
26079
+ /***/ (function(module, exports, __webpack_require__) {
26080
+
26081
+ module.exports = __webpack_require__(69);
26082
+
26083
+
26084
+ /***/ }),
26085
+ /* 69 */
26086
+ /***/ (function(module, exports, __webpack_require__) {
26087
+
26088
+ "use strict";
26089
+ /* WEBPACK VAR INJECTION */(function(global, module) {
26090
+
26091
+ Object.defineProperty(exports, "__esModule", {
26092
+ value: true
26093
+ });
26094
+
26095
+ var _ponyfill = __webpack_require__(71);
26096
+
26097
+ var _ponyfill2 = _interopRequireDefault(_ponyfill);
26098
+
26099
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
26100
+
26101
+ var root; /* global window */
26102
+
26103
+
26104
+ if (typeof self !== 'undefined') {
26105
+ root = self;
26106
+ } else if (typeof window !== 'undefined') {
26107
+ root = window;
26108
+ } else if (typeof global !== 'undefined') {
26109
+ root = global;
26110
+ } else if (true) {
26111
+ root = module;
26112
+ } else {
26113
+ root = Function('return this')();
26114
+ }
26115
+
26116
+ var result = (0, _ponyfill2['default'])(root);
26117
+ exports['default'] = result;
26118
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31), __webpack_require__(70)(module)))
26119
+
26120
+ /***/ }),
26121
+ /* 70 */
26122
+ /***/ (function(module, exports) {
26123
+
26124
+ module.exports = function(module) {
26125
+ if(!module.webpackPolyfill) {
26126
+ module.deprecate = function() {};
26127
+ module.paths = [];
26128
+ // module.parent = undefined by default
26129
+ if(!module.children) module.children = [];
26130
+ Object.defineProperty(module, "loaded", {
26131
+ enumerable: true,
26132
+ get: function() {
26133
+ return module.l;
26134
+ }
26135
+ });
26136
+ Object.defineProperty(module, "id", {
26137
+ enumerable: true,
26138
+ get: function() {
26139
+ return module.i;
26140
+ }
26141
+ });
26142
+ module.webpackPolyfill = 1;
26143
+ }
26144
+ return module;
26145
+ };
26146
+
26147
+
26148
+ /***/ }),
26149
+ /* 71 */
26150
+ /***/ (function(module, exports, __webpack_require__) {
26151
+
26152
+ "use strict";
26153
+
26154
+
26155
+ Object.defineProperty(exports, "__esModule", {
26156
+ value: true
26157
+ });
26158
+ exports['default'] = symbolObservablePonyfill;
26159
+ function symbolObservablePonyfill(root) {
26160
+ var result;
26161
+ var _Symbol = root.Symbol;
26162
+
26163
+ if (typeof _Symbol === 'function') {
26164
+ if (_Symbol.observable) {
26165
+ result = _Symbol.observable;
26166
+ } else {
26167
+ result = _Symbol('observable');
26168
+ _Symbol.observable = result;
26169
+ }
26170
+ } else {
26171
+ result = '@@observable';
26172
+ }
26173
+
26174
+ return result;
26175
+ };
26176
+
26177
+ /***/ }),
26178
+ /* 72 */
26179
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26180
+
26181
+ "use strict";
26182
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers;
26183
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(29);
26184
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(15);
26185
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(32);
26186
+
26187
+
26188
+
26189
+
26190
+ function getUndefinedStateErrorMessage(key, action) {
26191
+ var actionType = action && action.type;
26192
+ var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
26193
+
26194
+ return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';
26195
+ }
26196
+
26197
+ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
26198
+ var reducerKeys = Object.keys(reducers);
26199
+ var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
26200
+
26201
+ if (reducerKeys.length === 0) {
26202
+ return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
26203
+ }
26204
+
26205
+ if (!Object(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */])(inputState)) {
26206
+ return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
26207
+ }
26208
+
26209
+ var unexpectedKeys = Object.keys(inputState).filter(function (key) {
26210
+ return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
26211
+ });
26212
+
26213
+ unexpectedKeys.forEach(function (key) {
26214
+ unexpectedKeyCache[key] = true;
26215
+ });
26216
+
26217
+ if (unexpectedKeys.length > 0) {
26218
+ return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
26219
+ }
26220
+ }
26221
+
26222
+ function assertReducerShape(reducers) {
26223
+ Object.keys(reducers).forEach(function (key) {
26224
+ var reducer = reducers[key];
26225
+ var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT });
26226
+
26227
+ if (typeof initialState === 'undefined') {
26228
+ throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');
26229
+ }
26230
+
26231
+ var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
26232
+ if (typeof reducer(undefined, { type: type }) === 'undefined') {
26233
+ throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');
26234
+ }
26235
+ });
26236
+ }
26237
+
26238
+ /**
26239
+ * Turns an object whose values are different reducer functions, into a single
26240
+ * reducer function. It will call every child reducer, and gather their results
26241
+ * into a single state object, whose keys correspond to the keys of the passed
26242
+ * reducer functions.
26243
+ *
26244
+ * @param {Object} reducers An object whose values correspond to different
26245
+ * reducer functions that need to be combined into one. One handy way to obtain
26246
+ * it is to use ES6 `import * as reducers` syntax. The reducers may never return
26247
+ * undefined for any action. Instead, they should return their initial state
26248
+ * if the state passed to them was undefined, and the current state for any
26249
+ * unrecognized action.
26250
+ *
26251
+ * @returns {Function} A reducer function that invokes every reducer inside the
26252
+ * passed object, and builds a state object with the same shape.
26253
+ */
26254
+ function combineReducers(reducers) {
26255
+ var reducerKeys = Object.keys(reducers);
26256
+ var finalReducers = {};
26257
+ for (var i = 0; i < reducerKeys.length; i++) {
26258
+ var key = reducerKeys[i];
26259
+
26260
+ if (process.env.NODE_ENV !== 'production') {
26261
+ if (typeof reducers[key] === 'undefined') {
26262
+ Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])('No reducer provided for key "' + key + '"');
26263
+ }
26264
+ }
26265
+
26266
+ if (typeof reducers[key] === 'function') {
26267
+ finalReducers[key] = reducers[key];
26268
+ }
26269
+ }
26270
+ var finalReducerKeys = Object.keys(finalReducers);
26271
+
26272
+ var unexpectedKeyCache = void 0;
26273
+ if (process.env.NODE_ENV !== 'production') {
26274
+ unexpectedKeyCache = {};
26275
+ }
26276
+
26277
+ var shapeAssertionError = void 0;
26278
+ try {
26279
+ assertReducerShape(finalReducers);
26280
+ } catch (e) {
26281
+ shapeAssertionError = e;
26282
+ }
26283
+
26284
+ return function combination() {
26285
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26286
+ var action = arguments[1];
26287
+
26288
+ if (shapeAssertionError) {
26289
+ throw shapeAssertionError;
26290
+ }
26291
+
26292
+ if (process.env.NODE_ENV !== 'production') {
26293
+ var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
26294
+ if (warningMessage) {
26295
+ Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])(warningMessage);
26296
+ }
26297
+ }
26298
+
26299
+ var hasChanged = false;
26300
+ var nextState = {};
26301
+ for (var _i = 0; _i < finalReducerKeys.length; _i++) {
26302
+ var _key = finalReducerKeys[_i];
26303
+ var reducer = finalReducers[_key];
26304
+ var previousStateForKey = state[_key];
26305
+ var nextStateForKey = reducer(previousStateForKey, action);
26306
+ if (typeof nextStateForKey === 'undefined') {
26307
+ var errorMessage = getUndefinedStateErrorMessage(_key, action);
26308
+ throw new Error(errorMessage);
26309
+ }
26310
+ nextState[_key] = nextStateForKey;
26311
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
26312
+ }
26313
+ return hasChanged ? nextState : state;
26314
+ };
26315
+ }
26316
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
26317
+
26318
+ /***/ }),
26319
+ /* 73 */
26320
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26321
+
26322
+ "use strict";
26323
+ /* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators;
26324
+ function bindActionCreator(actionCreator, dispatch) {
26325
+ return function () {
26326
+ return dispatch(actionCreator.apply(undefined, arguments));
26327
+ };
26328
+ }
26329
+
26330
+ /**
26331
+ * Turns an object whose values are action creators, into an object with the
26332
+ * same keys, but with every function wrapped into a `dispatch` call so they
26333
+ * may be invoked directly. This is just a convenience method, as you can call
26334
+ * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
26335
+ *
26336
+ * For convenience, you can also pass a single function as the first argument,
26337
+ * and get a function in return.
26338
+ *
26339
+ * @param {Function|Object} actionCreators An object whose values are action
26340
+ * creator functions. One handy way to obtain it is to use ES6 `import * as`
26341
+ * syntax. You may also pass a single function.
26342
+ *
26343
+ * @param {Function} dispatch The `dispatch` function available on your Redux
26344
+ * store.
26345
+ *
26346
+ * @returns {Function|Object} The object mimicking the original object, but with
26347
+ * every action creator wrapped into the `dispatch` call. If you passed a
26348
+ * function as `actionCreators`, the return value will also be a single
26349
+ * function.
26350
+ */
26351
+ function bindActionCreators(actionCreators, dispatch) {
26352
+ if (typeof actionCreators === 'function') {
26353
+ return bindActionCreator(actionCreators, dispatch);
26354
+ }
26355
+
26356
+ if (typeof actionCreators !== 'object' || actionCreators === null) {
26357
+ throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
26358
+ }
26359
+
26360
+ var keys = Object.keys(actionCreators);
26361
+ var boundActionCreators = {};
26362
+ for (var i = 0; i < keys.length; i++) {
26363
+ var key = keys[i];
26364
+ var actionCreator = actionCreators[key];
26365
+ if (typeof actionCreator === 'function') {
26366
+ boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
26367
+ }
26368
+ }
26369
+ return boundActionCreators;
26370
+ }
26371
+
26372
+ /***/ }),
26373
+ /* 74 */
26374
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26375
+
26376
+ "use strict";
26377
+ /* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware;
26378
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(33);
26379
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
26380
+
26381
+
26382
+
26383
+ /**
26384
+ * Creates a store enhancer that applies middleware to the dispatch method
26385
+ * of the Redux store. This is handy for a variety of tasks, such as expressing
26386
+ * asynchronous actions in a concise manner, or logging every action payload.
26387
+ *
26388
+ * See `redux-thunk` package as an example of the Redux middleware.
26389
+ *
26390
+ * Because middleware is potentially asynchronous, this should be the first
26391
+ * store enhancer in the composition chain.
26392
+ *
26393
+ * Note that each middleware will be given the `dispatch` and `getState` functions
26394
+ * as named arguments.
26395
+ *
26396
+ * @param {...Function} middlewares The middleware chain to be applied.
26397
+ * @returns {Function} A store enhancer applying the middleware.
26398
+ */
26399
+ function applyMiddleware() {
26400
+ for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
26401
+ middlewares[_key] = arguments[_key];
26402
+ }
26403
+
26404
+ return function (createStore) {
26405
+ return function (reducer, preloadedState, enhancer) {
26406
+ var store = createStore(reducer, preloadedState, enhancer);
26407
+ var _dispatch = store.dispatch;
26408
+ var chain = [];
26409
+
26410
+ var middlewareAPI = {
26411
+ getState: store.getState,
26412
+ dispatch: function dispatch(action) {
26413
+ return _dispatch(action);
26414
+ }
26415
+ };
26416
+ chain = middlewares.map(function (middleware) {
26417
+ return middleware(middlewareAPI);
26418
+ });
26419
+ _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch);
26420
+
26421
+ return _extends({}, store, {
26422
+ dispatch: _dispatch
26423
+ });
26424
+ };
26425
+ };
26426
+ }
26427
+
26428
+ /***/ }),
26429
+ /* 75 */
26430
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26431
+
26432
+ "use strict";
26433
+ /* unused harmony export whenMapStateToPropsIsFunction */
26434
+ /* unused harmony export whenMapStateToPropsIsMissing */
26435
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(34);
26436
+
26437
+
26438
+ function whenMapStateToPropsIsFunction(mapStateToProps) {
26439
+ return typeof mapStateToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined;
26440
+ }
26441
+
26442
+ function whenMapStateToPropsIsMissing(mapStateToProps) {
26443
+ return !mapStateToProps ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function () {
26444
+ return {};
26445
+ }) : undefined;
26446
+ }
26447
+
26448
+ /* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]);
26449
+
26450
+ /***/ }),
26451
+ /* 76 */
26452
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26453
+
26454
+ "use strict";
26455
+ /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export defaultMergeProps */
26456
+ /* unused harmony export wrapMergePropsFunc */
26457
+ /* unused harmony export whenMergePropsIsFunction */
26458
+ /* unused harmony export whenMergePropsIsOmitted */
26459
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(35);
26460
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
26461
+
26462
+
26463
+
26464
+ function defaultMergeProps(stateProps, dispatchProps, ownProps) {
26465
+ return _extends({}, ownProps, stateProps, dispatchProps);
26466
+ }
26467
+
26468
+ function wrapMergePropsFunc(mergeProps) {
26469
+ return function initMergePropsProxy(dispatch, _ref) {
26470
+ var displayName = _ref.displayName,
26471
+ pure = _ref.pure,
26472
+ areMergedPropsEqual = _ref.areMergedPropsEqual;
26473
+
26474
+ var hasRunOnce = false;
26475
+ var mergedProps = void 0;
26476
+
26477
+ return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
26478
+ var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
26479
+
26480
+ if (hasRunOnce) {
26481
+ if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
26482
+ } else {
26483
+ hasRunOnce = true;
26484
+ mergedProps = nextMergedProps;
26485
+
26486
+ if (process.env.NODE_ENV !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(mergedProps, displayName, 'mergeProps');
26487
+ }
26488
+
26489
+ return mergedProps;
26490
+ };
26491
+ };
26492
+ }
26493
+
26494
+ function whenMergePropsIsFunction(mergeProps) {
26495
+ return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
26496
+ }
26497
+
26498
+ function whenMergePropsIsOmitted(mergeProps) {
26499
+ return !mergeProps ? function () {
26500
+ return defaultMergeProps;
26501
+ } : undefined;
26502
+ }
26503
+
26504
+ /* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]);
26505
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
26506
+
26507
+ /***/ }),
26508
+ /* 77 */
26509
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26510
+
26511
+ "use strict";
26512
+ /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */
26513
+ /* unused harmony export pureFinalPropsSelectorFactory */
26514
+ /* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory;
26515
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(78);
26516
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26517
+
26518
+
26519
+
26520
+ function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
26521
+ return function impureFinalPropsSelector(state, ownProps) {
26522
+ return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
26523
+ };
26524
+ }
26525
+
26526
+ function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
26527
+ var areStatesEqual = _ref.areStatesEqual,
26528
+ areOwnPropsEqual = _ref.areOwnPropsEqual,
26529
+ areStatePropsEqual = _ref.areStatePropsEqual;
26530
+
26531
+ var hasRunAtLeastOnce = false;
26532
+ var state = void 0;
26533
+ var ownProps = void 0;
26534
+ var stateProps = void 0;
26535
+ var dispatchProps = void 0;
26536
+ var mergedProps = void 0;
26537
+
26538
+ function handleFirstCall(firstState, firstOwnProps) {
26539
+ state = firstState;
26540
+ ownProps = firstOwnProps;
26541
+ stateProps = mapStateToProps(state, ownProps);
26542
+ dispatchProps = mapDispatchToProps(dispatch, ownProps);
26543
+ mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
26544
+ hasRunAtLeastOnce = true;
26545
+ return mergedProps;
26546
+ }
26547
+
26548
+ function handleNewPropsAndNewState() {
26549
+ stateProps = mapStateToProps(state, ownProps);
26550
+
26551
+ if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
26552
+
26553
+ mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
26554
+ return mergedProps;
26555
+ }
26556
+
26557
+ function handleNewProps() {
26558
+ if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
26559
+
26560
+ if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
26561
+
26562
+ mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
26563
+ return mergedProps;
26564
+ }
26565
+
26566
+ function handleNewState() {
26567
+ var nextStateProps = mapStateToProps(state, ownProps);
26568
+ var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
26569
+ stateProps = nextStateProps;
26570
+
26571
+ if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
26572
+
26573
+ return mergedProps;
26574
+ }
26575
+
26576
+ function handleSubsequentCalls(nextState, nextOwnProps) {
26577
+ var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
26578
+ var stateChanged = !areStatesEqual(nextState, state);
26579
+ state = nextState;
26580
+ ownProps = nextOwnProps;
26581
+
26582
+ if (propsChanged && stateChanged) return handleNewPropsAndNewState();
26583
+ if (propsChanged) return handleNewProps();
26584
+ if (stateChanged) return handleNewState();
26585
+ return mergedProps;
26586
+ }
26587
+
26588
+ return function pureFinalPropsSelector(nextState, nextOwnProps) {
26589
+ return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
26590
+ };
26591
+ }
26592
+
26593
+ // TODO: Add more comments
26594
+
26595
+ // If pure is true, the selector returned by selectorFactory will memoize its results,
26596
+ // allowing connectAdvanced's shouldComponentUpdate to return false if final
26597
+ // props have not changed. If false, the selector will always return a new
26598
+ // object and shouldComponentUpdate will always return true.
26599
+
26600
+ function finalPropsSelectorFactory(dispatch, _ref2) {
26601
+ var initMapStateToProps = _ref2.initMapStateToProps,
26602
+ initMapDispatchToProps = _ref2.initMapDispatchToProps,
26603
+ initMergeProps = _ref2.initMergeProps,
26604
+ options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);
26605
+
26606
+ var mapStateToProps = initMapStateToProps(dispatch, options);
26607
+ var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
26608
+ var mergeProps = initMergeProps(dispatch, options);
26609
+
26610
+ if (process.env.NODE_ENV !== 'production') {
26611
+ Object(__WEBPACK_IMPORTED_MODULE_0__verifySubselectors__["a" /* default */])(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
26612
+ }
26613
+
26614
+ var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
26615
+
26616
+ return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
26617
+ }
26618
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
26619
+
26620
+ /***/ }),
26621
+ /* 78 */
26622
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
26623
+
26624
+ "use strict";
26625
+ /* harmony export (immutable) */ __webpack_exports__["a"] = verifySubselectors;
26626
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(14);
26627
+
26628
+
26629
+ function verify(selector, methodName, displayName) {
26630
+ if (!selector) {
26631
+ throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');
26632
+ } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
26633
+ if (!selector.hasOwnProperty('dependsOnOwnProps')) {
26634
+ Object(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */])('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');
26635
+ }
26636
+ }
26637
+ }
26638
+
26639
+ function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
26640
+ verify(mapStateToProps, 'mapStateToProps', displayName);
26641
+ verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
26642
+ verify(mergeProps, 'mergeProps', displayName);
26643
+ }
26644
+
26645
+ /***/ }),
26646
+ /* 79 */
26647
+ /***/ (function(module, exports, __webpack_require__) {
26648
+
26649
+ "use strict";
26650
+
26651
+ Object.defineProperty(exports, "__esModule", { value: true });
26652
+ var ReactRedux = __webpack_require__(3);
26653
+ var Main_1 = __webpack_require__(80);
26654
+ var mapDispatchToProps_1 = __webpack_require__(4);
26655
+ var mapStateToProps_1 = __webpack_require__(5);
26656
+ var MainContainer = ReactRedux.connect(mapStateToProps_1.default, mapDispatchToProps_1.default)(Main_1.default);
26657
+ exports.default = MainContainer;
26658
+
26659
+
26660
+ /***/ }),
26661
+ /* 80 */
26662
+ /***/ (function(module, exports, __webpack_require__) {
26663
+
26664
+ "use strict";
26665
+
26666
+ var __assign = (this && this.__assign) || Object.assign || function(t) {
26667
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26668
+ s = arguments[i];
26669
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26670
+ t[p] = s[p];
26671
+ }
26672
+ return t;
26673
+ };
26674
+ Object.defineProperty(exports, "__esModule", { value: true });
26675
+ var React = __webpack_require__(1);
26676
+ var utils_1 = __webpack_require__(16);
26677
+ var Admin_1 = __webpack_require__(81);
26678
+ var Loading_1 = __webpack_require__(100);
26679
+ var Message_1 = __webpack_require__(101);
26680
+ var PRE_RELEASE_TYPES = Object.freeze({
26681
+ alpha: 'alpha',
26682
+ beta: 'beta',
26683
+ });
26684
+ /* tslint:disable:max-line-length */
26685
+ var getMainView = function (props) {
26686
+ if (!props.data.config.permissions.canManageSettings)
26687
+ return "You don't have permission to make any changes here. Please contact the site administrator to get access.";
26688
+ else if (props.data.isFetchingAdminOptions || props.data.isFetchingSyncStatus)
26689
+ return React.createElement(Loading_1.default, null);
26690
+ return React.createElement(Admin_1.default, __assign({}, props));
26691
+ };
26692
+ var getPreReleaseNotice = function (pluginVersion) {
26693
+ // Format of versions can be either 1.0.0, 1.0.0-beta, or 1.0.0-beta.1
26694
+ var preReleaseType = (pluginVersion.split('-')[1] || '').split('.')[0];
26695
+ if (PRE_RELEASE_TYPES[preReleaseType]) {
26696
+ return (React.createElement("div", { className: "notice notice-info inline" },
26697
+ React.createElement("p", null,
26698
+ "You are using a ",
26699
+ React.createElement("strong", null,
26700
+ "pre-release version (", "" + pluginVersion,
26701
+ ")"),
26702
+ " of the Disqus WordPress plugin.",
26703
+ ' ',
26704
+ React.createElement("a", { href: 'https://github.com/disqus/disqus-wordpress-plugin/releases', target: '_blank' }, "Check for new releases"))));
26705
+ }
26706
+ return null;
26707
+ };
26708
+ var Main = function (props) { return (React.createElement("div", { className: 'dsq-admin-wrapper' },
26709
+ React.createElement("div", { className: 'wrap' },
26710
+ React.createElement("a", { href: utils_1.getWordpressAdminUrl('disqus'), className: 'disqus-logo' },
26711
+ React.createElement("img", { src: 'https://a.disquscdn.com/dotcom/d-2407bda/img/brand/disqus-logo-blue-white.svg', width: 102 }))),
26712
+ React.createElement("div", { className: 'wrap' },
26713
+ getPreReleaseNotice(props.data.config.site.pluginVersion),
26714
+ props.data.message ? React.createElement(Message_1.default, __assign({}, props.data.message)) : null,
26715
+ getMainView(props)))); };
26716
+ /* tslint:enable:max-line-length */
26717
+ exports.default = Main;
26718
+
26719
+
26720
+ /***/ }),
26721
+ /* 81 */
26722
+ /***/ (function(module, exports, __webpack_require__) {
26723
+
26724
+ "use strict";
26725
+
26726
+ var __assign = (this && this.__assign) || Object.assign || function(t) {
26727
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26728
+ s = arguments[i];
26729
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26730
+ t[p] = s[p];
26731
+ }
26732
+ return t;
26733
+ };
26734
+ Object.defineProperty(exports, "__esModule", { value: true });
26735
+ var React = __webpack_require__(1);
26736
+ var ExportCommentsContainer_1 = __webpack_require__(82);
26737
+ var InstallContainer_1 = __webpack_require__(87);
26738
+ var SiteConfigContainer_1 = __webpack_require__(89);
26739
+ var SSOConfigContainer_1 = __webpack_require__(91);
26740
+ var SupportDiagnosticsContainer_1 = __webpack_require__(93);
26741
+ var SyncConfigContainer_1 = __webpack_require__(95);
26742
+ var utils_1 = __webpack_require__(16);
26743
+ var HelpResources_1 = __webpack_require__(97);
26744
+ var SupportLinks_1 = __webpack_require__(98);
26745
+ var WelcomePanel_1 = __webpack_require__(99);
26746
+ var getSSOContainer = function (props) {
26747
+ var adminOptions = props.data.adminOptions;
26748
+ if (!adminOptions.disqus_public_key || !adminOptions.disqus_secret_key || !adminOptions.disqus_installed) {
26749
+ return (React.createElement("div", { className: 'notice notice-warning' },
26750
+ React.createElement("p", null,
26751
+ React.createElement("span", { className: 'dashicons dashicons-warning' }),
26752
+ ' ',
26753
+ "You must have a Site Shortname, API Public Key, and API Secret Key configured to enable this feature.")));
26754
+ }
26755
+ return React.createElement(SSOConfigContainer_1.default, null);
26756
+ };
26757
+ var getSyncContainer = function (props) {
26758
+ var adminOptions = props.data.adminOptions;
26759
+ if (!adminOptions.disqus_secret_key || !adminOptions.disqus_admin_access_token || !adminOptions.disqus_installed) {
26760
+ return (React.createElement("div", { className: 'notice notice-warning' },
26761
+ React.createElement("p", null,
26762
+ React.createElement("span", { className: 'dashicons dashicons-warning' }),
26763
+ ' ',
26764
+ "You must have a Site Shortname, API Secret Key, and API Access Token configured to enable this feature.")));
26765
+ }
26766
+ return React.createElement(SyncConfigContainer_1.default, null);
26767
+ };
26768
+ var getActiveTab = function (props) { return (props.data.activeTab || (props.data.adminOptions.disqus_installed ? 'siteConfiguration' : 'install')); };
26769
+ var getExportContainer = function (props) {
26770
+ var adminOptions = props.data.adminOptions;
26771
+ if (!adminOptions.disqus_secret_key || !adminOptions.disqus_admin_access_token) {
26772
+ return (React.createElement("div", { className: 'notice notice-warning' },
26773
+ React.createElement("p", null,
26774
+ React.createElement("span", { className: 'dashicons dashicons-warning' }),
26775
+ ' ',
26776
+ "You must have an API Secret Key and API Access Token configured to enable this feature.")));
26777
+ }
26778
+ return React.createElement(ExportCommentsContainer_1.default, null);
26779
+ };
26780
+ var getTabClassName = function (props, id) {
26781
+ var activeTab = getActiveTab(props);
26782
+ return "nav-tab" + (activeTab === id ? ' nav-tab-active' : '');
26783
+ };
26784
+ var AdminTabBar = function (props) { return (React.createElement("div", { className: 'nav-tab-wrapper' },
26785
+ React.createElement("a", { href: '#install', className: getTabClassName(props, 'install') }, props.data.adminOptions.disqus_installed ? "Reinstall" : "Install"),
26786
+ React.createElement("a", { href: '#siteConfiguration', className: getTabClassName(props, 'siteConfiguration') }, "Site Configuration"),
26787
+ React.createElement("a", { href: '#syncing', className: getTabClassName(props, 'syncing') }, "Syncing"),
26788
+ React.createElement("a", { href: '#singleSignOn', className: getTabClassName(props, 'singleSignOn') }, "Single Sign-on"),
26789
+ React.createElement("a", { href: '#support', className: getTabClassName(props, 'support') }, "Support"))); };
26790
+ /* tslint:disable:max-line-length */
26791
+ var getActiveTabView = function (props) {
26792
+ var activeTab = getActiveTab(props);
26793
+ switch (activeTab) {
26794
+ case 'syncing':
26795
+ return (React.createElement("div", null,
26796
+ React.createElement("h3", null, "WordPress Comments"),
26797
+ React.createElement("p", { className: 'description' }, "Disqus has replaced the default WordPress commenting system. You may access and edit the comments in your database, but any actions performed there will not be reflected in Disqus."),
26798
+ React.createElement("p", { className: 'submit' },
26799
+ React.createElement("a", { href: utils_1.getWordpressAdminUrl('editComments'), className: 'button button-large' },
26800
+ React.createElement("span", { className: 'dashicons dashicons-wordpress-alt' }),
26801
+ ' ',
26802
+ "View WordPress Comments")),
26803
+ React.createElement("hr", null),
26804
+ React.createElement("h3", null, "Sync"),
26805
+ React.createElement("p", { className: 'description' }, "Copy comments created and edited in Disqus to your local WordPress database for backup purposes."),
26806
+ getSyncContainer(props),
26807
+ React.createElement("hr", null),
26808
+ React.createElement("h3", null, "Import"),
26809
+ React.createElement("p", { className: 'description' },
26810
+ "Import your existing WordPress comments to Disqus.",
26811
+ ' ',
26812
+ React.createElement("a", { href: 'https://help.disqus.com/customer/portal/articles/466255', target: '_blank' }, "Learn More")),
26813
+ getExportContainer(props)));
26814
+ case 'singleSignOn':
26815
+ return (React.createElement("div", null,
26816
+ React.createElement("h3", null, "Set up Single Sign-on"),
26817
+ React.createElement("p", { className: 'description' },
26818
+ "Allow users to sign in with this site's user accounts. This is a Disqus Pro feature.",
26819
+ ' ',
26820
+ React.createElement("a", { href: 'https://help.disqus.com/customer/portal/articles/1148635', target: '_blank' }, "Learn More")),
26821
+ getSSOContainer(props)));
26822
+ case 'support':
26823
+ return (React.createElement("div", null,
26824
+ React.createElement("h3", null, "How to Get Support"),
26825
+ React.createElement(SupportLinks_1.default, null),
26826
+ React.createElement("hr", null),
26827
+ React.createElement("h3", null, "Helpful Resources"),
26828
+ React.createElement(HelpResources_1.default, null),
26829
+ React.createElement("hr", null),
26830
+ React.createElement("h3", null, "Diagnostic Information"),
26831
+ React.createElement("p", { className: 'description' }, "Include the following information in any private support requests, but do not share this publicly."),
26832
+ React.createElement("div", { className: 'submit' },
26833
+ React.createElement(SupportDiagnosticsContainer_1.default, null))));
26834
+ case 'install':
26835
+ return React.createElement(InstallContainer_1.default, null);
26836
+ case 'siteConfiguration':
26837
+ default:
26838
+ return (React.createElement("div", null,
26839
+ React.createElement("h3", null, "Site Configuration"),
26840
+ React.createElement("p", { className: 'description' },
26841
+ "Your site configuration comes from Disqus. Changing these values may break your installation.",
26842
+ ' ',
26843
+ React.createElement("a", { href: utils_1.getForumAdminUrl(props.data.adminOptions.disqus_forum_url, 'install/platforms/wordpress'), target: '_blank' }, "WordPress install instructions")),
26844
+ React.createElement(SiteConfigContainer_1.default, null)));
26845
+ }
26846
+ };
26847
+ var Admin = function (props) { return (React.createElement("div", null,
26848
+ props.data.adminOptions.disqus_installed ? React.createElement(WelcomePanel_1.default, { shortname: props.data.adminOptions.disqus_forum_url }) : null,
26849
+ React.createElement(AdminTabBar, __assign({}, props)),
26850
+ getActiveTabView(props))); };
26851
+ /* tslint:enable:max-line-length */
26852
+ exports.default = Admin;
26853
+
26854
+
26855
+ /***/ }),
26856
+ /* 82 */
26857
+ /***/ (function(module, exports, __webpack_require__) {
26858
+
26859
+ "use strict";
26860
+
26861
+ Object.defineProperty(exports, "__esModule", { value: true });
26862
+ var ReactRedux = __webpack_require__(3);
26863
+ var ExportComments_1 = __webpack_require__(83);
26864
+ var mapDispatchToProps_1 = __webpack_require__(4);
26865
+ var mapStateToProps_1 = __webpack_require__(5);
26866
+ var ExportCommentsContainer = ReactRedux.connect(mapStateToProps_1.default, mapDispatchToProps_1.default)(ExportComments_1.default);
26867
+ exports.default = ExportCommentsContainer;
26868
+
26869
+
26870
+ /***/ }),
26871
+ /* 83 */
26872
+ /***/ (function(module, exports, __webpack_require__) {
26873
+
26874
+ "use strict";
26875
+
26876
+ var __assign = (this && this.__assign) || Object.assign || function(t) {
26877
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26878
+ s = arguments[i];
26879
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26880
+ t[p] = s[p];
26881
+ }
26882
+ return t;
26883
+ };
26884
+ Object.defineProperty(exports, "__esModule", { value: true });
26885
+ var React = __webpack_require__(1);
26886
+ var AdminState_1 = __webpack_require__(11);
26887
+ var getStatusMessage = function (props) {
26888
+ if (props.data.isExportRunning)
26889
+ return React.createElement("h4", null, "Sending to Disqus" + '…');
26890
+ return (React.createElement("h4", null,
26891
+ React.createElement("span", null,
26892
+ "Done!",
26893
+ ' ',
26894
+ React.createElement("a", { href: "https://import.disqus.com/" + props.data.adminOptions.disqus_forum_url + "/", target: '_blank' }, "Check your import status"))));
26895
+ };
26896
+ var LogMessages = function (props) {
26897
+ var logArray = props.data.exportLogs.toArray();
26898
+ var logElements = logArray.map(function (log) {
26899
+ var statusColor;
26900
+ var statusText;
26901
+ switch (log.status) {
26902
+ case AdminState_1.ExportLogStaus.failed:
26903
+ statusColor = 'red';
26904
+ statusText = React.createElement("abbr", { title: log.error }, "Failed");
26905
+ break;
26906
+ case AdminState_1.ExportLogStaus.complete:
26907
+ statusColor = 'green';
26908
+ statusText = "Complete";
26909
+ break;
26910
+ case AdminState_1.ExportLogStaus.pending:
26911
+ default:
26912
+ statusColor = 'gray';
26913
+ statusText = "Pending";
26914
+ break;
26915
+ }
26916
+ return (React.createElement("tr", { key: log.id },
26917
+ React.createElement("td", null, log.id),
26918
+ React.createElement("td", null,
26919
+ React.createElement("a", { href: log.link }, log.title)),
26920
+ React.createElement("td", null,
26921
+ React.createElement("strong", { style: { color: statusColor } }, statusText)),
26922
+ React.createElement("td", null, log.numComments)));
26923
+ });
26924
+ return (React.createElement("div", null,
26925
+ getStatusMessage(props),
26926
+ React.createElement("table", { className: 'wp-list-table widefat striped' },
26927
+ React.createElement("thead", null,
26928
+ React.createElement("tr", null,
26929
+ React.createElement("th", { scope: 'col' }, "ID"),
26930
+ React.createElement("th", { scope: 'col' }, "Title"),
26931
+ React.createElement("th", { scope: 'col' }, "Status"),
26932
+ React.createElement("th", { scope: 'col' }, "# Imported"))),
26933
+ React.createElement("tbody", null, logElements))));
26934
+ };
26935
+ var ExportComments = function (props) { return (React.createElement("form", { name: 'export', method: 'POST', onSubmit: props.onSubmitExportCommentsForm },
26936
+ React.createElement("p", { className: 'submit' },
26937
+ React.createElement("button", { type: 'submit', className: 'button button-large', disabled: props.data.isExportRunning },
26938
+ React.createElement("span", { className: 'dashicons dashicons-upload' }),
26939
+ ' ',
26940
+ "Import Comments")),
26941
+ props.data.exportLogs.size ? React.createElement(LogMessages, __assign({}, props)) : null)); };
26942
+ exports.default = ExportComments;
26943
+
26944
+
26945
+ /***/ }),
26946
+ /* 84 */
26947
+ /***/ (function(module, exports, __webpack_require__) {
26948
+
26949
+ "use strict";
26950
+
26951
+ var __extends = (this && this.__extends) || (function () {
26952
+ var extendStatics = Object.setPrototypeOf ||
26953
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26954
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
26955
+ return function (d, b) {
26956
+ extendStatics(d, b);
26957
+ function __() { this.constructor = d; }
26958
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26959
+ };
26960
+ })();
26961
+ Object.defineProperty(exports, "__esModule", { value: true });
26962
+ var immutable_1 = __webpack_require__(17);
26963
+ var AdminOptions = /** @class */ (function (_super) {
26964
+ __extends(AdminOptions, _super);
26965
+ /* tslint:enable:variable-name */
26966
+ function AdminOptions(options) {
26967
+ return _super.call(this, options) || this;
26968
+ }
26969
+ AdminOptions.prototype.set = function (key, value) {
26970
+ return _super.prototype.set.call(this, key, value);
26971
+ };
26972
+ AdminOptions.prototype.with = function (values) {
26973
+ return this.merge(values);
26974
+ };
26975
+ return AdminOptions;
26976
+ }(immutable_1.Record({
26977
+ disqus_admin_access_token: null,
26978
+ disqus_forum_url: null,
26979
+ disqus_installed: null,
26980
+ disqus_public_key: null,
26981
+ disqus_secret_key: null,
26982
+ disqus_sso_button: null,
26983
+ disqus_sso_enabled: null,
26984
+ disqus_sync_token: null,
26985
+ })));
26986
+ exports.default = AdminOptions;
26987
+
26988
+
26989
+ /***/ }),
26990
+ /* 85 */
26991
+ /***/ (function(module, exports, __webpack_require__) {
26992
+
26993
+ "use strict";
26994
+
26995
+ var __extends = (this && this.__extends) || (function () {
26996
+ var extendStatics = Object.setPrototypeOf ||
26997
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26998
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
26999
+ return function (d, b) {
27000
+ extendStatics(d, b);
27001
+ function __() { this.constructor = d; }
27002
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
27003
+ };
27004
+ })();
27005
+ Object.defineProperty(exports, "__esModule", { value: true });
27006
+ var immutable_1 = __webpack_require__(17);
27007
+ var SyncStatus = /** @class */ (function (_super) {
27008
+ __extends(SyncStatus, _super);
27009
+ /* tslint:enable:variable-name */
27010
+ function SyncStatus(options) {
27011
+ return _super.call(this, options) || this;
27012
+ }
27013
+ SyncStatus.prototype.set = function (key, value) {
27014
+ return _super.prototype.set.call(this, key, value);
27015
+ };
27016
+ SyncStatus.prototype.with = function (values) {
27017
+ return this.merge(values);
27018
+ };
27019
+ return SyncStatus;
27020
+ }(immutable_1.Record({
27021
+ enabled: null,
27022
+ last_message: null,
27023
+ requires_update: null,
27024
+ subscribed: null,
27025
+ subscription: null,
27026
+ })));
27027
+ exports.default = SyncStatus;
27028
+
27029
+
27030
+ /***/ }),
27031
+ /* 86 */
27032
+ /***/ (function(module, exports, __webpack_require__) {
27033
+
27034
+ "use strict";
27035
+
27036
+ Object.defineProperty(exports, "__esModule", { value: true });
27037
+ var actions_1 = __webpack_require__(10);
27038
+ var DisqusApi_1 = __webpack_require__(36);
27039
+ var AdminState_1 = __webpack_require__(11);
27040
+ var WordPressRestApi_1 = __webpack_require__(18);
27041
+ var POSTS_PER_PAGE = 10;
27042
+ exports.POSTS_PER_PAGE = POSTS_PER_PAGE;
27043
+ var WordPressCommentExporter = /** @class */ (function () {
27044
+ function WordPressCommentExporter(dispatch) {
27045
+ this.dispatch = dispatch;
27046
+ this.currentPage = 1;
27047
+ }
27048
+ WordPressCommentExporter.prototype.startExportPosts = function () {
27049
+ return WordPressRestApi_1.WordPressRestApi.instance.wordpressRestGet('posts', "per_page=" + POSTS_PER_PAGE + "&page=" + this.currentPage, this.handlePostsResponse);
27050
+ };
27051
+ WordPressCommentExporter.prototype.exportPost = function (post) {
27052
+ WordPressRestApi_1.WordPressRestApi.instance.pluginRestPost('export/post', { postId: post.id }, this.handleExportPostResponse.bind(null, post));
27053
+ };
27054
+ WordPressCommentExporter.prototype.dispatchComplete = function (post, numComments) {
27055
+ this.dispatch(actions_1.updateExportPostLogAction({
27056
+ error: null,
27057
+ id: post.id,
27058
+ link: post.link,
27059
+ numComments: numComments,
27060
+ status: AdminState_1.ExportLogStaus.complete,
27061
+ title: post.title.rendered,
27062
+ }));
27063
+ };
27064
+ WordPressCommentExporter.prototype.dispatchError = function (post, error) {
27065
+ this.dispatch(actions_1.updateExportPostLogAction({
27066
+ error: error,
27067
+ id: post.id,
27068
+ link: post.link,
27069
+ numComments: null,
27070
+ status: AdminState_1.ExportLogStaus.failed,
27071
+ title: post.title.rendered,
27072
+ }));
27073
+ };
27074
+ WordPressCommentExporter.prototype.handleDisqusImportResponse = function (post, exportPostResponse, xhr) {
27075
+ var jsonObject = null;
27076
+ try {
27077
+ jsonObject = JSON.parse(xhr.target.responseText);
27078
+ }
27079
+ catch (error) {
27080
+ // Continue
27081
+ }
27082
+ if (!jsonObject) {
27083
+ this.dispatchError(post, "Unknown error uploading to the Disqus servers");
27084
+ return;
27085
+ }
27086
+ if (jsonObject.code !== 0) {
27087
+ this.dispatchError(post, jsonObject.response);
27088
+ return;
27089
+ }
27090
+ this.dispatchComplete(post, exportPostResponse.data.comments.length);
27091
+ };
27092
+ WordPressCommentExporter.prototype.handleExportPostResponse = function (post, response) {
27093
+ if (!response || response.code !== 'OK') {
27094
+ this.dispatchError(post, response.message);
27095
+ return;
27096
+ }
27097
+ if (!response.data.comments.length) {
27098
+ this.dispatchComplete(post, response.data.comments.length);
27099
+ return;
27100
+ }
27101
+ var wxr = response.data.wxr;
27102
+ DisqusApi_1.DisqusApi.instance.createImport(wxr.xmlContent, wxr.filename, this.handleDisqusImportResponse.bind(null, post, response));
27103
+ };
27104
+ WordPressCommentExporter.prototype.handlePostsResponse = function (response) {
27105
+ var _this = this;
27106
+ if (Array.isArray(response)) {
27107
+ response.forEach(function (post) {
27108
+ _this.dispatch(actions_1.updateExportPostLogAction({
27109
+ error: null,
27110
+ id: post.id,
27111
+ link: post.link,
27112
+ numComments: null,
27113
+ status: AdminState_1.ExportLogStaus.pending,
27114
+ title: post.title.rendered,
27115
+ }));
27116
+ _this.exportPost(post);
27117
+ });
27118
+ if (response.length === POSTS_PER_PAGE) {
27119
+ this.currentPage += 1;
27120
+ this.startExportPosts();
27121
+ }
27122
+ }
27123
+ };
27124
+ return WordPressCommentExporter;
27125
+ }());
27126
+ exports.default = WordPressCommentExporter;
27127
+
27128
+
27129
+ /***/ }),
27130
+ /* 87 */
27131
+ /***/ (function(module, exports, __webpack_require__) {
27132
+
27133
+ "use strict";
27134
+
27135
+ Object.defineProperty(exports, "__esModule", { value: true });
27136
+ var ReactRedux = __webpack_require__(3);
27137
+ var Install_1 = __webpack_require__(88);
27138
+ var mapDispatchToProps_1 = __webpack_require__(4);
27139
+ var mapStateToProps_1 = __webpack_require__(5);
27140
+ var InstallContainer = ReactRedux.connect(mapStateToProps_1.default, mapDispatchToProps_1.default)(Install_1.default);
27141
+ exports.default = InstallContainer;
27142
+
27143
+
27144
+ /***/ }),
27145
+ /* 88 */
27146
+ /***/ (function(module, exports, __webpack_require__) {
27147
+
27148
+ "use strict";
27149
+
27150
+ var __extends = (this && this.__extends) || (function () {
27151
+ var extendStatics = Object.setPrototypeOf ||
27152
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
27153
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27154
+ return function (d, b) {
27155
+ extendStatics(d, b);
27156
+ function __() { this.constructor = d; }
27157
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
27158
+ };
27159
+ })();
27160
+ Object.defineProperty(exports, "__esModule", { value: true });
27161
+ var React = __webpack_require__(1);
27162
+ var AdminState_1 = __webpack_require__(11);
27163
+ var REST_OPTIONS_1 = __webpack_require__(37);
27164
+ var DISQUS_URL_BASE = 'https://disqus.com/';
27165
+ var DISQUS_SIGNUP_URL = DISQUS_URL_BASE + "profile/signup/";
27166
+ var DISQUS_LOGIN_URL = DISQUS_URL_BASE + "profile/login/";
27167
+ var DISQUS_CREATE_URL = DISQUS_URL_BASE + "admin/create/";
27168
+ var DISQUS_WORDPRESS_URL = DISQUS_URL_BASE + "admin/install/platforms/wordpress/";
27169
+ var SYNCTOKEN_INPUT_ID = 'configKey';
27170
+ /* tslint:disable:max-line-length */
27171
+ var Install = /** @class */ (function (_super) {
27172
+ __extends(Install, _super);
27173
+ function Install() {
27174
+ return _super !== null && _super.apply(this, arguments) || this;
27175
+ }
27176
+ Install.prototype.render = function () {
27177
+ var syncToken = "" + REST_OPTIONS_1.default.base + REST_OPTIONS_1.default.disqusBase + "settings " + this.props.data.adminOptions.get('disqus_sync_token', '');
27178
+ return (React.createElement("div", null,
27179
+ React.createElement("h3", null, "Automatic Installation"),
27180
+ React.createElement("p", null, "Installs Disqus on your site using a generated API application. If your site isn't publicly accessible, use the manual installation method."),
27181
+ this.getAutoInstallPrompt(syncToken)));
27182
+ };
27183
+ Install.prototype.getAutoInstallPrompt = function (syncToken) {
27184
+ switch (this.props.data.installationState) {
27185
+ case AdminState_1.InstallationState.none:
27186
+ return (React.createElement("div", null,
27187
+ React.createElement("p", { className: 'submit' },
27188
+ React.createElement("strong", null, "Do you have a Disqus account?"),
27189
+ React.createElement("br", null),
27190
+ React.createElement("button", { className: 'button', onClick: this.props.onUpdateInstallationState.bind(null, AdminState_1.InstallationState.hasAccount) }, "Yes"),
27191
+ ' ',
27192
+ React.createElement("button", { className: 'button', onClick: this.props.onUpdateInstallationState.bind(null, AdminState_1.InstallationState.noAccount) }, "No"))));
27193
+ case AdminState_1.InstallationState.hasAccount:
27194
+ return (React.createElement("div", null,
27195
+ React.createElement("p", { className: 'submit' },
27196
+ React.createElement("strong", null, "Do you have a site registered on Disqus you want to use?"),
27197
+ React.createElement("br", null),
27198
+ React.createElement("button", { className: 'button', onClick: this.props.onUpdateInstallationState.bind(null, AdminState_1.InstallationState.hasSite) }, "Yes"),
27199
+ ' ',
27200
+ React.createElement("button", { className: 'button', onClick: this.props.onUpdateInstallationState.bind(null, AdminState_1.InstallationState.noSite) }, "No"))));
27201
+ case AdminState_1.InstallationState.noAccount:
27202
+ return (React.createElement("ol", { className: 'dsq-installation__instruction-list' },
27203
+ React.createElement("li", null,
27204
+ "Sign up to register your account and site with Disqus",
27205
+ React.createElement("br", null),
27206
+ React.createElement("button", { className: 'button button-primary button-large', onClick: this.openDisqusPage.bind(this, syncToken, DISQUS_SIGNUP_URL + "?next=" + encodeURIComponent(DISQUS_CREATE_URL)) }, "Sign up")),
27207
+ React.createElement("li", null,
27208
+ "After creating the site, go to the WordPress installation page to finish.",
27209
+ React.createElement("br", null),
27210
+ React.createElement("button", { className: 'button', onClick: this.openDisqusPage.bind(this, syncToken, DISQUS_LOGIN_URL + "?next=" + encodeURIComponent(DISQUS_WORDPRESS_URL)) }, "WordPress installation page")),
27211
+ React.createElement("li", null,
27212
+ "If needed, copy the sync token below and paste it to the input field in the installation page",
27213
+ React.createElement("br", null),
27214
+ React.createElement("input", { id: SYNCTOKEN_INPUT_ID, type: 'text', value: syncToken, className: 'regular-text', readOnly: true }),
27215
+ React.createElement("button", { className: 'button', onClick: this.props.onCopyText.bind(null, SYNCTOKEN_INPUT_ID) }, "Copy")),
27216
+ React.createElement("li", null, "Click the Install button and finish configuring your Disqus settings")));
27217
+ case AdminState_1.InstallationState.hasSite:
27218
+ return (React.createElement("ol", { className: 'dsq-installation__instruction-list' },
27219
+ React.createElement("li", null,
27220
+ "Go to the WordPress installation page",
27221
+ React.createElement("br", null),
27222
+ React.createElement("button", { className: 'button button-primary button-large', onClick: this.openDisqusPage.bind(this, syncToken, DISQUS_LOGIN_URL + "?next=" + encodeURIComponent(DISQUS_WORDPRESS_URL)) }, "WordPress installation page")),
27223
+ React.createElement("li", null, "When prompted, choose the Disqus site you want to use"),
27224
+ React.createElement("li", null,
27225
+ "If needed, copy the sync token below and paste it to the input field in the installation page",
27226
+ React.createElement("br", null),
27227
+ React.createElement("input", { id: SYNCTOKEN_INPUT_ID, type: 'text', value: syncToken, className: 'regular-text', readOnly: true }),
27228
+ React.createElement("button", { className: 'button', onClick: this.props.onCopyText.bind(null, SYNCTOKEN_INPUT_ID) }, "Copy")),
27229
+ React.createElement("li", null, "Click the Install button and finish configuring your Disqus settings")));
27230
+ case AdminState_1.InstallationState.noSite:
27231
+ return (React.createElement("ol", { className: 'dsq-installation__instruction-list' },
27232
+ React.createElement("li", null,
27233
+ "Create a new site on Disqus",
27234
+ React.createElement("br", null),
27235
+ React.createElement("button", { className: 'button button-primary button-large', onClick: this.openDisqusPage.bind(this, syncToken, DISQUS_LOGIN_URL + "?next=" + encodeURIComponent(DISQUS_CREATE_URL)) }, "Create site")),
27236
+ React.createElement("li", null,
27237
+ "After creating the site, go to the WordPress installation page to finish.",
27238
+ React.createElement("br", null),
27239
+ React.createElement("button", { className: 'button', onClick: this.openDisqusPage.bind(this, syncToken, DISQUS_LOGIN_URL + "?next=" + encodeURIComponent(DISQUS_WORDPRESS_URL)) }, "WordPress installation page")),
27240
+ React.createElement("li", null,
27241
+ "If needed, copy the sync token below and paste it to the input field in the installation page",
27242
+ React.createElement("br", null),
27243
+ React.createElement("input", { id: SYNCTOKEN_INPUT_ID, type: 'text', value: syncToken, className: 'regular-text', readOnly: true }),
27244
+ React.createElement("button", { className: 'button', onClick: this.props.onCopyText.bind(null, SYNCTOKEN_INPUT_ID) },