gather-vue 8.6.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 (178) hide show
  1. package/README.md +64 -0
  2. package/dist/.htaccess +1 -0
  3. package/dist/App-B7KWoHRH.js +160 -0
  4. package/dist/App-B7KWoHRH.js.gz +0 -0
  5. package/dist/App-C03tW0-W.js +405 -0
  6. package/dist/App-C03tW0-W.js.gz +0 -0
  7. package/dist/BannerExample-CRj1iMwh.js +77 -0
  8. package/dist/BannerExample-CRj1iMwh.js.gz +0 -0
  9. package/dist/BannerExample-DLN6d9M0.js +84 -0
  10. package/dist/BannerExample-DLN6d9M0.js.gz +0 -0
  11. package/dist/CallToAction-BbJ-zDFa.js +3493 -0
  12. package/dist/CallToAction-BbJ-zDFa.js.gz +0 -0
  13. package/dist/CallToAction-jAi8aaI-.js +35 -0
  14. package/dist/CallToAction-jAi8aaI-.js.gz +0 -0
  15. package/dist/Card-B1Pdd5BL.js +202 -0
  16. package/dist/Card-B1Pdd5BL.js.gz +0 -0
  17. package/dist/Card-qMo1jrfb.js +699 -0
  18. package/dist/Card-qMo1jrfb.js.gz +0 -0
  19. package/dist/CloseCardButton-CL_3xkAF.js +71 -0
  20. package/dist/CloseCardButton-CL_3xkAF.js.gz +0 -0
  21. package/dist/Editor-DXSZFkEM.js +149 -0
  22. package/dist/Editor-DXSZFkEM.js.gz +0 -0
  23. package/dist/EmailExistsView-CX1ijN0R.js +72 -0
  24. package/dist/EmailExistsView-CX1ijN0R.js.gz +0 -0
  25. package/dist/EmailInvitation-BVFicmrK.js +22 -0
  26. package/dist/EmailView-DdaSnKFq.js +84 -0
  27. package/dist/EmailView-DdaSnKFq.js.gz +0 -0
  28. package/dist/FriendBannerExample-C8QmPZyP.js +76 -0
  29. package/dist/FriendBannerExample-C8QmPZyP.js.gz +0 -0
  30. package/dist/FriendConfirmation-B-RemAoP.js +22 -0
  31. package/dist/FriendForm-CunLFX_H.js +255 -0
  32. package/dist/FriendForm-CunLFX_H.js.gz +0 -0
  33. package/dist/FriendOptIn-bp4udUYv.js +27 -0
  34. package/dist/FriendPending-cFjgyL8g.js +22 -0
  35. package/dist/FriendPitch-BhSs2eLR.js +19 -0
  36. package/dist/FriendPitch-CAS1c3Co.js +33 -0
  37. package/dist/FriendSuccess-uxEdomAY.js +22 -0
  38. package/dist/Invitations-hprUCIvW.js +27 -0
  39. package/dist/InviteRoot-Dima8d2G.js +252 -0
  40. package/dist/InviteRoot-Dima8d2G.js.gz +0 -0
  41. package/dist/LaunchButton-BQw42WVn.js +18 -0
  42. package/dist/MazBtn.1qp5aQ4N-DU0ii1Xr.js +103 -0
  43. package/dist/MazBtn.1qp5aQ4N-DU0ii1Xr.js.gz +0 -0
  44. package/dist/MazCheckbox.UAnkvAoS-pse3PCQf.js +149 -0
  45. package/dist/MazCheckbox.UAnkvAoS-pse3PCQf.js.gz +0 -0
  46. package/dist/MazIcon.B5hPzeLk-C20gse35.js +103 -0
  47. package/dist/MazIcon.B5hPzeLk-C20gse35.js.gz +0 -0
  48. package/dist/MazPhoneNumberInput-Cz50Ts4U.js +4751 -0
  49. package/dist/MazPhoneNumberInput-Cz50Ts4U.js.gz +0 -0
  50. package/dist/MazSpinner.DZT5jj-c-y1IYJMcd.js +34 -0
  51. package/dist/MazSpinner.DZT5jj-c-y1IYJMcd.js.gz +0 -0
  52. package/dist/Menu-BsKr40BO.js +21377 -0
  53. package/dist/Menu-BsKr40BO.js.gz +0 -0
  54. package/dist/Message-D4PAgcHO.js +22 -0
  55. package/dist/MessageCard-CC74qCir.js +74 -0
  56. package/dist/MessageCard-CC74qCir.js.gz +0 -0
  57. package/dist/MessageView-BKAIrwj7.js +88 -0
  58. package/dist/MessageView-BKAIrwj7.js.gz +0 -0
  59. package/dist/PendingApprovalCard-Dzs0UxBO.js +48 -0
  60. package/dist/PendingApprovalCard-Dzs0UxBO.js.gz +0 -0
  61. package/dist/PendingApprovalView-V-OUYSnK.js +33 -0
  62. package/dist/ReferralButton-CEue5qud.js +18 -0
  63. package/dist/ReferralFailedView-3Ua13t4V.js +74 -0
  64. package/dist/ReferralFailedView-3Ua13t4V.js.gz +0 -0
  65. package/dist/ReferredConfirmCard-iwgkcZCm.js +48 -0
  66. package/dist/ReferredConfirmCard-iwgkcZCm.js.gz +0 -0
  67. package/dist/ReferredConfirmView-DS1RNBwP.js +33 -0
  68. package/dist/ReferredSuccessCard-Dg-a4FYr.js +209 -0
  69. package/dist/ReferredSuccessCard-Dg-a4FYr.js.gz +0 -0
  70. package/dist/ReferredSuccessView-ChVztlUr.js +33 -0
  71. package/dist/ReferredView-7HezoVIA.js +98 -0
  72. package/dist/ReferredView-7HezoVIA.js.gz +0 -0
  73. package/dist/RewardCard-CwU2X2Yo.js +197 -0
  74. package/dist/RewardCard-CwU2X2Yo.js.gz +0 -0
  75. package/dist/Rewards-DdyEwCyy.js +27 -0
  76. package/dist/RewardsRoot-CnQfyjC6.js +198 -0
  77. package/dist/RewardsRoot-CnQfyjC6.js.gz +0 -0
  78. package/dist/Root-bUfnZpPP.js +17 -0
  79. package/dist/ShareInvitation-SAgC-8YA.js +22 -0
  80. package/dist/SignIn-CroW3mY6.js +36 -0
  81. package/dist/SignIn-CroW3mY6.js.gz +0 -0
  82. package/dist/SignIn-g32Hg2or.js +17 -0
  83. package/dist/SignInTextArea-DBRk6x09.js +17 -0
  84. package/dist/SignUpFormCard-Cail4V4M.js +287 -0
  85. package/dist/SignUpFormCard-Cail4V4M.js.gz +0 -0
  86. package/dist/SignUpView-a7LPgEeX.js +368 -0
  87. package/dist/SignUpView-a7LPgEeX.js.gz +0 -0
  88. package/dist/SignUpView-uujOX5hN.js +103 -0
  89. package/dist/SignUpView-uujOX5hN.js.gz +0 -0
  90. package/dist/SocialView-CbBZTB7Z.js +87 -0
  91. package/dist/SocialView-CbBZTB7Z.js.gz +0 -0
  92. package/dist/Stats-DtS-GXsI.js +22 -0
  93. package/dist/StatsView-fX-VznRc.js +90 -0
  94. package/dist/StatsView-fX-VznRc.js.gz +0 -0
  95. package/dist/Success-k06CZz0K.js +40 -0
  96. package/dist/Success-k06CZz0K.js.gz +0 -0
  97. package/dist/SuccessCard-C1iF1j2W.js +219 -0
  98. package/dist/SuccessCard-C1iF1j2W.js.gz +0 -0
  99. package/dist/SuccessView-CDUVkpSQ.js +77 -0
  100. package/dist/SuccessView-CDUVkpSQ.js.gz +0 -0
  101. package/dist/TextArea-DFfa9A93.js +17 -0
  102. package/dist/TextAreaCard-D_VfEHME.js +34 -0
  103. package/dist/TextAreaCard-D_VfEHME.js.gz +0 -0
  104. package/dist/UserView-DnD929IT.js +96 -0
  105. package/dist/UserView-DnD929IT.js.gz +0 -0
  106. package/dist/WhatsAppShare-B40Ouvds.js +59 -0
  107. package/dist/WhatsAppShare-B40Ouvds.js.gz +0 -0
  108. package/dist/agent-session-Xh6dZlhc.js +298 -0
  109. package/dist/agent-session-Xh6dZlhc.js.gz +0 -0
  110. package/dist/aggregate-base-C6N8Ymd5.js +830 -0
  111. package/dist/aggregate-base-C6N8Ymd5.js.gz +0 -0
  112. package/dist/bel-serializer-DMbFBZ6U.js +51 -0
  113. package/dist/bel-serializer-DMbFBZ6U.js.gz +0 -0
  114. package/dist/browser-q7cvfJ-2.js +366 -0
  115. package/dist/browser-q7cvfJ-2.js.gz +0 -0
  116. package/dist/cart.js +5 -0
  117. package/dist/cart.js.gz +0 -0
  118. package/dist/check.C9Q_W85g-DmgtOx7Q.js +30 -0
  119. package/dist/chevron-down.BkvtON3b-RNrTKYcy.js +30 -0
  120. package/dist/content-5VAQ1vQ0.js +4 -0
  121. package/dist/event-origin-BSW5uum9.js +13 -0
  122. package/dist/examples.mobile.json.tW3aL0qI-tW3aL0qI.js +4 -0
  123. package/dist/examples.mobile.json.tW3aL0qI-tW3aL0qI.js.gz +0 -0
  124. package/dist/eye-slash.BoO00xzs-CULY_lvM.js +30 -0
  125. package/dist/eye.f8zAUc30-Yr89kafZ.js +43 -0
  126. package/dist/eye.f8zAUc30-Yr89kafZ.js.gz +0 -0
  127. package/dist/favicon.ico +0 -0
  128. package/dist/first-paint-B61SrVKm.js +453 -0
  129. package/dist/first-paint-B61SrVKm.js.gz +0 -0
  130. package/dist/gather-vue.css +5 -0
  131. package/dist/gather-vue.css.gz +0 -0
  132. package/dist/gather-widget.es.js +5 -0
  133. package/dist/gather-widget.umd.js +263 -0
  134. package/dist/gather-widget.umd.js.gz +0 -0
  135. package/dist/gather_widget.css +58 -0
  136. package/dist/gather_widget.css.gz +0 -0
  137. package/dist/gather_widget.js +72 -0
  138. package/dist/gather_widget.js.gz +0 -0
  139. package/dist/iframe-BELrOJ1p.js +6 -0
  140. package/dist/index-3lvNtPTE.js +327 -0
  141. package/dist/index-3lvNtPTE.js.gz +0 -0
  142. package/dist/index-BDyGxL1x.js +255 -0
  143. package/dist/index-BDyGxL1x.js.gz +0 -0
  144. package/dist/index-BF9haAFD.js +343 -0
  145. package/dist/index-BF9haAFD.js.gz +0 -0
  146. package/dist/index-BMIST_QA.js +128 -0
  147. package/dist/index-BMIST_QA.js.gz +0 -0
  148. package/dist/index-BdWnMhAc.js +235 -0
  149. package/dist/index-BdWnMhAc.js.gz +0 -0
  150. package/dist/index-BioZsJbf.js +190 -0
  151. package/dist/index-BioZsJbf.js.gz +0 -0
  152. package/dist/index-BzOcD8v-.js +166 -0
  153. package/dist/index-BzOcD8v-.js.gz +0 -0
  154. package/dist/index-C8pB9mUQ.js +147 -0
  155. package/dist/index-C8pB9mUQ.js.gz +0 -0
  156. package/dist/index-C_ougoWd.js +426 -0
  157. package/dist/index-C_ougoWd.js.gz +0 -0
  158. package/dist/index-CoRlIGDo.js +513 -0
  159. package/dist/index-CoRlIGDo.js.gz +0 -0
  160. package/dist/index-CyWBxUBS.js +291 -0
  161. package/dist/index-CyWBxUBS.js.gz +0 -0
  162. package/dist/index-DijQHge7.js +325 -0
  163. package/dist/index-DijQHge7.js.gz +0 -0
  164. package/dist/magnifying-glass.-nBiyXot-CuA_mltt.js +30 -0
  165. package/dist/main-DPldah1M.js +40243 -0
  166. package/dist/main-DPldah1M.js.gz +0 -0
  167. package/dist/nav-timing-B-TNQpyK.js +31 -0
  168. package/dist/nav-timing-B-TNQpyK.js.gz +0 -0
  169. package/dist/no-photography.BJX8HSus-BJX8HSus.js +4 -0
  170. package/dist/no-symbol.CIgKzsrB-3PuxVsDY.js +30 -0
  171. package/dist/recorder-PHZWRV-S.js +8271 -0
  172. package/dist/recorder-PHZWRV-S.js.gz +0 -0
  173. package/dist/stylesheet-evaluator-B4P289vW.js +86 -0
  174. package/dist/stylesheet-evaluator-B4P289vW.js.gz +0 -0
  175. package/dist/time-to-first-byte-kiwh1xjs.js +29 -0
  176. package/dist/traverse-Bw4y1x4D.js +8 -0
  177. package/dist/type-check-Bp684oBR.js +6 -0
  178. package/package.json +89 -0
@@ -0,0 +1,255 @@
1
+ var k = Object.defineProperty;
2
+ var w = (r) => {
3
+ throw TypeError(r);
4
+ };
5
+ var q = (r, e, t) => e in r ? k(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
6
+ var D = (r, e, t) => q(r, typeof e != "symbol" ? e + "" : e, t), F = (r, e, t) => e.has(r) || w("Cannot " + t);
7
+ var a = (r, e, t) => (F(r, e, "read from private field"), t ? t.call(r) : e.get(r)), T = (r, e, t) => e.has(r) ? w("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), c = (r, e, t, i) => (F(r, e, "write to private field"), i ? i.call(r, t) : e.set(r, t), t);
8
+ import { T as C, y as d, U as g, V as N, d as O, W as P, r as v, i as K, B as R, t as M, z as b, v as S, X as L } from "./main-DPldah1M.js";
9
+ import { a as x, b as A } from "./nav-timing-B-TNQpyK.js";
10
+ import { A as W } from "./aggregate-base-C6N8Ymd5.js";
11
+ import { f as G, a as U } from "./first-paint-B61SrVKm.js";
12
+ import { t as I } from "./time-to-first-byte-kiwh1xjs.js";
13
+ import { a as z } from "./traverse-Bw4y1x4D.js";
14
+ function H(r) {
15
+ const e = [], t = C();
16
+ try {
17
+ Object.keys(t.initializedAgents[r].features).forEach((i) => {
18
+ switch (i) {
19
+ case d.ajax:
20
+ e.push("xhr");
21
+ break;
22
+ case d.jserrors:
23
+ e.push("err");
24
+ break;
25
+ case d.genericEvents:
26
+ e.push("ins");
27
+ break;
28
+ case d.sessionTrace:
29
+ e.push("stn");
30
+ break;
31
+ case d.softNav:
32
+ case d.spa:
33
+ e.push("spa");
34
+ break;
35
+ }
36
+ });
37
+ } catch {
38
+ }
39
+ return e;
40
+ }
41
+ var y, h, m, u;
42
+ class V {
43
+ constructor(e) {
44
+ /**
45
+ * Pointer to the current agent session if it exists.
46
+ * @type {import('../session/session-entity').SessionEntity}
47
+ */
48
+ T(this, y);
49
+ /**
50
+ * Represents the browser origin time corrected to NR server time.
51
+ * @type {number}
52
+ */
53
+ T(this, h);
54
+ /**
55
+ * Represents the difference in milliseconds between the calculated NR server time and
56
+ * the local time.
57
+ * @type {number}
58
+ */
59
+ T(this, m);
60
+ /**
61
+ * Represents whether the timekeeper is in a state that it can accurately convert
62
+ * timestamps.
63
+ * @type {boolean}
64
+ */
65
+ T(this, u, !1);
66
+ c(this, y, e), this.processStoredDiff();
67
+ }
68
+ get ready() {
69
+ return a(this, u);
70
+ }
71
+ get correctedOriginTime() {
72
+ return a(this, h);
73
+ }
74
+ get localTimeDiff() {
75
+ return a(this, m);
76
+ }
77
+ /**
78
+ * Process a rum request to calculate NR server time.
79
+ * @param rumRequest {XMLHttpRequest} The xhr for the rum request
80
+ * @param startTime {number} The start time of the RUM request
81
+ * @param endTime {number} The end time of the RUM request
82
+ * @param nrServerTime {number} the unix number value of the NR server time in MS, returned in the RUM request body
83
+ */
84
+ processRumRequest(e, t, i, s) {
85
+ var f;
86
+ if (this.processStoredDiff(), a(this, u)) return;
87
+ if (!s) throw new Error("nrServerTime not found");
88
+ const n = (i - t) / 2, o = t + n;
89
+ if (c(this, h, Math.floor(s - o)), c(this, m, g - a(this, h)), isNaN(a(this, h)))
90
+ throw new Error("Failed to correct browser time to server time");
91
+ (f = a(this, y)) == null || f.write({
92
+ serverTimeDiff: a(this, m)
93
+ }), c(this, u, !0);
94
+ }
95
+ /**
96
+ * Converts a page origin relative time to an absolute timestamp
97
+ * using the user's local clock.
98
+ * @param relativeTime {number} The relative time of the event in milliseconds
99
+ * @returns {number} Corrected unix/epoch timestamp
100
+ */
101
+ convertRelativeTimestamp(e) {
102
+ return g + e;
103
+ }
104
+ /**
105
+ * Converts an absolute timestamp to a relative timestamp using the
106
+ * user's local clock.
107
+ * @param timestamp
108
+ * @returns {number}
109
+ */
110
+ convertAbsoluteTimestamp(e) {
111
+ return e - g;
112
+ }
113
+ /**
114
+ * Corrects an absolute timestamp to NR server time.
115
+ * @param timestamp {number} The unix/epoch timestamp of the event with milliseconds
116
+ * @return {number} Corrected unix/epoch timestamp
117
+ */
118
+ correctAbsoluteTimestamp(e) {
119
+ return e - a(this, m);
120
+ }
121
+ /**
122
+ * Corrects relative timestamp to NR server time (epoch).
123
+ * @param {DOMHighResTimeStamp} relativeTime
124
+ * @returns {number}
125
+ */
126
+ correctRelativeTimestamp(e) {
127
+ return this.correctAbsoluteTimestamp(this.convertRelativeTimestamp(e));
128
+ }
129
+ /** Process the session entity and use the info to set the main time calculations if present */
130
+ processStoredDiff() {
131
+ var t, i;
132
+ if (a(this, u)) return;
133
+ const e = (i = (t = a(this, y)) == null ? void 0 : t.read()) == null ? void 0 : i.serverTimeDiff;
134
+ typeof e == "number" && !isNaN(e) && (c(this, m, e), c(this, h, g - a(this, m)), c(this, u, !0));
135
+ }
136
+ }
137
+ y = new WeakMap(), h = new WeakMap(), m = new WeakMap(), u = new WeakMap();
138
+ class _ extends W {
139
+ constructor(e) {
140
+ if (super(e, N), this.timeToFirstByte = 0, this.firstByteToWindowLoad = 0, this.firstByteToDomContent = 0, O("send-rum", (t, i) => {
141
+ this.sendRum(t, i);
142
+ }, this.featureName, this.ee), !P(e.info))
143
+ return this.ee.abort(), v(43);
144
+ e.runtime.timeKeeper = new V(e.runtime.session), K ? I.subscribe(({
145
+ value: t,
146
+ attrs: i
147
+ }) => {
148
+ const s = i.navigationEntry;
149
+ this.timeToFirstByte = Math.max(t, this.timeToFirstByte), this.firstByteToWindowLoad = Math.max(Math.round(s.loadEventEnd - this.timeToFirstByte), this.firstByteToWindowLoad), this.firstByteToDomContent = Math.max(Math.round(s.domContentLoadedEventEnd - this.timeToFirstByte), this.firstByteToDomContent), this.sendRum();
150
+ }) : this.sendRum();
151
+ }
152
+ /**
153
+ *
154
+ * @param {Function} cb A function to run once the RUM call has finished - Defaults to activateFeatures
155
+ * @param {*} customAttributes custom attributes to attach to the RUM call - Defaults to info.js
156
+ * @param {*} target The target to harvest to - Since we will not know the entityGuid before harvesting, this must be an object directly supplied from the info object or API, not an entityGuid string for lookup with the entityManager - Defaults to { licenseKey: this.agentRef.info.licenseKey, applicationID: this.agentRef.info.applicationID }
157
+ */
158
+ sendRum(e = this.agentRef.info.jsAttributes, t = {
159
+ licenseKey: this.agentRef.info.licenseKey,
160
+ applicationID: this.agentRef.info.applicationID
161
+ }) {
162
+ var p, E, B;
163
+ const i = this.agentRef.info, s = {};
164
+ i.queueTime && (s.qt = i.queueTime), i.applicationTime && (s.ap = i.applicationTime), s.be = this.timeToFirstByte, s.fe = this.firstByteToWindowLoad, s.dc = this.firstByteToDomContent;
165
+ const n = {
166
+ tt: i.ttGuid,
167
+ us: i.user,
168
+ ac: i.account,
169
+ pr: i.product,
170
+ af: H(this.agentIdentifier).join(","),
171
+ ...s,
172
+ xx: i.extra,
173
+ ua: i.userAttributes,
174
+ at: i.atts
175
+ };
176
+ this.agentRef.runtime.session && (n.fsh = Number(this.agentRef.runtime.session.isNew));
177
+ let o;
178
+ if (typeof e == "object" && Object.keys(e).length > 0 && (o = z({
179
+ ja: e
180
+ }, this.obfuscator.obfuscateString.bind(this.obfuscator), "string")), R.performance) {
181
+ if (typeof PerformanceNavigationTiming < "u") {
182
+ const l = (B = (E = (p = R) == null ? void 0 : p.performance) == null ? void 0 : E.getEntriesByType("navigation")) == null ? void 0 : B[0], j = {
183
+ timing: A(g, l, {}),
184
+ navigation: x(l, {})
185
+ };
186
+ n.perf = M(j);
187
+ } else if (typeof PerformanceTiming < "u") {
188
+ const l = {
189
+ timing: A(g, R.performance.timing, {}, !0),
190
+ navigation: x(R.performance.navigation, {})
191
+ };
192
+ n.perf = M(l);
193
+ }
194
+ }
195
+ n.fp = G.current.value, n.fcp = U.current.value;
196
+ const f = this.agentRef.runtime.timeKeeper;
197
+ f != null && f.ready && (n.timestamp = Math.floor(f.correctRelativeTimestamp(b()))), this.rumStartTime = b(), this.agentRef.runtime.harvester.triggerHarvestFor(this, {
198
+ directSend: {
199
+ targetApp: t,
200
+ payload: {
201
+ qs: n,
202
+ body: o
203
+ }
204
+ },
205
+ needResponse: !0,
206
+ sendEmptyBody: !0
207
+ });
208
+ }
209
+ postHarvestCleanup({
210
+ status: e,
211
+ responseText: t,
212
+ xhr: i,
213
+ targetApp: s
214
+ }) {
215
+ const n = b();
216
+ let o, f;
217
+ try {
218
+ ({
219
+ app: o,
220
+ ...f
221
+ } = JSON.parse(t)), this.processEntities(o.agents, s);
222
+ } catch (p) {
223
+ v(53, p);
224
+ }
225
+ if (S(s, this.agentRef)) {
226
+ if (e >= 400 || e === 0) {
227
+ v(18, e), this.ee.abort();
228
+ return;
229
+ }
230
+ try {
231
+ if (this.agentRef.runtime.timeKeeper.processRumRequest(i, this.rumStartTime, n, o.nrServerTime), !this.agentRef.runtime.timeKeeper.ready) throw new Error("TimeKeeper not ready");
232
+ } catch (p) {
233
+ this.ee.abort(), v(17, p);
234
+ return;
235
+ }
236
+ Object.keys(this.agentRef.runtime.appMetadata).length || (this.agentRef.runtime.appMetadata = o), this.drain(), this.agentRef.runtime.harvester.startTimer(), L(f, this.agentRef);
237
+ }
238
+ }
239
+ processEntities(e, t) {
240
+ !e || !t || e.forEach((i) => {
241
+ const s = this.agentRef.runtime.entityManager, n = i.entityGuid;
242
+ s.get(n) || (S(t, this.agentRef) && s.setDefaultEntity({
243
+ ...t,
244
+ entityGuid: n
245
+ }), s.set(i.entityGuid, {
246
+ ...t,
247
+ entityGuid: n
248
+ }));
249
+ });
250
+ }
251
+ }
252
+ D(_, "featureName", N);
253
+ export {
254
+ _ as Aggregate
255
+ };
Binary file
@@ -0,0 +1,343 @@
1
+ var H = Object.defineProperty;
2
+ var P = (t) => {
3
+ throw TypeError(t);
4
+ };
5
+ var K = (t, e, i) => e in t ? H(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
6
+ var _ = (t, e, i) => K(t, typeof e != "symbol" ? e + "" : e, i), C = (t, e, i) => e.has(t) || P("Cannot " + i);
7
+ var y = (t, e, i) => (C(t, e, "read from private field"), i ? i.call(t) : e.get(t)), M = (t, e, i) => e.has(t) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i, n) => (C(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i);
8
+ import { aS as A, aT as L, aU as O, aV as N, i as S, d as v, aW as B, r as R, B as I, t as V, z as W, S as x, j as G } from "./main-DPldah1M.js";
9
+ import { c as b, A as j } from "./aggregate-base-C6N8Ymd5.js";
10
+ import { a as F } from "./traverse-Bw4y1x4D.js";
11
+ import { i as U } from "./iframe-BELrOJ1p.js";
12
+ import { i as D } from "./type-check-Bp684oBR.js";
13
+ const z = (t, e = []) => {
14
+ if (!t) return {
15
+ path: void 0,
16
+ nearestFields: {}
17
+ };
18
+ const i = (s) => {
19
+ try {
20
+ let u = 1;
21
+ const {
22
+ tagName: f
23
+ } = s;
24
+ for (; s.previousElementSibling; )
25
+ s.previousElementSibling.tagName === f && u++, s = s.previousElementSibling;
26
+ return u;
27
+ } catch {
28
+ }
29
+ };
30
+ let n = "", l = i(t);
31
+ const r = {};
32
+ try {
33
+ for (; t != null && t.tagName; ) {
34
+ const {
35
+ id: s,
36
+ localName: u
37
+ } = t;
38
+ e.forEach((o) => {
39
+ var h, p;
40
+ r[p = c(o)] || (r[p] = ((h = t[o]) == null ? void 0 : h.baseVal) || t[o]);
41
+ }), n = [u, s ? "#".concat(s) : "", n ? ">".concat(n) : ""].join(""), t = t.parentNode;
42
+ }
43
+ } catch {
44
+ }
45
+ return {
46
+ path: n ? l ? "".concat(n, ":nth-of-type(").concat(l, ")") : n : void 0,
47
+ nearestFields: r
48
+ };
49
+ function c(s) {
50
+ return s === "tagName" && (s = "tag"), s === "className" && (s = "class"), "nearest".concat(s.charAt(0).toUpperCase() + s.slice(1));
51
+ }
52
+ };
53
+ class Y {
54
+ constructor(e, i, n) {
55
+ this.event = e, this.count = 1, this.originMs = Math.floor(e.timeStamp), this.relativeMs = [0], this.selectorPath = i, this.rageClick = void 0, this.nearestTargetFields = n, this.currentUrl = b("" + location);
56
+ }
57
+ /**
58
+ * Aggregates the count and maintains the relative MS array for matching events
59
+ * Will determine if a rage click was observed as part of the aggregation
60
+ * @param {Event} evt
61
+ * @returns {void}
62
+ */
63
+ aggregate(e) {
64
+ this.count++, this.relativeMs.push(Math.floor(e.timeStamp - this.originMs)), this.isRageClick() && (this.rageClick = !0);
65
+ }
66
+ /**
67
+ * Determines if the current set of relative ms values constitutes a rage click
68
+ * @returns {boolean}
69
+ */
70
+ isRageClick() {
71
+ const e = this.relativeMs.length;
72
+ return this.event.type === "click" && e >= A && this.relativeMs[e - 1] - this.relativeMs[e - A] < L;
73
+ }
74
+ }
75
+ var m, g;
76
+ class q {
77
+ constructor() {
78
+ /** @type {AggregatedUserAction=} */
79
+ M(this, m);
80
+ M(this, g, "");
81
+ }
82
+ get aggregationEvent() {
83
+ const e = y(this, m);
84
+ return E(this, g, ""), E(this, m, void 0), e;
85
+ }
86
+ /**
87
+ * Process the event and determine if a new aggregation set should be made or if it should increment the current aggregation
88
+ * @param {Event} evt The event supplied by the addEventListener callback
89
+ * @returns {AggregatedUserAction|undefined} The previous aggregation set if it has been completed by processing the current event
90
+ */
91
+ process(e, i) {
92
+ if (!e) return;
93
+ const {
94
+ selectorPath: n,
95
+ nearestTargetFields: l
96
+ } = Q(e, i), r = X(e, n);
97
+ if (r && r === y(this, g))
98
+ y(this, m).aggregate(e);
99
+ else {
100
+ const a = y(this, m);
101
+ return E(this, g, r), E(this, m, new Y(e, n, l)), a;
102
+ }
103
+ }
104
+ }
105
+ m = new WeakMap(), g = new WeakMap();
106
+ function Q(t, e) {
107
+ let i, n = {};
108
+ if (O.includes(t.type) || t.target === window) i = "window";
109
+ else if (t.target === document) i = "document";
110
+ else {
111
+ const {
112
+ path: l,
113
+ nearestFields: r
114
+ } = z(t.target, e);
115
+ i = l, n = r;
116
+ }
117
+ return {
118
+ selectorPath: i,
119
+ nearestTargetFields: n
120
+ };
121
+ }
122
+ function X(t, e) {
123
+ let i = t.type;
124
+ return t.type !== "scrollend" && (i += "-" + e), i;
125
+ }
126
+ class Z extends j {
127
+ constructor(e) {
128
+ super(e, N), this.eventsPerHarvest = 1e3, this.referrerUrl = S && document.referrer ? b(document.referrer) : void 0, this.waitForFlags(["ins"]).then(([i]) => {
129
+ if (!i) {
130
+ this.blocked = !0, this.deregisterDrain();
131
+ return;
132
+ }
133
+ this.trackSupportabilityMetrics(), v("api-recordCustomEvent", (r, a, c) => {
134
+ if (B.includes(a)) return R(46);
135
+ this.addEvent({
136
+ eventType: a,
137
+ timestamp: this.toEpoch(r),
138
+ ...c
139
+ });
140
+ }, this.featureName, this.ee), e.init.page_action.enabled && v("api-addPageAction", (r, a, c, s) => {
141
+ var u, f;
142
+ if (!this.agentRef.runtime.entityManager.get(s)) return R(56, this.featureName);
143
+ this.addEvent({
144
+ ...c,
145
+ eventType: "PageAction",
146
+ timestamp: this.toEpoch(r),
147
+ timeSinceLoad: r / 1e3,
148
+ actionName: a,
149
+ referrerUrl: this.referrerUrl,
150
+ ...S && {
151
+ browserWidth: (u = window.document.documentElement) == null ? void 0 : u.clientWidth,
152
+ browserHeight: (f = window.document.documentElement) == null ? void 0 : f.clientHeight
153
+ }
154
+ }, s);
155
+ }, this.featureName, this.ee);
156
+ let n = () => {
157
+ };
158
+ S && e.init.user_actions.enabled && (this.userActionAggregator = new q(), this.harvestOpts.beforeUnload = () => n == null ? void 0 : n(this.userActionAggregator.aggregationEvent), n = (r) => {
159
+ try {
160
+ if (r != null && r.event) {
161
+ let u = function(o) {
162
+ return o === "tagName" && (o = "tag"), o === "className" && (o = "class"), "target".concat(o.charAt(0).toUpperCase() + o.slice(1));
163
+ }, f = function(o) {
164
+ return !!(r.selectorPath !== "window" && r.selectorPath !== "document" && a instanceof HTMLElement && (a != null && a[o]));
165
+ };
166
+ const {
167
+ target: a,
168
+ timeStamp: c,
169
+ type: s
170
+ } = r.event;
171
+ this.addEvent({
172
+ eventType: "UserAction",
173
+ timestamp: this.toEpoch(c),
174
+ action: s,
175
+ actionCount: r.count,
176
+ actionDuration: r.relativeMs[r.relativeMs.length - 1],
177
+ actionMs: r.relativeMs,
178
+ rageClick: r.rageClick,
179
+ target: r.selectorPath,
180
+ currentUrl: r.currentUrl,
181
+ ...U(window) && {
182
+ iframe: !0
183
+ },
184
+ ...this.agentRef.init.user_actions.elementAttributes.reduce((o, h) => (f(h) && (o[u(h)] = String(a[h]).trim().slice(0, 128)), o), {}),
185
+ ...r.nearestTargetFields
186
+ });
187
+ }
188
+ } catch {
189
+ }
190
+ }, v("ua", (r) => {
191
+ n(this.userActionAggregator.process(r, this.agentRef.init.user_actions.elementAttributes));
192
+ }, this.featureName, this.ee));
193
+ const l = [...e.init.performance.capture_marks ? ["mark"] : [], ...e.init.performance.capture_measures ? ["measure"] : []];
194
+ if (l.length)
195
+ try {
196
+ l.forEach((r) => {
197
+ PerformanceObserver.supportedEntryTypes.includes(r) && new PerformanceObserver((c) => {
198
+ c.getEntries().forEach((s) => {
199
+ try {
200
+ let f = function(o) {
201
+ if (o == null) return {};
202
+ return D(o) ? h(o) : {
203
+ entryDetail: o
204
+ };
205
+ function h(p, k = "entryDetail") {
206
+ let T = {};
207
+ return p == null || Object.keys(p).forEach((d) => {
208
+ let w = k + "." + d;
209
+ D(p[d]) ? Object.assign(T, h(p[d], w)) : p[d] !== null && p[d] !== void 0 && (T[w] = p[d]);
210
+ }), T;
211
+ }
212
+ };
213
+ this.reportSupportabilityMetric("Generic/Performance/" + r + "/Seen");
214
+ const u = e.init.performance.capture_detail ? f(s.detail) : {};
215
+ this.addEvent({
216
+ ...u,
217
+ eventType: "BrowserPerformance",
218
+ timestamp: this.toEpoch(s.startTime),
219
+ entryName: s.name,
220
+ entryDuration: s.duration,
221
+ entryType: r
222
+ });
223
+ } catch {
224
+ }
225
+ });
226
+ }).observe({
227
+ buffered: !0,
228
+ type: r
229
+ });
230
+ });
231
+ } catch {
232
+ }
233
+ S && e.init.performance.resources.enabled && v("browserPerformance.resource", (r) => {
234
+ var a;
235
+ try {
236
+ const {
237
+ name: c,
238
+ duration: s,
239
+ ...u
240
+ } = r.toJSON();
241
+ let f = !1;
242
+ try {
243
+ const h = new URL(c).hostname, p = h.includes("newrelic.com") || h.includes("nr-data.net") || h.includes("nr-local.net");
244
+ if (this.agentRef.init.performance.resources.ignore_newrelic && p || this.agentRef.init.performance.resources.asset_types.length && !this.agentRef.init.performance.resources.asset_types.includes(u.initiatorType)) return;
245
+ f = h === ((a = I) == null ? void 0 : a.location.hostname) || e.init.performance.resources.first_party_domains.includes(h), f && this.reportSupportabilityMetric("Generic/Performance/FirstPartyResource/Seen"), p && this.reportSupportabilityMetric("Generic/Performance/NrResource/Seen");
246
+ } catch {
247
+ }
248
+ this.reportSupportabilityMetric("Generic/Performance/Resource/Seen");
249
+ const o = {
250
+ ...u,
251
+ eventType: "BrowserPerformance",
252
+ timestamp: Math.floor(e.runtime.timeKeeper.correctRelativeTimestamp(u.startTime)),
253
+ entryName: b(c),
254
+ entryDuration: s,
255
+ firstParty: f
256
+ };
257
+ this.addEvent(o);
258
+ } catch (c) {
259
+ this.ee.emit("internal-error", [c, "GenericEvents-Resource"]);
260
+ }
261
+ }, this.featureName, this.ee), v("api-measure", (r, a) => {
262
+ const {
263
+ start: c,
264
+ duration: s,
265
+ customAttributes: u
266
+ } = r, f = {
267
+ ...u,
268
+ eventType: "BrowserPerformance",
269
+ timestamp: Math.floor(e.runtime.timeKeeper.correctRelativeTimestamp(c)),
270
+ entryName: a,
271
+ entryDuration: s,
272
+ entryType: "measure"
273
+ };
274
+ this.addEvent(f);
275
+ }, this.featureName, this.ee), e.runtime.harvester.triggerHarvestFor(this), this.drain();
276
+ });
277
+ }
278
+ // WARNING: Insights times are in seconds. EXCEPT timestamp, which is in ms.
279
+ /** Some keys are set by the query params or request headers sent with the harvest and override the body values, so check those before adding new standard body values...
280
+ * see harvest.js#baseQueryString for more info on the query params
281
+ * Notably:
282
+ * * name: set by the `t=` query param
283
+ * * appId: set by the `a=` query param
284
+ * * standalone: set by the `sa=` query param
285
+ * * session: set by the `s=` query param
286
+ * * sessionTraceId: set by the `ptid=` query param
287
+ * * userAgent*: set by the userAgent header
288
+ * @param {object=} obj the event object for storing in the event buffer
289
+ * @param {string=} targetEntityGuid the target entity guid for the event to scope buffering and harvesting. Defaults to agent config if undefined
290
+ * @returns void
291
+ */
292
+ addEvent(e = {}, i) {
293
+ if (!e || !Object.keys(e).length) return;
294
+ if (!e.eventType) {
295
+ R(44);
296
+ return;
297
+ }
298
+ for (let a in e) {
299
+ let c = e[a];
300
+ e[a] = c && typeof c == "object" ? V(c) : c;
301
+ }
302
+ const n = {
303
+ /** should be overridden by the event-specific attributes, but just in case -- set it to now() */
304
+ timestamp: Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(W())),
305
+ /** all generic events require pageUrl(s) */
306
+ pageUrl: b("" + G),
307
+ currentUrl: b("" + location)
308
+ }, l = {
309
+ /** Agent-level custom attributes */
310
+ ...this.agentRef.info.jsAttributes || {},
311
+ /** Fallbacks for required properties in-case the event did not supply them, should take precedence over agent-level custom attrs */
312
+ ...n,
313
+ /** Event-specific attributes take precedence over agent-level custom attributes and fallbacks */
314
+ ...e
315
+ };
316
+ !this.events.add(l, i) && !this.events.isEmpty(void 0, i) && (this.ee.emit(x, ["GenericEvents/Harvest/Max/Seen"]), this.agentRef.runtime.harvester.triggerHarvestFor(this, {
317
+ targetEntityGuid: i
318
+ }), this.events.add(l));
319
+ }
320
+ serializer(e) {
321
+ return F({
322
+ ins: e
323
+ }, this.obfuscator.obfuscateString.bind(this.obfuscator), "string");
324
+ }
325
+ queryStringsBuilder() {
326
+ return {
327
+ ua: this.agentRef.info.userAttributes,
328
+ at: this.agentRef.info.atts
329
+ };
330
+ }
331
+ toEpoch(e) {
332
+ return Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(e));
333
+ }
334
+ trackSupportabilityMetrics() {
335
+ var i, n;
336
+ const e = "Config/Performance/";
337
+ this.agentRef.init.performance.capture_marks && this.reportSupportabilityMetric(e + "CaptureMarks/Enabled"), this.agentRef.init.performance.capture_measures && this.reportSupportabilityMetric(e + "CaptureMeasures/Enabled"), this.agentRef.init.performance.resources.enabled && this.reportSupportabilityMetric(e + "Resources/Enabled"), ((i = this.agentRef.init.performance.resources.asset_types) == null ? void 0 : i.length) !== 0 && this.reportSupportabilityMetric(e + "Resources/AssetTypes/Changed"), ((n = this.agentRef.init.performance.resources.first_party_domains) == null ? void 0 : n.length) !== 0 && this.reportSupportabilityMetric(e + "Resources/FirstPartyDomains/Changed"), this.agentRef.init.performance.resources.ignore_newrelic === !1 && this.reportSupportabilityMetric(e + "Resources/IgnoreNewrelic/Changed");
338
+ }
339
+ }
340
+ _(Z, "featureName", N);
341
+ export {
342
+ Z as Aggregate
343
+ };
Binary file