@mjhls/mjh-framework 1.0.864 → 1.0.866-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +9 -10
  3. package/dist/cjs/AD300x250.js +28 -30
  4. package/dist/cjs/AD300x250x600.js +28 -30
  5. package/dist/cjs/AD728x90.js +31 -33
  6. package/dist/cjs/ADFloatingFooter.js +30 -32
  7. package/dist/cjs/ADFooter.js +12 -15
  8. package/dist/cjs/ADGutter.js +30 -32
  9. package/dist/cjs/{ADInfeed-f8324b70.js → ADInfeed-7c09edba.js} +13 -15
  10. package/dist/cjs/ADSkyscraper.js +30 -32
  11. package/dist/cjs/ADSponsoredResources.js +30 -32
  12. package/dist/cjs/ADWebcast.js +30 -32
  13. package/dist/cjs/ADWelcome.js +31 -33
  14. package/dist/cjs/{ADlgInfeed-98d7c699.js → ADlgInfeed-2e7effc7.js} +10 -11
  15. package/dist/cjs/AccordionPanel.js +27 -31
  16. package/dist/cjs/AdSlot.js +33 -35
  17. package/dist/cjs/AdSlotsProvider.js +910 -20
  18. package/dist/cjs/AlgoliaSearch.js +14023 -60
  19. package/dist/cjs/AlphabeticList.js +23 -26
  20. package/dist/cjs/ArticleCarousel.js +19 -25
  21. package/dist/cjs/ArticleProgramLandingPage.js +60 -62
  22. package/dist/cjs/ArticleSeriesLandingPage.js +41 -43
  23. package/dist/cjs/ArticleSeriesListing.js +60 -62
  24. package/dist/cjs/Auth.js +1504 -682
  25. package/dist/cjs/AuthWrapper.js +266 -310
  26. package/dist/cjs/{AuthorComponent-c21aac7f.js → AuthorComponent-02e827ae.js} +13 -14
  27. package/dist/cjs/Beam.js +6 -8
  28. package/dist/cjs/{BlockContent-36e54d77.js → BlockContent-091a991f.js} +55 -56
  29. package/dist/cjs/Breadcrumbs.js +25 -29
  30. package/dist/cjs/CMEDeck.js +82 -83
  31. package/dist/cjs/Column1.js +11 -14
  32. package/dist/cjs/Column2.js +31 -36
  33. package/dist/cjs/Column3.js +57 -61
  34. package/dist/cjs/ConferenceArticleCard.js +25 -23
  35. package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
  36. package/dist/cjs/DeckContent.js +94 -99
  37. package/dist/cjs/DeckQueue.js +88 -92
  38. package/dist/cjs/{Dfp-3f0ed4c8.js → Dfp-14d2455c.js} +32 -34
  39. package/dist/cjs/EventsDeck.js +134 -143
  40. package/dist/cjs/ExternalResources.js +78 -80
  41. package/dist/cjs/Feature.js +27 -26
  42. package/dist/cjs/ForbesHero.js +40 -43
  43. package/dist/cjs/GridContent.js +232 -238
  44. package/dist/cjs/GridHero.js +42 -45
  45. package/dist/cjs/GroupDeck.js +57 -60
  46. package/dist/cjs/HamMagazine.js +130 -137
  47. package/dist/cjs/Header.js +12 -14
  48. package/dist/cjs/Hero.js +15 -13
  49. package/dist/cjs/HighlightenVideo.js +17 -18
  50. package/dist/cjs/HorizontalArticleListing.js +70 -72
  51. package/dist/cjs/HorizontalHero.js +28 -26
  52. package/dist/cjs/IssueContentDeck.js +71 -78
  53. package/dist/cjs/IssueDeck.js +70 -77
  54. package/dist/cjs/IssueLanding.js +65 -67
  55. package/dist/cjs/LeftNav.js +37 -40
  56. package/dist/cjs/MasterDeck.js +70 -72
  57. package/dist/cjs/MediaSeriesLanding.js +1093 -1186
  58. package/dist/cjs/NavDvm.js +72 -79
  59. package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
  60. package/dist/cjs/NavMagazine.js +136 -143
  61. package/dist/cjs/NavNative.js +128 -138
  62. package/dist/cjs/OncliveHero.js +22 -19
  63. package/dist/cjs/OncliveLargeHero.js +70 -73
  64. package/dist/cjs/PageFilter.js +12 -15
  65. package/dist/cjs/PartnerDetailListing.js +3917 -118
  66. package/dist/cjs/PdfDownload.js +9 -10
  67. package/dist/cjs/PopUpModal.js +17 -21
  68. package/dist/cjs/PubSection.js +41 -43
  69. package/dist/cjs/PubToc.js +13 -16
  70. package/dist/cjs/PublicationDeck.js +65 -67
  71. package/dist/cjs/PublicationLanding.js +129 -135
  72. package/dist/cjs/QueueDeckExpanded.js +309 -310
  73. package/dist/cjs/RecentNews.js +22 -23
  74. package/dist/cjs/RelatedContent.js +29 -27
  75. package/dist/cjs/RelatedTopicsDropdown.js +19 -22
  76. package/dist/cjs/RolesDeck.js +27 -32
  77. package/dist/cjs/Search.js +16 -22
  78. package/dist/cjs/Segment.js +4 -6
  79. package/dist/cjs/SeriesListingDeck.js +37 -38
  80. package/dist/cjs/{SeriesSlider-e3e8ead7.js → SeriesSlider-49b81b0b.js} +35 -36
  81. package/dist/cjs/SetCookie.js +1 -1
  82. package/dist/cjs/SideFooter.js +34 -37
  83. package/dist/cjs/SocialIcons.js +9 -10
  84. package/dist/cjs/{SocialSearchComponent-948138c7.js → SocialSearchComponent-650f6101.js} +36 -40
  85. package/dist/cjs/SocialShare.js +29 -31
  86. package/dist/cjs/TaxonomyCard.js +61 -64
  87. package/dist/cjs/TaxonomyDescription.js +53 -55
  88. package/dist/cjs/TemplateNormal.js +72 -74
  89. package/dist/cjs/ThumbnailCard.js +24 -23
  90. package/dist/cjs/Ustream.js +28 -31
  91. package/dist/cjs/VerticalHero.js +19 -17
  92. package/dist/cjs/VideoProgramLandingPage.js +74 -79
  93. package/dist/cjs/VideoSeriesCard.js +31 -32
  94. package/dist/cjs/VideoSeriesFilter.js +16 -18
  95. package/dist/cjs/VideoSeriesLandingPage.js +50 -52
  96. package/dist/cjs/VideoSeriesListing.js +77 -79
  97. package/dist/cjs/View.js +281 -284
  98. package/dist/cjs/YahooHero.js +39 -42
  99. package/dist/cjs/YoutubeGroup.js +73 -82
  100. package/dist/cjs/{_is-array-6128bd56.js → _is-array-aa52fa1e.js} +14 -14
  101. package/dist/cjs/{_iter-detect-55a5657a.js → _iter-detect-05795553.js} +9 -10
  102. package/dist/cjs/{_object-pie-083f2dd6.js → _object-pie-68c5bcbc.js} +4 -4
  103. package/dist/cjs/_object-sap-171b9ea5.js +16 -0
  104. package/dist/cjs/{_object-to-array-8fe5a54f.js → _object-to-array-9bac8737.js} +5 -5
  105. package/dist/cjs/{asyncToGenerator-58c289d9.js → asyncToGenerator-df19209d.js} +82 -84
  106. package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-156bd4d6.js} +9 -11
  107. package/dist/cjs/{_to-object-6de10e57.js → core.get-iterator-method-f3c44602.js} +247 -11
  108. package/dist/cjs/{debounce-d4a2369b.js → debounce-529c8d06.js} +2 -2
  109. package/dist/cjs/define-property-21887c62.js +20 -0
  110. package/dist/cjs/{defineProperty-0cb76d99.js → defineProperty-77a37684.js} +1 -1
  111. package/dist/cjs/{entities-3f9d0f2f.js → entities-310b46ee.js} +1 -1
  112. package/dist/cjs/{eq-5fc26c07.js → eq-bb2843ed.js} +1 -1
  113. package/dist/cjs/events-1b438fe7.js +469 -0
  114. package/dist/cjs/{extends-29bdbc6d.js → extends-eed4f016.js} +13 -13
  115. package/dist/cjs/faundadb.js +19 -21
  116. package/dist/cjs/{get-5839e5b5.js → get-adbb11e3.js} +21 -21
  117. package/dist/cjs/getQuery.js +2 -2
  118. package/dist/cjs/getRelatedArticle.js +18 -20
  119. package/dist/cjs/getRootDocGroup.js +6 -8
  120. package/dist/cjs/getSerializers.js +44 -45
  121. package/dist/cjs/{getTargeting-32d1c2e4.js → getTargeting-8874437b.js} +3 -3
  122. package/dist/cjs/getTargeting.js +6 -8
  123. package/dist/{esm/iconBase-ccc56b97.js → cjs/iconBase-68959171.js} +8 -2
  124. package/dist/cjs/{index-f86bb269.js → index-3294d3bc.js} +45 -44
  125. package/dist/cjs/{index-32097c80.js → index-59af05c4.js} +1089 -1094
  126. package/dist/cjs/{index-eadd5035.js → index-96b3db50.js} +15 -17
  127. package/dist/cjs/{index-0e4427c8.js → index-98e01cb9.js} +13 -479
  128. package/dist/cjs/{index-efca863c.js → index-be0c82be.js} +30 -36
  129. package/dist/cjs/index-e2e62963.js +89 -0
  130. package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
  131. package/dist/cjs/{index.esm-2bb721c8.js → index.esm-4d410430.js} +21 -21
  132. package/dist/cjs/{index.esm-00a6aade.js → index.esm-90433435.js} +16 -7
  133. package/dist/cjs/{index.esm-c1e16606.js → index.esm-e32d3e8e.js} +7 -4
  134. package/dist/cjs/{index.esm-f27f80d9.js → index.esm-ff47db6f.js} +13 -6
  135. package/dist/cjs/index.js +164 -171
  136. package/dist/cjs/inherits-8d29278d.js +110 -0
  137. package/dist/cjs/{inherits-c2065b95.js → inherits-cba9c846.js} +26 -27
  138. package/dist/cjs/{isSymbol-03abbdf0.js → isSymbol-04666465.js} +15 -15
  139. package/dist/cjs/keys-d207942e.js +25 -0
  140. package/dist/cjs/{lodash-f0783643.js → lodash-fc2922d0.js} +31 -128
  141. package/dist/cjs/main-02daeefe.js +862 -0
  142. package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
  143. package/dist/cjs/{moment-aca40de1.js → moment-575fe24c.js} +9 -11
  144. package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-f7f48f71.js} +27 -28
  145. package/dist/cjs/{slicedToArray-5d1bc3b3.js → slicedToArray-f6d4eaa8.js} +17 -19
  146. package/dist/cjs/{smoothscroll-99df7f93.js → smoothscroll-5054361f.js} +1 -1
  147. package/dist/cjs/stringify-bbc68047.js +17 -0
  148. package/dist/cjs/timeDifferenceCalc.js +1 -1
  149. package/dist/cjs/{toConsumableArray-ddb70795.js → toConsumableArray-c9b8a0d0.js} +12 -14
  150. package/dist/cjs/{toNumber-5e1fac58.js → toNumber-36d1e7e5.js} +5 -40
  151. package/dist/cjs/{typeof-88a668c5.js → typeof-5f52cf64.js} +97 -98
  152. package/dist/cjs/urlFor.js +21 -4
  153. package/dist/cjs/{ustream-api-b2b9092f.js → ustream-api-9ebe112f.js} +4 -4
  154. package/dist/cjs/{util-6f784d85.js → util-f2c1b65b.js} +1 -1
  155. package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
  156. package/dist/cjs/{web.dom.iterable-46657b5c.js → web.dom.iterable-e34bf324.js} +8 -9
  157. package/dist/esm/AD.js +1 -1
  158. package/dist/esm/AD300x250.js +22 -23
  159. package/dist/esm/AD300x250x600.js +22 -23
  160. package/dist/esm/AD728x90.js +25 -26
  161. package/dist/esm/ADFloatingFooter.js +21 -22
  162. package/dist/esm/ADFooter.js +4 -6
  163. package/dist/esm/ADGutter.js +21 -22
  164. package/dist/esm/{ADInfeed-a71a3972.js → ADInfeed-bfd129d9.js} +6 -6
  165. package/dist/esm/ADSkyscraper.js +21 -22
  166. package/dist/esm/ADSponsoredResources.js +21 -22
  167. package/dist/esm/ADWebcast.js +21 -22
  168. package/dist/esm/ADWelcome.js +18 -19
  169. package/dist/esm/{ADlgInfeed-d94f1437.js → ADlgInfeed-0489335b.js} +4 -4
  170. package/dist/esm/AccordionPanel.js +6 -8
  171. package/dist/esm/AdSlot.js +22 -23
  172. package/dist/esm/AdSlotsProvider.js +907 -16
  173. package/dist/esm/AlgoliaSearch.js +13993 -29
  174. package/dist/esm/AlphabeticList.js +8 -10
  175. package/dist/esm/ArticleCarousel.js +13 -18
  176. package/dist/esm/ArticleProgramLandingPage.js +48 -49
  177. package/dist/esm/ArticleSeriesLandingPage.js +31 -32
  178. package/dist/esm/ArticleSeriesListing.js +33 -34
  179. package/dist/esm/Auth.js +1418 -592
  180. package/dist/esm/AuthWrapper.js +244 -287
  181. package/dist/esm/{AuthorComponent-30aeba69.js → AuthorComponent-e6f95c2f.js} +1 -1
  182. package/dist/esm/Beam.js +6 -8
  183. package/dist/esm/{BlockContent-c99c9a8d.js → BlockContent-e9b4ddcf.js} +34 -34
  184. package/dist/esm/Breadcrumbs.js +5 -7
  185. package/dist/esm/CMEDeck.js +23 -24
  186. package/dist/esm/Column1.js +4 -4
  187. package/dist/esm/Column2.js +19 -21
  188. package/dist/esm/Column3.js +37 -38
  189. package/dist/esm/ConferenceArticleCard.js +10 -7
  190. package/dist/esm/DeckContent.js +48 -49
  191. package/dist/esm/DeckQueue.js +48 -48
  192. package/dist/esm/{Dfp-be030f2a.js → Dfp-f867d061.js} +13 -14
  193. package/dist/esm/EventsDeck.js +48 -50
  194. package/dist/esm/ExternalResources.js +46 -47
  195. package/dist/esm/Feature.js +7 -4
  196. package/dist/esm/ForbesHero.js +10 -12
  197. package/dist/esm/GridContent.js +89 -90
  198. package/dist/esm/GridHero.js +11 -13
  199. package/dist/esm/GroupDeck.js +12 -14
  200. package/dist/esm/HamMagazine.js +28 -30
  201. package/dist/esm/Hero.js +7 -4
  202. package/dist/esm/HighlightenVideo.js +2 -2
  203. package/dist/esm/HorizontalArticleListing.js +45 -46
  204. package/dist/esm/HorizontalHero.js +8 -5
  205. package/dist/esm/IssueContentDeck.js +25 -27
  206. package/dist/esm/IssueDeck.js +35 -37
  207. package/dist/esm/IssueLanding.js +54 -55
  208. package/dist/esm/LeftNav.js +20 -21
  209. package/dist/esm/MasterDeck.js +35 -36
  210. package/dist/esm/MediaSeriesLanding.js +643 -733
  211. package/dist/esm/NavDvm.js +14 -16
  212. package/dist/esm/NavMagazine.js +32 -34
  213. package/dist/esm/NavNative.js +32 -34
  214. package/dist/esm/OncliveHero.js +8 -4
  215. package/dist/esm/OncliveLargeHero.js +11 -13
  216. package/dist/esm/PageFilter.js +4 -6
  217. package/dist/esm/PartnerDetailListing.js +3863 -64
  218. package/dist/esm/PdfDownload.js +2 -2
  219. package/dist/esm/PopUpModal.js +4 -6
  220. package/dist/esm/PubSection.js +33 -34
  221. package/dist/esm/PubToc.js +6 -8
  222. package/dist/esm/PublicationDeck.js +27 -24
  223. package/dist/esm/PublicationLanding.js +47 -49
  224. package/dist/esm/QueueDeckExpanded.js +37 -38
  225. package/dist/esm/RecentNews.js +4 -4
  226. package/dist/esm/RelatedContent.js +10 -7
  227. package/dist/esm/RolesDeck.js +12 -12
  228. package/dist/esm/Search.js +6 -8
  229. package/dist/esm/Segment.js +4 -6
  230. package/dist/esm/SeriesListingDeck.js +19 -20
  231. package/dist/esm/{SeriesSlider-ae17159f.js → SeriesSlider-d555a1d2.js} +10 -10
  232. package/dist/esm/SetCookie.js +1 -1
  233. package/dist/esm/SideFooter.js +13 -15
  234. package/dist/esm/{SocialSearchComponent-db963c3e.js → SocialSearchComponent-d7dec0c2.js} +12 -12
  235. package/dist/esm/TaxonomyCard.js +27 -25
  236. package/dist/esm/TaxonomyDescription.js +44 -45
  237. package/dist/esm/TemplateNormal.js +48 -49
  238. package/dist/esm/ThumbnailCard.js +10 -7
  239. package/dist/esm/Ustream.js +12 -14
  240. package/dist/esm/VerticalHero.js +6 -3
  241. package/dist/esm/VideoProgramLandingPage.js +52 -53
  242. package/dist/esm/VideoSeriesCard.js +13 -13
  243. package/dist/esm/VideoSeriesFilter.js +7 -9
  244. package/dist/esm/VideoSeriesLandingPage.js +37 -38
  245. package/dist/esm/VideoSeriesListing.js +34 -35
  246. package/dist/esm/View.js +109 -108
  247. package/dist/esm/YahooHero.js +13 -15
  248. package/dist/esm/YoutubeGroup.js +35 -43
  249. package/dist/esm/{_is-array-3e99e06e.js → _is-array-4df618a6.js} +6 -6
  250. package/dist/esm/{_iter-detect-7e5e5ce2.js → _iter-detect-130ee549.js} +7 -8
  251. package/dist/esm/{_object-pie-133f504a.js → _object-pie-33c40e79.js} +4 -4
  252. package/dist/esm/{_object-sap-f353c2a9.js → _object-sap-8b8ea5a9.js} +1 -1
  253. package/dist/esm/{_object-to-array-0f197f89.js → _object-to-array-c54dd835.js} +2 -2
  254. package/dist/esm/{asyncToGenerator-7f8f9219.js → asyncToGenerator-7bf8bc4d.js} +30 -32
  255. package/dist/esm/{brightcove-react-player-loader.es-57a70a56.js → brightcove-react-player-loader.es-83f53e4e.js} +4 -5
  256. package/dist/esm/{_to-object-b50e61c3.js → core.get-iterator-method-86d4db69.js} +238 -9
  257. package/dist/esm/{debounce-533d9748.js → debounce-9207d8ee.js} +2 -2
  258. package/dist/esm/define-property-6d26cb48.js +18 -0
  259. package/dist/esm/{defineProperty-f5ff6f5a.js → defineProperty-d7d9b577.js} +1 -1
  260. package/dist/esm/{entities-932b50cf.js → entities-7cc3bf45.js} +1 -1
  261. package/dist/esm/{eq-bdcbf886.js → eq-b470f743.js} +1 -1
  262. package/dist/esm/events-6c3a7a63.js +467 -0
  263. package/dist/esm/{extends-60e0e1c6.js → extends-5b1796d4.js} +7 -7
  264. package/dist/esm/faundadb.js +5 -7
  265. package/dist/esm/{get-3c308da4.js → get-1e515072.js} +21 -21
  266. package/dist/esm/getQuery.js +2 -2
  267. package/dist/esm/getRelatedArticle.js +12 -14
  268. package/dist/esm/getRootDocGroup.js +4 -6
  269. package/dist/esm/getSerializers.js +44 -45
  270. package/dist/esm/{getTargeting-cf2724e3.js → getTargeting-277c801e.js} +2 -2
  271. package/dist/esm/getTargeting.js +6 -8
  272. package/dist/{cjs/iconBase-be4097c0.js → esm/iconBase-602d52fe.js} +8 -33
  273. package/dist/esm/{index-5cc7b406.js → index-41a678ea.js} +4 -469
  274. package/dist/esm/{index-755f2cc2.js → index-5f7e79e7.js} +6 -6
  275. package/dist/esm/{index-0dbff1d1.js → index-73819142.js} +30 -36
  276. package/dist/esm/index-aaa2dae0.js +85 -0
  277. package/dist/esm/{index-79cfd25c.js → index-ef6d5dcf.js} +45 -44
  278. package/dist/esm/{index-5e84f9cd.js → index-efc23b2b.js} +664 -659
  279. package/dist/esm/{index.es-a6137319.js → index.es-29c1cef5.js} +5 -23
  280. package/dist/esm/{index.esm-f6156a57.js → index.esm-29e48d38.js} +16 -7
  281. package/dist/esm/{index.esm-d4932dea.js → index.esm-cf08bf18.js} +13 -6
  282. package/dist/esm/{index.esm-9b042655.js → index.esm-f8aaeeeb.js} +7 -4
  283. package/dist/esm/{index.esm-37268dca.js → index.esm-fd746768.js} +5 -4
  284. package/dist/esm/index.js +122 -126
  285. package/dist/esm/{inherits-a41fe93f.js → inherits-2409637d.js} +18 -19
  286. package/dist/esm/inherits-77d5e4fc.js +101 -0
  287. package/dist/esm/{isSymbol-a7e9aafe.js → isSymbol-1981418f.js} +15 -15
  288. package/dist/esm/keys-69989821.js +23 -0
  289. package/dist/esm/{lodash-f97fd99a.js → lodash-17fdfebb.js} +31 -128
  290. package/dist/esm/main-e4a934b2.js +851 -0
  291. package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
  292. package/dist/esm/{moment-bc12cb97.js → moment-e2f9b20c.js} +9 -11
  293. package/dist/esm/{react-social-icons-9be47857.js → react-social-icons-a7d5c5c7.js} +16 -16
  294. package/dist/esm/{slicedToArray-be2f7a22.js → slicedToArray-67a08c9c.js} +12 -14
  295. package/dist/esm/{smoothscroll-fa4e3f8c.js → smoothscroll-0cd4c7a6.js} +1 -1
  296. package/dist/esm/stringify-70b72959.js +15 -0
  297. package/dist/esm/timeDifferenceCalc.js +1 -1
  298. package/dist/esm/{toConsumableArray-6d9a4616.js → toConsumableArray-32282905.js} +7 -9
  299. package/dist/esm/{toNumber-5aeba6e7.js → toNumber-2f7a84cd.js} +5 -40
  300. package/dist/esm/{typeof-a286cf0c.js → typeof-c05a82ba.js} +35 -36
  301. package/dist/esm/urlFor.js +19 -2
  302. package/dist/esm/{ustream-api-33a866b6.js → ustream-api-4c4fe0ba.js} +4 -4
  303. package/dist/esm/{util-3ab476bf.js → util-7700fc59.js} +1 -1
  304. package/dist/esm/{web.dom.iterable-4109ff68.js → web.dom.iterable-f8f967cd.js} +2 -3
  305. package/package.json +1 -1
  306. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
  307. package/dist/cjs/_object-sap-a175b4a9.js +0 -16
  308. package/dist/cjs/core.get-iterator-method-f474eacc.js +0 -39
  309. package/dist/cjs/define-property-c88be878.js +0 -20
  310. package/dist/cjs/es6.string.iterator-c2573ffd.js +0 -210
  311. package/dist/cjs/keys-7f2c2108.js +0 -25
  312. package/dist/cjs/main-f1c77adb.js +0 -973
  313. package/dist/cjs/stringify-c9ac1214.js +0 -17
  314. package/dist/esm/core.get-iterator-method-133dfacd.js +0 -36
  315. package/dist/esm/define-property-fe54dc9f.js +0 -18
  316. package/dist/esm/es6.string.iterator-bc33758b.js +0 -201
  317. package/dist/esm/keys-7a3adabf.js +0 -23
  318. package/dist/esm/main-d4165069.js +0 -961
  319. package/dist/esm/stringify-59c8f690.js +0 -15
package/dist/cjs/Auth.js CHANGED
@@ -2,35 +2,28 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var asyncToGenerator = require('./asyncToGenerator-58c289d9.js');
6
- var stringify = require('./stringify-c9ac1214.js');
7
- var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
8
+ require('./core.get-iterator-method-f3c44602.js');
9
+ require('./_library-dd23b178.js');
10
+ require('./_iter-detect-05795553.js');
11
+ require('./_object-pie-68c5bcbc.js');
12
+ var _extends$1 = require('./extends-eed4f016.js');
13
+ require('./web.dom.iterable-e34bf324.js');
8
14
  var React = require('react');
15
+ var React__default = _interopDefault(React);
9
16
  var Router = require('next/router');
10
- var _extends = require('./extends-29bdbc6d.js');
17
+ var Router__default = _interopDefault(Router);
18
+ var slicedToArray = require('./slicedToArray-f6d4eaa8.js');
19
+ var stringify = require('./stringify-bbc68047.js');
20
+ var asyncToGenerator = require('./asyncToGenerator-df19209d.js');
11
21
  var reactBootstrap = require('react-bootstrap');
12
- var useSWR = require('swr');
13
- var index = require('./index-bd6c9f56.js');
14
- var Local = require('passport-local');
15
- var mysql = require('mysql');
16
- var util = require('./util-6f784d85.js');
17
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
18
- var md5 = require('./md5-e1ca5797.js');
19
- require('./es6.string.iterator-c2573ffd.js');
20
- require('./_to-object-6de10e57.js');
21
- require('./web.dom.iterable-46657b5c.js');
22
- require('./_library-dd23b178.js');
23
- require('./core.get-iterator-method-f474eacc.js');
24
- require('./_iter-detect-55a5657a.js');
25
- require('./_object-pie-083f2dd6.js');
26
-
27
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
28
-
29
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
30
- var Router__default = /*#__PURE__*/_interopDefaultLegacy(Router);
31
- var useSWR__default = /*#__PURE__*/_interopDefaultLegacy(useSWR);
32
- var Local__default = /*#__PURE__*/_interopDefaultLegacy(Local);
33
- var mysql__default = /*#__PURE__*/_interopDefaultLegacy(mysql);
22
+ var util = require('./util-f2c1b65b.js');
23
+ var index$6 = require('./index-bd6c9f56.js');
24
+ var Local = _interopDefault(require('passport-local'));
25
+ var mysql = _interopDefault(require('mysql'));
26
+ var md5 = require('./md5-5039b1a6.js');
34
27
 
35
28
  var returnFormField = function returnFormField(_ref) {
36
29
  var name = _ref.name,
@@ -69,21 +62,21 @@ var returnFormField = function returnFormField(_ref) {
69
62
  }
70
63
 
71
64
  if (type == 'text' || type == 'email' || type == 'password' || type == 'number') {
72
- return React__default['default'].createElement(
65
+ return React__default.createElement(
73
66
  reactBootstrap.Form.Group,
74
- _extends._extends({}, opts, { controlId: name }),
75
- React__default['default'].createElement(
67
+ _extends$1._extends({}, opts, { controlId: name }),
68
+ React__default.createElement(
76
69
  reactBootstrap.Form.Label,
77
70
  { kye: name + '_label' },
78
71
  label,
79
- required && React__default['default'].createElement(
72
+ required && React__default.createElement(
80
73
  'span',
81
74
  { style: { color: 'red' } },
82
75
  '*'
83
76
  )
84
77
  ),
85
- React__default['default'].createElement(reactBootstrap.Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
86
- React__default['default'].createElement(
78
+ React__default.createElement(reactBootstrap.Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
79
+ React__default.createElement(
87
80
  reactBootstrap.Form.Control.Feedback,
88
81
  { key: name + '_feedback', type: 'invalid' },
89
82
  errors[name]
@@ -91,28 +84,28 @@ var returnFormField = function returnFormField(_ref) {
91
84
  );
92
85
  }
93
86
  if (type == 'select') {
94
- return React__default['default'].createElement(
87
+ return React__default.createElement(
95
88
  reactBootstrap.Form.Group,
96
- _extends._extends({}, opts, { key: name, controlId: name }),
97
- React__default['default'].createElement(
89
+ _extends$1._extends({}, opts, { key: name, controlId: name }),
90
+ React__default.createElement(
98
91
  reactBootstrap.Form.Label,
99
92
  { key: name + '_' + label },
100
93
  label,
101
- required && React__default['default'].createElement(
94
+ required && React__default.createElement(
102
95
  'span',
103
96
  { key: name + '_required_span', style: { color: 'red' } },
104
97
  '*'
105
98
  )
106
99
  ),
107
- React__default['default'].createElement(
100
+ React__default.createElement(
108
101
  reactBootstrap.Form.Control,
109
102
  { key: name + '_select', as: 'select', name: name, required: required, defaultValue: default_value },
110
- React__default['default'].createElement('option', { value: '', key: name + '_options_empty' }),
103
+ React__default.createElement('option', { value: '', key: name + '_options_empty' }),
111
104
  options.map(function (option, index) {
112
105
  var value = option.value ? option.value : option;
113
106
  var label = option.label ? option.label : option;
114
107
  var key = name + '_options_' + index;
115
- return React__default['default'].createElement(
108
+ return React__default.createElement(
116
109
  'option',
117
110
  { key: key, value: value },
118
111
  label
@@ -123,32 +116,1081 @@ var returnFormField = function returnFormField(_ref) {
123
116
  }
124
117
 
125
118
  if (type == 'radio' || type == 'checkbox') {
126
- return React__default['default'].createElement(
119
+ return React__default.createElement(
127
120
  reactBootstrap.Form.Group,
128
121
  opts,
129
- React__default['default'].createElement(
122
+ React__default.createElement(
130
123
  reactBootstrap.Form.Label,
131
124
  null,
132
125
  label,
133
- required && React__default['default'].createElement(
126
+ required && React__default.createElement(
134
127
  'span',
135
128
  { style: { color: 'red' } },
136
129
  '*'
137
130
  )
138
131
  ),
139
132
  options.map(function (option, index) {
140
- return React__default['default'].createElement(
133
+ return React__default.createElement(
141
134
  reactBootstrap.Form.Check,
142
135
  { type: type, key: index, required: required },
143
- React__default['default'].createElement(reactBootstrap.Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
144
- React__default['default'].createElement(reactBootstrap.Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
136
+ React__default.createElement(reactBootstrap.Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
137
+ React__default.createElement(reactBootstrap.Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
145
138
  );
146
139
  })
147
140
  );
148
141
  }
149
142
  };
150
143
 
151
- var _this$4 = undefined;
144
+ var has = Object.prototype.hasOwnProperty;
145
+
146
+ function dequal(foo, bar) {
147
+ var ctor, len;
148
+ if (foo === bar) return true;
149
+
150
+ if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
151
+ if (ctor === Date) return foo.getTime() === bar.getTime();
152
+ if (ctor === RegExp) return foo.toString() === bar.toString();
153
+
154
+ if (ctor === Array) {
155
+ if ((len=foo.length) === bar.length) {
156
+ while (len-- && dequal(foo[len], bar[len]));
157
+ }
158
+ return len === -1;
159
+ }
160
+
161
+ if (!ctor || typeof foo === 'object') {
162
+ len = 0;
163
+ for (ctor in foo) {
164
+ if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
165
+ if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
166
+ }
167
+ return Object.keys(bar).length === len;
168
+ }
169
+ }
170
+
171
+ return foo !== foo && bar !== bar;
172
+ }
173
+
174
+ // use WeakMap to store the object->key mapping
175
+ // so the objects can be garbage collected.
176
+ // WeakMap uses a hashtable under the hood, so the lookup
177
+ // complexity is almost O(1).
178
+ var table = new WeakMap();
179
+ // counter of the key
180
+ var counter = 0;
181
+ // hashes an array of objects and returns a string
182
+ function hash(args) {
183
+ if (!args.length)
184
+ return '';
185
+ var key = 'arg';
186
+ for (var i = 0; i < args.length; ++i) {
187
+ if (args[i] === null) {
188
+ key += '@null';
189
+ continue;
190
+ }
191
+ var _hash = void 0;
192
+ if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
193
+ // need to consider the case that args[i] is a string:
194
+ // args[i] _hash
195
+ // "undefined" -> '"undefined"'
196
+ // undefined -> 'undefined'
197
+ // 123 -> '123'
198
+ // "null" -> '"null"'
199
+ if (typeof args[i] === 'string') {
200
+ _hash = '"' + args[i] + '"';
201
+ }
202
+ else {
203
+ _hash = String(args[i]);
204
+ }
205
+ }
206
+ else {
207
+ if (!table.has(args[i])) {
208
+ _hash = counter;
209
+ table.set(args[i], counter++);
210
+ }
211
+ else {
212
+ _hash = table.get(args[i]);
213
+ }
214
+ }
215
+ key += '@' + _hash;
216
+ }
217
+ return key;
218
+ }
219
+
220
+ var Cache = /** @class */ (function () {
221
+ function Cache(initialData) {
222
+ if (initialData === void 0) { initialData = {}; }
223
+ this.cache = new Map(Object.entries(initialData));
224
+ this.subs = [];
225
+ }
226
+ Cache.prototype.get = function (key) {
227
+ var _key = this.serializeKey(key)[0];
228
+ return this.cache.get(_key);
229
+ };
230
+ Cache.prototype.set = function (key, value) {
231
+ var _key = this.serializeKey(key)[0];
232
+ this.cache.set(_key, value);
233
+ this.notify();
234
+ };
235
+ Cache.prototype.keys = function () {
236
+ return Array.from(this.cache.keys());
237
+ };
238
+ Cache.prototype.has = function (key) {
239
+ var _key = this.serializeKey(key)[0];
240
+ return this.cache.has(_key);
241
+ };
242
+ Cache.prototype.clear = function () {
243
+ this.cache.clear();
244
+ this.notify();
245
+ };
246
+ Cache.prototype.delete = function (key) {
247
+ var _key = this.serializeKey(key)[0];
248
+ this.cache.delete(_key);
249
+ this.notify();
250
+ };
251
+ // TODO: introduce namespace for the cache
252
+ Cache.prototype.serializeKey = function (key) {
253
+ var args = null;
254
+ if (typeof key === 'function') {
255
+ try {
256
+ key = key();
257
+ }
258
+ catch (err) {
259
+ // dependencies not ready
260
+ key = '';
261
+ }
262
+ }
263
+ if (Array.isArray(key)) {
264
+ // args array
265
+ args = key;
266
+ key = hash(key);
267
+ }
268
+ else {
269
+ // convert null to ''
270
+ key = String(key || '');
271
+ }
272
+ var errorKey = key ? 'err@' + key : '';
273
+ var isValidatingKey = key ? 'validating@' + key : '';
274
+ return [key, args, errorKey, isValidatingKey];
275
+ };
276
+ Cache.prototype.subscribe = function (listener) {
277
+ var _this = this;
278
+ if (typeof listener !== 'function') {
279
+ throw new Error('Expected the listener to be a function.');
280
+ }
281
+ var isSubscribed = true;
282
+ this.subs.push(listener);
283
+ return function () {
284
+ if (!isSubscribed)
285
+ return;
286
+ isSubscribed = false;
287
+ var index = _this.subs.indexOf(listener);
288
+ if (index > -1) {
289
+ _this.subs[index] = _this.subs[_this.subs.length - 1];
290
+ _this.subs.length--;
291
+ }
292
+ };
293
+ };
294
+ // Notify Cache subscribers about a change in the cache
295
+ Cache.prototype.notify = function () {
296
+ for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
297
+ var listener = _a[_i];
298
+ listener();
299
+ }
300
+ };
301
+ return Cache;
302
+ }());
303
+
304
+ /**
305
+ * Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
306
+ * it's not reliable to detect if the browser is currently online or offline
307
+ * based on `navigator.onLine`.
308
+ * As a work around, we always assume it's online on first load, and change
309
+ * the status upon `online` or `offline` events.
310
+ */
311
+ var online = true;
312
+ var isOnline = function () { return online; };
313
+ var isDocumentVisible = function () {
314
+ if (typeof document !== 'undefined' &&
315
+ document.visibilityState !== undefined) {
316
+ return document.visibilityState !== 'hidden';
317
+ }
318
+ // always assume it's visible
319
+ return true;
320
+ };
321
+ var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
322
+ var registerOnFocus = function (cb) {
323
+ if (typeof window !== 'undefined' &&
324
+ window.addEventListener !== undefined &&
325
+ typeof document !== 'undefined' &&
326
+ document.addEventListener !== undefined) {
327
+ // focus revalidate
328
+ document.addEventListener('visibilitychange', function () { return cb(); }, false);
329
+ window.addEventListener('focus', function () { return cb(); }, false);
330
+ }
331
+ };
332
+ var registerOnReconnect = function (cb) {
333
+ if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
334
+ // reconnect revalidate
335
+ window.addEventListener('online', function () {
336
+ online = true;
337
+ cb();
338
+ }, false);
339
+ // nothing to revalidate, just update the status
340
+ window.addEventListener('offline', function () { return (online = false); }, false);
341
+ }
342
+ };
343
+ var webPreset = {
344
+ isOnline: isOnline,
345
+ isDocumentVisible: isDocumentVisible,
346
+ fetcher: fetcher,
347
+ registerOnFocus: registerOnFocus,
348
+ registerOnReconnect: registerOnReconnect
349
+ };
350
+
351
+ var __assign = (undefined && undefined.__assign) || function () {
352
+ __assign = Object.assign || function(t) {
353
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
354
+ s = arguments[i];
355
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
356
+ t[p] = s[p];
357
+ }
358
+ return t;
359
+ };
360
+ return __assign.apply(this, arguments);
361
+ };
362
+ // cache
363
+ var cache = new Cache();
364
+ // error retry
365
+ function onErrorRetry(_, __, config, revalidate, opts) {
366
+ if (!config.isDocumentVisible()) {
367
+ // if it's hidden, stop
368
+ // it will auto revalidate when focus
369
+ return;
370
+ }
371
+ if (typeof config.errorRetryCount === 'number' &&
372
+ opts.retryCount > config.errorRetryCount) {
373
+ return;
374
+ }
375
+ // exponential backoff
376
+ var count = Math.min(opts.retryCount, 8);
377
+ var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
378
+ setTimeout(revalidate, timeout, opts);
379
+ }
380
+ // client side: need to adjust the config
381
+ // based on the browser status
382
+ // slow connection (<= 70Kbps)
383
+ var slowConnection = typeof window !== 'undefined' &&
384
+ // @ts-ignore
385
+ navigator['connection'] &&
386
+ // @ts-ignore
387
+ ['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
388
+ // config
389
+ var defaultConfig = __assign({
390
+ // events
391
+ onLoadingSlow: function () { }, onSuccess: function () { }, onError: function () { }, onErrorRetry: onErrorRetry, errorRetryInterval: (slowConnection ? 10 : 5) * 1000, focusThrottleInterval: 5 * 1000, dedupingInterval: 2 * 1000, loadingTimeout: (slowConnection ? 5 : 3) * 1000, refreshInterval: 0, revalidateOnFocus: true, revalidateOnReconnect: true, refreshWhenHidden: false, refreshWhenOffline: false, shouldRetryOnError: true, suspense: false, compare: dequal, isPaused: function () { return false; } }, webPreset);
392
+
393
+ var IS_SERVER = typeof window === 'undefined' ||
394
+ // @ts-ignore
395
+ !!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
396
+ // polyfill for requestAnimationFrame
397
+ var rAF = IS_SERVER
398
+ ? null
399
+ : window['requestAnimationFrame']
400
+ ? function (f) { return window['requestAnimationFrame'](f); }
401
+ : function (f) { return setTimeout(f, 1); };
402
+ // React currently throws a warning when using useLayoutEffect on the server.
403
+ // To get around it, we can conditionally useEffect on the server (no-op) and
404
+ // useLayoutEffect in the browser.
405
+ var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
406
+
407
+ var SWRConfigContext = React.createContext({});
408
+ SWRConfigContext.displayName = 'SWRConfigContext';
409
+
410
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
411
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
412
+ return new (P || (P = Promise))(function (resolve, reject) {
413
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
414
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
415
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
416
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
417
+ });
418
+ };
419
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
420
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
421
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
422
+ function verb(n) { return function (v) { return step([n, v]); }; }
423
+ function step(op) {
424
+ if (f) throw new TypeError("Generator is already executing.");
425
+ while (_) try {
426
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
427
+ if (y = 0, t) op = [op[0] & 2, t.value];
428
+ switch (op[0]) {
429
+ case 0: case 1: t = op; break;
430
+ case 4: _.label++; return { value: op[1], done: false };
431
+ case 5: _.label++; y = op[1]; op = [0]; continue;
432
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
433
+ default:
434
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
435
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
436
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
437
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
438
+ if (t[2]) _.ops.pop();
439
+ _.trys.pop(); continue;
440
+ }
441
+ op = body.call(thisArg, _);
442
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
443
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
444
+ }
445
+ };
446
+ // global state managers
447
+ var CONCURRENT_PROMISES = {};
448
+ var CONCURRENT_PROMISES_TS = {};
449
+ var FOCUS_REVALIDATORS = {};
450
+ var RECONNECT_REVALIDATORS = {};
451
+ var CACHE_REVALIDATORS = {};
452
+ var MUTATION_TS = {};
453
+ var MUTATION_END_TS = {};
454
+ // generate strictly increasing timestamps
455
+ var now = (function () {
456
+ var ts = 0;
457
+ return function () { return ++ts; };
458
+ })();
459
+ // setup DOM events listeners for `focus` and `reconnect` actions
460
+ if (!IS_SERVER) {
461
+ var revalidate_1 = function (revalidators) {
462
+ if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
463
+ return;
464
+ for (var key in revalidators) {
465
+ if (revalidators[key][0])
466
+ revalidators[key][0]();
467
+ }
468
+ };
469
+ if (typeof defaultConfig.registerOnFocus === 'function') {
470
+ defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
471
+ }
472
+ if (typeof defaultConfig.registerOnReconnect === 'function') {
473
+ defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
474
+ }
475
+ }
476
+ var trigger = function (_key, shouldRevalidate) {
477
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
478
+ // we are ignoring the second argument which correspond to the arguments
479
+ // the fetcher will receive when key is an array
480
+ var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
481
+ if (!key)
482
+ return Promise.resolve();
483
+ var updaters = CACHE_REVALIDATORS[key];
484
+ if (key && updaters) {
485
+ var currentData = cache.get(key);
486
+ var currentError = cache.get(keyErr);
487
+ var currentIsValidating = cache.get(keyValidating);
488
+ var promises = [];
489
+ for (var i = 0; i < updaters.length; ++i) {
490
+ promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
491
+ }
492
+ // return new updated value
493
+ return Promise.all(promises).then(function () { return cache.get(key); });
494
+ }
495
+ return Promise.resolve(cache.get(key));
496
+ };
497
+ var broadcastState = function (key, data, error, isValidating) {
498
+ var updaters = CACHE_REVALIDATORS[key];
499
+ if (key && updaters) {
500
+ for (var i = 0; i < updaters.length; ++i) {
501
+ updaters[i](false, data, error, isValidating);
502
+ }
503
+ }
504
+ };
505
+ var mutate = function (_key, _data, shouldRevalidate) {
506
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
507
+ return __awaiter(void 0, void 0, void 0, function () {
508
+ var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
509
+ return __generator(this, function (_b) {
510
+ switch (_b.label) {
511
+ case 0:
512
+ _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
513
+ if (!key)
514
+ return [2 /*return*/];
515
+ // if there is no new data to update, let's just revalidate the key
516
+ if (typeof _data === 'undefined')
517
+ return [2 /*return*/, trigger(_key, shouldRevalidate)
518
+ // update global timestamps
519
+ ];
520
+ // update global timestamps
521
+ MUTATION_TS[key] = now() - 1;
522
+ MUTATION_END_TS[key] = 0;
523
+ beforeMutationTs = MUTATION_TS[key];
524
+ beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
525
+ isAsyncMutation = false;
526
+ if (_data && typeof _data === 'function') {
527
+ // `_data` is a function, call it passing current cache value
528
+ try {
529
+ _data = _data(cache.get(key));
530
+ }
531
+ catch (err) {
532
+ // if `_data` function throws an error synchronously, it shouldn't be cached
533
+ _data = undefined;
534
+ error = err;
535
+ }
536
+ }
537
+ if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
538
+ // `_data` is a promise
539
+ isAsyncMutation = true;
540
+ _b.label = 1;
541
+ case 1:
542
+ _b.trys.push([1, 3, , 4]);
543
+ return [4 /*yield*/, _data];
544
+ case 2:
545
+ data = _b.sent();
546
+ return [3 /*break*/, 4];
547
+ case 3:
548
+ err_1 = _b.sent();
549
+ error = err_1;
550
+ return [3 /*break*/, 4];
551
+ case 4: return [3 /*break*/, 6];
552
+ case 5:
553
+ data = _data;
554
+ _b.label = 6;
555
+ case 6:
556
+ shouldAbort = function () {
557
+ // check if other mutations have occurred since we've started this mutation
558
+ if (beforeMutationTs !== MUTATION_TS[key] ||
559
+ beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
560
+ if (error)
561
+ throw error;
562
+ return true;
563
+ }
564
+ };
565
+ // if there's a race we don't update cache or broadcast change, just return the data
566
+ if (shouldAbort())
567
+ return [2 /*return*/, data];
568
+ if (typeof data !== 'undefined') {
569
+ // update cached data
570
+ cache.set(key, data);
571
+ }
572
+ // always update or reset the error
573
+ cache.set(keyErr, error);
574
+ // reset the timestamp to mark the mutation has ended
575
+ MUTATION_END_TS[key] = now() - 1;
576
+ if (!isAsyncMutation) {
577
+ // we skip broadcasting if there's another mutation happened synchronously
578
+ if (shouldAbort())
579
+ return [2 /*return*/, data];
580
+ }
581
+ updaters = CACHE_REVALIDATORS[key];
582
+ if (updaters) {
583
+ promises = [];
584
+ for (i = 0; i < updaters.length; ++i) {
585
+ promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
586
+ }
587
+ // return new updated value
588
+ return [2 /*return*/, Promise.all(promises).then(function () {
589
+ if (error)
590
+ throw error;
591
+ return cache.get(key);
592
+ })];
593
+ }
594
+ // throw error or return data to be used by caller of mutate
595
+ if (error)
596
+ throw error;
597
+ return [2 /*return*/, data];
598
+ }
599
+ });
600
+ });
601
+ };
602
+ function useSWR() {
603
+ var _this = this;
604
+ var args = [];
605
+ for (var _i = 0; _i < arguments.length; _i++) {
606
+ args[_i] = arguments[_i];
607
+ }
608
+ var _key = args[0];
609
+ var config = Object.assign({}, defaultConfig, React.useContext(SWRConfigContext), args.length > 2
610
+ ? args[2]
611
+ : args.length === 2 && typeof args[1] === 'object'
612
+ ? args[1]
613
+ : {});
614
+ // in typescript args.length > 2 is not same as args.lenth === 3
615
+ // we do a safe type assertion here
616
+ // args.length === 3
617
+ var fn = (args.length > 2
618
+ ? args[1]
619
+ : args.length === 2 && typeof args[1] === 'function'
620
+ ? args[1]
621
+ : /**
622
+ pass fn as null will disable revalidate
623
+ https://paco.sh/blog/shared-hook-state-with-swr
624
+ */
625
+ args[1] === null
626
+ ? args[1]
627
+ : config.fetcher);
628
+ // we assume `key` as the identifier of the request
629
+ // `key` can change but `fn` shouldn't
630
+ // (because `revalidate` only depends on `key`)
631
+ // `keyErr` is the cache key for error objects
632
+ var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
633
+ var configRef = React.useRef(config);
634
+ useIsomorphicLayoutEffect(function () {
635
+ configRef.current = config;
636
+ });
637
+ var willRevalidateOnMount = function () {
638
+ return (config.revalidateOnMount ||
639
+ (!config.initialData && config.revalidateOnMount === undefined));
640
+ };
641
+ var resolveData = function () {
642
+ var cachedData = cache.get(key);
643
+ return typeof cachedData === 'undefined' ? config.initialData : cachedData;
644
+ };
645
+ var resolveIsValidating = function () {
646
+ return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
647
+ };
648
+ var initialData = resolveData();
649
+ var initialError = cache.get(keyErr);
650
+ var initialIsValidating = resolveIsValidating();
651
+ // if a state is accessed (data, error or isValidating),
652
+ // we add the state to dependencies so if the state is
653
+ // updated in the future, we can trigger a rerender
654
+ var stateDependencies = React.useRef({
655
+ data: false,
656
+ error: false,
657
+ isValidating: false
658
+ });
659
+ var stateRef = React.useRef({
660
+ data: initialData,
661
+ error: initialError,
662
+ isValidating: initialIsValidating
663
+ });
664
+ // display the data label in the React DevTools next to SWR hooks
665
+ React.useDebugValue(stateRef.current.data);
666
+ var rerender = React.useState({})[1];
667
+ var dispatch = React.useCallback(function (payload) {
668
+ var shouldUpdateState = false;
669
+ for (var k in payload) {
670
+ // @ts-ignore
671
+ if (stateRef.current[k] === payload[k]) {
672
+ continue;
673
+ }
674
+ // @ts-ignore
675
+ stateRef.current[k] = payload[k];
676
+ // @ts-ignore
677
+ if (stateDependencies.current[k]) {
678
+ shouldUpdateState = true;
679
+ }
680
+ }
681
+ if (shouldUpdateState) {
682
+ // if component is unmounted, should skip rerender
683
+ // if component is not mounted, should skip rerender
684
+ if (unmountedRef.current || !initialMountedRef.current)
685
+ return;
686
+ rerender({});
687
+ }
688
+ },
689
+ // config.suspense isn't allowed to change during the lifecycle
690
+ // eslint-disable-next-line react-hooks/exhaustive-deps
691
+ []);
692
+ // error ref inside revalidate (is last request errored?)
693
+ var unmountedRef = React.useRef(false);
694
+ var keyRef = React.useRef(key);
695
+ // check if component is mounted in suspense mode
696
+ var initialMountedRef = React.useRef(false);
697
+ // do unmount check for callbacks
698
+ var eventsCallback = React.useCallback(function (event) {
699
+ var _a;
700
+ var params = [];
701
+ for (var _i = 1; _i < arguments.length; _i++) {
702
+ params[_i - 1] = arguments[_i];
703
+ }
704
+ if (unmountedRef.current)
705
+ return;
706
+ if (!initialMountedRef.current)
707
+ return;
708
+ if (key !== keyRef.current)
709
+ return;
710
+ // @ts-ignore
711
+ (_a = configRef.current)[event].apply(_a, params);
712
+ }, [key]);
713
+ var boundMutate = React.useCallback(function (data, shouldRevalidate) {
714
+ return mutate(keyRef.current, data, shouldRevalidate);
715
+ }, []);
716
+ var addRevalidator = function (revalidators, callback) {
717
+ if (!revalidators[key]) {
718
+ revalidators[key] = [callback];
719
+ }
720
+ else {
721
+ revalidators[key].push(callback);
722
+ }
723
+ return function () {
724
+ var keyedRevalidators = revalidators[key];
725
+ var index = keyedRevalidators.indexOf(callback);
726
+ if (index >= 0) {
727
+ // O(1): faster than splice
728
+ keyedRevalidators[index] =
729
+ keyedRevalidators[keyedRevalidators.length - 1];
730
+ keyedRevalidators.pop();
731
+ }
732
+ };
733
+ };
734
+ // start a revalidation
735
+ var revalidate = React.useCallback(function (revalidateOpts) {
736
+ if (revalidateOpts === void 0) { revalidateOpts = {}; }
737
+ return __awaiter(_this, void 0, void 0, function () {
738
+ var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
739
+ return __generator(this, function (_c) {
740
+ switch (_c.label) {
741
+ case 0:
742
+ if (!key || !fn)
743
+ return [2 /*return*/, false];
744
+ if (unmountedRef.current)
745
+ return [2 /*return*/, false];
746
+ if (configRef.current.isPaused())
747
+ return [2 /*return*/, false];
748
+ _a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
749
+ loading = true;
750
+ shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
751
+ _c.label = 1;
752
+ case 1:
753
+ _c.trys.push([1, 6, , 7]);
754
+ dispatch({
755
+ isValidating: true
756
+ });
757
+ cache.set(keyValidating, true);
758
+ if (!shouldDeduping) {
759
+ // also update other hooks
760
+ broadcastState(key, stateRef.current.data, stateRef.current.error, true);
761
+ }
762
+ newData = void 0;
763
+ startAt = void 0;
764
+ if (!shouldDeduping) return [3 /*break*/, 3];
765
+ // there's already an ongoing request,
766
+ // this one needs to be deduplicated.
767
+ startAt = CONCURRENT_PROMISES_TS[key];
768
+ return [4 /*yield*/, CONCURRENT_PROMISES[key]];
769
+ case 2:
770
+ newData = _c.sent();
771
+ return [3 /*break*/, 5];
772
+ case 3:
773
+ // if no cache being rendered currently (it shows a blank page),
774
+ // we trigger the loading slow event.
775
+ if (config.loadingTimeout && !cache.get(key)) {
776
+ setTimeout(function () {
777
+ if (loading)
778
+ eventsCallback('onLoadingSlow', key, config);
779
+ }, config.loadingTimeout);
780
+ }
781
+ if (fnArgs !== null) {
782
+ CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
783
+ }
784
+ else {
785
+ CONCURRENT_PROMISES[key] = fn(key);
786
+ }
787
+ CONCURRENT_PROMISES_TS[key] = startAt = now();
788
+ return [4 /*yield*/, CONCURRENT_PROMISES[key]];
789
+ case 4:
790
+ newData = _c.sent();
791
+ setTimeout(function () {
792
+ delete CONCURRENT_PROMISES[key];
793
+ delete CONCURRENT_PROMISES_TS[key];
794
+ }, config.dedupingInterval);
795
+ // trigger the success event,
796
+ // only do this for the original request.
797
+ eventsCallback('onSuccess', newData, key, config);
798
+ _c.label = 5;
799
+ case 5:
800
+ // if there're other ongoing request(s), started after the current one,
801
+ // we need to ignore the current one to avoid possible race conditions:
802
+ // req1------------------>res1 (current one)
803
+ // req2---------------->res2
804
+ // the request that fired later will always be kept.
805
+ if (CONCURRENT_PROMISES_TS[key] > startAt) {
806
+ return [2 /*return*/, false];
807
+ }
808
+ // if there're other mutations(s), overlapped with the current revalidation:
809
+ // case 1:
810
+ // req------------------>res
811
+ // mutate------>end
812
+ // case 2:
813
+ // req------------>res
814
+ // mutate------>end
815
+ // case 3:
816
+ // req------------------>res
817
+ // mutate-------...---------->
818
+ // we have to ignore the revalidation result (res) because it's no longer fresh.
819
+ // meanwhile, a new revalidation should be triggered when the mutation ends.
820
+ if (MUTATION_TS[key] &&
821
+ // case 1
822
+ (startAt <= MUTATION_TS[key] ||
823
+ // case 2
824
+ startAt <= MUTATION_END_TS[key] ||
825
+ // case 3
826
+ MUTATION_END_TS[key] === 0)) {
827
+ dispatch({ isValidating: false });
828
+ return [2 /*return*/, false];
829
+ }
830
+ cache.set(keyErr, undefined);
831
+ cache.set(keyValidating, false);
832
+ newState = {
833
+ isValidating: false
834
+ };
835
+ if (typeof stateRef.current.error !== 'undefined') {
836
+ // we don't have an error
837
+ newState.error = undefined;
838
+ }
839
+ if (!config.compare(stateRef.current.data, newData)) {
840
+ // deep compare to avoid extra re-render
841
+ // data changed
842
+ newState.data = newData;
843
+ }
844
+ if (!config.compare(cache.get(key), newData)) {
845
+ cache.set(key, newData);
846
+ }
847
+ // merge the new state
848
+ dispatch(newState);
849
+ if (!shouldDeduping) {
850
+ // also update other hooks
851
+ broadcastState(key, newData, newState.error, false);
852
+ }
853
+ return [3 /*break*/, 7];
854
+ case 6:
855
+ err_2 = _c.sent();
856
+ delete CONCURRENT_PROMISES[key];
857
+ delete CONCURRENT_PROMISES_TS[key];
858
+ if (configRef.current.isPaused()) {
859
+ dispatch({
860
+ isValidating: false
861
+ });
862
+ return [2 /*return*/, false];
863
+ }
864
+ cache.set(keyErr, err_2);
865
+ // get a new error
866
+ // don't use deep equal for errors
867
+ if (stateRef.current.error !== err_2) {
868
+ // we keep the stale data
869
+ dispatch({
870
+ isValidating: false,
871
+ error: err_2
872
+ });
873
+ if (!shouldDeduping) {
874
+ // also broadcast to update other hooks
875
+ broadcastState(key, undefined, err_2, false);
876
+ }
877
+ }
878
+ // events and retry
879
+ eventsCallback('onError', err_2, key, config);
880
+ if (config.shouldRetryOnError) {
881
+ // when retrying, we always enable deduping
882
+ eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
883
+ retryCount: retryCount + 1,
884
+ dedupe: true
885
+ });
886
+ }
887
+ return [3 /*break*/, 7];
888
+ case 7:
889
+ loading = false;
890
+ return [2 /*return*/, true];
891
+ }
892
+ });
893
+ });
894
+ },
895
+ // dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
896
+ // so we can them from the deps array.
897
+ //
898
+ // FIXME:
899
+ // `fn` and `config` might be changed during the lifecycle,
900
+ // but they might be changed every render like this.
901
+ // useSWR('key', () => fetch('/api/'), { suspense: true })
902
+ // So we omit the values from the deps array
903
+ // even though it might cause unexpected behaviors.
904
+ // eslint-disable-next-line react-hooks/exhaustive-deps
905
+ [key]);
906
+ // mounted (client side rendering)
907
+ useIsomorphicLayoutEffect(function () {
908
+ if (!key)
909
+ return undefined;
910
+ // after `key` updates, we need to mark it as mounted
911
+ unmountedRef.current = false;
912
+ var isUpdating = initialMountedRef.current;
913
+ initialMountedRef.current = true;
914
+ // after the component is mounted (hydrated),
915
+ // we need to update the data from the cache
916
+ // and trigger a revalidation
917
+ var currentHookData = stateRef.current.data;
918
+ var latestKeyedData = resolveData();
919
+ // update the state if the key changed (not the inital render) or cache updated
920
+ keyRef.current = key;
921
+ if (!config.compare(currentHookData, latestKeyedData)) {
922
+ dispatch({ data: latestKeyedData });
923
+ }
924
+ // revalidate with deduping
925
+ var softRevalidate = function () { return revalidate({ dedupe: true }); };
926
+ // trigger a revalidation
927
+ if (isUpdating || willRevalidateOnMount()) {
928
+ if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
929
+ // delay revalidate if there's cache
930
+ // to not block the rendering
931
+ // @ts-ignore it's safe to use requestAnimationFrame in browser
932
+ rAF(softRevalidate);
933
+ }
934
+ else {
935
+ softRevalidate();
936
+ }
937
+ }
938
+ var pending = false;
939
+ var onFocus = function () {
940
+ if (pending || !configRef.current.revalidateOnFocus)
941
+ return;
942
+ pending = true;
943
+ softRevalidate();
944
+ setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
945
+ };
946
+ var onReconnect = function () {
947
+ if (configRef.current.revalidateOnReconnect) {
948
+ softRevalidate();
949
+ }
950
+ };
951
+ // register global cache update listener
952
+ var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
953
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
954
+ if (dedupe === void 0) { dedupe = true; }
955
+ // update hook state
956
+ var newState = {};
957
+ var needUpdate = false;
958
+ if (typeof updatedData !== 'undefined' &&
959
+ !config.compare(stateRef.current.data, updatedData)) {
960
+ newState.data = updatedData;
961
+ needUpdate = true;
962
+ }
963
+ // always update error
964
+ // because it can be `undefined`
965
+ if (stateRef.current.error !== updatedError) {
966
+ newState.error = updatedError;
967
+ needUpdate = true;
968
+ }
969
+ if (typeof updatedIsValidating !== 'undefined' &&
970
+ stateRef.current.isValidating !== updatedIsValidating) {
971
+ newState.isValidating = updatedIsValidating;
972
+ needUpdate = true;
973
+ }
974
+ if (needUpdate) {
975
+ dispatch(newState);
976
+ }
977
+ if (shouldRevalidate) {
978
+ if (dedupe) {
979
+ return softRevalidate();
980
+ }
981
+ else {
982
+ return revalidate();
983
+ }
984
+ }
985
+ return false;
986
+ };
987
+ var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
988
+ var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
989
+ var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
990
+ return function () {
991
+ // cleanup
992
+ dispatch = function () { return null; };
993
+ // mark it as unmounted
994
+ unmountedRef.current = true;
995
+ unsubFocus();
996
+ unsubReconnect();
997
+ unsubUpdate();
998
+ };
999
+ }, [key, revalidate]);
1000
+ useIsomorphicLayoutEffect(function () {
1001
+ var timer = null;
1002
+ var tick = function () { return __awaiter(_this, void 0, void 0, function () {
1003
+ return __generator(this, function (_a) {
1004
+ switch (_a.label) {
1005
+ case 0:
1006
+ if (!(!stateRef.current.error &&
1007
+ (configRef.current.refreshWhenHidden ||
1008
+ configRef.current.isDocumentVisible()) &&
1009
+ (configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
1010
+ // only revalidate when the page is visible
1011
+ // if API request errored, we stop polling in this round
1012
+ // and let the error retry function handle it
1013
+ return [4 /*yield*/, revalidate({ dedupe: true })];
1014
+ case 1:
1015
+ // only revalidate when the page is visible
1016
+ // if API request errored, we stop polling in this round
1017
+ // and let the error retry function handle it
1018
+ _a.sent();
1019
+ _a.label = 2;
1020
+ case 2:
1021
+ // Read the latest refreshInterval
1022
+ if (configRef.current.refreshInterval && timer) {
1023
+ timer = setTimeout(tick, configRef.current.refreshInterval);
1024
+ }
1025
+ return [2 /*return*/];
1026
+ }
1027
+ });
1028
+ }); };
1029
+ if (configRef.current.refreshInterval) {
1030
+ timer = setTimeout(tick, configRef.current.refreshInterval);
1031
+ }
1032
+ return function () {
1033
+ if (timer) {
1034
+ clearTimeout(timer);
1035
+ timer = null;
1036
+ }
1037
+ };
1038
+ }, [
1039
+ config.refreshInterval,
1040
+ config.refreshWhenHidden,
1041
+ config.refreshWhenOffline,
1042
+ revalidate
1043
+ ]);
1044
+ // suspense
1045
+ var latestData;
1046
+ var latestError;
1047
+ if (config.suspense) {
1048
+ // in suspense mode, we can't return empty state
1049
+ // (it should be suspended)
1050
+ // try to get data and error from cache
1051
+ latestData = cache.get(key);
1052
+ latestError = cache.get(keyErr);
1053
+ if (typeof latestData === 'undefined') {
1054
+ latestData = initialData;
1055
+ }
1056
+ if (typeof latestError === 'undefined') {
1057
+ latestError = initialError;
1058
+ }
1059
+ if (typeof latestData === 'undefined' &&
1060
+ typeof latestError === 'undefined') {
1061
+ // need to start the request if it hasn't
1062
+ if (!CONCURRENT_PROMISES[key]) {
1063
+ // trigger revalidate immediately
1064
+ // to get the promise
1065
+ // in this revalidate, should not rerender
1066
+ revalidate();
1067
+ }
1068
+ if (CONCURRENT_PROMISES[key] &&
1069
+ typeof CONCURRENT_PROMISES[key].then === 'function') {
1070
+ // if it is a promise
1071
+ throw CONCURRENT_PROMISES[key];
1072
+ }
1073
+ // it's a value, return it directly (override)
1074
+ latestData = CONCURRENT_PROMISES[key];
1075
+ }
1076
+ if (typeof latestData === 'undefined' && latestError) {
1077
+ // in suspense mode, throw error if there's no content
1078
+ throw latestError;
1079
+ }
1080
+ }
1081
+ // define returned state
1082
+ // can be memorized since the state is a ref
1083
+ var memoizedState = React.useMemo(function () {
1084
+ // revalidate will be deprecated in the 1.x release
1085
+ // because mutate() covers the same use case of revalidate().
1086
+ // This remains only for backward compatibility
1087
+ var state = { revalidate: revalidate, mutate: boundMutate };
1088
+ Object.defineProperties(state, {
1089
+ error: {
1090
+ // `key` might be changed in the upcoming hook re-render,
1091
+ // but the previous state will stay
1092
+ // so we need to match the latest key and data (fallback to `initialData`)
1093
+ get: function () {
1094
+ stateDependencies.current.error = true;
1095
+ if (config.suspense) {
1096
+ return latestError;
1097
+ }
1098
+ return keyRef.current === key ? stateRef.current.error : initialError;
1099
+ },
1100
+ enumerable: true
1101
+ },
1102
+ data: {
1103
+ get: function () {
1104
+ stateDependencies.current.data = true;
1105
+ if (config.suspense) {
1106
+ return latestData;
1107
+ }
1108
+ return keyRef.current === key ? stateRef.current.data : initialData;
1109
+ },
1110
+ enumerable: true
1111
+ },
1112
+ isValidating: {
1113
+ get: function () {
1114
+ stateDependencies.current.isValidating = true;
1115
+ return key ? stateRef.current.isValidating : false;
1116
+ },
1117
+ enumerable: true
1118
+ }
1119
+ });
1120
+ return state;
1121
+ // `config.suspense` isn't allowed to change during the lifecycle.
1122
+ // `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
1123
+ // so we can omit them from the deps array,
1124
+ // but we put it to enable react-hooks/exhaustive-deps rule.
1125
+ // `initialData` and `initialError` are not initial values
1126
+ // because they are changed during the lifecycle
1127
+ // so we should add them in the deps array.
1128
+ }, [
1129
+ revalidate,
1130
+ initialData,
1131
+ initialError,
1132
+ boundMutate,
1133
+ key,
1134
+ config.suspense,
1135
+ latestError,
1136
+ latestData
1137
+ ]);
1138
+ return memoizedState;
1139
+ }
1140
+ Object.defineProperty(SWRConfigContext.Provider, 'default', {
1141
+ value: defaultConfig
1142
+ });
1143
+ var SWRConfig = SWRConfigContext.Provider;
1144
+
1145
+ var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1146
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1147
+ return new (P || (P = Promise))(function (resolve, reject) {
1148
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1149
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1150
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1151
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1152
+ });
1153
+ };
1154
+ var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
1155
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1156
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1157
+ function verb(n) { return function (v) { return step([n, v]); }; }
1158
+ function step(op) {
1159
+ if (f) throw new TypeError("Generator is already executing.");
1160
+ while (_) try {
1161
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1162
+ if (y = 0, t) op = [op[0] & 2, t.value];
1163
+ switch (op[0]) {
1164
+ case 0: case 1: t = op; break;
1165
+ case 4: _.label++; return { value: op[1], done: false };
1166
+ case 5: _.label++; y = op[1]; op = [0]; continue;
1167
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
1168
+ default:
1169
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1170
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1171
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1172
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1173
+ if (t[2]) _.ops.pop();
1174
+ _.trys.pop(); continue;
1175
+ }
1176
+ op = body.call(thisArg, _);
1177
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1178
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1179
+ }
1180
+ };
1181
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
1182
+ var t = {};
1183
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1184
+ t[p] = s[p];
1185
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1186
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1187
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1188
+ t[p[i]] = s[p[i]];
1189
+ }
1190
+ return t;
1191
+ };
1192
+
1193
+ var _this = undefined;
152
1194
 
153
1195
  var dataHandler = function () {
154
1196
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(api_url, body) {
@@ -214,7 +1256,7 @@ var dataHandler = function () {
214
1256
  return _context.stop();
215
1257
  }
216
1258
  }
217
- }, _callee, _this$4, [[0, 20]]);
1259
+ }, _callee, _this, [[0, 20]]);
218
1260
  }));
219
1261
 
220
1262
  return function dataHandler(_x, _x2) {
@@ -227,7 +1269,7 @@ function useUser() {
227
1269
  redirectTo = _ref.redirectTo,
228
1270
  redirectIfFound = _ref.redirectIfFound;
229
1271
 
230
- var _useSWR = useSWR__default['default']('/api/auth/user', dataHandler),
1272
+ var _useSWR = useSWR('/api/auth/user', dataHandler),
231
1273
  data = _useSWR.data,
232
1274
  error = _useSWR.error;
233
1275
 
@@ -242,7 +1284,7 @@ function useUser() {
242
1284
  redirectTo && !redirectIfFound && !hasUser ||
243
1285
  // If redirectIfFound is also set, redirect if the user was found
244
1286
  redirectIfFound && hasUser) {
245
- Router__default['default'].push(redirectTo);
1287
+ Router__default.push(redirectTo);
246
1288
  }
247
1289
  }, [redirectTo, redirectIfFound, finished, hasUser]);
248
1290
 
@@ -348,43 +1390,43 @@ var LoginForm = function LoginForm(props) {
348
1390
  loading = _useState4[0],
349
1391
  setLoading = _useState4[1];
350
1392
 
351
- return React__default['default'].createElement(
1393
+ return React__default.createElement(
352
1394
  reactBootstrap.Form,
353
1395
  { className: 'login', onSubmit: handleSubmit },
354
- React__default['default'].createElement(
1396
+ React__default.createElement(
355
1397
  'h1',
356
1398
  null,
357
1399
  'Login'
358
1400
  ),
359
- React__default['default'].createElement('hr', null),
1401
+ React__default.createElement('hr', null),
360
1402
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
361
1403
  returnFormField({ name: 'password', label: 'Password', type: 'password', required: true }),
362
- React__default['default'].createElement('hr', null),
363
- React__default['default'].createElement(
1404
+ React__default.createElement('hr', null),
1405
+ React__default.createElement(
364
1406
  reactBootstrap.Form.Row,
365
1407
  null,
366
- React__default['default'].createElement(
1408
+ React__default.createElement(
367
1409
  reactBootstrap.Form.Group,
368
1410
  { as: reactBootstrap.Col },
369
- React__default['default'].createElement(
1411
+ React__default.createElement(
370
1412
  'a',
371
1413
  { href: '/auth/signup' },
372
1414
  'I don\'t have an account'
373
1415
  )
374
1416
  ),
375
- React__default['default'].createElement(
1417
+ React__default.createElement(
376
1418
  reactBootstrap.Form.Group,
377
1419
  { as: reactBootstrap.Col, className: 'text-right' },
378
- !loading && React__default['default'].createElement(
1420
+ !loading && React__default.createElement(
379
1421
  reactBootstrap.Button,
380
1422
  { type: 'submit' },
381
1423
  'Login'
382
1424
  ),
383
- loading && React__default['default'].createElement(
1425
+ loading && React__default.createElement(
384
1426
  reactBootstrap.Button,
385
1427
  { variant: 'primary', disabled: true },
386
- React__default['default'].createElement(reactBootstrap.Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
387
- React__default['default'].createElement(
1428
+ React__default.createElement(reactBootstrap.Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
1429
+ React__default.createElement(
388
1430
  'span',
389
1431
  { className: 'sr-only' },
390
1432
  'Loading...'
@@ -392,12 +1434,12 @@ var LoginForm = function LoginForm(props) {
392
1434
  )
393
1435
  )
394
1436
  ),
395
- errorMsg && React__default['default'].createElement(
1437
+ errorMsg && React__default.createElement(
396
1438
  'p',
397
1439
  { className: 'error' },
398
1440
  errorMsg
399
1441
  ),
400
- React__default['default'].createElement(
1442
+ React__default.createElement(
401
1443
  'style',
402
1444
  { jsx: 'true'.toString() },
403
1445
  '\n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
@@ -410,9 +1452,9 @@ var countries = ["United States", "Afghanistan", "Albania", "Algeria", "American
410
1452
 
411
1453
  var states = ['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY'];
412
1454
 
413
- var _this$3 = undefined;
1455
+ var _this$1 = undefined;
414
1456
 
415
- var SignupForm$1 = function SignupForm(props) {
1457
+ var SignupForm = function SignupForm(props) {
416
1458
  var handleSubmit = function () {
417
1459
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
418
1460
  var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
@@ -573,7 +1615,7 @@ var SignupForm$1 = function SignupForm(props) {
573
1615
  return _context.stop();
574
1616
  }
575
1617
  }
576
- }, _callee, _this$3);
1618
+ }, _callee, _this$1);
577
1619
  }));
578
1620
 
579
1621
  return function loadInitData() {
@@ -640,7 +1682,7 @@ var SignupForm$1 = function SignupForm(props) {
640
1682
  return _context2.stop();
641
1683
  }
642
1684
  }
643
- }, _callee2, _this$3);
1685
+ }, _callee2, _this$1);
644
1686
  }));
645
1687
 
646
1688
  return function handleOccupationChanged(_x) {
@@ -653,29 +1695,29 @@ var SignupForm$1 = function SignupForm(props) {
653
1695
  loading = _useState14[0],
654
1696
  setLoading = _useState14[1];
655
1697
 
656
- return React__default['default'].createElement(
1698
+ return React__default.createElement(
657
1699
  reactBootstrap.Form,
658
1700
  { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
659
- React__default['default'].createElement(
1701
+ React__default.createElement(
660
1702
  'h1',
661
1703
  null,
662
1704
  'Sign Up'
663
1705
  ),
664
- React__default['default'].createElement('hr', null),
1706
+ React__default.createElement('hr', null),
665
1707
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
666
- React__default['default'].createElement(
1708
+ React__default.createElement(
667
1709
  reactBootstrap.Form.Row,
668
1710
  null,
669
1711
  returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: true }),
670
1712
  returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: true })
671
1713
  ),
672
- React__default['default'].createElement(
1714
+ React__default.createElement(
673
1715
  reactBootstrap.Form.Row,
674
1716
  null,
675
1717
  returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true }),
676
1718
  returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true })
677
1719
  ),
678
- React__default['default'].createElement(
1720
+ React__default.createElement(
679
1721
  reactBootstrap.Form.Row,
680
1722
  null,
681
1723
  returnFormField({
@@ -689,7 +1731,7 @@ var SignupForm$1 = function SignupForm(props) {
689
1731
  }),
690
1732
  countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states })
691
1733
  ),
692
- React__default['default'].createElement(
1734
+ React__default.createElement(
693
1735
  reactBootstrap.Form.Row,
694
1736
  null,
695
1737
  countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col }),
@@ -736,38 +1778,38 @@ var SignupForm$1 = function SignupForm(props) {
736
1778
  required: true,
737
1779
  options: [{ label: 'By registering you agree to our <a href="/terms" style="color:blue">Terms and Conditions</a> and <a href="/privacy" style="color:blue">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
738
1780
  }),
739
- React__default['default'].createElement('hr', null),
740
- React__default['default'].createElement(
1781
+ React__default.createElement('hr', null),
1782
+ React__default.createElement(
741
1783
  reactBootstrap.Form.Row,
742
1784
  null,
743
- React__default['default'].createElement(
1785
+ React__default.createElement(
744
1786
  reactBootstrap.Form.Group,
745
1787
  { as: reactBootstrap.Col },
746
- React__default['default'].createElement(
1788
+ React__default.createElement(
747
1789
  'a',
748
1790
  { href: '/auth/login' },
749
1791
  'I already have an account'
750
1792
  )
751
1793
  ),
752
- React__default['default'].createElement(
1794
+ React__default.createElement(
753
1795
  reactBootstrap.Form.Group,
754
1796
  { as: reactBootstrap.Col, className: 'text-right' },
755
- !loading && React__default['default'].createElement(
1797
+ !loading && React__default.createElement(
756
1798
  reactBootstrap.Button,
757
1799
  { type: 'submit' },
758
1800
  'Sign Up'
759
1801
  ),
760
- loading && React__default['default'].createElement(
1802
+ loading && React__default.createElement(
761
1803
  reactBootstrap.Button,
762
1804
  { variant: 'primary', disabled: true },
763
- React__default['default'].createElement(reactBootstrap.Spinner, {
1805
+ React__default.createElement(reactBootstrap.Spinner, {
764
1806
  as: 'span',
765
1807
  animation: 'border',
766
1808
  role: 'status',
767
1809
  'aria-hidden': 'true',
768
1810
  size: 'sm'
769
1811
  }),
770
- React__default['default'].createElement(
1812
+ React__default.createElement(
771
1813
  'span',
772
1814
  { className: 'sr-only' },
773
1815
  'Loading...'
@@ -775,12 +1817,12 @@ var SignupForm$1 = function SignupForm(props) {
775
1817
  )
776
1818
  )
777
1819
  ),
778
- errorMsg && React__default['default'].createElement(
1820
+ errorMsg && React__default.createElement(
779
1821
  'p',
780
1822
  { className: 'error' },
781
1823
  errorMsg
782
1824
  ),
783
- React__default['default'].createElement(
1825
+ React__default.createElement(
784
1826
  'style',
785
1827
  { jsx: 'true'.toString() },
786
1828
  ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
@@ -790,7 +1832,7 @@ var SignupForm$1 = function SignupForm(props) {
790
1832
 
791
1833
  var _this$2 = undefined;
792
1834
 
793
- var SignupForm = function SignupForm(props) {
1835
+ var SignupForm$1 = function SignupForm(props) {
794
1836
  var handleSubmit = function () {
795
1837
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
796
1838
  var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
@@ -1070,32 +2112,32 @@ var SignupForm = function SignupForm(props) {
1070
2112
  loading = _useState18[0],
1071
2113
  setLoading = _useState18[1];
1072
2114
 
1073
- return React__default['default'].createElement(
2115
+ return React__default.createElement(
1074
2116
  reactBootstrap.Form,
1075
2117
  { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
1076
- React__default['default'].createElement(
2118
+ React__default.createElement(
1077
2119
  'h1',
1078
2120
  null,
1079
2121
  'Profile'
1080
2122
  ),
1081
- React__default['default'].createElement('hr', null),
1082
- userData ? React__default['default'].createElement(
1083
- React__default['default'].Fragment,
2123
+ React__default.createElement('hr', null),
2124
+ userData ? React__default.createElement(
2125
+ React__default.Fragment,
1084
2126
  null,
1085
2127
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true, readonly: true, default_value: userData.email }),
1086
- React__default['default'].createElement(
2128
+ React__default.createElement(
1087
2129
  reactBootstrap.Form.Row,
1088
2130
  null,
1089
2131
  returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: false }),
1090
2132
  returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: false })
1091
2133
  ),
1092
- React__default['default'].createElement(
2134
+ React__default.createElement(
1093
2135
  reactBootstrap.Form.Row,
1094
2136
  null,
1095
2137
  returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.first_name }),
1096
2138
  returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.last_name })
1097
2139
  ),
1098
- React__default['default'].createElement(
2140
+ React__default.createElement(
1099
2141
  reactBootstrap.Form.Row,
1100
2142
  null,
1101
2143
  returnFormField({
@@ -1110,7 +2152,7 @@ var SignupForm = function SignupForm(props) {
1110
2152
  }),
1111
2153
  countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states, default_value: userData.shared.state })
1112
2154
  ),
1113
- React__default['default'].createElement(
2155
+ React__default.createElement(
1114
2156
  reactBootstrap.Form.Row,
1115
2157
  null,
1116
2158
  countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col, default_value: userData.shared.zip }),
@@ -1160,29 +2202,29 @@ var SignupForm = function SignupForm(props) {
1160
2202
  required: true,
1161
2203
  options: [{ label: 'By registering you agree to our <a href="/terms">Terms and Conditions</a> and <a href="/privacy">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
1162
2204
  }),
1163
- React__default['default'].createElement('hr', null),
1164
- React__default['default'].createElement(
2205
+ React__default.createElement('hr', null),
2206
+ React__default.createElement(
1165
2207
  reactBootstrap.Form.Row,
1166
2208
  null,
1167
- React__default['default'].createElement(
2209
+ React__default.createElement(
1168
2210
  reactBootstrap.Form.Group,
1169
2211
  { as: reactBootstrap.Col },
1170
- !loading && React__default['default'].createElement(
2212
+ !loading && React__default.createElement(
1171
2213
  reactBootstrap.Button,
1172
2214
  { type: 'submit' },
1173
2215
  'Update'
1174
2216
  ),
1175
- loading && React__default['default'].createElement(
2217
+ loading && React__default.createElement(
1176
2218
  reactBootstrap.Button,
1177
2219
  { variant: 'primary', disabled: true },
1178
- React__default['default'].createElement(reactBootstrap.Spinner, {
2220
+ React__default.createElement(reactBootstrap.Spinner, {
1179
2221
  as: 'span',
1180
2222
  animation: 'border',
1181
2223
  role: 'status',
1182
2224
  'aria-hidden': 'true',
1183
2225
  size: 'sm'
1184
2226
  }),
1185
- React__default['default'].createElement(
2227
+ React__default.createElement(
1186
2228
  'span',
1187
2229
  { className: 'sr-only' },
1188
2230
  'Loading...'
@@ -1190,24 +2232,24 @@ var SignupForm = function SignupForm(props) {
1190
2232
  )
1191
2233
  )
1192
2234
  )
1193
- ) : React__default['default'].createElement(reactBootstrap.Spinner, {
2235
+ ) : React__default.createElement(reactBootstrap.Spinner, {
1194
2236
  as: 'span',
1195
2237
  animation: 'border',
1196
2238
  role: 'status',
1197
2239
  'aria-hidden': 'true',
1198
2240
  size: 'sm'
1199
2241
  }),
1200
- errorMsg && React__default['default'].createElement(
2242
+ errorMsg && React__default.createElement(
1201
2243
  'p',
1202
2244
  { className: 'error' },
1203
2245
  errorMsg
1204
2246
  ),
1205
- successMsg && React__default['default'].createElement(
2247
+ successMsg && React__default.createElement(
1206
2248
  'p',
1207
2249
  { className: 'success' },
1208
2250
  successMsg
1209
2251
  ),
1210
- React__default['default'].createElement(
2252
+ React__default.createElement(
1211
2253
  'style',
1212
2254
  { jsx: 'true'.toString() },
1213
2255
  ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n .success {\n color: green;\n margin: 1rem 0 0;\n }\n '
@@ -1220,7 +2262,7 @@ var MAX_AGE = 60 * 60 * 8; // 8 hours
1220
2262
 
1221
2263
  function setTokenCookie(res, token, eKey) {
1222
2264
  var cookies_serailized = [];
1223
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, token, {
2265
+ cookies_serailized.push(index$6.serialize_1(TOKEN_NAME, token, {
1224
2266
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1225
2267
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1226
2268
  //httpOnly: true,
@@ -1229,7 +2271,7 @@ function setTokenCookie(res, token, eKey) {
1229
2271
  //sameSite: 'lax',
1230
2272
  }));
1231
2273
 
1232
- cookies_serailized.push(index.serialize_1('eKey', eKey, {
2274
+ cookies_serailized.push(index$6.serialize_1('eKey', eKey, {
1233
2275
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1234
2276
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1235
2277
  //httpOnly: true,
@@ -1243,12 +2285,12 @@ function setTokenCookie(res, token, eKey) {
1243
2285
 
1244
2286
  function removeTokenCookie(res) {
1245
2287
  var cookies_serailized = [];
1246
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, '', {
2288
+ cookies_serailized.push(index$6.serialize_1(TOKEN_NAME, '', {
1247
2289
  maxAge: -1,
1248
2290
  expires: new Date(Date.now() - MAX_AGE * 1000),
1249
2291
  path: '/'
1250
2292
  }));
1251
- cookies_serailized.push(index.serialize_1('eKey', '', {
2293
+ cookies_serailized.push(index$6.serialize_1('eKey', '', {
1252
2294
  maxAge: -1,
1253
2295
  expires: new Date(Date.now() - MAX_AGE * 1000),
1254
2296
  path: '/'
@@ -1263,7 +2305,7 @@ function parseCookies(req) {
1263
2305
 
1264
2306
  // For pages we do need to parse the cookies.
1265
2307
  var cookie = req.headers ? req.headers.cookie : null;
1266
- return index.parse_1(cookie || '');
2308
+ return index$6.parse_1(cookie || '');
1267
2309
  }
1268
2310
 
1269
2311
  function getTokenCookie(req) {
@@ -1325,10 +2367,10 @@ var iron = /*#__PURE__*/Object.freeze({
1325
2367
  getSession: getSession
1326
2368
  });
1327
2369
 
1328
- var toStr$5 = Object.prototype.toString;
2370
+ var toStr = Object.prototype.toString;
1329
2371
 
1330
2372
  var isArguments = function isArguments(value) {
1331
- var str = toStr$5.call(value);
2373
+ var str = toStr.call(value);
1332
2374
  var isArgs = str === '[object Arguments]';
1333
2375
  if (!isArgs) {
1334
2376
  isArgs = str !== '[object Array]' &&
@@ -1336,16 +2378,16 @@ var isArguments = function isArguments(value) {
1336
2378
  typeof value === 'object' &&
1337
2379
  typeof value.length === 'number' &&
1338
2380
  value.length >= 0 &&
1339
- toStr$5.call(value.callee) === '[object Function]';
2381
+ toStr.call(value.callee) === '[object Function]';
1340
2382
  }
1341
2383
  return isArgs;
1342
2384
  };
1343
2385
 
1344
- var keysShim$1;
2386
+ var keysShim;
1345
2387
  if (!Object.keys) {
1346
2388
  // modified from https://github.com/es-shims/es5-shim
1347
2389
  var has$1 = Object.prototype.hasOwnProperty;
1348
- var toStr$4 = Object.prototype.toString;
2390
+ var toStr$1 = Object.prototype.toString;
1349
2391
  var isArgs = isArguments; // eslint-disable-line global-require
1350
2392
  var isEnumerable = Object.prototype.propertyIsEnumerable;
1351
2393
  var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
@@ -1418,11 +2460,11 @@ if (!Object.keys) {
1418
2460
  }
1419
2461
  };
1420
2462
 
1421
- keysShim$1 = function keys(object) {
2463
+ keysShim = function keys(object) {
1422
2464
  var isObject = object !== null && typeof object === 'object';
1423
- var isFunction = toStr$4.call(object) === '[object Function]';
2465
+ var isFunction = toStr$1.call(object) === '[object Function]';
1424
2466
  var isArguments = isArgs(object);
1425
- var isString = isObject && toStr$4.call(object) === '[object String]';
2467
+ var isString = isObject && toStr$1.call(object) === '[object String]';
1426
2468
  var theKeys = [];
1427
2469
 
1428
2470
  if (!isObject && !isFunction && !isArguments) {
@@ -1460,17 +2502,17 @@ if (!Object.keys) {
1460
2502
  return theKeys;
1461
2503
  };
1462
2504
  }
1463
- var implementation$3 = keysShim$1;
2505
+ var implementation = keysShim;
1464
2506
 
1465
- var slice$1 = Array.prototype.slice;
2507
+ var slice = Array.prototype.slice;
1466
2508
 
1467
2509
 
1468
2510
  var origKeys = Object.keys;
1469
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation$3;
2511
+ var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation;
1470
2512
 
1471
2513
  var originalKeys = Object.keys;
1472
2514
 
1473
- keysShim.shim = function shimObjectKeys() {
2515
+ keysShim$1.shim = function shimObjectKeys() {
1474
2516
  if (Object.keys) {
1475
2517
  var keysWorksWithArguments = (function () {
1476
2518
  // Safari 5.0 bug
@@ -1480,27 +2522,27 @@ keysShim.shim = function shimObjectKeys() {
1480
2522
  if (!keysWorksWithArguments) {
1481
2523
  Object.keys = function keys(object) { // eslint-disable-line func-name-matching
1482
2524
  if (isArguments(object)) {
1483
- return originalKeys(slice$1.call(object));
2525
+ return originalKeys(slice.call(object));
1484
2526
  }
1485
2527
  return originalKeys(object);
1486
2528
  };
1487
2529
  }
1488
2530
  } else {
1489
- Object.keys = keysShim;
2531
+ Object.keys = keysShim$1;
1490
2532
  }
1491
- return Object.keys || keysShim;
2533
+ return Object.keys || keysShim$1;
1492
2534
  };
1493
2535
 
1494
- var objectKeys = keysShim;
2536
+ var objectKeys = keysShim$1;
1495
2537
 
1496
- var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
2538
+ var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
1497
2539
 
1498
- var toStr$3 = Object.prototype.toString;
2540
+ var toStr$2 = Object.prototype.toString;
1499
2541
  var concat = Array.prototype.concat;
1500
2542
  var origDefineProperty = Object.defineProperty;
1501
2543
 
1502
2544
  var isFunction = function (fn) {
1503
- return typeof fn === 'function' && toStr$3.call(fn) === '[object Function]';
2545
+ return typeof fn === 'function' && toStr$2.call(fn) === '[object Function]';
1504
2546
  };
1505
2547
 
1506
2548
  var arePropertyDescriptorsSupported = function () {
@@ -1537,7 +2579,7 @@ var defineProperty = function (object, name, value, predicate) {
1537
2579
  var defineProperties = function (object, map) {
1538
2580
  var predicates = arguments.length > 2 ? arguments[2] : {};
1539
2581
  var props = objectKeys(map);
1540
- if (hasSymbols$4) {
2582
+ if (hasSymbols) {
1541
2583
  props = concat.call(props, Object.getOwnPropertySymbols(map));
1542
2584
  }
1543
2585
  for (var i = 0; i < props.length; i += 1) {
@@ -1549,59 +2591,6 @@ defineProperties.supportsDescriptors = !!supportsDescriptors;
1549
2591
 
1550
2592
  var defineProperties_1 = defineProperties;
1551
2593
 
1552
- /* eslint no-invalid-this: 1 */
1553
-
1554
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1555
- var slice = Array.prototype.slice;
1556
- var toStr$2 = Object.prototype.toString;
1557
- var funcType = '[object Function]';
1558
-
1559
- var implementation$2 = function bind(that) {
1560
- var target = this;
1561
- if (typeof target !== 'function' || toStr$2.call(target) !== funcType) {
1562
- throw new TypeError(ERROR_MESSAGE + target);
1563
- }
1564
- var args = slice.call(arguments, 1);
1565
-
1566
- var bound;
1567
- var binder = function () {
1568
- if (this instanceof bound) {
1569
- var result = target.apply(
1570
- this,
1571
- args.concat(slice.call(arguments))
1572
- );
1573
- if (Object(result) === result) {
1574
- return result;
1575
- }
1576
- return this;
1577
- } else {
1578
- return target.apply(
1579
- that,
1580
- args.concat(slice.call(arguments))
1581
- );
1582
- }
1583
- };
1584
-
1585
- var boundLength = Math.max(0, target.length - args.length);
1586
- var boundArgs = [];
1587
- for (var i = 0; i < boundLength; i++) {
1588
- boundArgs.push('$' + i);
1589
- }
1590
-
1591
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1592
-
1593
- if (target.prototype) {
1594
- var Empty = function Empty() {};
1595
- Empty.prototype = target.prototype;
1596
- bound.prototype = new Empty();
1597
- Empty.prototype = null;
1598
- }
1599
-
1600
- return bound;
1601
- };
1602
-
1603
- var functionBind = Function.prototype.bind || implementation$2;
1604
-
1605
2594
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
1606
2595
  var shams = function hasSymbols() {
1607
2596
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
@@ -1625,7 +2614,7 @@ var shams = function hasSymbols() {
1625
2614
 
1626
2615
  var symVal = 42;
1627
2616
  obj[sym] = symVal;
1628
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
2617
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
1629
2618
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1630
2619
 
1631
2620
  if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
@@ -1643,10 +2632,10 @@ var shams = function hasSymbols() {
1643
2632
  return true;
1644
2633
  };
1645
2634
 
1646
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
2635
+ var origSymbol = _commonjsHelpers.commonjsGlobal.Symbol;
1647
2636
 
1648
2637
 
1649
- var hasSymbols$3 = function hasNativeSymbols() {
2638
+ var hasSymbols$1 = function hasNativeSymbols() {
1650
2639
  if (typeof origSymbol !== 'function') { return false; }
1651
2640
  if (typeof Symbol !== 'function') { return false; }
1652
2641
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -1655,34 +2644,79 @@ var hasSymbols$3 = function hasNativeSymbols() {
1655
2644
  return shams();
1656
2645
  };
1657
2646
 
1658
- var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
2647
+ /* eslint no-invalid-this: 1 */
1659
2648
 
1660
- var undefined$1;
2649
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
2650
+ var slice$1 = Array.prototype.slice;
2651
+ var toStr$3 = Object.prototype.toString;
2652
+ var funcType = '[object Function]';
1661
2653
 
1662
- var $SyntaxError$1 = SyntaxError;
1663
- var $Function = Function;
1664
- var $TypeError$5 = TypeError;
2654
+ var implementation$1 = function bind(that) {
2655
+ var target = this;
2656
+ if (typeof target !== 'function' || toStr$3.call(target) !== funcType) {
2657
+ throw new TypeError(ERROR_MESSAGE + target);
2658
+ }
2659
+ var args = slice$1.call(arguments, 1);
1665
2660
 
1666
- // eslint-disable-next-line consistent-return
1667
- var getEvalledConstructor = function (expressionSyntax) {
1668
- try {
1669
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1670
- } catch (e) {}
2661
+ var bound;
2662
+ var binder = function () {
2663
+ if (this instanceof bound) {
2664
+ var result = target.apply(
2665
+ this,
2666
+ args.concat(slice$1.call(arguments))
2667
+ );
2668
+ if (Object(result) === result) {
2669
+ return result;
2670
+ }
2671
+ return this;
2672
+ } else {
2673
+ return target.apply(
2674
+ that,
2675
+ args.concat(slice$1.call(arguments))
2676
+ );
2677
+ }
2678
+ };
2679
+
2680
+ var boundLength = Math.max(0, target.length - args.length);
2681
+ var boundArgs = [];
2682
+ for (var i = 0; i < boundLength; i++) {
2683
+ boundArgs.push('$' + i);
2684
+ }
2685
+
2686
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
2687
+
2688
+ if (target.prototype) {
2689
+ var Empty = function Empty() {};
2690
+ Empty.prototype = target.prototype;
2691
+ bound.prototype = new Empty();
2692
+ Empty.prototype = null;
2693
+ }
2694
+
2695
+ return bound;
1671
2696
  };
1672
2697
 
1673
- var $gOPD$2 = Object.getOwnPropertyDescriptor;
1674
- if ($gOPD$2) {
2698
+ var functionBind = Function.prototype.bind || implementation$1;
2699
+
2700
+ /* globals
2701
+ Atomics,
2702
+ SharedArrayBuffer,
2703
+ */
2704
+
2705
+ var undefined$1;
2706
+
2707
+ var $TypeError = TypeError;
2708
+
2709
+ var $gOPD = Object.getOwnPropertyDescriptor;
2710
+ if ($gOPD) {
1675
2711
  try {
1676
- $gOPD$2({}, '');
2712
+ $gOPD({}, '');
1677
2713
  } catch (e) {
1678
- $gOPD$2 = null; // this is IE 8, which has a broken gOPD
2714
+ $gOPD = null; // this is IE 8, which has a broken gOPD
1679
2715
  }
1680
2716
  }
1681
2717
 
1682
- var throwTypeError = function () {
1683
- throw new $TypeError$5();
1684
- };
1685
- var ThrowTypeError = $gOPD$2
2718
+ var throwTypeError = function () { throw new $TypeError(); };
2719
+ var ThrowTypeError = $gOPD
1686
2720
  ? (function () {
1687
2721
  try {
1688
2722
  // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
@@ -1691,7 +2725,7 @@ var ThrowTypeError = $gOPD$2
1691
2725
  } catch (calleeThrows) {
1692
2726
  try {
1693
2727
  // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1694
- return $gOPD$2(arguments, 'callee').get;
2728
+ return $gOPD(arguments, 'callee').get;
1695
2729
  } catch (gOPDthrows) {
1696
2730
  return throwTypeError;
1697
2731
  }
@@ -1699,354 +2733,206 @@ var ThrowTypeError = $gOPD$2
1699
2733
  }())
1700
2734
  : throwTypeError;
1701
2735
 
1702
- var hasSymbols$2 = hasSymbols$3();
2736
+ var hasSymbols$2 = hasSymbols$1();
1703
2737
 
1704
2738
  var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1705
-
1706
- var needsEval = {};
2739
+ var generatorFunction = undefined$1;
2740
+ var asyncFunction = undefined$1;
2741
+ var asyncGenFunction = undefined$1;
1707
2742
 
1708
2743
  var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
1709
2744
 
1710
2745
  var INTRINSICS = {
1711
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
1712
2746
  '%Array%': Array,
1713
2747
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
2748
+ '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype,
1714
2749
  '%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1,
2750
+ '%ArrayPrototype%': Array.prototype,
2751
+ '%ArrayProto_entries%': Array.prototype.entries,
2752
+ '%ArrayProto_forEach%': Array.prototype.forEach,
2753
+ '%ArrayProto_keys%': Array.prototype.keys,
2754
+ '%ArrayProto_values%': Array.prototype.values,
1715
2755
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
1716
- '%AsyncFunction%': needsEval,
1717
- '%AsyncGenerator%': needsEval,
1718
- '%AsyncGeneratorFunction%': needsEval,
1719
- '%AsyncIteratorPrototype%': needsEval,
2756
+ '%AsyncFunction%': asyncFunction,
2757
+ '%AsyncFunctionPrototype%': undefined$1,
2758
+ '%AsyncGenerator%': undefined$1,
2759
+ '%AsyncGeneratorFunction%': asyncGenFunction,
2760
+ '%AsyncGeneratorPrototype%': undefined$1,
2761
+ '%AsyncIteratorPrototype%': undefined$1,
1720
2762
  '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1721
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
1722
2763
  '%Boolean%': Boolean,
2764
+ '%BooleanPrototype%': Boolean.prototype,
1723
2765
  '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
2766
+ '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype,
1724
2767
  '%Date%': Date,
2768
+ '%DatePrototype%': Date.prototype,
1725
2769
  '%decodeURI%': decodeURI,
1726
2770
  '%decodeURIComponent%': decodeURIComponent,
1727
2771
  '%encodeURI%': encodeURI,
1728
2772
  '%encodeURIComponent%': encodeURIComponent,
1729
2773
  '%Error%': Error,
2774
+ '%ErrorPrototype%': Error.prototype,
1730
2775
  '%eval%': eval, // eslint-disable-line no-eval
1731
2776
  '%EvalError%': EvalError,
2777
+ '%EvalErrorPrototype%': EvalError.prototype,
1732
2778
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
2779
+ '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype,
1733
2780
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1734
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
1735
- '%Function%': $Function,
1736
- '%GeneratorFunction%': needsEval,
2781
+ '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype,
2782
+ '%Function%': Function,
2783
+ '%FunctionPrototype%': Function.prototype,
2784
+ '%Generator%': undefined$1,
2785
+ '%GeneratorFunction%': generatorFunction,
2786
+ '%GeneratorPrototype%': undefined$1,
1737
2787
  '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
2788
+ '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1738
2789
  '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
2790
+ '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1739
2791
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
2792
+ '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype,
1740
2793
  '%isFinite%': isFinite,
1741
2794
  '%isNaN%': isNaN,
1742
2795
  '%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1743
2796
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
2797
+ '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1,
1744
2798
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1745
2799
  '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
2800
+ '%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype,
1746
2801
  '%Math%': Math,
1747
2802
  '%Number%': Number,
2803
+ '%NumberPrototype%': Number.prototype,
1748
2804
  '%Object%': Object,
2805
+ '%ObjectPrototype%': Object.prototype,
2806
+ '%ObjProto_toString%': Object.prototype.toString,
2807
+ '%ObjProto_valueOf%': Object.prototype.valueOf,
1749
2808
  '%parseFloat%': parseFloat,
1750
2809
  '%parseInt%': parseInt,
1751
2810
  '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
2811
+ '%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype,
2812
+ '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then,
2813
+ '%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all,
2814
+ '%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject,
2815
+ '%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve,
1752
2816
  '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1753
2817
  '%RangeError%': RangeError,
2818
+ '%RangeErrorPrototype%': RangeError.prototype,
1754
2819
  '%ReferenceError%': ReferenceError,
2820
+ '%ReferenceErrorPrototype%': ReferenceError.prototype,
1755
2821
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1756
2822
  '%RegExp%': RegExp,
2823
+ '%RegExpPrototype%': RegExp.prototype,
1757
2824
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1758
2825
  '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
2826
+ '%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype,
1759
2827
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
2828
+ '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype,
1760
2829
  '%String%': String,
1761
2830
  '%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1,
2831
+ '%StringPrototype%': String.prototype,
1762
2832
  '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
1763
- '%SyntaxError%': $SyntaxError$1,
2833
+ '%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1,
2834
+ '%SyntaxError%': SyntaxError,
2835
+ '%SyntaxErrorPrototype%': SyntaxError.prototype,
1764
2836
  '%ThrowTypeError%': ThrowTypeError,
1765
2837
  '%TypedArray%': TypedArray,
1766
- '%TypeError%': $TypeError$5,
2838
+ '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1,
2839
+ '%TypeError%': $TypeError,
2840
+ '%TypeErrorPrototype%': $TypeError.prototype,
1767
2841
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
2842
+ '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype,
1768
2843
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
2844
+ '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype,
1769
2845
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
2846
+ '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype,
1770
2847
  '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
2848
+ '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype,
1771
2849
  '%URIError%': URIError,
2850
+ '%URIErrorPrototype%': URIError.prototype,
1772
2851
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1773
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
1774
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
1775
- };
1776
-
1777
- var doEval = function doEval(name) {
1778
- var value;
1779
- if (name === '%AsyncFunction%') {
1780
- value = getEvalledConstructor('async function () {}');
1781
- } else if (name === '%GeneratorFunction%') {
1782
- value = getEvalledConstructor('function* () {}');
1783
- } else if (name === '%AsyncGeneratorFunction%') {
1784
- value = getEvalledConstructor('async function* () {}');
1785
- } else if (name === '%AsyncGenerator%') {
1786
- var fn = doEval('%AsyncGeneratorFunction%');
1787
- if (fn) {
1788
- value = fn.prototype;
1789
- }
1790
- } else if (name === '%AsyncIteratorPrototype%') {
1791
- var gen = doEval('%AsyncGenerator%');
1792
- if (gen) {
1793
- value = getProto(gen.prototype);
1794
- }
1795
- }
1796
-
1797
- INTRINSICS[name] = value;
1798
-
1799
- return value;
2852
+ '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype,
2853
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
2854
+ '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype
1800
2855
  };
1801
2856
 
1802
- var LEGACY_ALIASES = {
1803
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1804
- '%ArrayPrototype%': ['Array', 'prototype'],
1805
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1806
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1807
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1808
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1809
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1810
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1811
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1812
- '%BooleanPrototype%': ['Boolean', 'prototype'],
1813
- '%DataViewPrototype%': ['DataView', 'prototype'],
1814
- '%DatePrototype%': ['Date', 'prototype'],
1815
- '%ErrorPrototype%': ['Error', 'prototype'],
1816
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1817
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1818
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1819
- '%FunctionPrototype%': ['Function', 'prototype'],
1820
- '%Generator%': ['GeneratorFunction', 'prototype'],
1821
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1822
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1823
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1824
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1825
- '%JSONParse%': ['JSON', 'parse'],
1826
- '%JSONStringify%': ['JSON', 'stringify'],
1827
- '%MapPrototype%': ['Map', 'prototype'],
1828
- '%NumberPrototype%': ['Number', 'prototype'],
1829
- '%ObjectPrototype%': ['Object', 'prototype'],
1830
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1831
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1832
- '%PromisePrototype%': ['Promise', 'prototype'],
1833
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1834
- '%Promise_all%': ['Promise', 'all'],
1835
- '%Promise_reject%': ['Promise', 'reject'],
1836
- '%Promise_resolve%': ['Promise', 'resolve'],
1837
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1838
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1839
- '%RegExpPrototype%': ['RegExp', 'prototype'],
1840
- '%SetPrototype%': ['Set', 'prototype'],
1841
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1842
- '%StringPrototype%': ['String', 'prototype'],
1843
- '%SymbolPrototype%': ['Symbol', 'prototype'],
1844
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1845
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1846
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1847
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1848
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1849
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1850
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1851
- '%URIErrorPrototype%': ['URIError', 'prototype'],
1852
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1853
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
1854
- };
1855
-
1856
-
1857
-
1858
- var $concat$2 = functionBind.call(Function.call, Array.prototype.concat);
1859
- var $spliceApply = functionBind.call(Function.apply, Array.prototype.splice);
2857
+
1860
2858
  var $replace = functionBind.call(Function.call, String.prototype.replace);
1861
- var $strSlice = functionBind.call(Function.call, String.prototype.slice);
1862
2859
 
1863
2860
  /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1864
2861
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1865
2862
  var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1866
2863
  var stringToPath = function stringToPath(string) {
1867
- var first = $strSlice(string, 0, 1);
1868
- var last = $strSlice(string, -1);
1869
- if (first === '%' && last !== '%') {
1870
- throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
1871
- } else if (last === '%' && first !== '%') {
1872
- throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
1873
- }
1874
2864
  var result = [];
1875
2865
  $replace(string, rePropName, function (match, number, quote, subString) {
1876
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
2866
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
1877
2867
  });
1878
2868
  return result;
1879
2869
  };
1880
2870
  /* end adaptation */
1881
2871
 
1882
2872
  var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1883
- var intrinsicName = name;
1884
- var alias;
1885
- if (src(LEGACY_ALIASES, intrinsicName)) {
1886
- alias = LEGACY_ALIASES[intrinsicName];
1887
- intrinsicName = '%' + alias[0] + '%';
2873
+ if (!(name in INTRINSICS)) {
2874
+ throw new SyntaxError('intrinsic ' + name + ' does not exist!');
1888
2875
  }
1889
2876
 
1890
- if (src(INTRINSICS, intrinsicName)) {
1891
- var value = INTRINSICS[intrinsicName];
1892
- if (value === needsEval) {
1893
- value = doEval(intrinsicName);
1894
- }
1895
- if (typeof value === 'undefined' && !allowMissing) {
1896
- throw new $TypeError$5('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1897
- }
1898
-
1899
- return {
1900
- alias: alias,
1901
- name: intrinsicName,
1902
- value: value
1903
- };
2877
+ // istanbul ignore if // hopefully this is impossible to test :-)
2878
+ if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
2879
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1904
2880
  }
1905
2881
 
1906
- throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
2882
+ return INTRINSICS[name];
1907
2883
  };
1908
2884
 
1909
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
2885
+ var GetIntrinsic = function GetIntrinsic(name, allowMissing) {
1910
2886
  if (typeof name !== 'string' || name.length === 0) {
1911
- throw new $TypeError$5('intrinsic name must be a non-empty string');
2887
+ throw new TypeError('intrinsic name must be a non-empty string');
1912
2888
  }
1913
2889
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1914
- throw new $TypeError$5('"allowMissing" argument must be a boolean');
2890
+ throw new TypeError('"allowMissing" argument must be a boolean');
1915
2891
  }
1916
2892
 
1917
2893
  var parts = stringToPath(name);
1918
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1919
-
1920
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1921
- var intrinsicRealName = intrinsic.name;
1922
- var value = intrinsic.value;
1923
- var skipFurtherCaching = false;
1924
-
1925
- var alias = intrinsic.alias;
1926
- if (alias) {
1927
- intrinsicBaseName = alias[0];
1928
- $spliceApply(parts, $concat$2([0, 1], alias));
1929
- }
1930
-
1931
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1932
- var part = parts[i];
1933
- var first = $strSlice(part, 0, 1);
1934
- var last = $strSlice(part, -1);
1935
- if (
1936
- (
1937
- (first === '"' || first === "'" || first === '`')
1938
- || (last === '"' || last === "'" || last === '`')
1939
- )
1940
- && first !== last
1941
- ) {
1942
- throw new $SyntaxError$1('property names with quotes must have matching quotes');
1943
- }
1944
- if (part === 'constructor' || !isOwn) {
1945
- skipFurtherCaching = true;
1946
- }
1947
2894
 
1948
- intrinsicBaseName += '.' + part;
1949
- intrinsicRealName = '%' + intrinsicBaseName + '%';
1950
-
1951
- if (src(INTRINSICS, intrinsicRealName)) {
1952
- value = INTRINSICS[intrinsicRealName];
1953
- } else if (value != null) {
1954
- if (!(part in value)) {
1955
- if (!allowMissing) {
1956
- throw new $TypeError$5('base intrinsic for ' + name + ' exists, but the property is not available.');
1957
- }
1958
- return void undefined$1;
1959
- }
1960
- if ($gOPD$2 && (i + 1) >= parts.length) {
1961
- var desc = $gOPD$2(value, part);
1962
- isOwn = !!desc;
1963
-
1964
- // By convention, when a data property is converted to an accessor
1965
- // property to emulate a data property that does not suffer from
1966
- // the override mistake, that accessor's getter is marked with
1967
- // an `originalValue` property. Here, when we detect this, we
1968
- // uphold the illusion by pretending to see that original data
1969
- // property, i.e., returning the value rather than the getter
1970
- // itself.
1971
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1972
- value = desc.get;
1973
- } else {
1974
- value = value[part];
2895
+ var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
2896
+ for (var i = 1; i < parts.length; i += 1) {
2897
+ if (value != null) {
2898
+ if ($gOPD && (i + 1) >= parts.length) {
2899
+ var desc = $gOPD(value, parts[i]);
2900
+ if (!allowMissing && !(parts[i] in value)) {
2901
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1975
2902
  }
2903
+ value = desc ? (desc.get || desc.value) : value[parts[i]];
1976
2904
  } else {
1977
- isOwn = src(value, part);
1978
- value = value[part];
1979
- }
1980
-
1981
- if (isOwn && !skipFurtherCaching) {
1982
- INTRINSICS[intrinsicRealName] = value;
2905
+ value = value[parts[i]];
1983
2906
  }
1984
2907
  }
1985
2908
  }
1986
2909
  return value;
1987
2910
  };
1988
2911
 
1989
- var callBind = _commonjsHelpers.createCommonjsModule(function (module) {
2912
+ var $Function = GetIntrinsic('%Function%');
2913
+ var $apply = $Function.apply;
2914
+ var $call = $Function.call;
1990
2915
 
1991
-
1992
-
1993
-
1994
- var $apply = getIntrinsic('%Function.prototype.apply%');
1995
- var $call = getIntrinsic('%Function.prototype.call%');
1996
- var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
1997
-
1998
- var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1999
- var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
2000
- var $max = getIntrinsic('%Math.max%');
2001
-
2002
- if ($defineProperty) {
2003
- try {
2004
- $defineProperty({}, 'a', { value: 1 });
2005
- } catch (e) {
2006
- // IE 8 has a broken defineProperty
2007
- $defineProperty = null;
2008
- }
2009
- }
2010
-
2011
- module.exports = function callBind(originalFunction) {
2012
- var func = $reflectApply(functionBind, $call, arguments);
2013
- if ($gOPD && $defineProperty) {
2014
- var desc = $gOPD(func, 'length');
2015
- if (desc.configurable) {
2016
- // original length, plus the receiver, minus any additional arguments (after the receiver)
2017
- $defineProperty(
2018
- func,
2019
- 'length',
2020
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
2021
- );
2022
- }
2023
- }
2024
- return func;
2916
+ var callBind = function callBind() {
2917
+ return functionBind.apply($call, arguments);
2025
2918
  };
2026
2919
 
2027
- var applyBind = function applyBind() {
2028
- return $reflectApply(functionBind, $apply, arguments);
2920
+ var apply = function applyBind() {
2921
+ return functionBind.apply($apply, arguments);
2029
2922
  };
2923
+ callBind.apply = apply;
2030
2924
 
2031
- if ($defineProperty) {
2032
- $defineProperty(module.exports, 'apply', { value: applyBind });
2033
- } else {
2034
- module.exports.apply = applyBind;
2035
- }
2036
- });
2037
- callBind.apply;
2038
-
2039
- var $indexOf = callBind(getIntrinsic('String.prototype.indexOf'));
2925
+ var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
2040
2926
 
2041
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
2042
- var intrinsic = getIntrinsic(name, !!allowMissing);
2043
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
2927
+ var callBound = function callBoundIntrinsic(name, allowMissing) {
2928
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
2929
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
2044
2930
  return callBind(intrinsic);
2045
2931
  }
2046
2932
  return intrinsic;
2047
2933
  };
2048
2934
 
2049
- var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
2935
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
2050
2936
 
2051
2937
  if ($defineProperty) {
2052
2938
  try {
@@ -2059,7 +2945,7 @@ if ($defineProperty) {
2059
2945
 
2060
2946
 
2061
2947
 
2062
- var $isEnumerable$1 = callBound$1('Object.prototype.propertyIsEnumerable');
2948
+ var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
2063
2949
 
2064
2950
  // eslint-disable-next-line max-params
2065
2951
  var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
@@ -2073,7 +2959,7 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
2073
2959
  }
2074
2960
 
2075
2961
  // fallback for ES3
2076
- if (P in O && $isEnumerable$1(O, P) !== !!desc['[[Enumerable]]']) {
2962
+ if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
2077
2963
  // a non-enumerable existing property
2078
2964
  return false;
2079
2965
  }
@@ -2088,13 +2974,15 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
2088
2974
  return true;
2089
2975
  };
2090
2976
 
2091
- var $TypeError$4 = getIntrinsic('%TypeError%');
2092
- var $SyntaxError = getIntrinsic('%SyntaxError%');
2977
+ var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
2978
+
2979
+ var $TypeError$1 = GetIntrinsic('%TypeError%');
2980
+ var $SyntaxError = GetIntrinsic('%SyntaxError%');
2093
2981
 
2094
2982
 
2095
2983
 
2096
2984
  var predicates = {
2097
- // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
2985
+ // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
2098
2986
  'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
2099
2987
  if (Type(Desc) !== 'Object') {
2100
2988
  return false;
@@ -2117,7 +3005,7 @@ var predicates = {
2117
3005
  var isData = src(Desc, '[[Value]]');
2118
3006
  var IsAccessor = src(Desc, '[[Get]]') || src(Desc, '[[Set]]');
2119
3007
  if (isData && IsAccessor) {
2120
- throw new $TypeError$4('Property Descriptors may not be both accessor and data descriptors');
3008
+ throw new $TypeError$1('Property Descriptors may not be both accessor and data descriptors');
2121
3009
  }
2122
3010
  return true;
2123
3011
  }
@@ -2129,13 +3017,13 @@ var assertRecord = function assertRecord(Type, recordType, argumentName, value)
2129
3017
  throw new $SyntaxError('unknown record type: ' + recordType);
2130
3018
  }
2131
3019
  if (!predicate(Type, value)) {
2132
- throw new $TypeError$4(argumentName + ' must be a ' + recordType);
3020
+ throw new $TypeError$1(argumentName + ' must be a ' + recordType);
2133
3021
  }
2134
3022
  };
2135
3023
 
2136
- // https://262.ecma-international.org/5.1/#sec-8
3024
+ // https://www.ecma-international.org/ecma-262/5.1/#sec-8
2137
3025
 
2138
- var Type$1 = function Type(x) {
3026
+ var Type = function Type(x) {
2139
3027
  if (x === null) {
2140
3028
  return 'Null';
2141
3029
  }
@@ -2156,26 +3044,23 @@ var Type$1 = function Type(x) {
2156
3044
  }
2157
3045
  };
2158
3046
 
2159
- // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
3047
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-tostring
2160
3048
 
2161
- var Type = function Type(x) {
3049
+ var Type$1 = function Type$1(x) {
2162
3050
  if (typeof x === 'symbol') {
2163
3051
  return 'Symbol';
2164
3052
  }
2165
- if (typeof x === 'bigint') {
2166
- return 'BigInt';
2167
- }
2168
- return Type$1(x);
3053
+ return Type(x);
2169
3054
  };
2170
3055
 
2171
- // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
3056
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
2172
3057
 
2173
3058
  var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
2174
3059
  if (typeof Desc === 'undefined') {
2175
3060
  return Desc;
2176
3061
  }
2177
3062
 
2178
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
3063
+ assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2179
3064
 
2180
3065
  var obj = {};
2181
3066
  if ('[[Value]]' in Desc) {
@@ -2199,7 +3084,7 @@ var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
2199
3084
  return obj;
2200
3085
  };
2201
3086
 
2202
- var $gOPD$1 = getIntrinsic('%Object.getOwnPropertyDescriptor%');
3087
+ var $gOPD$1 = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
2203
3088
  if ($gOPD$1) {
2204
3089
  try {
2205
3090
  $gOPD$1([], 'length');
@@ -2211,85 +3096,65 @@ if ($gOPD$1) {
2211
3096
 
2212
3097
  var getOwnPropertyDescriptor = $gOPD$1;
2213
3098
 
2214
- var $Array = getIntrinsic('%Array%');
3099
+ var $Array = GetIntrinsic('%Array%');
2215
3100
 
2216
3101
  // eslint-disable-next-line global-require
2217
- var toStr$1 = !$Array.isArray && callBound$1('Object.prototype.toString');
3102
+ var toStr$4 = !$Array.isArray && callBound('Object.prototype.toString');
2218
3103
 
2219
- // https://ecma-international.org/ecma-262/6.0/#sec-isarray
3104
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
2220
3105
 
2221
3106
  var IsArray = $Array.isArray || function IsArray(argument) {
2222
- return toStr$1(argument) === '[object Array]';
3107
+ return toStr$4(argument) === '[object Array]';
2223
3108
  };
2224
3109
 
2225
- // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
3110
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
2226
3111
 
2227
3112
  var IsPropertyKey = function IsPropertyKey(argument) {
2228
3113
  return typeof argument === 'string' || typeof argument === 'symbol';
2229
3114
  };
2230
3115
 
2231
- var hasSymbols$1 = hasSymbols$3();
2232
- var hasToStringTag$1 = hasSymbols$1 && typeof Symbol.toStringTag === 'symbol';
2233
- var has;
2234
- var $exec;
2235
- var isRegexMarker;
2236
- var badStringifier;
2237
-
2238
- if (hasToStringTag$1) {
2239
- has = callBound$1('Object.prototype.hasOwnProperty');
2240
- $exec = callBound$1('RegExp.prototype.exec');
2241
- isRegexMarker = {};
3116
+ var regexExec = RegExp.prototype.exec;
3117
+ var gOPD = Object.getOwnPropertyDescriptor;
2242
3118
 
2243
- var throwRegexMarker = function () {
2244
- throw isRegexMarker;
2245
- };
2246
- badStringifier = {
2247
- toString: throwRegexMarker,
2248
- valueOf: throwRegexMarker
2249
- };
3119
+ var tryRegexExecCall = function tryRegexExec(value) {
3120
+ try {
3121
+ var lastIndex = value.lastIndex;
3122
+ value.lastIndex = 0; // eslint-disable-line no-param-reassign
2250
3123
 
2251
- if (typeof Symbol.toPrimitive === 'symbol') {
2252
- badStringifier[Symbol.toPrimitive] = throwRegexMarker;
3124
+ regexExec.call(value);
3125
+ return true;
3126
+ } catch (e) {
3127
+ return false;
3128
+ } finally {
3129
+ value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
2253
3130
  }
2254
- }
2255
-
2256
- var $toString = callBound$1('Object.prototype.toString');
2257
- var gOPD = Object.getOwnPropertyDescriptor;
3131
+ };
3132
+ var toStr$5 = Object.prototype.toString;
2258
3133
  var regexClass = '[object RegExp]';
3134
+ var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2259
3135
 
2260
- var isRegex = hasToStringTag$1
2261
- // eslint-disable-next-line consistent-return
2262
- ? function isRegex(value) {
2263
- if (!value || typeof value !== 'object') {
2264
- return false;
2265
- }
2266
-
2267
- var descriptor = gOPD(value, 'lastIndex');
2268
- var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
2269
- if (!hasLastIndexDataProperty) {
2270
- return false;
2271
- }
3136
+ var isRegex = function isRegex(value) {
3137
+ if (!value || typeof value !== 'object') {
3138
+ return false;
3139
+ }
3140
+ if (!hasToStringTag) {
3141
+ return toStr$5.call(value) === regexClass;
3142
+ }
2272
3143
 
2273
- try {
2274
- $exec(value, badStringifier);
2275
- } catch (e) {
2276
- return e === isRegexMarker;
2277
- }
3144
+ var descriptor = gOPD(value, 'lastIndex');
3145
+ var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
3146
+ if (!hasLastIndexDataProperty) {
3147
+ return false;
2278
3148
  }
2279
- : function isRegex(value) {
2280
- // In older browsers, typeof regex incorrectly returns 'function'
2281
- if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
2282
- return false;
2283
- }
2284
3149
 
2285
- return $toString(value) === regexClass;
2286
- };
3150
+ return tryRegexExecCall(value);
3151
+ };
2287
3152
 
2288
- // http://262.ecma-international.org/5.1/#sec-9.2
3153
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
2289
3154
 
2290
3155
  var ToBoolean = function ToBoolean(value) { return !!value; };
2291
3156
 
2292
- var $match = getIntrinsic('%Symbol.match%', true);
3157
+ var $match = GetIntrinsic('%Symbol.match%', true);
2293
3158
 
2294
3159
 
2295
3160
 
@@ -2311,27 +3176,6 @@ var IsRegExp = function IsRegExp(argument) {
2311
3176
  };
2312
3177
 
2313
3178
  var fnToStr = Function.prototype.toString;
2314
- var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
2315
- var badArrayLike;
2316
- var isCallableMarker;
2317
- if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
2318
- try {
2319
- badArrayLike = Object.defineProperty({}, 'length', {
2320
- get: function () {
2321
- throw isCallableMarker;
2322
- }
2323
- });
2324
- isCallableMarker = {};
2325
- // eslint-disable-next-line no-throw-literal
2326
- reflectApply(function () { throw 42; }, null, badArrayLike);
2327
- } catch (_) {
2328
- if (_ !== isCallableMarker) {
2329
- reflectApply = null;
2330
- }
2331
- }
2332
- } else {
2333
- reflectApply = null;
2334
- }
2335
3179
 
2336
3180
  var constructorRegex = /^\s*class\b/;
2337
3181
  var isES6ClassFn = function isES6ClassFunction(value) {
@@ -2352,52 +3196,36 @@ var tryFunctionObject = function tryFunctionToStr(value) {
2352
3196
  return false;
2353
3197
  }
2354
3198
  };
2355
- var toStr = Object.prototype.toString;
3199
+ var toStr$6 = Object.prototype.toString;
2356
3200
  var fnClass = '[object Function]';
2357
3201
  var genClass = '[object GeneratorFunction]';
2358
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2359
- /* globals document: false */
2360
- var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
2361
-
2362
- var isCallable = reflectApply
2363
- ? function isCallable(value) {
2364
- if (value === documentDotAll) { return true; }
2365
- if (!value) { return false; }
2366
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2367
- if (typeof value === 'function' && !value.prototype) { return true; }
2368
- try {
2369
- reflectApply(value, null, badArrayLike);
2370
- } catch (e) {
2371
- if (e !== isCallableMarker) { return false; }
2372
- }
2373
- return !isES6ClassFn(value);
2374
- }
2375
- : function isCallable(value) {
2376
- if (value === documentDotAll) { return true; }
2377
- if (!value) { return false; }
2378
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2379
- if (typeof value === 'function' && !value.prototype) { return true; }
2380
- if (hasToStringTag) { return tryFunctionObject(value); }
2381
- if (isES6ClassFn(value)) { return false; }
2382
- var strClass = toStr.call(value);
2383
- return strClass === fnClass || strClass === genClass;
2384
- };
3202
+ var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
3203
+
3204
+ var isCallable = function isCallable(value) {
3205
+ if (!value) { return false; }
3206
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
3207
+ if (typeof value === 'function' && !value.prototype) { return true; }
3208
+ if (hasToStringTag$1) { return tryFunctionObject(value); }
3209
+ if (isES6ClassFn(value)) { return false; }
3210
+ var strClass = toStr$6.call(value);
3211
+ return strClass === fnClass || strClass === genClass;
3212
+ };
2385
3213
 
2386
- // http://262.ecma-international.org/5.1/#sec-9.11
3214
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
2387
3215
 
2388
3216
  var IsCallable = isCallable;
2389
3217
 
2390
- var $TypeError$3 = getIntrinsic('%TypeError%');
3218
+ var $TypeError$2 = GetIntrinsic('%TypeError%');
2391
3219
 
2392
3220
 
2393
3221
 
2394
3222
 
2395
3223
 
2396
- // https://262.ecma-international.org/5.1/#sec-8.10.5
3224
+ // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
2397
3225
 
2398
3226
  var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
2399
- if (Type(Obj) !== 'Object') {
2400
- throw new $TypeError$3('ToPropertyDescriptor requires an object');
3227
+ if (Type$1(Obj) !== 'Object') {
3228
+ throw new $TypeError$2('ToPropertyDescriptor requires an object');
2401
3229
  }
2402
3230
 
2403
3231
  var desc = {};
@@ -2416,29 +3244,29 @@ var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
2416
3244
  if (src(Obj, 'get')) {
2417
3245
  var getter = Obj.get;
2418
3246
  if (typeof getter !== 'undefined' && !IsCallable(getter)) {
2419
- throw new $TypeError$3('getter must be a function');
3247
+ throw new TypeError('getter must be a function');
2420
3248
  }
2421
3249
  desc['[[Get]]'] = getter;
2422
3250
  }
2423
3251
  if (src(Obj, 'set')) {
2424
3252
  var setter = Obj.set;
2425
3253
  if (typeof setter !== 'undefined' && !IsCallable(setter)) {
2426
- throw new $TypeError$3('setter must be a function');
3254
+ throw new $TypeError$2('setter must be a function');
2427
3255
  }
2428
3256
  desc['[[Set]]'] = setter;
2429
3257
  }
2430
3258
 
2431
3259
  if ((src(desc, '[[Get]]') || src(desc, '[[Set]]')) && (src(desc, '[[Value]]') || src(desc, '[[Writable]]'))) {
2432
- throw new $TypeError$3('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
3260
+ throw new $TypeError$2('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
2433
3261
  }
2434
3262
  return desc;
2435
3263
  };
2436
3264
 
2437
- var $TypeError$2 = getIntrinsic('%TypeError%');
3265
+ var $TypeError$3 = GetIntrinsic('%TypeError%');
2438
3266
 
2439
3267
 
2440
3268
 
2441
- var $isEnumerable = callBound$1('Object.prototype.propertyIsEnumerable');
3269
+ var $isEnumerable$1 = callBound('Object.prototype.propertyIsEnumerable');
2442
3270
 
2443
3271
 
2444
3272
 
@@ -2448,14 +3276,14 @@ var $isEnumerable = callBound$1('Object.prototype.propertyIsEnumerable');
2448
3276
 
2449
3277
 
2450
3278
 
2451
- // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
3279
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
2452
3280
 
2453
3281
  var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2454
- if (Type(O) !== 'Object') {
2455
- throw new $TypeError$2('Assertion failed: O must be an Object');
3282
+ if (Type$1(O) !== 'Object') {
3283
+ throw new $TypeError$3('Assertion failed: O must be an Object');
2456
3284
  }
2457
3285
  if (!IsPropertyKey(P)) {
2458
- throw new $TypeError$2('Assertion failed: P must be a Property Key');
3286
+ throw new $TypeError$3('Assertion failed: P must be a Property Key');
2459
3287
  }
2460
3288
  if (!src(O, P)) {
2461
3289
  return void 0;
@@ -2466,7 +3294,7 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2466
3294
  var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
2467
3295
  return {
2468
3296
  '[[Configurable]]': !(arrayLength || regexLastIndex),
2469
- '[[Enumerable]]': $isEnumerable(O, P),
3297
+ '[[Enumerable]]': $isEnumerable$1(O, P),
2470
3298
  '[[Value]]': O[P],
2471
3299
  '[[Writable]]': true
2472
3300
  };
@@ -2474,14 +3302,14 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2474
3302
  return ToPropertyDescriptor(getOwnPropertyDescriptor(O, P));
2475
3303
  };
2476
3304
 
2477
- // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
3305
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
2478
3306
 
2479
3307
  var IsDataDescriptor = function IsDataDescriptor(Desc) {
2480
3308
  if (typeof Desc === 'undefined') {
2481
3309
  return false;
2482
3310
  }
2483
3311
 
2484
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
3312
+ assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2485
3313
 
2486
3314
  if (!src(Desc, '[[Value]]') && !src(Desc, '[[Writable]]')) {
2487
3315
  return false;
@@ -2494,14 +3322,14 @@ var isPrimitive = function isPrimitive(value) {
2494
3322
  return value === null || (typeof value !== 'function' && typeof value !== 'object');
2495
3323
  };
2496
3324
 
2497
- var $Object$1 = getIntrinsic('%Object%');
3325
+ var $Object = GetIntrinsic('%Object%');
2498
3326
 
2499
3327
 
2500
3328
 
2501
- var $preventExtensions = $Object$1.preventExtensions;
2502
- var $isExtensible = $Object$1.isExtensible;
3329
+ var $preventExtensions = $Object.preventExtensions;
3330
+ var $isExtensible = $Object.isExtensible;
2503
3331
 
2504
- // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
3332
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
2505
3333
 
2506
3334
  var IsExtensible = $preventExtensions
2507
3335
  ? function IsExtensible(obj) {
@@ -2515,7 +3343,7 @@ var _isNaN = Number.isNaN || function isNaN(a) {
2515
3343
  return a !== a;
2516
3344
  };
2517
3345
 
2518
- // http://262.ecma-international.org/5.1/#sec-9.12
3346
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
2519
3347
 
2520
3348
  var SameValue = function SameValue(x, y) {
2521
3349
  if (x === y) { // 0 === -0, but they are not identical.
@@ -2525,7 +3353,7 @@ var SameValue = function SameValue(x, y) {
2525
3353
  return _isNaN(x) && _isNaN(y);
2526
3354
  };
2527
3355
 
2528
- var $TypeError$1 = getIntrinsic('%TypeError%');
3356
+ var $TypeError$4 = GetIntrinsic('%TypeError%');
2529
3357
 
2530
3358
 
2531
3359
 
@@ -2537,18 +3365,18 @@ var $TypeError$1 = getIntrinsic('%TypeError%');
2537
3365
 
2538
3366
 
2539
3367
 
2540
- // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
3368
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
2541
3369
 
2542
3370
  var CreateDataProperty = function CreateDataProperty(O, P, V) {
2543
- if (Type(O) !== 'Object') {
2544
- throw new $TypeError$1('Assertion failed: Type(O) is not Object');
3371
+ if (Type$1(O) !== 'Object') {
3372
+ throw new $TypeError$4('Assertion failed: Type(O) is not Object');
2545
3373
  }
2546
3374
  if (!IsPropertyKey(P)) {
2547
- throw new $TypeError$1('Assertion failed: IsPropertyKey(P) is not true');
3375
+ throw new $TypeError$4('Assertion failed: IsPropertyKey(P) is not true');
2548
3376
  }
2549
3377
  var oldDesc = OrdinaryGetOwnProperty(O, P);
2550
- var extensible = !oldDesc || IsExtensible(O);
2551
- var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
3378
+ var extensible = oldDesc || IsExtensible(O);
3379
+ var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
2552
3380
  if (immutable || !extensible) {
2553
3381
  return false;
2554
3382
  }
@@ -2567,44 +3395,44 @@ var CreateDataProperty = function CreateDataProperty(O, P, V) {
2567
3395
  );
2568
3396
  };
2569
3397
 
2570
- var $TypeError = getIntrinsic('%TypeError%');
3398
+ var $TypeError$5 = GetIntrinsic('%TypeError%');
2571
3399
 
2572
- // http://262.ecma-international.org/5.1/#sec-9.10
3400
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
2573
3401
 
2574
3402
  var CheckObjectCoercible = function CheckObjectCoercible(value, optMessage) {
2575
3403
  if (value == null) {
2576
- throw new $TypeError(optMessage || ('Cannot call method on ' + value));
3404
+ throw new $TypeError$5(optMessage || ('Cannot call method on ' + value));
2577
3405
  }
2578
3406
  return value;
2579
3407
  };
2580
3408
 
2581
3409
  var RequireObjectCoercible = CheckObjectCoercible;
2582
3410
 
2583
- var $Object = getIntrinsic('%Object%');
3411
+ var $Object$1 = GetIntrinsic('%Object%');
2584
3412
 
2585
3413
 
2586
3414
 
2587
- // https://ecma-international.org/ecma-262/6.0/#sec-toobject
3415
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
2588
3416
 
2589
3417
  var ToObject = function ToObject(value) {
2590
3418
  RequireObjectCoercible(value);
2591
- return $Object(value);
3419
+ return $Object$1(value);
2592
3420
  };
2593
3421
 
2594
- var $gOPD = Object.getOwnPropertyDescriptor;
3422
+ var $gOPD$2 = Object.getOwnPropertyDescriptor;
2595
3423
  var $getOwnNames = Object.getOwnPropertyNames;
2596
3424
  var $getSymbols = Object.getOwnPropertySymbols;
2597
- var $concat$1 = callBound$1('Array.prototype.concat');
2598
- var $reduce = callBound$1('Array.prototype.reduce');
3425
+ var $concat = callBound('Array.prototype.concat');
3426
+ var $reduce = callBound('Array.prototype.reduce');
2599
3427
  var getAll = $getSymbols ? function (obj) {
2600
- return $concat$1($getOwnNames(obj), $getSymbols(obj));
3428
+ return $concat($getOwnNames(obj), $getSymbols(obj));
2601
3429
  } : $getOwnNames;
2602
3430
 
2603
- var isES5$1 = IsCallable($gOPD) && IsCallable($getOwnNames);
3431
+ var isES5 = IsCallable($gOPD$2) && IsCallable($getOwnNames);
2604
3432
 
2605
- var implementation$1 = function getOwnPropertyDescriptors(value) {
3433
+ var implementation$2 = function getOwnPropertyDescriptors(value) {
2606
3434
  RequireObjectCoercible(value);
2607
- if (!isES5$1) {
3435
+ if (!isES5) {
2608
3436
  throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
2609
3437
  }
2610
3438
 
@@ -2612,7 +3440,7 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
2612
3440
  return $reduce(
2613
3441
  getAll(O),
2614
3442
  function (acc, key) {
2615
- var descriptor = $gOPD(O, key);
3443
+ var descriptor = $gOPD$2(O, key);
2616
3444
  if (typeof descriptor !== 'undefined') {
2617
3445
  CreateDataProperty(acc, key, descriptor);
2618
3446
  }
@@ -2622,40 +3450,34 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
2622
3450
  );
2623
3451
  };
2624
3452
 
2625
- var polyfill$2 = function getPolyfill() {
2626
- return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$1;
3453
+ var polyfill = function getPolyfill() {
3454
+ return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$2;
2627
3455
  };
2628
3456
 
2629
- var shim$1 = function shimGetOwnPropertyDescriptors() {
2630
- var polyfill = polyfill$2();
3457
+ var shim = function shimGetOwnPropertyDescriptors() {
3458
+ var polyfill$1 = polyfill();
2631
3459
  defineProperties_1(
2632
3460
  Object,
2633
- { getOwnPropertyDescriptors: polyfill },
2634
- { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } }
3461
+ { getOwnPropertyDescriptors: polyfill$1 },
3462
+ { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill$1; } }
2635
3463
  );
2636
- return polyfill;
3464
+ return polyfill$1;
2637
3465
  };
2638
3466
 
2639
- var bound = callBind(polyfill$2(), Object);
2640
-
2641
- defineProperties_1(bound, {
2642
- getPolyfill: polyfill$2,
2643
- implementation: implementation$1,
2644
- shim: shim$1
3467
+ defineProperties_1(implementation$2, {
3468
+ getPolyfill: polyfill,
3469
+ implementation: implementation$2,
3470
+ shim: shim
2645
3471
  });
2646
3472
 
2647
- var object_getownpropertydescriptors = bound;
3473
+ var object_getownpropertydescriptors = implementation$2;
2648
3474
 
2649
- // TODO; semver-major: remove
2650
-
2651
- var callBound = callBound$1;
2652
-
2653
- var isES5 = typeof Object.defineProperty === 'function'
3475
+ var isES5$1 = typeof Object.defineProperty === 'function'
2654
3476
  && typeof Object.defineProperties === 'function';
2655
3477
 
2656
3478
  var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
2657
3479
 
2658
- if (!isES5 || !hasProto) {
3480
+ if (!isES5$1 || !hasProto) {
2659
3481
  throw new TypeError('util.promisify requires a true ES5 environment, that also supports `__proto__`');
2660
3482
  }
2661
3483
 
@@ -2668,15 +3490,15 @@ if (typeof Promise !== 'function') {
2668
3490
 
2669
3491
 
2670
3492
  var $slice = callBound('Array.prototype.slice');
2671
- var $concat = callBound('Array.prototype.concat');
3493
+ var $concat$1 = callBound('Array.prototype.concat');
2672
3494
  var $forEach = callBound('Array.prototype.forEach');
2673
3495
 
2674
- var hasSymbols = hasSymbols$3();
3496
+ var hasSymbols$3 = hasSymbols$1();
2675
3497
 
2676
- var kCustomPromisifiedSymbol = hasSymbols ? Symbol('util.promisify.custom') : null;
2677
- var kCustomPromisifyArgsSymbol = hasSymbols ? Symbol('customPromisifyArgs') : null;
3498
+ var kCustomPromisifiedSymbol = hasSymbols$3 ? Symbol('util.promisify.custom') : null;
3499
+ var kCustomPromisifyArgsSymbol = hasSymbols$3 ? Symbol('customPromisifyArgs') : null;
2678
3500
 
2679
- var implementation = function promisify(orig) {
3501
+ var implementation$3 = function promisify(orig) {
2680
3502
  if (typeof orig !== 'function') {
2681
3503
  var error = new TypeError('The "original" argument must be of type function');
2682
3504
  error.name = 'TypeError [ERR_INVALID_ARG_TYPE]';
@@ -2684,7 +3506,7 @@ var implementation = function promisify(orig) {
2684
3506
  throw error;
2685
3507
  }
2686
3508
 
2687
- if (hasSymbols && orig[kCustomPromisifiedSymbol]) {
3509
+ if (hasSymbols$3 && orig[kCustomPromisifiedSymbol]) {
2688
3510
  var customFunction = orig[kCustomPromisifiedSymbol];
2689
3511
  if (typeof customFunction !== 'function') {
2690
3512
  throw new TypeError('The [util.promisify.custom] property must be a function');
@@ -2706,7 +3528,7 @@ var implementation = function promisify(orig) {
2706
3528
  var args = $slice(arguments);
2707
3529
  var self = this; // eslint-disable-line no-invalid-this
2708
3530
  return new Promise(function (resolve, reject) {
2709
- orig.apply(self, $concat(args, function (err) {
3531
+ orig.apply(self, $concat$1(args, function (err) {
2710
3532
  var values = arguments.length > 1 ? $slice(arguments, 1) : [];
2711
3533
  if (err) {
2712
3534
  reject(err);
@@ -2736,17 +3558,17 @@ var implementation = function promisify(orig) {
2736
3558
 
2737
3559
  var custom = kCustomPromisifiedSymbol;
2738
3560
  var customPromisifyArgs = kCustomPromisifyArgsSymbol;
2739
- implementation.custom = custom;
2740
- implementation.customPromisifyArgs = customPromisifyArgs;
3561
+ implementation$3.custom = custom;
3562
+ implementation$3.customPromisifyArgs = customPromisifyArgs;
2741
3563
 
2742
3564
  var polyfill$1 = function getPolyfill() {
2743
3565
  if (typeof util.util.promisify === 'function') {
2744
3566
  return util.util.promisify;
2745
3567
  }
2746
- return implementation;
3568
+ return implementation$3;
2747
3569
  };
2748
3570
 
2749
- var shim = function shimUtilPromisify() {
3571
+ var shim$1 = function shimUtilPromisify() {
2750
3572
  var polyfill = polyfill$1();
2751
3573
  if (polyfill !== util.util.promisify) {
2752
3574
  Object.defineProperty(util.util, 'promisify', {
@@ -2759,20 +3581,20 @@ var shim = function shimUtilPromisify() {
2759
3581
  return polyfill;
2760
3582
  };
2761
3583
 
2762
- var polyfill = polyfill$1();
3584
+ var polyfill$2 = polyfill$1();
2763
3585
 
2764
3586
 
2765
3587
  /* eslint-disable no-unused-vars */
2766
3588
  var boundPromisify = function promisify(orig) {
2767
3589
  /* eslint-enable no-unused-vars */
2768
- return polyfill.apply(util.util, arguments);
3590
+ return polyfill$2.apply(util.util, arguments);
2769
3591
  };
2770
3592
  defineProperties_1(boundPromisify, {
2771
- custom: polyfill.custom,
2772
- customPromisifyArgs: polyfill.customPromisifyArgs,
3593
+ custom: polyfill$2.custom,
3594
+ customPromisifyArgs: polyfill$2.customPromisifyArgs,
2773
3595
  getPolyfill: polyfill$1,
2774
- implementation: implementation,
2775
- shim: shim
3596
+ implementation: implementation$3,
3597
+ shim: shim$1
2776
3598
  });
2777
3599
 
2778
3600
  var util_promisify = boundPromisify;
@@ -2791,7 +3613,7 @@ function connect() {
2791
3613
  };
2792
3614
  }
2793
3615
 
2794
- var connection = mysql__default['default'].createConnection(config);
3616
+ var connection = mysql.createConnection(config);
2795
3617
  return {
2796
3618
  query: function query(sql, args) {
2797
3619
  return util.util.promisify(connection.query).call(connection, sql, args);
@@ -2813,16 +3635,16 @@ function connect() {
2813
3635
 
2814
3636
  var db = connect;
2815
3637
 
2816
- var _this$1 = undefined;
3638
+ var _this$3 = undefined;
2817
3639
 
2818
- var config$1 = {
3640
+ var config = {
2819
3641
  host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
2820
3642
  user: 'nasp',
2821
3643
  password: 'uRNkF9SkfXQs6AKK',
2822
3644
  database: 'user'
2823
3645
  };
2824
3646
 
2825
- var findUser$1 = function () {
3647
+ var findUser = function () {
2826
3648
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(email) {
2827
3649
  var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2828
3650
  var db$1, query, res, user, hash, passwordsMatch, user_shared, occupation_id;
@@ -2834,7 +3656,7 @@ var findUser$1 = function () {
2834
3656
  _context.prev = 1;
2835
3657
 
2836
3658
 
2837
- db$1 = db(config$1);
3659
+ db$1 = db(config);
2838
3660
 
2839
3661
  query = '\n select * \n from user \n where trim(lower(email)) = ?\n ';
2840
3662
  _context.next = 6;
@@ -2930,7 +3752,7 @@ var findUser$1 = function () {
2930
3752
  };
2931
3753
  }();
2932
3754
 
2933
- var updateUser$1 = function () {
3755
+ var updateUser = function () {
2934
3756
  var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
2935
3757
  var db$1, query, res, hash, columns, i, column, occupation_name;
2936
3758
  return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
@@ -2943,7 +3765,7 @@ var updateUser$1 = function () {
2943
3765
 
2944
3766
  validateUserData(data);
2945
3767
 
2946
- db$1 = db(config$1);
3768
+ db$1 = db(config);
2947
3769
 
2948
3770
  _context2.next = 6;
2949
3771
  return db$1.beginTransaction();
@@ -3050,7 +3872,7 @@ var updateUser$1 = function () {
3050
3872
 
3051
3873
  return _context2.abrupt('return', {
3052
3874
  error: '',
3053
- user: findUser$1(data.email)
3875
+ user: findUser(data.email)
3054
3876
  });
3055
3877
 
3056
3878
  case 45:
@@ -3162,7 +3984,7 @@ var getOccupationNameById = function () {
3162
3984
  return _context3.stop();
3163
3985
  }
3164
3986
  }
3165
- }, _callee3, _this$1);
3987
+ }, _callee3, _this$3);
3166
3988
  }));
3167
3989
 
3168
3990
  return function getOccupationNameById(_x5, _x6) {
@@ -3170,7 +3992,7 @@ var getOccupationNameById = function () {
3170
3992
  };
3171
3993
  }();
3172
3994
 
3173
- var createUser$1 = function () {
3995
+ var createUser = function () {
3174
3996
  var _ref4 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee4(data) {
3175
3997
  var db$1, query, res, hash, columns, i, column, user_id, occupation_name;
3176
3998
  return asyncToGenerator.regenerator.wrap(function _callee4$(_context4) {
@@ -3183,7 +4005,7 @@ var createUser$1 = function () {
3183
4005
 
3184
4006
  validateUserData(data, true);
3185
4007
 
3186
- db$1 = db(config$1);
4008
+ db$1 = db(config);
3187
4009
 
3188
4010
  _context4.next = 6;
3189
4011
  return db$1.beginTransaction();
@@ -3279,7 +4101,7 @@ var createUser$1 = function () {
3279
4101
  case 39:
3280
4102
  return _context4.abrupt('return', {
3281
4103
  error: '',
3282
- user: findUser$1(data.email)
4104
+ user: findUser(data.email)
3283
4105
  });
3284
4106
 
3285
4107
  case 42:
@@ -3317,7 +4139,7 @@ var createUser$1 = function () {
3317
4139
  };
3318
4140
  }();
3319
4141
 
3320
- var createUser = function () {
4142
+ var createUser$1 = function () {
3321
4143
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(data) {
3322
4144
  var res;
3323
4145
  return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
@@ -3325,7 +4147,7 @@ var createUser = function () {
3325
4147
  switch (_context.prev = _context.next) {
3326
4148
  case 0:
3327
4149
  _context.next = 2;
3328
- return createUser$1(data);
4150
+ return createUser(data);
3329
4151
 
3330
4152
  case 2:
3331
4153
  res = _context.sent;
@@ -3353,7 +4175,7 @@ var createUser = function () {
3353
4175
  };
3354
4176
  }();
3355
4177
 
3356
- var updateUser = function () {
4178
+ var updateUser$1 = function () {
3357
4179
  var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
3358
4180
  var res;
3359
4181
  return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
@@ -3361,7 +4183,7 @@ var updateUser = function () {
3361
4183
  switch (_context2.prev = _context2.next) {
3362
4184
  case 0:
3363
4185
  _context2.next = 2;
3364
- return updateUser$1(data);
4186
+ return updateUser(data);
3365
4187
 
3366
4188
  case 2:
3367
4189
  res = _context2.sent;
@@ -3389,7 +4211,7 @@ var updateUser = function () {
3389
4211
  };
3390
4212
  }();
3391
4213
 
3392
- var findUser = function () {
4214
+ var findUser$1 = function () {
3393
4215
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(_ref4) {
3394
4216
  var email = _ref4.email,
3395
4217
  password = _ref4.password;
@@ -3399,7 +4221,7 @@ var findUser = function () {
3399
4221
  switch (_context3.prev = _context3.next) {
3400
4222
  case 0:
3401
4223
  _context3.next = 2;
3402
- return findUser$1(email, password);
4224
+ return findUser(email, password);
3403
4225
 
3404
4226
  case 2:
3405
4227
  res = _context3.sent;
@@ -3429,17 +4251,17 @@ var findUser = function () {
3429
4251
 
3430
4252
  var user = /*#__PURE__*/Object.freeze({
3431
4253
  __proto__: null,
3432
- createUser: createUser,
3433
- updateUser: updateUser,
3434
- findUser: findUser
4254
+ createUser: createUser$1,
4255
+ updateUser: updateUser$1,
4256
+ findUser: findUser$1
3435
4257
  });
3436
4258
 
3437
- var localStrategy = new Local__default['default'].Strategy({
4259
+ var localStrategy = new Local.Strategy({
3438
4260
  usernameField: 'email',
3439
4261
  passwordField: 'password'
3440
4262
  }, function (email, password, done) {
3441
4263
 
3442
- findUser({ email: email, password: password }).then(function (user) {
4264
+ findUser$1({ email: email, password: password }).then(function (user) {
3443
4265
  done(null, user);
3444
4266
  }).catch(function (error) {
3445
4267
  done(error);
@@ -3451,9 +4273,9 @@ var passportLocal = /*#__PURE__*/Object.freeze({
3451
4273
  localStrategy: localStrategy
3452
4274
  });
3453
4275
 
3454
- var _this = undefined;
4276
+ var _this$4 = undefined;
3455
4277
 
3456
- var config = {
4278
+ var config$1 = {
3457
4279
  host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
3458
4280
  user: 'nasp',
3459
4281
  password: 'uRNkF9SkfXQs6AKK',
@@ -3467,7 +4289,7 @@ var getOccupation = function () {
3467
4289
  while (1) {
3468
4290
  switch (_context.prev = _context.next) {
3469
4291
  case 0:
3470
- db$1 = db(config);
4292
+ db$1 = db(config$1);
3471
4293
  query = '\n select name as label, id as value\n from occupation\n where type = ?\n ';
3472
4294
  _context.next = 4;
3473
4295
  return db$1.query(query, [type]);
@@ -3485,7 +4307,7 @@ var getOccupation = function () {
3485
4307
  return _context.stop();
3486
4308
  }
3487
4309
  }
3488
- }, _callee, _this);
4310
+ }, _callee, _this$4);
3489
4311
  }));
3490
4312
 
3491
4313
  return function getOccupation(_x) {
@@ -3500,7 +4322,7 @@ var getFieldsAndOptions = function () {
3500
4322
  while (1) {
3501
4323
  switch (_context2.prev = _context2.next) {
3502
4324
  case 0:
3503
- db$1 = db(config);
4325
+ db$1 = db(config$1);
3504
4326
  query = '\n select * \n from field\n where occupation_id = ?\n order by sorting\n ';
3505
4327
  _context2.next = 4;
3506
4328
  return db$1.query(query, [occupation]);
@@ -3548,7 +4370,7 @@ var getFieldsAndOptions = function () {
3548
4370
  return _context2.stop();
3549
4371
  }
3550
4372
  }
3551
- }, _callee2, _this);
4373
+ }, _callee2, _this$4);
3552
4374
  }));
3553
4375
 
3554
4376
  return function getFieldsAndOptions(_x2) {
@@ -3619,8 +4441,8 @@ var ProcessData = (function () {
3619
4441
  })();
3620
4442
 
3621
4443
  var LoginForm_1 = LoginForm;
3622
- var SignupForm_1 = SignupForm$1;
3623
- var ProfileForm_1 = SignupForm;
4444
+ var SignupForm_1 = SignupForm;
4445
+ var ProfileForm_1 = SignupForm$1;
3624
4446
  var AuthCookies_1 = authCookies;
3625
4447
  var AuthHooks_1 = hooks;
3626
4448
  var Iron_1 = iron;