@mjhls/mjh-framework 1.0.994-CypressV3 → 1.0.994-invalidelement-v1

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 (225) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD.js +6 -6
  3. package/dist/cjs/AD300x250.js +5 -5
  4. package/dist/cjs/AD300x250x600.js +5 -5
  5. package/dist/cjs/AD728x90.js +6 -6
  6. package/dist/cjs/ADFloatingFooter.js +8 -8
  7. package/dist/cjs/ADFooter.js +5 -5
  8. package/dist/cjs/ADGutter.js +8 -8
  9. package/dist/cjs/{ADInfeed-e87afe8a.js → ADInfeed-f316b66a.js} +5 -5
  10. package/dist/cjs/ADSkyscraper.js +8 -8
  11. package/dist/cjs/ADSponsoredResources.js +8 -8
  12. package/dist/cjs/ADWebcast.js +8 -8
  13. package/dist/cjs/ADWelcome.js +12 -12
  14. package/dist/cjs/{ADlgInfeed-b5a3d436.js → ADlgInfeed-2003306e.js} +3 -3
  15. package/dist/cjs/AccordionPanel.js +17 -17
  16. package/dist/cjs/AdSlot.js +9 -9
  17. package/dist/cjs/AdSlotsProvider.js +7 -8
  18. package/dist/cjs/AlgoliaSearch.js +1214 -1129
  19. package/dist/cjs/AlphabeticList.js +12 -12
  20. package/dist/cjs/ArticleCarousel.js +5 -5
  21. package/dist/cjs/ArticleProgramLandingPage.js +16 -16
  22. package/dist/cjs/ArticleSeriesLandingPage.js +11 -11
  23. package/dist/cjs/ArticleSeriesListing.js +29 -29
  24. package/dist/cjs/Auth.js +23075 -242
  25. package/dist/cjs/AuthWrapper.js +120 -30
  26. package/dist/cjs/{AuthorComponent-39b37d84.js → AuthorComponent-7d00f6d5.js} +9 -9
  27. package/dist/cjs/{BlockContent-9ebd251f.js → BlockContent-96b44364.js} +18 -18
  28. package/dist/cjs/Breadcrumbs.js +17 -17
  29. package/dist/cjs/CMEDeck.js +61 -61
  30. package/dist/cjs/Column1.js +7 -7
  31. package/dist/cjs/Column2.js +15 -15
  32. package/dist/cjs/Column3.js +27 -27
  33. package/dist/cjs/ConferenceArticleCard.js +27 -27
  34. package/dist/cjs/{ConferenceBanner-6c9e718a.js → ConferenceBanner-213003ce.js} +3 -3
  35. package/dist/cjs/ContentCardPaginated.js +49 -49
  36. package/dist/cjs/DeckContent.js +66 -66
  37. package/dist/cjs/DeckQueue.js +57 -57
  38. package/dist/cjs/DeckQueuePaginated.js +46 -46
  39. package/dist/cjs/{Dfp-9be904d5.js → Dfp-c313a700.js} +17 -17
  40. package/dist/cjs/EventsDeck.js +107 -107
  41. package/dist/cjs/ExternalResources.js +36 -36
  42. package/dist/cjs/Feature.js +17 -17
  43. package/dist/cjs/ForbesHero.js +25 -25
  44. package/dist/cjs/GridContent.js +134 -134
  45. package/dist/cjs/GridContentPaginated.js +121 -121
  46. package/dist/cjs/GridHero.js +26 -26
  47. package/dist/cjs/GroupDeck.js +33 -33
  48. package/dist/cjs/HamMagazine.js +130 -130
  49. package/dist/cjs/Header.js +9 -9
  50. package/dist/cjs/HealthCareProfessionalModal.js +18 -18
  51. package/dist/cjs/Hero.js +5 -5
  52. package/dist/cjs/HighlightenVideo.js +13 -13
  53. package/dist/cjs/HorizontalArticleListing.js +30 -30
  54. package/dist/cjs/HorizontalHero.js +17 -17
  55. package/dist/cjs/{ImageSlider-6c00b878.js → ImageSlider-ca708da8.js} +1315 -176
  56. package/dist/cjs/IssueContentDeck.js +49 -49
  57. package/dist/cjs/IssueDeck.js +48 -48
  58. package/dist/cjs/IssueLanding.js +50 -50
  59. package/dist/cjs/KMTracker.js +15 -15
  60. package/dist/cjs/LeftNav.js +17 -17
  61. package/dist/cjs/MasterDeck.js +47 -47
  62. package/dist/cjs/MasterDeckPaginated.js +37 -37
  63. package/dist/cjs/{Tooltip-f075b7ef.js → MediaSeriesCard-f6db8f70.js} +678 -531
  64. package/dist/cjs/MediaSeriesLanding.js +56 -57
  65. package/dist/cjs/MediaSeriesLandingPaginated.js +54 -55
  66. package/dist/cjs/NavDvm.js +57 -57
  67. package/dist/cjs/{NavFooter-4799de4b.js → NavFooter-880e9d87.js} +11 -11
  68. package/dist/cjs/NavMagazine.js +116 -116
  69. package/dist/cjs/NavNative.js +106 -106
  70. package/dist/cjs/OncliveHero.js +11 -11
  71. package/dist/cjs/OncliveLargeHero.js +49 -49
  72. package/dist/cjs/PageFilter.js +5 -5
  73. package/dist/cjs/{Pagination-2a3d0103.js → Pagination-6359861a.js} +13 -13
  74. package/dist/cjs/PartnerDetailListing.js +52 -53
  75. package/dist/cjs/PartnerDetailListingPaginated.js +50 -73
  76. package/dist/cjs/PdfDownload.js +4 -4
  77. package/dist/cjs/PixelTracking.js +9 -9
  78. package/dist/cjs/PopUpModal.js +9 -9
  79. package/dist/cjs/PtceDeck.js +13 -13
  80. package/dist/cjs/PubSection.js +13 -13
  81. package/dist/cjs/PubToc.js +4 -4
  82. package/dist/cjs/PublicationDeck.js +44 -44
  83. package/dist/cjs/{PublicationFeature-5ccf9b13.js → PublicationFeature-a989a2b3.js} +29 -29
  84. package/dist/cjs/PublicationLanding.js +99 -99
  85. package/dist/cjs/QueueDeckExpanded.js +245 -245
  86. package/dist/cjs/QueueDeckExpandedPaginated.js +222 -222
  87. package/dist/cjs/RecentNews.js +15 -15
  88. package/dist/cjs/RelatedContent.js +42 -42
  89. package/dist/cjs/RelatedTopicsDropdown.js +24 -24
  90. package/dist/cjs/RolesDeck.js +20 -20
  91. package/dist/cjs/Schema.js +55 -52
  92. package/dist/cjs/Search.js +6 -6
  93. package/dist/cjs/SeriesListingDeck.js +18 -18
  94. package/dist/cjs/{SeriesSlider-594b19eb.js → SeriesSlider-f5248377.js} +26 -26
  95. package/dist/cjs/SideFooter.js +20 -20
  96. package/dist/cjs/SocialIcons.js +6 -6
  97. package/dist/cjs/{SocialSearchComponent-d2ab3d62.js → SocialSearchComponent-ca9c0c45.js} +28 -28
  98. package/dist/cjs/SocialShare.js +25 -25
  99. package/dist/cjs/TaxonomyCard.js +44 -44
  100. package/dist/cjs/TaxonomyDescription.js +13 -13
  101. package/dist/cjs/TemplateNormal.js +27 -27
  102. package/dist/cjs/ThumbnailCard.js +10 -10
  103. package/dist/cjs/Ustream.js +9 -9
  104. package/dist/cjs/VerticalHero.js +10 -10
  105. package/dist/cjs/VideoProgramLandingPage.js +30 -30
  106. package/dist/cjs/VideoSeriesCard.js +14 -14
  107. package/dist/cjs/VideoSeriesFilter.js +5 -5
  108. package/dist/cjs/VideoSeriesLandingPage.js +11 -11
  109. package/dist/cjs/VideoSeriesListing.js +46 -46
  110. package/dist/cjs/View.js +261 -274
  111. package/dist/cjs/YahooHero.js +22 -22
  112. package/dist/cjs/YoutubeGroup.js +37 -37
  113. package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-4c7825a1.js} +2 -2
  114. package/dist/cjs/defineProperty-ad65f5f0.js +110 -0
  115. package/dist/{esm/util-8ed16d48.js → cjs/empty-559717f3.js} +146 -1
  116. package/dist/cjs/getQuery.js +1 -1
  117. package/dist/cjs/getSerializers.js +8 -8
  118. package/dist/cjs/{getTargeting-ba942d9a.js → getTargeting-4439c99d.js} +9 -9
  119. package/dist/cjs/getTargeting.js +1 -1
  120. package/dist/cjs/iconBase-be4097c0.js +2 -4
  121. package/dist/cjs/index-0cf4c9fc.js +904 -0
  122. package/dist/cjs/{index-eadd5035.js → index-65621b6c.js} +5 -5
  123. package/dist/cjs/{index-f86bb269.js → index-96c331fd.js} +53 -52
  124. package/dist/cjs/{index-50be6759.js → index-9ec837cc.js} +9 -25
  125. package/dist/cjs/{index-f95a3c0f.js → index-b10d6863.js} +495 -511
  126. package/dist/cjs/{index-fc2f1ca2.js → index-d2a6ef75.js} +4 -4
  127. package/dist/cjs/{index.es-f3e47207.js → index.es-1ab8dda7.js} +4 -4
  128. package/dist/cjs/{index.esm-1461604c.js → index.esm-f59ef5b4.js} +14 -14
  129. package/dist/cjs/index.js +106 -111
  130. package/dist/cjs/{main-f1c77adb.js → main-6054981e.js} +17 -22
  131. package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-2c5c389a.js} +7 -7
  132. package/dist/cjs/ustream-api-3819e4aa.js +1 -1
  133. package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-56020df6.js} +1 -1
  134. package/dist/esm/AD300x250.js +1 -1
  135. package/dist/esm/AD300x250x600.js +1 -1
  136. package/dist/esm/AD728x90.js +1 -1
  137. package/dist/esm/ADFloatingFooter.js +1 -1
  138. package/dist/esm/ADGutter.js +1 -1
  139. package/dist/esm/ADSkyscraper.js +1 -1
  140. package/dist/esm/ADSponsoredResources.js +1 -1
  141. package/dist/esm/ADWebcast.js +1 -1
  142. package/dist/esm/ADWelcome.js +1 -1
  143. package/dist/esm/AdSlot.js +1 -1
  144. package/dist/esm/AdSlotsProvider.js +3 -3
  145. package/dist/esm/AlgoliaSearch.js +643 -558
  146. package/dist/esm/ArticleCarousel.js +1 -1
  147. package/dist/esm/ArticleProgramLandingPage.js +4 -4
  148. package/dist/esm/ArticleSeriesLandingPage.js +3 -3
  149. package/dist/esm/ArticleSeriesListing.js +1 -1
  150. package/dist/esm/Auth.js +22999 -163
  151. package/dist/esm/AuthWrapper.js +93 -3
  152. package/dist/esm/CMEDeck.js +1 -1
  153. package/dist/esm/Column3.js +1 -1
  154. package/dist/esm/ConferenceArticleCard.js +15 -15
  155. package/dist/esm/ContentCardPaginated.js +3 -3
  156. package/dist/esm/DeckContent.js +10 -10
  157. package/dist/esm/DeckQueue.js +1 -1
  158. package/dist/esm/DeckQueuePaginated.js +2 -2
  159. package/dist/esm/EventsDeck.js +19 -19
  160. package/dist/esm/ExternalResources.js +5 -5
  161. package/dist/esm/Feature.js +1 -1
  162. package/dist/esm/GridContent.js +3 -3
  163. package/dist/esm/GridContentPaginated.js +4 -4
  164. package/dist/esm/HamMagazine.js +29 -29
  165. package/dist/esm/HealthCareProfessionalModal.js +1 -1
  166. package/dist/esm/HorizontalArticleListing.js +4 -4
  167. package/dist/esm/{ImageSlider-f84174cb.js → ImageSlider-fada4f0c.js} +1257 -119
  168. package/dist/esm/IssueLanding.js +35 -35
  169. package/dist/esm/KMTracker.js +15 -15
  170. package/dist/esm/LeftNav.js +1 -1
  171. package/dist/esm/MasterDeck.js +11 -11
  172. package/dist/esm/MasterDeckPaginated.js +12 -12
  173. package/dist/esm/{Tooltip-95655b44.js → MediaSeriesCard-96ac8ed4.js} +396 -250
  174. package/dist/esm/MediaSeriesLanding.js +18 -19
  175. package/dist/esm/MediaSeriesLandingPaginated.js +18 -19
  176. package/dist/esm/NavMagazine.js +12 -12
  177. package/dist/esm/NavNative.js +10 -10
  178. package/dist/esm/{Pagination-dc30727b.js → Pagination-9fe9f61d.js} +1 -1
  179. package/dist/esm/PartnerDetailListing.js +8 -9
  180. package/dist/esm/PartnerDetailListingPaginated.js +16 -39
  181. package/dist/esm/PubSection.js +3 -3
  182. package/dist/esm/PublicationLanding.js +26 -26
  183. package/dist/esm/QueueDeckExpanded.js +3 -3
  184. package/dist/esm/QueueDeckExpandedPaginated.js +4 -4
  185. package/dist/esm/RelatedContent.js +28 -28
  186. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  187. package/dist/esm/Schema.js +55 -52
  188. package/dist/esm/SeriesListingDeck.js +2 -2
  189. package/dist/esm/{SeriesSlider-f771e20d.js → SeriesSlider-4875823e.js} +5 -5
  190. package/dist/esm/SideFooter.js +2 -2
  191. package/dist/esm/{SocialSearchComponent-165b4ae7.js → SocialSearchComponent-68d948b9.js} +1 -1
  192. package/dist/esm/TaxonomyDescription.js +4 -4
  193. package/dist/esm/TemplateNormal.js +2 -2
  194. package/dist/esm/Ustream.js +1 -1
  195. package/dist/esm/VideoProgramLandingPage.js +4 -4
  196. package/dist/esm/VideoSeriesCard.js +1 -1
  197. package/dist/esm/VideoSeriesLandingPage.js +3 -3
  198. package/dist/esm/VideoSeriesListing.js +1 -1
  199. package/dist/esm/View.js +45 -58
  200. package/dist/esm/YoutubeGroup.js +5 -5
  201. package/dist/esm/defineProperty-50094484.js +101 -0
  202. package/dist/{cjs/util-93a37fd0.js → esm/empty-a8042e3c.js} +135 -3
  203. package/dist/esm/getQuery.js +1 -1
  204. package/dist/esm/getSerializers.js +4 -4
  205. package/dist/esm/{getTargeting-9bd28724.js → getTargeting-c6884f34.js} +9 -9
  206. package/dist/esm/getTargeting.js +1 -1
  207. package/dist/esm/{index-04817712.js → index-076baa11.js} +12 -27
  208. package/dist/esm/{index-98ca9cec.js → index-0ce54f8a.js} +10 -25
  209. package/dist/esm/{index-79cfd25c.js → index-30a6257d.js} +53 -52
  210. package/dist/esm/index-e7075467.js +897 -0
  211. package/dist/esm/index.js +13 -18
  212. package/dist/esm/{main-1894c974.js → main-9f6806ea.js} +4 -9
  213. package/package.json +115 -115
  214. package/dist/cjs/CypressTesting.js +0 -53
  215. package/dist/cjs/MediaSeriesCard-2e5cd247.js +0 -81
  216. package/dist/cjs/PodcastsLanding.js +0 -235
  217. package/dist/cjs/defineProperty-e0fb52c5.js +0 -73
  218. package/dist/cjs/typeof-1358762e.js +0 -33
  219. package/dist/esm/CypressTesting.js +0 -47
  220. package/dist/esm/MediaSeriesCard-afb517a5.js +0 -75
  221. package/dist/esm/PodcastsLanding.js +0 -228
  222. package/dist/esm/defineProperty-23a8f8cd.js +0 -68
  223. package/dist/esm/typeof-2f07d0e8.js +0 -30
  224. /package/dist/esm/{ADInfeed-5765a73a.js → ADInfeed-777bb0b3.js} +0 -0
  225. /package/dist/esm/{ADlgInfeed-5e36f317.js → ADlgInfeed-e7fd1bb6.js} +0 -0
@@ -0,0 +1,904 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var PropTypes = require('prop-types');
5
+
6
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+
8
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
9
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
10
+
11
+ function warn(s) {
12
+ console.warn('[react-ga]', s);
13
+ }
14
+
15
+ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
16
+
17
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
+
21
+ function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
+
23
+ function _objectWithoutPropertiesLoose$1(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
+
25
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
+
27
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
28
+
29
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
30
+
31
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
+
33
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+
35
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
36
+
37
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
38
+
39
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
40
+
41
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
42
+
43
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
44
+
45
+ function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
46
+ var NEWTAB = '_blank';
47
+ var MIDDLECLICK = 1;
48
+
49
+ var OutboundLink$1 = /*#__PURE__*/function (_Component) {
50
+ _inherits(OutboundLink, _Component);
51
+
52
+ var _super = _createSuper(OutboundLink);
53
+
54
+ function OutboundLink() {
55
+ var _this;
56
+
57
+ _classCallCheck(this, OutboundLink);
58
+
59
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
60
+ args[_key] = arguments[_key];
61
+ }
62
+
63
+ _this = _super.call.apply(_super, [this].concat(args));
64
+
65
+ _defineProperty$2(_assertThisInitialized(_this), "handleClick", function (event) {
66
+ var _this$props = _this.props,
67
+ target = _this$props.target,
68
+ eventLabel = _this$props.eventLabel,
69
+ to = _this$props.to,
70
+ onClick = _this$props.onClick,
71
+ trackerNames = _this$props.trackerNames;
72
+ var eventMeta = {
73
+ label: eventLabel
74
+ };
75
+ var sameTarget = target !== NEWTAB;
76
+ var normalClick = !(event.ctrlKey || event.shiftKey || event.metaKey || event.button === MIDDLECLICK);
77
+
78
+ if (sameTarget && normalClick) {
79
+ event.preventDefault();
80
+ OutboundLink.trackLink(eventMeta, function () {
81
+ window.location.href = to;
82
+ }, trackerNames);
83
+ } else {
84
+ OutboundLink.trackLink(eventMeta, function () {}, trackerNames);
85
+ }
86
+
87
+ if (onClick) {
88
+ onClick(event);
89
+ }
90
+ });
91
+
92
+ return _this;
93
+ }
94
+
95
+ _createClass(OutboundLink, [{
96
+ key: "render",
97
+ value: function render() {
98
+ var _this$props2 = this.props,
99
+ href = _this$props2.to,
100
+ target = _this$props2.target,
101
+ oldProps = _objectWithoutProperties$1(_this$props2, ["to", "target"]);
102
+
103
+ var props = _objectSpread$2(_objectSpread$2({}, oldProps), {}, {
104
+ target: target,
105
+ href: href,
106
+ onClick: this.handleClick
107
+ });
108
+
109
+ if (target === NEWTAB) {
110
+ props.rel = "".concat(props.rel ? props.rel : '', " noopener noreferrer").trim();
111
+ }
112
+
113
+ delete props.eventLabel;
114
+ delete props.trackerNames;
115
+ return /*#__PURE__*/React__default["default"].createElement('a', props);
116
+ }
117
+ }]);
118
+
119
+ return OutboundLink;
120
+ }(React.Component);
121
+
122
+ _defineProperty$2(OutboundLink$1, "trackLink", function () {
123
+ warn('ga tracking not enabled');
124
+ });
125
+ OutboundLink$1.propTypes = {
126
+ eventLabel: PropTypes__default["default"].string.isRequired,
127
+ target: PropTypes__default["default"].string,
128
+ to: PropTypes__default["default"].string,
129
+ onClick: PropTypes__default["default"].func,
130
+ trackerNames: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
131
+ };
132
+ OutboundLink$1.defaultProps = {
133
+ target: null,
134
+ to: null,
135
+ onClick: null,
136
+ trackerNames: null
137
+ };
138
+
139
+ // See if s could be an email address. We don't want to send personal data like email.
140
+ // https://support.google.com/analytics/answer/2795983?hl=en
141
+ function mightBeEmail(s) {
142
+ // There's no point trying to validate rfc822 fully, just look for ...@...
143
+ return typeof s === 'string' && s.indexOf('@') !== -1;
144
+ }
145
+
146
+ var redacted = 'REDACTED (Potential Email Address)';
147
+ function redactEmail(string) {
148
+ if (mightBeEmail(string)) {
149
+ warn('This arg looks like an email address, redacting.');
150
+ return redacted;
151
+ }
152
+
153
+ return string;
154
+ }
155
+
156
+ // GA strings need to have leading/trailing whitespace trimmed, and not all
157
+ // browsers have String.prototoype.trim().
158
+ function trim(s) {
159
+ return s && s.toString().replace(/^\s+|\s+$/g, '');
160
+ }
161
+
162
+ /**
163
+ * To Title Case 2.1 - http://individed.com/code/to-title-case/
164
+ * Copyright 2008-2013 David Gouch. Licensed under the MIT License.
165
+ * https://github.com/gouch/to-title-case
166
+ */
167
+ var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; // test
168
+
169
+ function toTitleCase(string) {
170
+ return trim(string).replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
171
+ if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' && (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && title.charAt(index - 1).search(/[^\s-]/) < 0) {
172
+ return match.toLowerCase();
173
+ }
174
+
175
+ if (match.substr(1).search(/[A-Z]|\../) > -1) {
176
+ return match;
177
+ }
178
+
179
+ return match.charAt(0).toUpperCase() + match.substr(1);
180
+ });
181
+ }
182
+
183
+ function format() {
184
+ var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
185
+ var titleCase = arguments.length > 1 ? arguments[1] : undefined;
186
+ var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
187
+
188
+ var _str = s || '';
189
+
190
+ if (titleCase) {
191
+ _str = toTitleCase(s);
192
+ }
193
+
194
+ if (redactingEmail) {
195
+ _str = redactEmail(_str);
196
+ }
197
+
198
+ return _str;
199
+ }
200
+
201
+ function removeLeadingSlash(string) {
202
+ if (string.substring(0, 1) === '/') {
203
+ return string.substring(1);
204
+ }
205
+
206
+ return string;
207
+ }
208
+
209
+ var isLoaded = false;
210
+ function loadGA (options) {
211
+ if (isLoaded) return;
212
+ isLoaded = true;
213
+ var gaAddress = 'https://www.google-analytics.com/analytics.js';
214
+
215
+ if (options && options.gaAddress) {
216
+ gaAddress = options.gaAddress;
217
+ } else if (options && options.debug) {
218
+ gaAddress = 'https://www.google-analytics.com/analytics_debug.js';
219
+ }
220
+
221
+ var onerror = options && options.onerror; // https://developers.google.com/analytics/devguides/collection/analyticsjs/
222
+
223
+ /* eslint-disable */
224
+
225
+ (function (i, s, o, g, r, a, m) {
226
+ i['GoogleAnalyticsObject'] = r;
227
+ i[r] = i[r] || function () {
228
+ (i[r].q = i[r].q || []).push(arguments);
229
+ }, i[r].l = 1 * new Date();
230
+ a = s.createElement(o), m = s.getElementsByTagName(o)[0];
231
+ a.async = 1;
232
+ a.src = g;
233
+ a.onerror = onerror;
234
+ m.parentNode.insertBefore(a, m);
235
+ })(window, document, 'script', gaAddress, 'ga');
236
+ /* eslint-enable */
237
+
238
+ }
239
+
240
+ function log(s) {
241
+ console.info('[react-ga]', s);
242
+ }
243
+
244
+ var gaCalls = [];
245
+ var TestModeAPI = {
246
+ calls: gaCalls,
247
+ ga: function ga() {
248
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
249
+ args[_key] = arguments[_key];
250
+ }
251
+
252
+ gaCalls.push([].concat(args));
253
+ },
254
+ resetCalls: function resetCalls() {
255
+ gaCalls.length = 0;
256
+ }
257
+ };
258
+
259
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
260
+
261
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
262
+
263
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
264
+
265
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
266
+
267
+ function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
268
+
269
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
270
+
271
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
272
+
273
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
274
+
275
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
276
+
277
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
278
+
279
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
280
+
281
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
282
+
283
+ var _isNotBrowser = typeof window === 'undefined' || typeof document === 'undefined';
284
+
285
+ var _debug = false;
286
+ var _titleCase = true;
287
+ var _testMode = false;
288
+ var _alwaysSendToDefaultTracker = true;
289
+ var _redactEmail = true;
290
+
291
+ var internalGa = function internalGa() {
292
+ var _window;
293
+
294
+ if (_testMode) return TestModeAPI.ga.apply(TestModeAPI, arguments);
295
+ if (_isNotBrowser) return false;
296
+ if (!window.ga) return warn('ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually');
297
+ return (_window = window).ga.apply(_window, arguments);
298
+ };
299
+
300
+ function _format(s) {
301
+ return format(s, _titleCase, _redactEmail);
302
+ }
303
+
304
+ function _gaCommand(trackerNames) {
305
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
306
+ args[_key - 1] = arguments[_key];
307
+ }
308
+
309
+ var command = args[0];
310
+
311
+ if (typeof internalGa === 'function') {
312
+ if (typeof command !== 'string') {
313
+ warn('ga command must be a string');
314
+ return;
315
+ }
316
+
317
+ if (_alwaysSendToDefaultTracker || !Array.isArray(trackerNames)) internalGa.apply(void 0, args);
318
+
319
+ if (Array.isArray(trackerNames)) {
320
+ trackerNames.forEach(function (name) {
321
+ internalGa.apply(void 0, _toConsumableArray(["".concat(name, ".").concat(command)].concat(args.slice(1))));
322
+ });
323
+ }
324
+ }
325
+ }
326
+
327
+ function _initialize(gaTrackingID, options) {
328
+ if (!gaTrackingID) {
329
+ warn('gaTrackingID is required in initialize()');
330
+ return;
331
+ }
332
+
333
+ if (options) {
334
+ if (options.debug && options.debug === true) {
335
+ _debug = true;
336
+ }
337
+
338
+ if (options.titleCase === false) {
339
+ _titleCase = false;
340
+ }
341
+
342
+ if (options.redactEmail === false) {
343
+ _redactEmail = false;
344
+ }
345
+
346
+ if (options.useExistingGa) {
347
+ return;
348
+ }
349
+ }
350
+
351
+ if (options && options.gaOptions) {
352
+ internalGa('create', gaTrackingID, options.gaOptions);
353
+ } else {
354
+ internalGa('create', gaTrackingID, 'auto');
355
+ }
356
+ }
357
+
358
+ function addTrackers(configsOrTrackingId, options) {
359
+ if (Array.isArray(configsOrTrackingId)) {
360
+ configsOrTrackingId.forEach(function (config) {
361
+ if (_typeof(config) !== 'object') {
362
+ warn('All configs must be an object');
363
+ return;
364
+ }
365
+
366
+ _initialize(config.trackingId, config);
367
+ });
368
+ } else {
369
+ _initialize(configsOrTrackingId, options);
370
+ }
371
+
372
+ return true;
373
+ }
374
+ function initialize(configsOrTrackingId, options) {
375
+ if (options && options.testMode === true) {
376
+ _testMode = true;
377
+ } else {
378
+ if (_isNotBrowser) {
379
+ return;
380
+ }
381
+
382
+ if (!options || options.standardImplementation !== true) loadGA(options);
383
+ }
384
+
385
+ _alwaysSendToDefaultTracker = options && typeof options.alwaysSendToDefaultTracker === 'boolean' ? options.alwaysSendToDefaultTracker : true;
386
+ addTrackers(configsOrTrackingId, options);
387
+ }
388
+ /**
389
+ * ga:
390
+ * Returns the original GA object.
391
+ */
392
+
393
+ function ga() {
394
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
395
+ args[_key2] = arguments[_key2];
396
+ }
397
+
398
+ if (args.length > 0) {
399
+ internalGa.apply(void 0, args);
400
+
401
+ if (_debug) {
402
+ log("called ga('arguments');");
403
+ log("with arguments: ".concat(JSON.stringify(args)));
404
+ }
405
+ }
406
+
407
+ return window.ga;
408
+ }
409
+ /**
410
+ * set:
411
+ * GA tracker set method
412
+ * @param {Object} fieldsObject - a field/value pair or a group of field/value pairs on the tracker
413
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
414
+ */
415
+
416
+ function set(fieldsObject, trackerNames) {
417
+ if (!fieldsObject) {
418
+ warn('`fieldsObject` is required in .set()');
419
+ return;
420
+ }
421
+
422
+ if (_typeof(fieldsObject) !== 'object') {
423
+ warn('Expected `fieldsObject` arg to be an Object');
424
+ return;
425
+ }
426
+
427
+ if (Object.keys(fieldsObject).length === 0) {
428
+ warn('empty `fieldsObject` given to .set()');
429
+ }
430
+
431
+ _gaCommand(trackerNames, 'set', fieldsObject);
432
+
433
+ if (_debug) {
434
+ log("called ga('set', fieldsObject);");
435
+ log("with fieldsObject: ".concat(JSON.stringify(fieldsObject)));
436
+ }
437
+ }
438
+ /**
439
+ * send:
440
+ * Clone of the low level `ga.send` method
441
+ * WARNING: No validations will be applied to this
442
+ * @param {Object} fieldObject - field object for tracking different analytics
443
+ * @param {Array} trackerNames - trackers to send the command to
444
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
445
+ */
446
+
447
+ function send(fieldObject, trackerNames) {
448
+ _gaCommand(trackerNames, 'send', fieldObject);
449
+
450
+ if (_debug) {
451
+ log("called ga('send', fieldObject);");
452
+ log("with fieldObject: ".concat(JSON.stringify(fieldObject)));
453
+ log("with trackers: ".concat(JSON.stringify(trackerNames)));
454
+ }
455
+ }
456
+ /**
457
+ * pageview:
458
+ * Basic GA pageview tracking
459
+ * @param {String} path - the current page page e.g. '/about'
460
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
461
+ * @param {String} title - (optional) the page title e. g. 'My Website'
462
+ */
463
+
464
+ function pageview(rawPath, trackerNames, title) {
465
+ if (!rawPath) {
466
+ warn('path is required in .pageview()');
467
+ return;
468
+ }
469
+
470
+ var path = trim(rawPath);
471
+
472
+ if (path === '') {
473
+ warn('path cannot be an empty string in .pageview()');
474
+ return;
475
+ }
476
+
477
+ var extraFields = {};
478
+
479
+ if (title) {
480
+ extraFields.title = title;
481
+ }
482
+
483
+ if (typeof ga === 'function') {
484
+ _gaCommand(trackerNames, 'send', _objectSpread$1({
485
+ hitType: 'pageview',
486
+ page: path
487
+ }, extraFields));
488
+
489
+ if (_debug) {
490
+ log("called ga('send', 'pageview', path);");
491
+ var extraLog = '';
492
+
493
+ if (title) {
494
+ extraLog = " and title: ".concat(title);
495
+ }
496
+
497
+ log("with path: ".concat(path).concat(extraLog));
498
+ }
499
+ }
500
+ }
501
+ /**
502
+ * modalview:
503
+ * a proxy to basic GA pageview tracking to consistently track
504
+ * modal views that are an equivalent UX to a traditional pageview
505
+ * @param {String} modalName e.g. 'add-or-edit-club'
506
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
507
+ */
508
+
509
+ function modalview(rawModalName, trackerNames) {
510
+ if (!rawModalName) {
511
+ warn('modalName is required in .modalview(modalName)');
512
+ return;
513
+ }
514
+
515
+ var modalName = removeLeadingSlash(trim(rawModalName));
516
+
517
+ if (modalName === '') {
518
+ warn('modalName cannot be an empty string or a single / in .modalview()');
519
+ return;
520
+ }
521
+
522
+ if (typeof ga === 'function') {
523
+ var path = "/modal/".concat(modalName);
524
+
525
+ _gaCommand(trackerNames, 'send', 'pageview', path);
526
+
527
+ if (_debug) {
528
+ log("called ga('send', 'pageview', path);");
529
+ log("with path: ".concat(path));
530
+ }
531
+ }
532
+ }
533
+ /**
534
+ * timing:
535
+ * GA timing
536
+ * @param args.category {String} required
537
+ * @param args.variable {String} required
538
+ * @param args.value {Int} required
539
+ * @param args.label {String} required
540
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
541
+ */
542
+
543
+ function timing() {
544
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
545
+ category = _ref.category,
546
+ variable = _ref.variable,
547
+ value = _ref.value,
548
+ label = _ref.label;
549
+
550
+ var trackerNames = arguments.length > 1 ? arguments[1] : undefined;
551
+
552
+ if (typeof ga === 'function') {
553
+ if (!category || !variable || typeof value !== 'number') {
554
+ warn('args.category, args.variable ' + 'AND args.value are required in timing() ' + 'AND args.value has to be a number');
555
+ return;
556
+ } // Required Fields
557
+
558
+
559
+ var fieldObject = {
560
+ hitType: 'timing',
561
+ timingCategory: _format(category),
562
+ timingVar: _format(variable),
563
+ timingValue: value
564
+ };
565
+
566
+ if (label) {
567
+ fieldObject.timingLabel = _format(label);
568
+ }
569
+
570
+ send(fieldObject, trackerNames);
571
+ }
572
+ }
573
+ /**
574
+ * event:
575
+ * GA event tracking
576
+ * @param args.category {String} required
577
+ * @param args.action {String} required
578
+ * @param args.label {String} optional
579
+ * @param args.value {Int} optional
580
+ * @param args.nonInteraction {boolean} optional
581
+ * @param args.transport {string} optional
582
+ * @param {{action: string, category: string}} trackerNames - (optional) a list of extra trackers to run the command on
583
+ */
584
+
585
+ function event() {
586
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
587
+ category = _ref2.category,
588
+ action = _ref2.action,
589
+ label = _ref2.label,
590
+ value = _ref2.value,
591
+ nonInteraction = _ref2.nonInteraction,
592
+ transport = _ref2.transport,
593
+ args = _objectWithoutProperties(_ref2, ["category", "action", "label", "value", "nonInteraction", "transport"]);
594
+
595
+ var trackerNames = arguments.length > 1 ? arguments[1] : undefined;
596
+
597
+ if (typeof ga === 'function') {
598
+ // Simple Validation
599
+ if (!category || !action) {
600
+ warn('args.category AND args.action are required in event()');
601
+ return;
602
+ } // Required Fields
603
+
604
+
605
+ var fieldObject = {
606
+ hitType: 'event',
607
+ eventCategory: _format(category),
608
+ eventAction: _format(action)
609
+ }; // Optional Fields
610
+
611
+ if (label) {
612
+ fieldObject.eventLabel = _format(label);
613
+ }
614
+
615
+ if (typeof value !== 'undefined') {
616
+ if (typeof value !== 'number') {
617
+ warn('Expected `args.value` arg to be a Number.');
618
+ } else {
619
+ fieldObject.eventValue = value;
620
+ }
621
+ }
622
+
623
+ if (typeof nonInteraction !== 'undefined') {
624
+ if (typeof nonInteraction !== 'boolean') {
625
+ warn('`args.nonInteraction` must be a boolean.');
626
+ } else {
627
+ fieldObject.nonInteraction = nonInteraction;
628
+ }
629
+ }
630
+
631
+ if (typeof transport !== 'undefined') {
632
+ if (typeof transport !== 'string') {
633
+ warn('`args.transport` must be a string.');
634
+ } else {
635
+ if (['beacon', 'xhr', 'image'].indexOf(transport) === -1) {
636
+ warn('`args.transport` must be either one of these values: `beacon`, `xhr` or `image`');
637
+ }
638
+
639
+ fieldObject.transport = transport;
640
+ }
641
+ }
642
+
643
+ Object.keys(args).filter(function (key) {
644
+ return key.substr(0, 'dimension'.length) === 'dimension';
645
+ }).forEach(function (key) {
646
+ fieldObject[key] = args[key];
647
+ });
648
+ Object.keys(args).filter(function (key) {
649
+ return key.substr(0, 'metric'.length) === 'metric';
650
+ }).forEach(function (key) {
651
+ fieldObject[key] = args[key];
652
+ }); // Send to GA
653
+
654
+ send(fieldObject, trackerNames);
655
+ }
656
+ }
657
+ /**
658
+ * exception:
659
+ * GA exception tracking
660
+ * @param args.description {String} optional
661
+ * @param args.fatal {boolean} optional
662
+ * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
663
+ */
664
+
665
+ function exception(_ref3, trackerNames) {
666
+ var description = _ref3.description,
667
+ fatal = _ref3.fatal;
668
+
669
+ if (typeof ga === 'function') {
670
+ // Required Fields
671
+ var fieldObject = {
672
+ hitType: 'exception'
673
+ }; // Optional Fields
674
+
675
+ if (description) {
676
+ fieldObject.exDescription = _format(description);
677
+ }
678
+
679
+ if (typeof fatal !== 'undefined') {
680
+ if (typeof fatal !== 'boolean') {
681
+ warn('`args.fatal` must be a boolean.');
682
+ } else {
683
+ fieldObject.exFatal = fatal;
684
+ }
685
+ } // Send to GA
686
+
687
+
688
+ send(fieldObject, trackerNames);
689
+ }
690
+ }
691
+ var plugin = {
692
+ /**
693
+ * require:
694
+ * GA requires a plugin
695
+ * @param name {String} e.g. 'ecommerce' or 'myplugin'
696
+ * @param options {Object} optional e.g {path: '/log', debug: true}
697
+ * @param trackerName {String} optional e.g 'trackerName'
698
+ */
699
+ require: function require(rawName, options, trackerName) {
700
+ if (typeof ga === 'function') {
701
+ // Required Fields
702
+ if (!rawName) {
703
+ warn('`name` is required in .require()');
704
+ return;
705
+ }
706
+
707
+ var name = trim(rawName);
708
+
709
+ if (name === '') {
710
+ warn('`name` cannot be an empty string in .require()');
711
+ return;
712
+ }
713
+
714
+ var requireString = trackerName ? "".concat(trackerName, ".require") : 'require'; // Optional Fields
715
+
716
+ if (options) {
717
+ if (_typeof(options) !== 'object') {
718
+ warn('Expected `options` arg to be an Object');
719
+ return;
720
+ }
721
+
722
+ if (Object.keys(options).length === 0) {
723
+ warn('Empty `options` given to .require()');
724
+ }
725
+
726
+ ga(requireString, name, options);
727
+
728
+ if (_debug) {
729
+ log("called ga('require', '".concat(name, "', ").concat(JSON.stringify(options)));
730
+ }
731
+ } else {
732
+ ga(requireString, name);
733
+
734
+ if (_debug) {
735
+ log("called ga('require', '".concat(name, "');"));
736
+ }
737
+ }
738
+ }
739
+ },
740
+
741
+ /**
742
+ * execute:
743
+ * GA execute action for plugin
744
+ * Takes variable number of arguments
745
+ * @param pluginName {String} e.g. 'ecommerce' or 'myplugin'
746
+ * @param action {String} e.g. 'addItem' or 'myCustomAction'
747
+ * @param actionType {String} optional e.g. 'detail'
748
+ * @param payload {Object} optional e.g { id: '1x5e', name : 'My product to track' }
749
+ */
750
+ execute: function execute(pluginName, action) {
751
+ var payload;
752
+ var actionType;
753
+
754
+ for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
755
+ args[_key3 - 2] = arguments[_key3];
756
+ }
757
+
758
+ if (args.length === 1) {
759
+ payload = args[0];
760
+ } else {
761
+ actionType = args[0];
762
+ payload = args[1];
763
+ }
764
+
765
+ if (typeof ga === 'function') {
766
+ if (typeof pluginName !== 'string') {
767
+ warn('Expected `pluginName` arg to be a String.');
768
+ } else if (typeof action !== 'string') {
769
+ warn('Expected `action` arg to be a String.');
770
+ } else {
771
+ var command = "".concat(pluginName, ":").concat(action);
772
+ payload = payload || null;
773
+
774
+ if (actionType && payload) {
775
+ ga(command, actionType, payload);
776
+
777
+ if (_debug) {
778
+ log("called ga('".concat(command, "');"));
779
+ log("actionType: \"".concat(actionType, "\" with payload: ").concat(JSON.stringify(payload)));
780
+ }
781
+ } else if (payload) {
782
+ ga(command, payload);
783
+
784
+ if (_debug) {
785
+ log("called ga('".concat(command, "');"));
786
+ log("with payload: ".concat(JSON.stringify(payload)));
787
+ }
788
+ } else {
789
+ ga(command);
790
+
791
+ if (_debug) {
792
+ log("called ga('".concat(command, "');"));
793
+ }
794
+ }
795
+ }
796
+ }
797
+ }
798
+ };
799
+ /**
800
+ * outboundLink:
801
+ * GA outboundLink tracking
802
+ * @param args.label {String} e.g. url, or 'Create an Account'
803
+ * @param {function} hitCallback - Called after processing a hit.
804
+ */
805
+
806
+ function outboundLink(args, hitCallback, trackerNames) {
807
+ if (typeof hitCallback !== 'function') {
808
+ warn('hitCallback function is required');
809
+ return;
810
+ }
811
+
812
+ if (typeof ga === 'function') {
813
+ // Simple Validation
814
+ if (!args || !args.label) {
815
+ warn('args.label is required in outboundLink()');
816
+ return;
817
+ } // Required Fields
818
+
819
+
820
+ var fieldObject = {
821
+ hitType: 'event',
822
+ eventCategory: 'Outbound',
823
+ eventAction: 'Click',
824
+ eventLabel: _format(args.label)
825
+ };
826
+ var safetyCallbackCalled = false;
827
+
828
+ var safetyCallback = function safetyCallback() {
829
+ // This prevents a delayed response from GA
830
+ // causing hitCallback from being fired twice
831
+ safetyCallbackCalled = true;
832
+ hitCallback();
833
+ }; // Using a timeout to ensure the execution of critical application code
834
+ // in the case when the GA server might be down
835
+ // or an ad blocker prevents sending the data
836
+ // register safety net timeout:
837
+
838
+
839
+ var t = setTimeout(safetyCallback, 250);
840
+
841
+ var clearableCallbackForGA = function clearableCallbackForGA() {
842
+ clearTimeout(t);
843
+
844
+ if (!safetyCallbackCalled) {
845
+ hitCallback();
846
+ }
847
+ };
848
+
849
+ fieldObject.hitCallback = clearableCallbackForGA; // Send to GA
850
+
851
+ send(fieldObject, trackerNames);
852
+ } else {
853
+ // if ga is not defined, return the callback so the application
854
+ // continues to work as expected
855
+ setTimeout(hitCallback, 0);
856
+ }
857
+ }
858
+ var testModeAPI = TestModeAPI;
859
+ var core = {
860
+ initialize: initialize,
861
+ ga: ga,
862
+ set: set,
863
+ send: send,
864
+ pageview: pageview,
865
+ modalview: modalview,
866
+ timing: timing,
867
+ event: event,
868
+ exception: exception,
869
+ plugin: plugin,
870
+ outboundLink: outboundLink,
871
+ testModeAPI: TestModeAPI
872
+ };
873
+
874
+ var Defaults = /*#__PURE__*/Object.freeze({
875
+ __proto__: null,
876
+ addTrackers: addTrackers,
877
+ initialize: initialize,
878
+ ga: ga,
879
+ set: set,
880
+ send: send,
881
+ pageview: pageview,
882
+ modalview: modalview,
883
+ timing: timing,
884
+ event: event,
885
+ exception: exception,
886
+ plugin: plugin,
887
+ outboundLink: outboundLink,
888
+ testModeAPI: testModeAPI,
889
+ 'default': core
890
+ });
891
+
892
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
893
+
894
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
895
+
896
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
897
+ OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
898
+ OutboundLink$1.trackLink = outboundLink;
899
+ var OutboundLink = OutboundLink$1;
900
+ var ReactGA = _objectSpread(_objectSpread({}, Defaults), {}, {
901
+ OutboundLink: OutboundLink
902
+ });
903
+
904
+ exports.ReactGA = ReactGA;