PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.52
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.52
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / build / leadin.js

leadin.js in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.0.52, at build/leadin.js

5,890 lines 200.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
5 /*!*******************************************************************!*\
6 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
7 \*******************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 function memoize(fn) {
16 var cache = Object.create(null);
17 return function (arg) {
18 if (cache[arg] === undefined) cache[arg] = fn(arg);
19 return cache[arg];
20 };
21 }
22
23 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
24
25
26 /***/ }),
27
28 /***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js":
29 /*!***********************************************************************************************************!*\
30 !*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***!
31 \***********************************************************************************************************/
32 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
33
34 "use strict";
35 __webpack_require__.r(__webpack_exports__);
36 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
38 /* harmony export */ });
39 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js");
40
41
42 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
43
44 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
45 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
46 /* o */
47 && prop.charCodeAt(1) === 110
48 /* n */
49 && prop.charCodeAt(2) < 91;
50 }
51 /* Z+1 */
52 );
53
54 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPropValid);
55
56
57 /***/ }),
58
59 /***/ "./scripts/api/wordpressApiClient.ts":
60 /*!*******************************************!*\
61 !*** ./scripts/api/wordpressApiClient.ts ***!
62 \*******************************************/
63 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
65 "use strict";
66 __webpack_require__.r(__webpack_exports__);
67 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68 /* harmony export */ "disableInternalTracking": () => (/* binding */ disableInternalTracking),
69 /* harmony export */ "fetchDisableInternalTracking": () => (/* binding */ fetchDisableInternalTracking),
70 /* harmony export */ "getBusinessUnitId": () => (/* binding */ getBusinessUnitId),
71 /* harmony export */ "healthcheckRestApi": () => (/* binding */ healthcheckRestApi),
72 /* harmony export */ "setBusinessUnitId": () => (/* binding */ setBusinessUnitId),
73 /* harmony export */ "skipReview": () => (/* binding */ skipReview),
74 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
75 /* harmony export */ "updateHublet": () => (/* binding */ updateHublet)
76 /* harmony export */ });
77 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
78 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
79 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
80 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
81 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
82
83
84
85
86
87 function makeRequest(method, path) {
88 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
89 var queryParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
90 // eslint-disable-next-line compat/compat
91 var restApiUrl = new URL("".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restUrl, "leadin/v1").concat(path));
92 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_3__.addQueryObjectToUrl)(restApiUrl, queryParams);
93 return new Promise(function (resolve, reject) {
94 var payload = {
95 url: restApiUrl.toString(),
96 method: method,
97 contentType: 'application/json',
98 beforeSend: function beforeSend(xhr) {
99 return xhr.setRequestHeader('X-WP-Nonce', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restNonce);
100 },
101 success: resolve,
102 error: function error(response) {
103 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureMessage("HTTP Request to ".concat(restApiUrl, " failed with error ").concat(response.status, ": ").concat(response.responseText), {
104 fingerprint: ['{{ default }}', path, response.status, response.responseText]
105 });
106 reject(response);
107 }
108 };
109
110 if (method !== 'get') {
111 payload.data = JSON.stringify(data);
112 }
113
114 jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax(payload);
115 });
116 }
117
118 function healthcheckRestApi() {
119 return makeRequest('get', '/healthcheck');
120 }
121 function disableInternalTracking(value) {
122 return makeRequest('put', '/internal-tracking', value ? '1' : '0');
123 }
124 function fetchDisableInternalTracking() {
125 return makeRequest('get', '/internal-tracking').then(function (message) {
126 return {
127 message: message
128 };
129 });
130 }
131 function updateHublet(hublet) {
132 return makeRequest('put', '/hublet', {
133 hublet: hublet
134 });
135 }
136 function skipReview() {
137 return makeRequest('post', '/skip-review');
138 }
139 function trackConsent(canTrack) {
140 return makeRequest('post', '/track-consent', {
141 canTrack: canTrack
142 }).then(function (message) {
143 return {
144 message: message
145 };
146 });
147 }
148 function setBusinessUnitId(businessUnitId) {
149 return makeRequest('put', '/business-unit', {
150 businessUnitId: businessUnitId
151 });
152 }
153 function getBusinessUnitId() {
154 return makeRequest('get', '/business-unit');
155 }
156
157 /***/ }),
158
159 /***/ "./scripts/constants/leadinConfig.ts":
160 /*!*******************************************!*\
161 !*** ./scripts/constants/leadinConfig.ts ***!
162 \*******************************************/
163 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
164
165 "use strict";
166 __webpack_require__.r(__webpack_exports__);
167 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
168 /* harmony export */ "accountName": () => (/* binding */ accountName),
169 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
170 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
171 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
172 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
173 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
174 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
175 /* harmony export */ "env": () => (/* binding */ env),
176 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
177 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
178 /* harmony export */ "hublet": () => (/* binding */ hublet),
179 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
180 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
181 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
182 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
183 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
184 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
185 /* harmony export */ "locale": () => (/* binding */ locale),
186 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
187 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
188 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
189 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
190 /* harmony export */ "plugins": () => (/* binding */ plugins),
191 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
192 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
193 /* harmony export */ "portalId": () => (/* binding */ portalId),
194 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
195 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
196 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
197 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
198 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
199 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
200 /* harmony export */ "theme": () => (/* binding */ theme),
201 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
202 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
203 /* harmony export */ });
204 var _window$leadinConfig = window.leadinConfig,
205 accountName = _window$leadinConfig.accountName,
206 adminUrl = _window$leadinConfig.adminUrl,
207 activationTime = _window$leadinConfig.activationTime,
208 connectionStatus = _window$leadinConfig.connectionStatus,
209 deviceId = _window$leadinConfig.deviceId,
210 didDisconnect = _window$leadinConfig.didDisconnect,
211 env = _window$leadinConfig.env,
212 formsScript = _window$leadinConfig.formsScript,
213 meetingsScript = _window$leadinConfig.meetingsScript,
214 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
215 hublet = _window$leadinConfig.hublet,
216 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
217 hubspotNonce = _window$leadinConfig.hubspotNonce,
218 iframeUrl = _window$leadinConfig.iframeUrl,
219 impactLink = _window$leadinConfig.impactLink,
220 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
221 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
222 locale = _window$leadinConfig.locale,
223 loginUrl = _window$leadinConfig.loginUrl,
224 phpVersion = _window$leadinConfig.phpVersion,
225 pluginPath = _window$leadinConfig.pluginPath,
226 plugins = _window$leadinConfig.plugins,
227 portalDomain = _window$leadinConfig.portalDomain,
228 portalEmail = _window$leadinConfig.portalEmail,
229 portalId = _window$leadinConfig.portalId,
230 redirectNonce = _window$leadinConfig.redirectNonce,
231 restNonce = _window$leadinConfig.restNonce,
232 restUrl = _window$leadinConfig.restUrl,
233 refreshToken = _window$leadinConfig.refreshToken,
234 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
235 theme = _window$leadinConfig.theme,
236 trackConsent = _window$leadinConfig.trackConsent,
237 wpVersion = _window$leadinConfig.wpVersion,
238 contentEmbed = _window$leadinConfig.contentEmbed,
239 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope;
240
241
242 /***/ }),
243
244 /***/ "./scripts/constants/selectors.ts":
245 /*!****************************************!*\
246 !*** ./scripts/constants/selectors.ts ***!
247 \****************************************/
248 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
249
250 "use strict";
251 __webpack_require__.r(__webpack_exports__);
252 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
253 /* harmony export */ "domElements": () => (/* binding */ domElements)
254 /* harmony export */ });
255 var domElements = {
256 iframe: '#leadin-iframe',
257 subMenu: '.toplevel_page_leadin > ul',
258 subMenuLinks: '.toplevel_page_leadin > ul a',
259 subMenuButtons: '.toplevel_page_leadin > ul > li',
260 deactivatePluginButton: '[data-slug="leadin"] .deactivate a',
261 deactivateFeedbackForm: 'form.leadin-deactivate-form',
262 deactivateFeedbackSubmit: 'button#leadin-feedback-submit',
263 deactivateFeedbackSkip: 'button#leadin-feedback-skip',
264 thickboxModalClose: '.leadin-modal-close',
265 thickboxModalWindow: 'div#TB_window.thickbox-loading',
266 thickboxModalContent: 'div#TB_ajaxContent.TB_modal',
267 reviewBannerContainer: '#leadin-review-banner',
268 reviewBannerLeaveReviewLink: 'a#leave-review-button',
269 reviewBannerDismissButton: 'a#dismiss-review-banner-button',
270 leadinIframeContainer: 'leadin-iframe-container',
271 leadinIframe: 'leadin-iframe',
272 leadinIframeFallbackContainer: 'leadin-iframe-fallback-container'
273 };
274
275 /***/ }),
276
277 /***/ "./scripts/iframe/IframeErrorPage.tsx":
278 /*!********************************************!*\
279 !*** ./scripts/iframe/IframeErrorPage.tsx ***!
280 \********************************************/
281 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
282
283 "use strict";
284 __webpack_require__.r(__webpack_exports__);
285 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286 /* harmony export */ "IframeErrorPage": () => (/* binding */ IframeErrorPage)
287 /* harmony export */ });
288 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
289 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
290 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
291 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
292
293
294
295 var IframeErrorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
296 name: "IframeErrorContainer",
297 "class": "i1jit3y0",
298 propsAsIs: false
299 });
300 var ErrorHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('h1')({
301 name: "ErrorHeader",
302 "class": "e12lu7tb",
303 propsAsIs: false
304 });
305 var IframeErrorPage = function IframeErrorPage() {
306 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IframeErrorContainer, {
307 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", {
308 alt: "Cannot find page",
309 width: "175",
310 src: "//static.hsappstatic.net/ui-images/static-1.14/optimized/errors/map.svg"
311 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ErrorHeader, {
312 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The HubSpot for WordPress plugin is not able to load pages', 'leadin')
313 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
314 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Try disabling your browser extensions and ad blockers, then refresh the page', 'leadin')
315 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
316 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Or open the HubSpot for WordPress plugin in a different browser', 'leadin')
317 })]
318 });
319 };
320
321 __webpack_require__(/*! ./IframeErrorPage.linaria.css!=!../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./IframeErrorPage.tsx */ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx");
322
323 /***/ }),
324
325 /***/ "./scripts/iframe/constants.ts":
326 /*!*************************************!*\
327 !*** ./scripts/iframe/constants.ts ***!
328 \*************************************/
329 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
330
331 "use strict";
332 __webpack_require__.r(__webpack_exports__);
333 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
334 /* harmony export */ "App": () => (/* binding */ App),
335 /* harmony export */ "AppIframe": () => (/* binding */ AppIframe)
336 /* harmony export */ });
337 var _AppIframe;
338
339 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; }
340
341 var App;
342
343 (function (App) {
344 App[App["Forms"] = 0] = "Forms";
345 App[App["LiveChat"] = 1] = "LiveChat";
346 App[App["Plugin"] = 2] = "Plugin";
347 App[App["PluginSettings"] = 3] = "PluginSettings";
348 App[App["Background"] = 4] = "Background";
349 })(App || (App = {}));
350
351 var AppIframe = (_AppIframe = {}, _defineProperty(_AppIframe, App.Forms, 'integrated-form-app'), _defineProperty(_AppIframe, App.LiveChat, 'integrated-livechat-app'), _defineProperty(_AppIframe, App.Plugin, 'integrated-plugin-app'), _defineProperty(_AppIframe, App.PluginSettings, 'integrated-plugin-app'), _defineProperty(_AppIframe, App.Background, 'integrated-plugin-proxy'), _AppIframe);
352
353 /***/ }),
354
355 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
356 /*!****************************************************************!*\
357 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
358 \****************************************************************/
359 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
360
361 "use strict";
362 __webpack_require__.r(__webpack_exports__);
363 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
364 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
365 /* harmony export */ });
366 var CoreMessages = {
367 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
368 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
369 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
370 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
371 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
372 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID'
373 };
374
375 /***/ }),
376
377 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
378 /*!******************************************************************!*\
379 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
380 \******************************************************************/
381 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
382
383 "use strict";
384 __webpack_require__.r(__webpack_exports__);
385 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
386 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
387 /* harmony export */ });
388 var FormMessages = {
389 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
390 };
391
392 /***/ }),
393
394 /***/ "./scripts/iframe/integratedMessages/index.ts":
395 /*!****************************************************!*\
396 !*** ./scripts/iframe/integratedMessages/index.ts ***!
397 \****************************************************/
398 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
399
400 "use strict";
401 __webpack_require__.r(__webpack_exports__);
402 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
403 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
404 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
405 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
406 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
407 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
408 /* harmony export */ });
409 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
410 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
411 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
412 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
413 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
414
415
416
417
418
419
420 /***/ }),
421
422 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
423 /*!************************************************************************!*\
424 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
425 \************************************************************************/
426 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
427
428 "use strict";
429 __webpack_require__.r(__webpack_exports__);
430 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
431 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
432 /* harmony export */ });
433 var LiveChatMessages = {
434 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
435 };
436
437 /***/ }),
438
439 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
440 /*!********************************************************************!*\
441 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
442 \********************************************************************/
443 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
444
445 "use strict";
446 __webpack_require__.r(__webpack_exports__);
447 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
448 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
449 /* harmony export */ });
450 var PluginMessages = {
451 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
452 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
453 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
454 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
455 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
456 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
457 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
458 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
459 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
460 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
461 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
462 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
463 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
464 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
465 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
466 SkipReviewError: 'SKIP_REVIEW_ERROR',
467 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
468 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
469 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
470 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
471 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
472 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
473 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR'
474 };
475
476 /***/ }),
477
478 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
479 /*!******************************************************************!*\
480 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
481 \******************************************************************/
482 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
483
484 "use strict";
485 __webpack_require__.r(__webpack_exports__);
486 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
487 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
488 /* harmony export */ });
489 var ProxyMessages = {
490 FetchForms: 'FETCH_FORMS',
491 FetchForm: 'FETCH_FORM',
492 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
493 FetchAuth: 'FETCH_AUTH',
494 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
495 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
496 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
497 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
498 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
499 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
500 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
501 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
502 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
503 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
504 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
505 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
506 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
507 };
508
509 /***/ }),
510
511 /***/ "./scripts/iframe/messageMiddleware.ts":
512 /*!*********************************************!*\
513 !*** ./scripts/iframe/messageMiddleware.ts ***!
514 \*********************************************/
515 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
516
517 "use strict";
518 __webpack_require__.r(__webpack_exports__);
519 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
520 /* harmony export */ "messageMiddleware": () => (/* binding */ messageMiddleware)
521 /* harmony export */ });
522 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
523 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
524 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
525 /* harmony import */ var _utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/contentEmbedInstaller */ "./scripts/utils/contentEmbedInstaller.ts");
526
527
528
529
530 var messageMapper = new Map([[_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.TrackConsent, function (message) {
531 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.trackConsent)(message.payload);
532 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeRequest, function (message, embedder) {
533 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.disableInternalTracking)(message.payload).then(function () {
534 embedder.postMessage({
535 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
536 payload: message.payload
537 });
538 })["catch"](function (payload) {
539 embedder.postMessage({
540 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeError,
541 payload: payload
542 });
543 });
544 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchRequest, function (__message, embedder) {
545 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.fetchDisableInternalTracking)().then(function (_ref) {
546 var payload = _ref.message;
547 embedder.postMessage({
548 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
549 payload: payload
550 });
551 })["catch"](function (payload) {
552 embedder.postMessage({
553 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchError,
554 payload: payload
555 });
556 });
557 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchRequest, function (__message, embedder) {
558 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.getBusinessUnitId)().then(function (payload) {
559 embedder.postMessage({
560 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
561 payload: payload
562 });
563 })["catch"](function (payload) {
564 embedder.postMessage({
565 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchError,
566 payload: payload
567 });
568 });
569 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeRequest, function (message, embedder) {
570 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.setBusinessUnitId)(message.payload).then(function (payload) {
571 embedder.postMessage({
572 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
573 payload: payload
574 });
575 })["catch"](function (payload) {
576 embedder.postMessage({
577 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeError,
578 payload: payload
579 });
580 });
581 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewRequest, function (__message, embedder) {
582 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.skipReview)().then(function (payload) {
583 embedder.postMessage({
584 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewResponse,
585 payload: payload
586 });
587 })["catch"](function (payload) {
588 embedder.postMessage({
589 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewError,
590 payload: payload
591 });
592 });
593 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RemoveParentQueryParam, function (message) {
594 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_2__.removeQueryParamFromLocation)(message.payload);
595 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallRequest, function (message, embedder) {
596 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startInstall)(message.payload.nonce).then(function (payload) {
597 embedder.postMessage({
598 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallResponse,
599 payload: payload
600 });
601 })["catch"](function (payload) {
602 embedder.postMessage({
603 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallError,
604 payload: payload
605 });
606 });
607 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationRequest, function (message, embedder) {
608 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startActivation)(message.payload.activateAjaxUrl).then(function (payload) {
609 embedder.postMessage({
610 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationResponse,
611 payload: payload
612 });
613 })["catch"](function (payload) {
614 embedder.postMessage({
615 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationError,
616 payload: payload
617 });
618 });
619 }]]);
620 var messageMiddleware = function messageMiddleware(embedder) {
621 return function (message) {
622 var next = messageMapper.get(message.key);
623
624 if (next) {
625 next(message, embedder);
626 }
627 };
628 };
629
630 /***/ }),
631
632 /***/ "./scripts/iframe/renderIframeApp.tsx":
633 /*!********************************************!*\
634 !*** ./scripts/iframe/renderIframeApp.tsx ***!
635 \********************************************/
636 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
637
638 "use strict";
639 __webpack_require__.r(__webpack_exports__);
640 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
641 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
642 /* harmony export */ });
643 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
644 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
645 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
646 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
647 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
648 /* harmony import */ var _constants_selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/selectors */ "./scripts/constants/selectors.ts");
649 /* harmony import */ var _useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useAppEmbedder */ "./scripts/iframe/useAppEmbedder.ts");
650 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
651 /* harmony import */ var _IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IframeErrorPage */ "./scripts/iframe/IframeErrorPage.tsx");
652
653
654
655
656
657
658
659
660 var IntegratedIframePortal = function IntegratedIframePortal(props) {
661 var container = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
662 var iframeNotRendered = (0,_useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__["default"])(props.app, props.createRoute, container);
663
664 if (container && !iframeNotRendered) {
665 return /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_2___default().createPortal(props.children, container);
666 }
667
668 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
669 children: (!container || iframeNotRendered) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__.IframeErrorPage, {})
670 });
671 };
672
673 var renderIframeApp = function renderIframeApp() {
674 var iframeFallbackContainer = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
675 var app;
676 var queryParams = new URLSearchParams(location.search);
677 var page = queryParams.get('page');
678 var createRoute = queryParams.get('leadin_route[0]') === 'create';
679
680 switch (page) {
681 case 'leadin_forms':
682 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Forms;
683 break;
684
685 case 'leadin_chatflows':
686 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.LiveChat;
687 break;
688
689 case 'leadin_settings':
690 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.PluginSettings;
691 break;
692
693 case 'leadin_user_guide':
694 default:
695 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Plugin;
696 break;
697 }
698
699 react_dom__WEBPACK_IMPORTED_MODULE_2___default().render((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IntegratedIframePortal, {
700 app: app,
701 createRoute: createRoute
702 }), iframeFallbackContainer);
703 };
704
705 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderIframeApp);
706
707 /***/ }),
708
709 /***/ "./scripts/iframe/useAppEmbedder.ts":
710 /*!******************************************!*\
711 !*** ./scripts/iframe/useAppEmbedder.ts ***!
712 \******************************************/
713 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
714
715 "use strict";
716 __webpack_require__.r(__webpack_exports__);
717 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
718 /* harmony export */ "default": () => (/* binding */ useAppEmbedder)
719 /* harmony export */ });
720 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
721 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
722 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
723 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
724 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
725 /* harmony import */ var _messageMiddleware__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./messageMiddleware */ "./scripts/iframe/messageMiddleware.ts");
726 /* harmony import */ var _utils_iframe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/iframe */ "./scripts/utils/iframe.ts");
727 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
728
729 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
730
731 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; }
732
733
734
735
736
737
738
739
740 var getLeadinConfig = function getLeadinConfig() {
741 var utm_query_params = Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams).filter(function (x) {
742 return /^utm/.test(x);
743 }).reduce(function (p, c) {
744 return _objectSpread(_defineProperty({}, c, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams[c]), p);
745 }, {});
746 return _objectSpread({
747 accountName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.accountName,
748 admin: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.admin,
749 adminUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.adminUrl,
750 company: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.company,
751 deviceId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId,
752 email: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.email,
753 firstName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.firstName,
754 irclickid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.irclickid,
755 justConnected: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.justConnected,
756 lastName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.lastName,
757 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinPluginVersion,
758 mpid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.mpid,
759 nonce: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.nonce,
760 phpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.phpVersion,
761 plugins: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.plugins,
762 portalDomain: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalDomain,
763 portalEmail: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalEmail,
764 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
765 reviewSkippedDate: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.reviewSkippedDate,
766 theme: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.theme,
767 trackConsent: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.trackConsent,
768 websiteName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.websiteName,
769 wpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.wpVersion,
770 contentEmbed: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.contentEmbed,
771 requiresContentEmbedScope: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.requiresContentEmbedScope
772 }, utm_query_params);
773 };
774
775 var getAppOptions = function getAppOptions(app) {
776 var createRoute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
777 var _window = window,
778 IntegratedAppOptions = _window.IntegratedAppOptions,
779 FormsAppOptions = _window.FormsAppOptions,
780 LiveChatAppOptions = _window.LiveChatAppOptions,
781 PluginAppOptions = _window.PluginAppOptions;
782 var options;
783
784 switch (app) {
785 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.Plugin:
786 options = new PluginAppOptions().setLeadinConfig(getLeadinConfig());
787 break;
788
789 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.PluginSettings:
790 options = new PluginAppOptions().setLeadinConfig(getLeadinConfig()).setPluginSettingsInit();
791 break;
792
793 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.Forms:
794 options = new FormsAppOptions();
795
796 if (createRoute) {
797 options = options.setCreateFormAppInit();
798 }
799
800 break;
801
802 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.LiveChat:
803 options = new LiveChatAppOptions();
804
805 if (createRoute) {
806 options = options.setCreateLiveChatAppInit();
807 }
808
809 break;
810
811 default:
812 options = new IntegratedAppOptions();
813 }
814
815 return options;
816 };
817
818 function useAppEmbedder(app, createRoute, container) {
819 console.info('HubSpot plugin - starting app embedder for:', _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app], container);
820 var iframeNotRendered = (0,_utils_iframe__WEBPACK_IMPORTED_MODULE_5__.useIframeNotRendered)(_constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app]);
821 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
822 var _window2 = window,
823 IntegratedAppEmbedder = _window2.IntegratedAppEmbedder;
824
825 if (IntegratedAppEmbedder) {
826 var options = getAppOptions(app, createRoute).setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId).setRefreshToken(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken);
827 var embedder = new IntegratedAppEmbedder(_constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app], _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl, _utils_iframe__WEBPACK_IMPORTED_MODULE_5__.resizeWindow, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken ? '' : _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink).setOptions(options);
828 embedder.subscribe((0,_messageMiddleware__WEBPACK_IMPORTED_MODULE_4__.messageMiddleware)(embedder));
829 embedder.attachTo(container, true);
830 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
831
832 window.embedder = embedder;
833 }
834 }, []);
835
836 if (iframeNotRendered) {
837 console.error('HubSpot plugin Iframe not rendered', {
838 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
839 container: container,
840 appName: _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app],
841 hasIntegratedAppEmbedder: !!window.IntegratedAppEmbedder
842 });
843 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureException(new Error('Leadin Iframe not rendered'), {
844 fingerprint: ['USE_APP_EMBEDDER', 'IFRAME_SETUP_ERROR'],
845 extra: {
846 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
847 container: container,
848 app: app,
849 hubspotBaseUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl,
850 impactLink: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink,
851 appName: _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app],
852 hasRefreshToken: !!_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken
853 }
854 });
855 }
856
857 return iframeNotRendered;
858 }
859
860 /***/ }),
861
862 /***/ "./scripts/lib/Raven.ts":
863 /*!******************************!*\
864 !*** ./scripts/lib/Raven.ts ***!
865 \******************************/
866 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
867
868 "use strict";
869 __webpack_require__.r(__webpack_exports__);
870 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
871 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
872 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
873 /* harmony export */ });
874 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
875 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
876 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
877
878
879 function configureRaven() {
880 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('app.hubspot.com') === -1) {
881 return;
882 }
883
884 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config('https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', {
885 instrument: {
886 tryCatch: false
887 },
888 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
889 }).install();
890 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
891 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
892 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
893 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
894 });
895 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
896 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
897 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
898 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
899 }).join(',')
900 });
901 }
902 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
903
904 /***/ }),
905
906 /***/ "./scripts/utils/appUtils.ts":
907 /*!***********************************!*\
908 !*** ./scripts/utils/appUtils.ts ***!
909 \***********************************/
910 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
911
912 "use strict";
913 __webpack_require__.r(__webpack_exports__);
914 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
915 /* harmony export */ "initApp": () => (/* binding */ initApp),
916 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
917 /* harmony export */ });
918 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
919 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
920 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
921
922
923 function initApp(initFn) {
924 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
925 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
926 }
927 function initAppOnReady(initFn) {
928 function main() {
929 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
930 }
931
932 initApp(main);
933 }
934
935 /***/ }),
936
937 /***/ "./scripts/utils/contentEmbedInstaller.ts":
938 /*!************************************************!*\
939 !*** ./scripts/utils/contentEmbedInstaller.ts ***!
940 \************************************************/
941 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
942
943 "use strict";
944 __webpack_require__.r(__webpack_exports__);
945 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
946 /* harmony export */ "startActivation": () => (/* binding */ startActivation),
947 /* harmony export */ "startInstall": () => (/* binding */ startInstall)
948 /* harmony export */ });
949 function startInstall(nonce) {
950 var formData = new FormData();
951 var ajaxUrl = window.ajaxurl;
952 formData.append('_wpnonce', nonce);
953 formData.append('action', 'content_embed_install');
954 return fetch(ajaxUrl, {
955 method: 'POST',
956 body: formData,
957 keepalive: true
958 }).then(function (res) {
959 return res.json();
960 });
961 }
962 function startActivation(requestUrl) {
963 return fetch(requestUrl, {
964 method: 'POST',
965 keepalive: true
966 }).then(function (res) {
967 return res.json();
968 });
969 }
970
971 /***/ }),
972
973 /***/ "./scripts/utils/iframe.ts":
974 /*!*********************************!*\
975 !*** ./scripts/utils/iframe.ts ***!
976 \*********************************/
977 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
978
979 "use strict";
980 __webpack_require__.r(__webpack_exports__);
981 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
982 /* harmony export */ "resizeWindow": () => (/* binding */ resizeWindow),
983 /* harmony export */ "useIframeNotRendered": () => (/* binding */ useIframeNotRendered)
984 /* harmony export */ });
985 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
986 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
987 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
988
989 function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
990
991 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); }
992
993 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; }
994
995 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
996
997 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
998
999
1000 var IFRAME_DISPLAY_TIMEOUT = 5000;
1001 function useIframeNotRendered(app) {
1002 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
1003 _useState2 = _slicedToArray(_useState, 2),
1004 iframeNotRendered = _useState2[0],
1005 setIframeNotRendered = _useState2[1];
1006
1007 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1008 var timer = setTimeout(function () {
1009 var iframe = document.getElementById(app);
1010
1011 if (!iframe) {
1012 setIframeNotRendered(true);
1013 }
1014 }, IFRAME_DISPLAY_TIMEOUT);
1015 return function () {
1016 if (timer) {
1017 clearTimeout(timer);
1018 }
1019 };
1020 }, []);
1021 return iframeNotRendered;
1022 }
1023 var resizeWindow = function resizeWindow() {
1024 var adminMenuWrap = document.getElementById('adminmenuwrap');
1025 var sideMenuHeight = adminMenuWrap ? adminMenuWrap.offsetHeight : 0;
1026 var adminBar = document.getElementById('wpadminbar');
1027 var adminBarHeight = adminBar && adminBar.offsetHeight || 0;
1028 var offset = 4;
1029
1030 if (window.innerHeight < sideMenuHeight) {
1031 return sideMenuHeight - offset;
1032 } else {
1033 return window.innerHeight - adminBarHeight - offset;
1034 }
1035 };
1036
1037 /***/ }),
1038
1039 /***/ "./scripts/utils/queryParams.ts":
1040 /*!**************************************!*\
1041 !*** ./scripts/utils/queryParams.ts ***!
1042 \**************************************/
1043 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1044
1045 "use strict";
1046 __webpack_require__.r(__webpack_exports__);
1047 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1048 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
1049 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
1050 /* harmony export */ });
1051 function addQueryObjectToUrl(urlObject, queryParams) {
1052 Object.keys(queryParams).forEach(function (key) {
1053 urlObject.searchParams.append(key, queryParams[key]);
1054 });
1055 }
1056 function removeQueryParamFromLocation(key) {
1057 var location = new URL(window.location.href);
1058 location.searchParams["delete"](key);
1059 window.history.replaceState(null, '', location.href);
1060 }
1061
1062 /***/ }),
1063
1064 /***/ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx":
1065 /*!*************************************************************************************************************************************************************************!*\
1066 !*** ./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx ***!
1067 \*************************************************************************************************************************************************************************/
1068 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1069
1070 "use strict";
1071 __webpack_require__.r(__webpack_exports__);
1072 // extracted by mini-css-extract-plugin
1073
1074
1075 /***/ }),
1076
1077 /***/ "./node_modules/object-assign/index.js":
1078 /*!*********************************************!*\
1079 !*** ./node_modules/object-assign/index.js ***!
1080 \*********************************************/
1081 /***/ ((module) => {
1082
1083 "use strict";
1084 /*
1085 object-assign
1086 (c) Sindre Sorhus
1087 @license MIT
1088 */
1089
1090
1091 /* eslint-disable no-unused-vars */
1092 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1093 var hasOwnProperty = Object.prototype.hasOwnProperty;
1094 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1095
1096 function toObject(val) {
1097 if (val === null || val === undefined) {
1098 throw new TypeError('Object.assign cannot be called with null or undefined');
1099 }
1100
1101 return Object(val);
1102 }
1103
1104 function shouldUseNative() {
1105 try {
1106 if (!Object.assign) {
1107 return false;
1108 }
1109
1110 // Detect buggy property enumeration order in older V8 versions.
1111
1112 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1113 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1114 test1[5] = 'de';
1115 if (Object.getOwnPropertyNames(test1)[0] === '5') {
1116 return false;
1117 }
1118
1119 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1120 var test2 = {};
1121 for (var i = 0; i < 10; i++) {
1122 test2['_' + String.fromCharCode(i)] = i;
1123 }
1124 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1125 return test2[n];
1126 });
1127 if (order2.join('') !== '0123456789') {
1128 return false;
1129 }
1130
1131 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1132 var test3 = {};
1133 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1134 test3[letter] = letter;
1135 });
1136 if (Object.keys(Object.assign({}, test3)).join('') !==
1137 'abcdefghijklmnopqrst') {
1138 return false;
1139 }
1140
1141 return true;
1142 } catch (err) {
1143 // We don't expect any of the above to throw, but better to be safe.
1144 return false;
1145 }
1146 }
1147
1148 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
1149 var from;
1150 var to = toObject(target);
1151 var symbols;
1152
1153 for (var s = 1; s < arguments.length; s++) {
1154 from = Object(arguments[s]);
1155
1156 for (var key in from) {
1157 if (hasOwnProperty.call(from, key)) {
1158 to[key] = from[key];
1159 }
1160 }
1161
1162 if (getOwnPropertySymbols) {
1163 symbols = getOwnPropertySymbols(from);
1164 for (var i = 0; i < symbols.length; i++) {
1165 if (propIsEnumerable.call(from, symbols[i])) {
1166 to[symbols[i]] = from[symbols[i]];
1167 }
1168 }
1169 }
1170 }
1171
1172 return to;
1173 };
1174
1175
1176 /***/ }),
1177
1178 /***/ "./node_modules/raven-js/src/configError.js":
1179 /*!**************************************************!*\
1180 !*** ./node_modules/raven-js/src/configError.js ***!
1181 \**************************************************/
1182 /***/ ((module) => {
1183
1184 function RavenConfigError(message) {
1185 this.name = 'RavenConfigError';
1186 this.message = message;
1187 }
1188 RavenConfigError.prototype = new Error();
1189 RavenConfigError.prototype.constructor = RavenConfigError;
1190
1191 module.exports = RavenConfigError;
1192
1193
1194 /***/ }),
1195
1196 /***/ "./node_modules/raven-js/src/console.js":
1197 /*!**********************************************!*\
1198 !*** ./node_modules/raven-js/src/console.js ***!
1199 \**********************************************/
1200 /***/ ((module) => {
1201
1202 var wrapMethod = function(console, level, callback) {
1203 var originalConsoleLevel = console[level];
1204 var originalConsole = console;
1205
1206 if (!(level in console)) {
1207 return;
1208 }
1209
1210 var sentryLevel = level === 'warn' ? 'warning' : level;
1211
1212 console[level] = function() {
1213 var args = [].slice.call(arguments);
1214
1215 var msg = '' + args.join(' ');
1216 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
1217
1218 if (level === 'assert') {
1219 if (args[0] === false) {
1220 // Default browsers message
1221 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
1222 data.extra.arguments = args.slice(1);
1223 callback && callback(msg, data);
1224 }
1225 } else {
1226 callback && callback(msg, data);
1227 }
1228
1229 // this fails for some browsers. :(
1230 if (originalConsoleLevel) {
1231 // IE9 doesn't allow calling apply on console functions directly
1232 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
1233 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
1234 }
1235 };
1236 };
1237
1238 module.exports = {
1239 wrapMethod: wrapMethod
1240 };
1241
1242
1243 /***/ }),
1244
1245 /***/ "./node_modules/raven-js/src/raven.js":
1246 /*!********************************************!*\
1247 !*** ./node_modules/raven-js/src/raven.js ***!
1248 \********************************************/
1249 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1250
1251 /*global XDomainRequest:false */
1252
1253 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
1254 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
1255 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
1256
1257 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
1258 var isError = utils.isError;
1259 var isObject = utils.isObject;
1260 var isObject = utils.isObject;
1261 var isErrorEvent = utils.isErrorEvent;
1262 var isUndefined = utils.isUndefined;
1263 var isFunction = utils.isFunction;
1264 var isString = utils.isString;
1265 var isEmptyObject = utils.isEmptyObject;
1266 var each = utils.each;
1267 var objectMerge = utils.objectMerge;
1268 var truncate = utils.truncate;
1269 var objectFrozen = utils.objectFrozen;
1270 var hasKey = utils.hasKey;
1271 var joinRegExp = utils.joinRegExp;
1272 var urlencode = utils.urlencode;
1273 var uuid4 = utils.uuid4;
1274 var htmlTreeAsString = utils.htmlTreeAsString;
1275 var isSameException = utils.isSameException;
1276 var isSameStacktrace = utils.isSameStacktrace;
1277 var parseUrl = utils.parseUrl;
1278 var fill = utils.fill;
1279
1280 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
1281
1282 var dsnKeys = 'source protocol user pass host port path'.split(' '),
1283 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
1284
1285 function now() {
1286 return +new Date();
1287 }
1288
1289 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
1290 var _window =
1291 typeof window !== 'undefined'
1292 ? window
1293 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
1294 var _document = _window.document;
1295 var _navigator = _window.navigator;
1296
1297 function keepOriginalCallback(original, callback) {
1298 return isFunction(callback)
1299 ? function(data) {
1300 return callback(data, original);
1301 }
1302 : callback;
1303 }
1304
1305 // First, check for JSON support
1306 // If there is no JSON, we no-op the core features of Raven
1307 // since JSON is required to encode the payload
1308 function Raven() {
1309 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
1310 // Raven can run in contexts where there's no document (react-native)
1311 this._hasDocument = !isUndefined(_document);
1312 this._hasNavigator = !isUndefined(_navigator);
1313 this._lastCapturedException = null;
1314 this._lastData = null;
1315 this._lastEventId = null;
1316 this._globalServer = null;
1317 this._globalKey = null;
1318 this._globalProject = null;
1319 this._globalContext = {};
1320 this._globalOptions = {
1321 logger: 'javascript',
1322 ignoreErrors: [],
1323 ignoreUrls: [],
1324 whitelistUrls: [],
1325 includePaths: [],
1326 collectWindowErrors: true,
1327 maxMessageLength: 0,
1328
1329 // By default, truncates URL values to 250 chars
1330 maxUrlLength: 250,
1331 stackTraceLimit: 50,
1332 autoBreadcrumbs: true,
1333 instrument: true,
1334 sampleRate: 1
1335 };
1336 this._ignoreOnError = 0;
1337 this._isRavenInstalled = false;
1338 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
1339 // capture references to window.console *and* all its methods first
1340 // before the console plugin has a chance to monkey patch
1341 this._originalConsole = _window.console || {};
1342 this._originalConsoleMethods = {};
1343 this._plugins = [];
1344 this._startTime = now();
1345 this._wrappedBuiltIns = [];
1346 this._breadcrumbs = [];
1347 this._lastCapturedEvent = null;
1348 this._keypressTimeout;
1349 this._location = _window.location;
1350 this._lastHref = this._location && this._location.href;
1351 this._resetBackoff();
1352
1353 // eslint-disable-next-line guard-for-in
1354 for (var method in this._originalConsole) {
1355 this._originalConsoleMethods[method] = this._originalConsole[method];
1356 }
1357 }
1358
1359 /*
1360 * The core Raven singleton
1361 *
1362 * @this {Raven}
1363 */
1364
1365 Raven.prototype = {
1366 // Hardcode version string so that raven source can be loaded directly via
1367 // webpack (using a build step causes webpack #1617). Grunt verifies that
1368 // this value matches package.json during build.
1369 // See: https://github.com/getsentry/raven-js/issues/465
1370 VERSION: '3.19.1',
1371
1372 debug: false,
1373
1374 TraceKit: TraceKit, // alias to TraceKit
1375
1376 /*
1377 * Configure Raven with a DSN and extra options
1378 *
1379 * @param {string} dsn The public Sentry DSN
1380 * @param {object} options Set of global options [optional]
1381 * @return {Raven}
1382 */
1383 config: function(dsn, options) {
1384 var self = this;
1385
1386 if (self._globalServer) {
1387 this._logDebug('error', 'Error: Raven has already been configured');
1388 return self;
1389 }
1390 if (!dsn) return self;
1391
1392 var globalOptions = self._globalOptions;
1393
1394 // merge in options
1395 if (options) {
1396 each(options, function(key, value) {
1397 // tags and extra are special and need to be put into context
1398 if (key === 'tags' || key === 'extra' || key === 'user') {
1399 self._globalContext[key] = value;
1400 } else {
1401 globalOptions[key] = value;
1402 }
1403 });
1404 }
1405
1406 self.setDSN(dsn);
1407
1408 // "Script error." is hard coded into browsers for errors that it can't read.
1409 // this is the result of a script being pulled in from an external domain and CORS.
1410 globalOptions.ignoreErrors.push(/^Script error\.?$/);
1411 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
1412
1413 // join regexp rules into one big rule
1414 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
1415 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
1416 ? joinRegExp(globalOptions.ignoreUrls)
1417 : false;
1418 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
1419 ? joinRegExp(globalOptions.whitelistUrls)
1420 : false;
1421 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
1422 globalOptions.maxBreadcrumbs = Math.max(
1423 0,
1424 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
1425 ); // default and hard limit is 100
1426
1427 var autoBreadcrumbDefaults = {
1428 xhr: true,
1429 console: true,
1430 dom: true,
1431 location: true
1432 };
1433
1434 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
1435 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
1436 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
1437 } else if (autoBreadcrumbs !== false) {
1438 autoBreadcrumbs = autoBreadcrumbDefaults;
1439 }
1440 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
1441
1442 var instrumentDefaults = {
1443 tryCatch: true
1444 };
1445
1446 var instrument = globalOptions.instrument;
1447 if ({}.toString.call(instrument) === '[object Object]') {
1448 instrument = objectMerge(instrumentDefaults, instrument);
1449 } else if (instrument !== false) {
1450 instrument = instrumentDefaults;
1451 }
1452 globalOptions.instrument = instrument;
1453
1454 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
1455
1456 // return for chaining
1457 return self;
1458 },
1459
1460 /*
1461 * Installs a global window.onerror error handler
1462 * to capture and report uncaught exceptions.
1463 * At this point, install() is required to be called due
1464 * to the way TraceKit is set up.
1465 *
1466 * @return {Raven}
1467 */
1468 install: function() {
1469 var self = this;
1470 if (self.isSetup() && !self._isRavenInstalled) {
1471 TraceKit.report.subscribe(function() {
1472 self._handleOnErrorStackInfo.apply(self, arguments);
1473 });
1474 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
1475 self._instrumentTryCatch();
1476 }
1477
1478 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
1479
1480 // Install all of the plugins
1481 self._drainPlugins();
1482
1483 self._isRavenInstalled = true;
1484 }
1485
1486 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
1487 return this;
1488 },
1489
1490 /*
1491 * Set the DSN (can be called multiple time unlike config)
1492 *
1493 * @param {string} dsn The public Sentry DSN
1494 */
1495 setDSN: function(dsn) {
1496 var self = this,
1497 uri = self._parseDSN(dsn),
1498 lastSlash = uri.path.lastIndexOf('/'),
1499 path = uri.path.substr(1, lastSlash);
1500
1501 self._dsn = dsn;
1502 self._globalKey = uri.user;
1503 self._globalSecret = uri.pass && uri.pass.substr(1);
1504 self._globalProject = uri.path.substr(lastSlash + 1);
1505
1506 self._globalServer = self._getGlobalServer(uri);
1507
1508 self._globalEndpoint =
1509 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
1510
1511 // Reset backoff state since we may be pointing at a
1512 // new project/server
1513 this._resetBackoff();
1514 },
1515
1516 /*
1517 * Wrap code within a context so Raven can capture errors
1518 * reliably across domains that is executed immediately.
1519 *
1520 * @param {object} options A specific set of options for this context [optional]
1521 * @param {function} func The callback to be immediately executed within the context
1522 * @param {array} args An array of arguments to be called with the callback [optional]
1523 */
1524 context: function(options, func, args) {
1525 if (isFunction(options)) {
1526 args = func || [];
1527 func = options;
1528 options = undefined;
1529 }
1530
1531 return this.wrap(options, func).apply(this, args);
1532 },
1533
1534 /*
1535 * Wrap code within a context and returns back a new function to be executed
1536 *
1537 * @param {object} options A specific set of options for this context [optional]
1538 * @param {function} func The function to be wrapped in a new context
1539 * @param {function} func A function to call before the try/catch wrapper [optional, private]
1540 * @return {function} The newly wrapped functions with a context
1541 */
1542 wrap: function(options, func, _before) {
1543 var self = this;
1544 // 1 argument has been passed, and it's not a function
1545 // so just return it
1546 if (isUndefined(func) && !isFunction(options)) {
1547 return options;
1548 }
1549
1550 // options is optional
1551 if (isFunction(options)) {
1552 func = options;
1553 options = undefined;
1554 }
1555
1556 // At this point, we've passed along 2 arguments, and the second one
1557 // is not a function either, so we'll just return the second argument.
1558 if (!isFunction(func)) {
1559 return func;
1560 }
1561
1562 // We don't wanna wrap it twice!
1563 try {
1564 if (func.__raven__) {
1565 return func;
1566 }
1567
1568 // If this has already been wrapped in the past, return that
1569 if (func.__raven_wrapper__) {
1570 return func.__raven_wrapper__;
1571 }
1572 } catch (e) {
1573 // Just accessing custom props in some Selenium environments
1574 // can cause a "Permission denied" exception (see raven-js#495).
1575 // Bail on wrapping and return the function as-is (defers to window.onerror).
1576 return func;
1577 }
1578
1579 function wrapped() {
1580 var args = [],
1581 i = arguments.length,
1582 deep = !options || (options && options.deep !== false);
1583
1584 if (_before && isFunction(_before)) {
1585 _before.apply(this, arguments);
1586 }
1587
1588 // Recursively wrap all of a function's arguments that are
1589 // functions themselves.
1590 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
1591
1592 try {
1593 // Attempt to invoke user-land function
1594 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
1595 // means Raven caught an error invoking your application code. This is
1596 // expected behavior and NOT indicative of a bug with Raven.js.
1597 return func.apply(this, args);
1598 } catch (e) {
1599 self._ignoreNextOnError();
1600 self.captureException(e, options);
1601 throw e;
1602 }
1603 }
1604
1605 // copy over properties of the old function
1606 for (var property in func) {
1607 if (hasKey(func, property)) {
1608 wrapped[property] = func[property];
1609 }
1610 }
1611 wrapped.prototype = func.prototype;
1612
1613 func.__raven_wrapper__ = wrapped;
1614 // Signal that this function has been wrapped already
1615 // for both debugging and to prevent it to being wrapped twice
1616 wrapped.__raven__ = true;
1617 wrapped.__inner__ = func;
1618
1619 return wrapped;
1620 },
1621
1622 /*
1623 * Uninstalls the global error handler.
1624 *
1625 * @return {Raven}
1626 */
1627 uninstall: function() {
1628 TraceKit.report.uninstall();
1629
1630 this._restoreBuiltIns();
1631
1632 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
1633 this._isRavenInstalled = false;
1634
1635 return this;
1636 },
1637
1638 /*
1639 * Manually capture an exception and send it over to Sentry
1640 *
1641 * @param {error} ex An exception to be logged
1642 * @param {object} options A specific set of options for this error [optional]
1643 * @return {Raven}
1644 */
1645 captureException: function(ex, options) {
1646 // Cases for sending ex as a message, rather than an exception
1647 var isNotError = !isError(ex);
1648 var isNotErrorEvent = !isErrorEvent(ex);
1649 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
1650
1651 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
1652 return this.captureMessage(
1653 ex,
1654 objectMerge(
1655 {
1656 trimHeadFrames: 1,
1657 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
1658 },
1659 options
1660 )
1661 );
1662 }
1663
1664 // Get actual Error from ErrorEvent
1665 if (isErrorEvent(ex)) ex = ex.error;
1666
1667 // Store the raw exception object for potential debugging and introspection
1668 this._lastCapturedException = ex;
1669
1670 // TraceKit.report will re-raise any exception passed to it,
1671 // which means you have to wrap it in try/catch. Instead, we
1672 // can wrap it here and only re-raise if TraceKit.report
1673 // raises an exception different from the one we asked to
1674 // report on.
1675 try {
1676 var stack = TraceKit.computeStackTrace(ex);
1677 this._handleStackInfo(stack, options);
1678 } catch (ex1) {
1679 if (ex !== ex1) {
1680 throw ex1;
1681 }
1682 }
1683
1684 return this;
1685 },
1686
1687 /*
1688 * Manually send a message to Sentry
1689 *
1690 * @param {string} msg A plain message to be captured in Sentry
1691 * @param {object} options A specific set of options for this message [optional]
1692 * @return {Raven}
1693 */
1694 captureMessage: function(msg, options) {
1695 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
1696 // early call; we'll error on the side of logging anything called before configuration since it's
1697 // probably something you should see:
1698 if (
1699 !!this._globalOptions.ignoreErrors.test &&
1700 this._globalOptions.ignoreErrors.test(msg)
1701 ) {
1702 return;
1703 }
1704
1705 options = options || {};
1706
1707 var data = objectMerge(
1708 {
1709 message: msg + '' // Make sure it's actually a string
1710 },
1711 options
1712 );
1713
1714 var ex;
1715 // Generate a "synthetic" stack trace from this point.
1716 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
1717 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
1718 // or if it catches a thrown object without a "stack" property.
1719 try {
1720 throw new Error(msg);
1721 } catch (ex1) {
1722 ex = ex1;
1723 }
1724
1725 // null exception name so `Error` isn't prefixed to msg
1726 ex.name = null;
1727 var stack = TraceKit.computeStackTrace(ex);
1728
1729 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
1730 var initialCall = stack.stack[1];
1731
1732 var fileurl = (initialCall && initialCall.url) || '';
1733
1734 if (
1735 !!this._globalOptions.ignoreUrls.test &&
1736 this._globalOptions.ignoreUrls.test(fileurl)
1737 ) {
1738 return;
1739 }
1740
1741 if (
1742 !!this._globalOptions.whitelistUrls.test &&
1743 !this._globalOptions.whitelistUrls.test(fileurl)
1744 ) {
1745 return;
1746 }
1747
1748 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
1749 options = objectMerge(
1750 {
1751 // fingerprint on msg, not stack trace (legacy behavior, could be
1752 // revisited)
1753 fingerprint: msg,
1754 // since we know this is a synthetic trace, the top N-most frames
1755 // MUST be from Raven.js, so mark them as in_app later by setting
1756 // trimHeadFrames
1757 trimHeadFrames: (options.trimHeadFrames || 0) + 1
1758 },
1759 options
1760 );
1761
1762 var frames = this._prepareFrames(stack, options);
1763 data.stacktrace = {
1764 // Sentry expects frames oldest to newest
1765 frames: frames.reverse()
1766 };
1767 }
1768
1769 // Fire away!
1770 this._send(data);
1771
1772 return this;
1773 },
1774
1775 captureBreadcrumb: function(obj) {
1776 var crumb = objectMerge(
1777 {
1778 timestamp: now() / 1000
1779 },
1780 obj
1781 );
1782
1783 if (isFunction(this._globalOptions.breadcrumbCallback)) {
1784 var result = this._globalOptions.breadcrumbCallback(crumb);
1785
1786 if (isObject(result) && !isEmptyObject(result)) {
1787 crumb = result;
1788 } else if (result === false) {
1789 return this;
1790 }
1791 }
1792
1793 this._breadcrumbs.push(crumb);
1794 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
1795 this._breadcrumbs.shift();
1796 }
1797 return this;
1798 },
1799
1800 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
1801 var pluginArgs = [].slice.call(arguments, 1);
1802
1803 this._plugins.push([plugin, pluginArgs]);
1804 if (this._isRavenInstalled) {
1805 this._drainPlugins();
1806 }
1807
1808 return this;
1809 },
1810
1811 /*
1812 * Set/clear a user to be sent along with the payload.
1813 *
1814 * @param {object} user An object representing user data [optional]
1815 * @return {Raven}
1816 */
1817 setUserContext: function(user) {
1818 // Intentionally do not merge here since that's an unexpected behavior.
1819 this._globalContext.user = user;
1820
1821 return this;
1822 },
1823
1824 /*
1825 * Merge extra attributes to be sent along with the payload.
1826 *
1827 * @param {object} extra An object representing extra data [optional]
1828 * @return {Raven}
1829 */
1830 setExtraContext: function(extra) {
1831 this._mergeContext('extra', extra);
1832
1833 return this;
1834 },
1835
1836 /*
1837 * Merge tags to be sent along with the payload.
1838 *
1839 * @param {object} tags An object representing tags [optional]
1840 * @return {Raven}
1841 */
1842 setTagsContext: function(tags) {
1843 this._mergeContext('tags', tags);
1844
1845 return this;
1846 },
1847
1848 /*
1849 * Clear all of the context.
1850 *
1851 * @return {Raven}
1852 */
1853 clearContext: function() {
1854 this._globalContext = {};
1855
1856 return this;
1857 },
1858
1859 /*
1860 * Get a copy of the current context. This cannot be mutated.
1861 *
1862 * @return {object} copy of context
1863 */
1864 getContext: function() {
1865 // lol javascript
1866 return JSON.parse(stringify(this._globalContext));
1867 },
1868
1869 /*
1870 * Set environment of application
1871 *
1872 * @param {string} environment Typically something like 'production'.
1873 * @return {Raven}
1874 */
1875 setEnvironment: function(environment) {
1876 this._globalOptions.environment = environment;
1877
1878 return this;
1879 },
1880
1881 /*
1882 * Set release version of application
1883 *
1884 * @param {string} release Typically something like a git SHA to identify version
1885 * @return {Raven}
1886 */
1887 setRelease: function(release) {
1888 this._globalOptions.release = release;
1889
1890 return this;
1891 },
1892
1893 /*
1894 * Set the dataCallback option
1895 *
1896 * @param {function} callback The callback to run which allows the
1897 * data blob to be mutated before sending
1898 * @return {Raven}
1899 */
1900 setDataCallback: function(callback) {
1901 var original = this._globalOptions.dataCallback;
1902 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
1903 return this;
1904 },
1905
1906 /*
1907 * Set the breadcrumbCallback option
1908 *
1909 * @param {function} callback The callback to run which allows filtering
1910 * or mutating breadcrumbs
1911 * @return {Raven}
1912 */
1913 setBreadcrumbCallback: function(callback) {
1914 var original = this._globalOptions.breadcrumbCallback;
1915 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
1916 return this;
1917 },
1918
1919 /*
1920 * Set the shouldSendCallback option
1921 *
1922 * @param {function} callback The callback to run which allows
1923 * introspecting the blob before sending
1924 * @return {Raven}
1925 */
1926 setShouldSendCallback: function(callback) {
1927 var original = this._globalOptions.shouldSendCallback;
1928 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
1929 return this;
1930 },
1931
1932 /**
1933 * Override the default HTTP transport mechanism that transmits data
1934 * to the Sentry server.
1935 *
1936 * @param {function} transport Function invoked instead of the default
1937 * `makeRequest` handler.
1938 *
1939 * @return {Raven}
1940 */
1941 setTransport: function(transport) {
1942 this._globalOptions.transport = transport;
1943
1944 return this;
1945 },
1946
1947 /*
1948 * Get the latest raw exception that was captured by Raven.
1949 *
1950 * @return {error}
1951 */
1952 lastException: function() {
1953 return this._lastCapturedException;
1954 },
1955
1956 /*
1957 * Get the last event id
1958 *
1959 * @return {string}
1960 */
1961 lastEventId: function() {
1962 return this._lastEventId;
1963 },
1964
1965 /*
1966 * Determine if Raven is setup and ready to go.
1967 *
1968 * @return {boolean}
1969 */
1970 isSetup: function() {
1971 if (!this._hasJSON) return false; // needs JSON support
1972 if (!this._globalServer) {
1973 if (!this.ravenNotConfiguredError) {
1974 this.ravenNotConfiguredError = true;
1975 this._logDebug('error', 'Error: Raven has not been configured.');
1976 }
1977 return false;
1978 }
1979 return true;
1980 },
1981
1982 afterLoad: function() {
1983 // TODO: remove window dependence?
1984
1985 // Attempt to initialize Raven on load
1986 var RavenConfig = _window.RavenConfig;
1987 if (RavenConfig) {
1988 this.config(RavenConfig.dsn, RavenConfig.config).install();
1989 }
1990 },
1991
1992 showReportDialog: function(options) {
1993 if (
1994 !_document // doesn't work without a document (React native)
1995 )
1996 return;
1997
1998 options = options || {};
1999
2000 var lastEventId = options.eventId || this.lastEventId();
2001 if (!lastEventId) {
2002 throw new RavenConfigError('Missing eventId');
2003 }
2004
2005 var dsn = options.dsn || this._dsn;
2006 if (!dsn) {
2007 throw new RavenConfigError('Missing DSN');
2008 }
2009
2010 var encode = encodeURIComponent;
2011 var qs = '';
2012 qs += '?eventId=' + encode(lastEventId);
2013 qs += '&dsn=' + encode(dsn);
2014
2015 var user = options.user || this._globalContext.user;
2016 if (user) {
2017 if (user.name) qs += '&name=' + encode(user.name);
2018 if (user.email) qs += '&email=' + encode(user.email);
2019 }
2020
2021 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
2022
2023 var script = _document.createElement('script');
2024 script.async = true;
2025 script.src = globalServer + '/api/embed/error-page/' + qs;
2026 (_document.head || _document.body).appendChild(script);
2027 },
2028
2029 /**** Private functions ****/
2030 _ignoreNextOnError: function() {
2031 var self = this;
2032 this._ignoreOnError += 1;
2033 setTimeout(function() {
2034 // onerror should trigger before setTimeout
2035 self._ignoreOnError -= 1;
2036 });
2037 },
2038
2039 _triggerEvent: function(eventType, options) {
2040 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
2041 var evt, key;
2042
2043 if (!this._hasDocument) return;
2044
2045 options = options || {};
2046
2047 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
2048
2049 if (_document.createEvent) {
2050 evt = _document.createEvent('HTMLEvents');
2051 evt.initEvent(eventType, true, true);
2052 } else {
2053 evt = _document.createEventObject();
2054 evt.eventType = eventType;
2055 }
2056
2057 for (key in options)
2058 if (hasKey(options, key)) {
2059 evt[key] = options[key];
2060 }
2061
2062 if (_document.createEvent) {
2063 // IE9 if standards
2064 _document.dispatchEvent(evt);
2065 } else {
2066 // IE8 regardless of Quirks or Standards
2067 // IE9 if quirks
2068 try {
2069 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
2070 } catch (e) {
2071 // Do nothing
2072 }
2073 }
2074 },
2075
2076 /**
2077 * Wraps addEventListener to capture UI breadcrumbs
2078 * @param evtName the event name (e.g. "click")
2079 * @returns {Function}
2080 * @private
2081 */
2082 _breadcrumbEventHandler: function(evtName) {
2083 var self = this;
2084 return function(evt) {
2085 // reset keypress timeout; e.g. triggering a 'click' after
2086 // a 'keypress' will reset the keypress debounce so that a new
2087 // set of keypresses can be recorded
2088 self._keypressTimeout = null;
2089
2090 // It's possible this handler might trigger multiple times for the same
2091 // event (e.g. event propagation through node ancestors). Ignore if we've
2092 // already captured the event.
2093 if (self._lastCapturedEvent === evt) return;
2094
2095 self._lastCapturedEvent = evt;
2096
2097 // try/catch both:
2098 // - accessing evt.target (see getsentry/raven-js#838, #768)
2099 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
2100 // can throw an exception in some circumstances.
2101 var target;
2102 try {
2103 target = htmlTreeAsString(evt.target);
2104 } catch (e) {
2105 target = '<unknown>';
2106 }
2107
2108 self.captureBreadcrumb({
2109 category: 'ui.' + evtName, // e.g. ui.click, ui.input
2110 message: target
2111 });
2112 };
2113 },
2114
2115 /**
2116 * Wraps addEventListener to capture keypress UI events
2117 * @returns {Function}
2118 * @private
2119 */
2120 _keypressEventHandler: function() {
2121 var self = this,
2122 debounceDuration = 1000; // milliseconds
2123
2124 // TODO: if somehow user switches keypress target before
2125 // debounce timeout is triggered, we will only capture
2126 // a single breadcrumb from the FIRST target (acceptable?)
2127 return function(evt) {
2128 var target;
2129 try {
2130 target = evt.target;
2131 } catch (e) {
2132 // just accessing event properties can throw an exception in some rare circumstances
2133 // see: https://github.com/getsentry/raven-js/issues/838
2134 return;
2135 }
2136 var tagName = target && target.tagName;
2137
2138 // only consider keypress events on actual input elements
2139 // this will disregard keypresses targeting body (e.g. tabbing
2140 // through elements, hotkeys, etc)
2141 if (
2142 !tagName ||
2143 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
2144 )
2145 return;
2146
2147 // record first keypress in a series, but ignore subsequent
2148 // keypresses until debounce clears
2149 var timeout = self._keypressTimeout;
2150 if (!timeout) {
2151 self._breadcrumbEventHandler('input')(evt);
2152 }
2153 clearTimeout(timeout);
2154 self._keypressTimeout = setTimeout(function() {
2155 self._keypressTimeout = null;
2156 }, debounceDuration);
2157 };
2158 },
2159
2160 /**
2161 * Captures a breadcrumb of type "navigation", normalizing input URLs
2162 * @param to the originating URL
2163 * @param from the target URL
2164 * @private
2165 */
2166 _captureUrlChange: function(from, to) {
2167 var parsedLoc = parseUrl(this._location.href);
2168 var parsedTo = parseUrl(to);
2169 var parsedFrom = parseUrl(from);
2170
2171 // because onpopstate only tells you the "new" (to) value of location.href, and
2172 // not the previous (from) value, we need to track the value of the current URL
2173 // state ourselves
2174 this._lastHref = to;
2175
2176 // Use only the path component of the URL if the URL matches the current
2177 // document (almost all the time when using pushState)
2178 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
2179 to = parsedTo.relative;
2180 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
2181 from = parsedFrom.relative;
2182
2183 this.captureBreadcrumb({
2184 category: 'navigation',
2185 data: {
2186 to: to,
2187 from: from
2188 }
2189 });
2190 },
2191
2192 /**
2193 * Wrap timer functions and event targets to catch errors and provide
2194 * better metadata.
2195 */
2196 _instrumentTryCatch: function() {
2197 var self = this;
2198
2199 var wrappedBuiltIns = self._wrappedBuiltIns;
2200
2201 function wrapTimeFn(orig) {
2202 return function(fn, t) {
2203 // preserve arity
2204 // Make a copy of the arguments to prevent deoptimization
2205 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2206 var args = new Array(arguments.length);
2207 for (var i = 0; i < args.length; ++i) {
2208 args[i] = arguments[i];
2209 }
2210 var originalCallback = args[0];
2211 if (isFunction(originalCallback)) {
2212 args[0] = self.wrap(originalCallback);
2213 }
2214
2215 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
2216 // also supports only two arguments and doesn't care what this is, so we
2217 // can just call the original function directly.
2218 if (orig.apply) {
2219 return orig.apply(this, args);
2220 } else {
2221 return orig(args[0], args[1]);
2222 }
2223 };
2224 }
2225
2226 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2227
2228 function wrapEventTarget(global) {
2229 var proto = _window[global] && _window[global].prototype;
2230 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
2231 fill(
2232 proto,
2233 'addEventListener',
2234 function(orig) {
2235 return function(evtName, fn, capture, secure) {
2236 // preserve arity
2237 try {
2238 if (fn && fn.handleEvent) {
2239 fn.handleEvent = self.wrap(fn.handleEvent);
2240 }
2241 } catch (err) {
2242 // can sometimes get 'Permission denied to access property "handle Event'
2243 }
2244
2245 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
2246 // so that we don't have more than one wrapper function
2247 var before, clickHandler, keypressHandler;
2248
2249 if (
2250 autoBreadcrumbs &&
2251 autoBreadcrumbs.dom &&
2252 (global === 'EventTarget' || global === 'Node')
2253 ) {
2254 // NOTE: generating multiple handlers per addEventListener invocation, should
2255 // revisit and verify we can just use one (almost certainly)
2256 clickHandler = self._breadcrumbEventHandler('click');
2257 keypressHandler = self._keypressEventHandler();
2258 before = function(evt) {
2259 // need to intercept every DOM event in `before` argument, in case that
2260 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
2261 // see #724
2262 if (!evt) return;
2263
2264 var eventType;
2265 try {
2266 eventType = evt.type;
2267 } catch (e) {
2268 // just accessing event properties can throw an exception in some rare circumstances
2269 // see: https://github.com/getsentry/raven-js/issues/838
2270 return;
2271 }
2272 if (eventType === 'click') return clickHandler(evt);
2273 else if (eventType === 'keypress') return keypressHandler(evt);
2274 };
2275 }
2276 return orig.call(
2277 this,
2278 evtName,
2279 self.wrap(fn, undefined, before),
2280 capture,
2281 secure
2282 );
2283 };
2284 },
2285 wrappedBuiltIns
2286 );
2287 fill(
2288 proto,
2289 'removeEventListener',
2290 function(orig) {
2291 return function(evt, fn, capture, secure) {
2292 try {
2293 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
2294 } catch (e) {
2295 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
2296 }
2297 return orig.call(this, evt, fn, capture, secure);
2298 };
2299 },
2300 wrappedBuiltIns
2301 );
2302 }
2303 }
2304
2305 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
2306 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
2307 if (_window.requestAnimationFrame) {
2308 fill(
2309 _window,
2310 'requestAnimationFrame',
2311 function(orig) {
2312 return function(cb) {
2313 return orig(self.wrap(cb));
2314 };
2315 },
2316 wrappedBuiltIns
2317 );
2318 }
2319
2320 // event targets borrowed from bugsnag-js:
2321 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
2322 var eventTargets = [
2323 'EventTarget',
2324 'Window',
2325 'Node',
2326 'ApplicationCache',
2327 'AudioTrackList',
2328 'ChannelMergerNode',
2329 'CryptoOperation',
2330 'EventSource',
2331 'FileReader',
2332 'HTMLUnknownElement',
2333 'IDBDatabase',
2334 'IDBRequest',
2335 'IDBTransaction',
2336 'KeyOperation',
2337 'MediaController',
2338 'MessagePort',
2339 'ModalWindow',
2340 'Notification',
2341 'SVGElementInstance',
2342 'Screen',
2343 'TextTrack',
2344 'TextTrackCue',
2345 'TextTrackList',
2346 'WebSocket',
2347 'WebSocketWorker',
2348 'Worker',
2349 'XMLHttpRequest',
2350 'XMLHttpRequestEventTarget',
2351 'XMLHttpRequestUpload'
2352 ];
2353 for (var i = 0; i < eventTargets.length; i++) {
2354 wrapEventTarget(eventTargets[i]);
2355 }
2356 },
2357
2358 /**
2359 * Instrument browser built-ins w/ breadcrumb capturing
2360 * - XMLHttpRequests
2361 * - DOM interactions (click/typing)
2362 * - window.location changes
2363 * - console
2364 *
2365 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
2366 */
2367 _instrumentBreadcrumbs: function() {
2368 var self = this;
2369 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2370
2371 var wrappedBuiltIns = self._wrappedBuiltIns;
2372
2373 function wrapProp(prop, xhr) {
2374 if (prop in xhr && isFunction(xhr[prop])) {
2375 fill(xhr, prop, function(orig) {
2376 return self.wrap(orig);
2377 }); // intentionally don't track filled methods on XHR instances
2378 }
2379 }
2380
2381 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
2382 var xhrproto = XMLHttpRequest.prototype;
2383 fill(
2384 xhrproto,
2385 'open',
2386 function(origOpen) {
2387 return function(method, url) {
2388 // preserve arity
2389
2390 // if Sentry key appears in URL, don't capture
2391 if (isString(url) && url.indexOf(self._globalKey) === -1) {
2392 this.__raven_xhr = {
2393 method: method,
2394 url: url,
2395 status_code: null
2396 };
2397 }
2398
2399 return origOpen.apply(this, arguments);
2400 };
2401 },
2402 wrappedBuiltIns
2403 );
2404
2405 fill(
2406 xhrproto,
2407 'send',
2408 function(origSend) {
2409 return function(data) {
2410 // preserve arity
2411 var xhr = this;
2412
2413 function onreadystatechangeHandler() {
2414 if (xhr.__raven_xhr && xhr.readyState === 4) {
2415 try {
2416 // touching statusCode in some platforms throws
2417 // an exception
2418 xhr.__raven_xhr.status_code = xhr.status;
2419 } catch (e) {
2420 /* do nothing */
2421 }
2422
2423 self.captureBreadcrumb({
2424 type: 'http',
2425 category: 'xhr',
2426 data: xhr.__raven_xhr
2427 });
2428 }
2429 }
2430
2431 var props = ['onload', 'onerror', 'onprogress'];
2432 for (var j = 0; j < props.length; j++) {
2433 wrapProp(props[j], xhr);
2434 }
2435
2436 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
2437 fill(
2438 xhr,
2439 'onreadystatechange',
2440 function(orig) {
2441 return self.wrap(orig, undefined, onreadystatechangeHandler);
2442 } /* intentionally don't track this instrumentation */
2443 );
2444 } else {
2445 // if onreadystatechange wasn't actually set by the page on this xhr, we
2446 // are free to set our own and capture the breadcrumb
2447 xhr.onreadystatechange = onreadystatechangeHandler;
2448 }
2449
2450 return origSend.apply(this, arguments);
2451 };
2452 },
2453 wrappedBuiltIns
2454 );
2455 }
2456
2457 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
2458 fill(
2459 _window,
2460 'fetch',
2461 function(origFetch) {
2462 return function(fn, t) {
2463 // preserve arity
2464 // Make a copy of the arguments to prevent deoptimization
2465 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2466 var args = new Array(arguments.length);
2467 for (var i = 0; i < args.length; ++i) {
2468 args[i] = arguments[i];
2469 }
2470
2471 var fetchInput = args[0];
2472 var method = 'GET';
2473 var url;
2474
2475 if (typeof fetchInput === 'string') {
2476 url = fetchInput;
2477 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
2478 url = fetchInput.url;
2479 if (fetchInput.method) {
2480 method = fetchInput.method;
2481 }
2482 } else {
2483 url = '' + fetchInput;
2484 }
2485
2486 if (args[1] && args[1].method) {
2487 method = args[1].method;
2488 }
2489
2490 var fetchData = {
2491 method: method,
2492 url: url,
2493 status_code: null
2494 };
2495
2496 self.captureBreadcrumb({
2497 type: 'http',
2498 category: 'fetch',
2499 data: fetchData
2500 });
2501
2502 return origFetch.apply(this, args).then(function(response) {
2503 fetchData.status_code = response.status;
2504
2505 return response;
2506 });
2507 };
2508 },
2509 wrappedBuiltIns
2510 );
2511 }
2512
2513 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
2514 // to the document. Do this before we instrument addEventListener.
2515 if (autoBreadcrumbs.dom && this._hasDocument) {
2516 if (_document.addEventListener) {
2517 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
2518 _document.addEventListener('keypress', self._keypressEventHandler(), false);
2519 } else {
2520 // IE8 Compatibility
2521 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
2522 _document.attachEvent('onkeypress', self._keypressEventHandler());
2523 }
2524 }
2525
2526 // record navigation (URL) changes
2527 // NOTE: in Chrome App environment, touching history.pushState, *even inside
2528 // a try/catch block*, will cause Chrome to output an error to console.error
2529 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
2530 var chrome = _window.chrome;
2531 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
2532 var hasPushAndReplaceState =
2533 !isChromePackagedApp &&
2534 _window.history &&
2535 history.pushState &&
2536 history.replaceState;
2537 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
2538 // TODO: remove onpopstate handler on uninstall()
2539 var oldOnPopState = _window.onpopstate;
2540 _window.onpopstate = function() {
2541 var currentHref = self._location.href;
2542 self._captureUrlChange(self._lastHref, currentHref);
2543
2544 if (oldOnPopState) {
2545 return oldOnPopState.apply(this, arguments);
2546 }
2547 };
2548
2549 var historyReplacementFunction = function(origHistFunction) {
2550 // note history.pushState.length is 0; intentionally not declaring
2551 // params to preserve 0 arity
2552 return function(/* state, title, url */) {
2553 var url = arguments.length > 2 ? arguments[2] : undefined;
2554
2555 // url argument is optional
2556 if (url) {
2557 // coerce to string (this is what pushState does)
2558 self._captureUrlChange(self._lastHref, url + '');
2559 }
2560
2561 return origHistFunction.apply(this, arguments);
2562 };
2563 };
2564
2565 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
2566 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
2567 }
2568
2569 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
2570 // console
2571 var consoleMethodCallback = function(msg, data) {
2572 self.captureBreadcrumb({
2573 message: msg,
2574 level: data.level,
2575 category: 'console'
2576 });
2577 };
2578
2579 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
2580 wrapConsoleMethod(console, level, consoleMethodCallback);
2581 });
2582 }
2583 },
2584
2585 _restoreBuiltIns: function() {
2586 // restore any wrapped builtins
2587 var builtin;
2588 while (this._wrappedBuiltIns.length) {
2589 builtin = this._wrappedBuiltIns.shift();
2590
2591 var obj = builtin[0],
2592 name = builtin[1],
2593 orig = builtin[2];
2594
2595 obj[name] = orig;
2596 }
2597 },
2598
2599 _drainPlugins: function() {
2600 var self = this;
2601
2602 // FIX ME TODO
2603 each(this._plugins, function(_, plugin) {
2604 var installer = plugin[0];
2605 var args = plugin[1];
2606 installer.apply(self, [self].concat(args));
2607 });
2608 },
2609
2610 _parseDSN: function(str) {
2611 var m = dsnPattern.exec(str),
2612 dsn = {},
2613 i = 7;
2614
2615 try {
2616 while (i--) dsn[dsnKeys[i]] = m[i] || '';
2617 } catch (e) {
2618 throw new RavenConfigError('Invalid DSN: ' + str);
2619 }
2620
2621 if (dsn.pass && !this._globalOptions.allowSecretKey) {
2622 throw new RavenConfigError(
2623 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
2624 );
2625 }
2626
2627 return dsn;
2628 },
2629
2630 _getGlobalServer: function(uri) {
2631 // assemble the endpoint from the uri pieces
2632 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
2633
2634 if (uri.protocol) {
2635 globalServer = uri.protocol + ':' + globalServer;
2636 }
2637 return globalServer;
2638 },
2639
2640 _handleOnErrorStackInfo: function() {
2641 // if we are intentionally ignoring errors via onerror, bail out
2642 if (!this._ignoreOnError) {
2643 this._handleStackInfo.apply(this, arguments);
2644 }
2645 },
2646
2647 _handleStackInfo: function(stackInfo, options) {
2648 var frames = this._prepareFrames(stackInfo, options);
2649
2650 this._triggerEvent('handle', {
2651 stackInfo: stackInfo,
2652 options: options
2653 });
2654
2655 this._processException(
2656 stackInfo.name,
2657 stackInfo.message,
2658 stackInfo.url,
2659 stackInfo.lineno,
2660 frames,
2661 options
2662 );
2663 },
2664
2665 _prepareFrames: function(stackInfo, options) {
2666 var self = this;
2667 var frames = [];
2668 if (stackInfo.stack && stackInfo.stack.length) {
2669 each(stackInfo.stack, function(i, stack) {
2670 var frame = self._normalizeFrame(stack, stackInfo.url);
2671 if (frame) {
2672 frames.push(frame);
2673 }
2674 });
2675
2676 // e.g. frames captured via captureMessage throw
2677 if (options && options.trimHeadFrames) {
2678 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
2679 frames[j].in_app = false;
2680 }
2681 }
2682 }
2683 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
2684 return frames;
2685 },
2686
2687 _normalizeFrame: function(frame, stackInfoUrl) {
2688 // normalize the frames data
2689 var normalized = {
2690 filename: frame.url,
2691 lineno: frame.line,
2692 colno: frame.column,
2693 function: frame.func || '?'
2694 };
2695
2696 // Case when we don't have any information about the error
2697 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
2698 // Generating synthetic error doesn't add any value here
2699 //
2700 // We should probably somehow let a user know that they should fix their code
2701 if (!frame.url) {
2702 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
2703 }
2704
2705 normalized.in_app = !// determine if an exception came from outside of our app
2706 // first we check the global includePaths list.
2707 (
2708 (!!this._globalOptions.includePaths.test &&
2709 !this._globalOptions.includePaths.test(normalized.filename)) ||
2710 // Now we check for fun, if the function name is Raven or TraceKit
2711 /(Raven|TraceKit)\./.test(normalized['function']) ||
2712 // finally, we do a last ditch effort and check for raven.min.js
2713 /raven\.(min\.)?js$/.test(normalized.filename)
2714 );
2715
2716 return normalized;
2717 },
2718
2719 _processException: function(type, message, fileurl, lineno, frames, options) {
2720 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
2721 if (
2722 !!this._globalOptions.ignoreErrors.test &&
2723 (this._globalOptions.ignoreErrors.test(message) ||
2724 this._globalOptions.ignoreErrors.test(prefixedMessage))
2725 ) {
2726 return;
2727 }
2728
2729 var stacktrace;
2730
2731 if (frames && frames.length) {
2732 fileurl = frames[0].filename || fileurl;
2733 // Sentry expects frames oldest to newest
2734 // and JS sends them as newest to oldest
2735 frames.reverse();
2736 stacktrace = {frames: frames};
2737 } else if (fileurl) {
2738 stacktrace = {
2739 frames: [
2740 {
2741 filename: fileurl,
2742 lineno: lineno,
2743 in_app: true
2744 }
2745 ]
2746 };
2747 }
2748
2749 if (
2750 !!this._globalOptions.ignoreUrls.test &&
2751 this._globalOptions.ignoreUrls.test(fileurl)
2752 ) {
2753 return;
2754 }
2755
2756 if (
2757 !!this._globalOptions.whitelistUrls.test &&
2758 !this._globalOptions.whitelistUrls.test(fileurl)
2759 ) {
2760 return;
2761 }
2762
2763 var data = objectMerge(
2764 {
2765 // sentry.interfaces.Exception
2766 exception: {
2767 values: [
2768 {
2769 type: type,
2770 value: message,
2771 stacktrace: stacktrace
2772 }
2773 ]
2774 },
2775 culprit: fileurl
2776 },
2777 options
2778 );
2779
2780 // Fire away!
2781 this._send(data);
2782 },
2783
2784 _trimPacket: function(data) {
2785 // For now, we only want to truncate the two different messages
2786 // but this could/should be expanded to just trim everything
2787 var max = this._globalOptions.maxMessageLength;
2788 if (data.message) {
2789 data.message = truncate(data.message, max);
2790 }
2791 if (data.exception) {
2792 var exception = data.exception.values[0];
2793 exception.value = truncate(exception.value, max);
2794 }
2795
2796 var request = data.request;
2797 if (request) {
2798 if (request.url) {
2799 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
2800 }
2801 if (request.Referer) {
2802 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
2803 }
2804 }
2805
2806 if (data.breadcrumbs && data.breadcrumbs.values)
2807 this._trimBreadcrumbs(data.breadcrumbs);
2808
2809 return data;
2810 },
2811
2812 /**
2813 * Truncate breadcrumb values (right now just URLs)
2814 */
2815 _trimBreadcrumbs: function(breadcrumbs) {
2816 // known breadcrumb properties with urls
2817 // TODO: also consider arbitrary prop values that start with (https?)?://
2818 var urlProps = ['to', 'from', 'url'],
2819 urlProp,
2820 crumb,
2821 data;
2822
2823 for (var i = 0; i < breadcrumbs.values.length; ++i) {
2824 crumb = breadcrumbs.values[i];
2825 if (
2826 !crumb.hasOwnProperty('data') ||
2827 !isObject(crumb.data) ||
2828 objectFrozen(crumb.data)
2829 )
2830 continue;
2831
2832 data = objectMerge({}, crumb.data);
2833 for (var j = 0; j < urlProps.length; ++j) {
2834 urlProp = urlProps[j];
2835 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
2836 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
2837 }
2838 }
2839 breadcrumbs.values[i].data = data;
2840 }
2841 },
2842
2843 _getHttpData: function() {
2844 if (!this._hasNavigator && !this._hasDocument) return;
2845 var httpData = {};
2846
2847 if (this._hasNavigator && _navigator.userAgent) {
2848 httpData.headers = {
2849 'User-Agent': navigator.userAgent
2850 };
2851 }
2852
2853 if (this._hasDocument) {
2854 if (_document.location && _document.location.href) {
2855 httpData.url = _document.location.href;
2856 }
2857 if (_document.referrer) {
2858 if (!httpData.headers) httpData.headers = {};
2859 httpData.headers.Referer = _document.referrer;
2860 }
2861 }
2862
2863 return httpData;
2864 },
2865
2866 _resetBackoff: function() {
2867 this._backoffDuration = 0;
2868 this._backoffStart = null;
2869 },
2870
2871 _shouldBackoff: function() {
2872 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
2873 },
2874
2875 /**
2876 * Returns true if the in-process data payload matches the signature
2877 * of the previously-sent data
2878 *
2879 * NOTE: This has to be done at this level because TraceKit can generate
2880 * data from window.onerror WITHOUT an exception object (IE8, IE9,
2881 * other old browsers). This can take the form of an "exception"
2882 * data object with a single frame (derived from the onerror args).
2883 */
2884 _isRepeatData: function(current) {
2885 var last = this._lastData;
2886
2887 if (
2888 !last ||
2889 current.message !== last.message || // defined for captureMessage
2890 current.culprit !== last.culprit // defined for captureException/onerror
2891 )
2892 return false;
2893
2894 // Stacktrace interface (i.e. from captureMessage)
2895 if (current.stacktrace || last.stacktrace) {
2896 return isSameStacktrace(current.stacktrace, last.stacktrace);
2897 } else if (current.exception || last.exception) {
2898 // Exception interface (i.e. from captureException/onerror)
2899 return isSameException(current.exception, last.exception);
2900 }
2901
2902 return true;
2903 },
2904
2905 _setBackoffState: function(request) {
2906 // If we are already in a backoff state, don't change anything
2907 if (this._shouldBackoff()) {
2908 return;
2909 }
2910
2911 var status = request.status;
2912
2913 // 400 - project_id doesn't exist or some other fatal
2914 // 401 - invalid/revoked dsn
2915 // 429 - too many requests
2916 if (!(status === 400 || status === 401 || status === 429)) return;
2917
2918 var retry;
2919 try {
2920 // If Retry-After is not in Access-Control-Expose-Headers, most
2921 // browsers will throw an exception trying to access it
2922 retry = request.getResponseHeader('Retry-After');
2923 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
2924 } catch (e) {
2925 /* eslint no-empty:0 */
2926 }
2927
2928 this._backoffDuration = retry
2929 ? // If Sentry server returned a Retry-After value, use it
2930 retry
2931 : // Otherwise, double the last backoff duration (starts at 1 sec)
2932 this._backoffDuration * 2 || 1000;
2933
2934 this._backoffStart = now();
2935 },
2936
2937 _send: function(data) {
2938 var globalOptions = this._globalOptions;
2939
2940 var baseData = {
2941 project: this._globalProject,
2942 logger: globalOptions.logger,
2943 platform: 'javascript'
2944 },
2945 httpData = this._getHttpData();
2946
2947 if (httpData) {
2948 baseData.request = httpData;
2949 }
2950
2951 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
2952 if (data.trimHeadFrames) delete data.trimHeadFrames;
2953
2954 data = objectMerge(baseData, data);
2955
2956 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
2957 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
2958 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
2959
2960 // Send along our own collected metadata with extra
2961 data.extra['session:duration'] = now() - this._startTime;
2962
2963 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
2964 // intentionally make shallow copy so that additions
2965 // to breadcrumbs aren't accidentally sent in this request
2966 data.breadcrumbs = {
2967 values: [].slice.call(this._breadcrumbs, 0)
2968 };
2969 }
2970
2971 // If there are no tags/extra, strip the key from the payload alltogther.
2972 if (isEmptyObject(data.tags)) delete data.tags;
2973
2974 if (this._globalContext.user) {
2975 // sentry.interfaces.User
2976 data.user = this._globalContext.user;
2977 }
2978
2979 // Include the environment if it's defined in globalOptions
2980 if (globalOptions.environment) data.environment = globalOptions.environment;
2981
2982 // Include the release if it's defined in globalOptions
2983 if (globalOptions.release) data.release = globalOptions.release;
2984
2985 // Include server_name if it's defined in globalOptions
2986 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
2987
2988 if (isFunction(globalOptions.dataCallback)) {
2989 data = globalOptions.dataCallback(data) || data;
2990 }
2991
2992 // Why??????????
2993 if (!data || isEmptyObject(data)) {
2994 return;
2995 }
2996
2997 // Check if the request should be filtered or not
2998 if (
2999 isFunction(globalOptions.shouldSendCallback) &&
3000 !globalOptions.shouldSendCallback(data)
3001 ) {
3002 return;
3003 }
3004
3005 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
3006 // so drop requests until "cool-off" period has elapsed.
3007 if (this._shouldBackoff()) {
3008 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
3009 return;
3010 }
3011
3012 if (typeof globalOptions.sampleRate === 'number') {
3013 if (Math.random() < globalOptions.sampleRate) {
3014 this._sendProcessedPayload(data);
3015 }
3016 } else {
3017 this._sendProcessedPayload(data);
3018 }
3019 },
3020
3021 _getUuid: function() {
3022 return uuid4();
3023 },
3024
3025 _sendProcessedPayload: function(data, callback) {
3026 var self = this;
3027 var globalOptions = this._globalOptions;
3028
3029 if (!this.isSetup()) return;
3030
3031 // Try and clean up the packet before sending by truncating long values
3032 data = this._trimPacket(data);
3033
3034 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
3035 // but this would require copying an un-truncated copy of the data packet, which can be
3036 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
3037 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
3038 this._logDebug('warn', 'Raven dropped repeat event: ', data);
3039 return;
3040 }
3041
3042 // Send along an event_id if not explicitly passed.
3043 // This event_id can be used to reference the error within Sentry itself.
3044 // Set lastEventId after we know the error should actually be sent
3045 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
3046
3047 // Store outbound payload after trim
3048 this._lastData = data;
3049
3050 this._logDebug('debug', 'Raven about to send:', data);
3051
3052 var auth = {
3053 sentry_version: '7',
3054 sentry_client: 'raven-js/' + this.VERSION,
3055 sentry_key: this._globalKey
3056 };
3057
3058 if (this._globalSecret) {
3059 auth.sentry_secret = this._globalSecret;
3060 }
3061
3062 var exception = data.exception && data.exception.values[0];
3063 this.captureBreadcrumb({
3064 category: 'sentry',
3065 message: exception
3066 ? (exception.type ? exception.type + ': ' : '') + exception.value
3067 : data.message,
3068 event_id: data.event_id,
3069 level: data.level || 'error' // presume error unless specified
3070 });
3071
3072 var url = this._globalEndpoint;
3073 (globalOptions.transport || this._makeRequest).call(this, {
3074 url: url,
3075 auth: auth,
3076 data: data,
3077 options: globalOptions,
3078 onSuccess: function success() {
3079 self._resetBackoff();
3080
3081 self._triggerEvent('success', {
3082 data: data,
3083 src: url
3084 });
3085 callback && callback();
3086 },
3087 onError: function failure(error) {
3088 self._logDebug('error', 'Raven transport failed to send: ', error);
3089
3090 if (error.request) {
3091 self._setBackoffState(error.request);
3092 }
3093
3094 self._triggerEvent('failure', {
3095 data: data,
3096 src: url
3097 });
3098 error = error || new Error('Raven send failed (no additional details provided)');
3099 callback && callback(error);
3100 }
3101 });
3102 },
3103
3104 _makeRequest: function(opts) {
3105 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
3106 if (!request) return;
3107
3108 // if browser doesn't support CORS (e.g. IE7), we are out of luck
3109 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
3110
3111 if (!hasCORS) return;
3112
3113 var url = opts.url;
3114
3115 if ('withCredentials' in request) {
3116 request.onreadystatechange = function() {
3117 if (request.readyState !== 4) {
3118 return;
3119 } else if (request.status === 200) {
3120 opts.onSuccess && opts.onSuccess();
3121 } else if (opts.onError) {
3122 var err = new Error('Sentry error code: ' + request.status);
3123 err.request = request;
3124 opts.onError(err);
3125 }
3126 };
3127 } else {
3128 request = new XDomainRequest();
3129 // xdomainrequest cannot go http -> https (or vice versa),
3130 // so always use protocol relative
3131 url = url.replace(/^https?:/, '');
3132
3133 // onreadystatechange not supported by XDomainRequest
3134 if (opts.onSuccess) {
3135 request.onload = opts.onSuccess;
3136 }
3137 if (opts.onError) {
3138 request.onerror = function() {
3139 var err = new Error('Sentry error code: XDomainRequest');
3140 err.request = request;
3141 opts.onError(err);
3142 };
3143 }
3144 }
3145
3146 // NOTE: auth is intentionally sent as part of query string (NOT as custom
3147 // HTTP header) so as to avoid preflight CORS requests
3148 request.open('POST', url + '?' + urlencode(opts.auth));
3149 request.send(stringify(opts.data));
3150 },
3151
3152 _logDebug: function(level) {
3153 if (this._originalConsoleMethods[level] && this.debug) {
3154 // In IE<10 console methods do not have their own 'apply' method
3155 Function.prototype.apply.call(
3156 this._originalConsoleMethods[level],
3157 this._originalConsole,
3158 [].slice.call(arguments, 1)
3159 );
3160 }
3161 },
3162
3163 _mergeContext: function(key, context) {
3164 if (isUndefined(context)) {
3165 delete this._globalContext[key];
3166 } else {
3167 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
3168 }
3169 }
3170 };
3171
3172 // Deprecations
3173 Raven.prototype.setUser = Raven.prototype.setUserContext;
3174 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
3175
3176 module.exports = Raven;
3177
3178
3179 /***/ }),
3180
3181 /***/ "./node_modules/raven-js/src/singleton.js":
3182 /*!************************************************!*\
3183 !*** ./node_modules/raven-js/src/singleton.js ***!
3184 \************************************************/
3185 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3186
3187 /**
3188 * Enforces a single instance of the Raven client, and the
3189 * main entry point for Raven. If you are a consumer of the
3190 * Raven library, you SHOULD load this file (vs raven.js).
3191 **/
3192
3193 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
3194
3195 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3196 var _window =
3197 typeof window !== 'undefined'
3198 ? window
3199 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3200 var _Raven = _window.Raven;
3201
3202 var Raven = new RavenConstructor();
3203
3204 /*
3205 * Allow multiple versions of Raven to be installed.
3206 * Strip Raven from the global context and returns the instance.
3207 *
3208 * @return {Raven}
3209 */
3210 Raven.noConflict = function() {
3211 _window.Raven = _Raven;
3212 return Raven;
3213 };
3214
3215 Raven.afterLoad();
3216
3217 module.exports = Raven;
3218
3219
3220 /***/ }),
3221
3222 /***/ "./node_modules/raven-js/src/utils.js":
3223 /*!********************************************!*\
3224 !*** ./node_modules/raven-js/src/utils.js ***!
3225 \********************************************/
3226 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3227
3228 var _window =
3229 typeof window !== 'undefined'
3230 ? window
3231 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3232
3233 function isObject(what) {
3234 return typeof what === 'object' && what !== null;
3235 }
3236
3237 // Yanked from https://git.io/vS8DV re-used under CC0
3238 // with some tiny modifications
3239 function isError(value) {
3240 switch ({}.toString.call(value)) {
3241 case '[object Error]':
3242 return true;
3243 case '[object Exception]':
3244 return true;
3245 case '[object DOMException]':
3246 return true;
3247 default:
3248 return value instanceof Error;
3249 }
3250 }
3251
3252 function isErrorEvent(value) {
3253 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
3254 }
3255
3256 function isUndefined(what) {
3257 return what === void 0;
3258 }
3259
3260 function isFunction(what) {
3261 return typeof what === 'function';
3262 }
3263
3264 function isString(what) {
3265 return Object.prototype.toString.call(what) === '[object String]';
3266 }
3267
3268 function isEmptyObject(what) {
3269 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
3270 return true;
3271 }
3272
3273 function supportsErrorEvent() {
3274 try {
3275 new ErrorEvent(''); // eslint-disable-line no-new
3276 return true;
3277 } catch (e) {
3278 return false;
3279 }
3280 }
3281
3282 function wrappedCallback(callback) {
3283 function dataCallback(data, original) {
3284 var normalizedData = callback(data) || data;
3285 if (original) {
3286 return original(normalizedData) || normalizedData;
3287 }
3288 return normalizedData;
3289 }
3290
3291 return dataCallback;
3292 }
3293
3294 function each(obj, callback) {
3295 var i, j;
3296
3297 if (isUndefined(obj.length)) {
3298 for (i in obj) {
3299 if (hasKey(obj, i)) {
3300 callback.call(null, i, obj[i]);
3301 }
3302 }
3303 } else {
3304 j = obj.length;
3305 if (j) {
3306 for (i = 0; i < j; i++) {
3307 callback.call(null, i, obj[i]);
3308 }
3309 }
3310 }
3311 }
3312
3313 function objectMerge(obj1, obj2) {
3314 if (!obj2) {
3315 return obj1;
3316 }
3317 each(obj2, function(key, value) {
3318 obj1[key] = value;
3319 });
3320 return obj1;
3321 }
3322
3323 /**
3324 * This function is only used for react-native.
3325 * react-native freezes object that have already been sent over the
3326 * js bridge. We need this function in order to check if the object is frozen.
3327 * So it's ok that objectFrozen returns false if Object.isFrozen is not
3328 * supported because it's not relevant for other "platforms". See related issue:
3329 * https://github.com/getsentry/react-native-sentry/issues/57
3330 */
3331 function objectFrozen(obj) {
3332 if (!Object.isFrozen) {
3333 return false;
3334 }
3335 return Object.isFrozen(obj);
3336 }
3337
3338 function truncate(str, max) {
3339 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
3340 }
3341
3342 /**
3343 * hasKey, a better form of hasOwnProperty
3344 * Example: hasKey(MainHostObject, property) === true/false
3345 *
3346 * @param {Object} host object to check property
3347 * @param {string} key to check
3348 */
3349 function hasKey(object, key) {
3350 return Object.prototype.hasOwnProperty.call(object, key);
3351 }
3352
3353 function joinRegExp(patterns) {
3354 // Combine an array of regular expressions and strings into one large regexp
3355 // Be mad.
3356 var sources = [],
3357 i = 0,
3358 len = patterns.length,
3359 pattern;
3360
3361 for (; i < len; i++) {
3362 pattern = patterns[i];
3363 if (isString(pattern)) {
3364 // If it's a string, we need to escape it
3365 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
3366 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
3367 } else if (pattern && pattern.source) {
3368 // If it's a regexp already, we want to extract the source
3369 sources.push(pattern.source);
3370 }
3371 // Intentionally skip other cases
3372 }
3373 return new RegExp(sources.join('|'), 'i');
3374 }
3375
3376 function urlencode(o) {
3377 var pairs = [];
3378 each(o, function(key, value) {
3379 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
3380 });
3381 return pairs.join('&');
3382 }
3383
3384 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
3385 // intentionally using regex and not <a/> href parsing trick because React Native and other
3386 // environments where DOM might not be available
3387 function parseUrl(url) {
3388 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
3389 if (!match) return {};
3390
3391 // coerce to undefined values to empty string so we don't get 'undefined'
3392 var query = match[6] || '';
3393 var fragment = match[8] || '';
3394 return {
3395 protocol: match[2],
3396 host: match[4],
3397 path: match[5],
3398 relative: match[5] + query + fragment // everything minus origin
3399 };
3400 }
3401 function uuid4() {
3402 var crypto = _window.crypto || _window.msCrypto;
3403
3404 if (!isUndefined(crypto) && crypto.getRandomValues) {
3405 // Use window.crypto API if available
3406 // eslint-disable-next-line no-undef
3407 var arr = new Uint16Array(8);
3408 crypto.getRandomValues(arr);
3409
3410 // set 4 in byte 7
3411 arr[3] = (arr[3] & 0xfff) | 0x4000;
3412 // set 2 most significant bits of byte 9 to '10'
3413 arr[4] = (arr[4] & 0x3fff) | 0x8000;
3414
3415 var pad = function(num) {
3416 var v = num.toString(16);
3417 while (v.length < 4) {
3418 v = '0' + v;
3419 }
3420 return v;
3421 };
3422
3423 return (
3424 pad(arr[0]) +
3425 pad(arr[1]) +
3426 pad(arr[2]) +
3427 pad(arr[3]) +
3428 pad(arr[4]) +
3429 pad(arr[5]) +
3430 pad(arr[6]) +
3431 pad(arr[7])
3432 );
3433 } else {
3434 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
3435 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
3436 var r = (Math.random() * 16) | 0,
3437 v = c === 'x' ? r : (r & 0x3) | 0x8;
3438 return v.toString(16);
3439 });
3440 }
3441 }
3442
3443 /**
3444 * Given a child DOM element, returns a query-selector statement describing that
3445 * and its ancestors
3446 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
3447 * @param elem
3448 * @returns {string}
3449 */
3450 function htmlTreeAsString(elem) {
3451 /* eslint no-extra-parens:0*/
3452 var MAX_TRAVERSE_HEIGHT = 5,
3453 MAX_OUTPUT_LEN = 80,
3454 out = [],
3455 height = 0,
3456 len = 0,
3457 separator = ' > ',
3458 sepLength = separator.length,
3459 nextStr;
3460
3461 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
3462 nextStr = htmlElementAsString(elem);
3463 // bail out if
3464 // - nextStr is the 'html' element
3465 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
3466 // (ignore this limit if we are on the first iteration)
3467 if (
3468 nextStr === 'html' ||
3469 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
3470 ) {
3471 break;
3472 }
3473
3474 out.push(nextStr);
3475
3476 len += nextStr.length;
3477 elem = elem.parentNode;
3478 }
3479
3480 return out.reverse().join(separator);
3481 }
3482
3483 /**
3484 * Returns a simple, query-selector representation of a DOM element
3485 * e.g. [HTMLElement] => input#foo.btn[name=baz]
3486 * @param HTMLElement
3487 * @returns {string}
3488 */
3489 function htmlElementAsString(elem) {
3490 var out = [],
3491 className,
3492 classes,
3493 key,
3494 attr,
3495 i;
3496
3497 if (!elem || !elem.tagName) {
3498 return '';
3499 }
3500
3501 out.push(elem.tagName.toLowerCase());
3502 if (elem.id) {
3503 out.push('#' + elem.id);
3504 }
3505
3506 className = elem.className;
3507 if (className && isString(className)) {
3508 classes = className.split(/\s+/);
3509 for (i = 0; i < classes.length; i++) {
3510 out.push('.' + classes[i]);
3511 }
3512 }
3513 var attrWhitelist = ['type', 'name', 'title', 'alt'];
3514 for (i = 0; i < attrWhitelist.length; i++) {
3515 key = attrWhitelist[i];
3516 attr = elem.getAttribute(key);
3517 if (attr) {
3518 out.push('[' + key + '="' + attr + '"]');
3519 }
3520 }
3521 return out.join('');
3522 }
3523
3524 /**
3525 * Returns true if either a OR b is truthy, but not both
3526 */
3527 function isOnlyOneTruthy(a, b) {
3528 return !!(!!a ^ !!b);
3529 }
3530
3531 /**
3532 * Returns true if the two input exception interfaces have the same content
3533 */
3534 function isSameException(ex1, ex2) {
3535 if (isOnlyOneTruthy(ex1, ex2)) return false;
3536
3537 ex1 = ex1.values[0];
3538 ex2 = ex2.values[0];
3539
3540 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
3541
3542 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
3543 }
3544
3545 /**
3546 * Returns true if the two input stack trace interfaces have the same content
3547 */
3548 function isSameStacktrace(stack1, stack2) {
3549 if (isOnlyOneTruthy(stack1, stack2)) return false;
3550
3551 var frames1 = stack1.frames;
3552 var frames2 = stack2.frames;
3553
3554 // Exit early if frame count differs
3555 if (frames1.length !== frames2.length) return false;
3556
3557 // Iterate through every frame; bail out if anything differs
3558 var a, b;
3559 for (var i = 0; i < frames1.length; i++) {
3560 a = frames1[i];
3561 b = frames2[i];
3562 if (
3563 a.filename !== b.filename ||
3564 a.lineno !== b.lineno ||
3565 a.colno !== b.colno ||
3566 a['function'] !== b['function']
3567 )
3568 return false;
3569 }
3570 return true;
3571 }
3572
3573 /**
3574 * Polyfill a method
3575 * @param obj object e.g. `document`
3576 * @param name method name present on object e.g. `addEventListener`
3577 * @param replacement replacement function
3578 * @param track {optional} record instrumentation to an array
3579 */
3580 function fill(obj, name, replacement, track) {
3581 var orig = obj[name];
3582 obj[name] = replacement(orig);
3583 if (track) {
3584 track.push([obj, name, orig]);
3585 }
3586 }
3587
3588 module.exports = {
3589 isObject: isObject,
3590 isError: isError,
3591 isErrorEvent: isErrorEvent,
3592 isUndefined: isUndefined,
3593 isFunction: isFunction,
3594 isString: isString,
3595 isEmptyObject: isEmptyObject,
3596 supportsErrorEvent: supportsErrorEvent,
3597 wrappedCallback: wrappedCallback,
3598 each: each,
3599 objectMerge: objectMerge,
3600 truncate: truncate,
3601 objectFrozen: objectFrozen,
3602 hasKey: hasKey,
3603 joinRegExp: joinRegExp,
3604 urlencode: urlencode,
3605 uuid4: uuid4,
3606 htmlTreeAsString: htmlTreeAsString,
3607 htmlElementAsString: htmlElementAsString,
3608 isSameException: isSameException,
3609 isSameStacktrace: isSameStacktrace,
3610 parseUrl: parseUrl,
3611 fill: fill
3612 };
3613
3614
3615 /***/ }),
3616
3617 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
3618 /*!***********************************************************!*\
3619 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
3620 \***********************************************************/
3621 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3622
3623 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
3624
3625 /*
3626 TraceKit - Cross brower stack traces
3627
3628 This was originally forked from github.com/occ/TraceKit, but has since been
3629 largely re-written and is now maintained as part of raven-js. Tests for
3630 this are in test/vendor.
3631
3632 MIT license
3633 */
3634
3635 var TraceKit = {
3636 collectWindowErrors: true,
3637 debug: false
3638 };
3639
3640 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3641 var _window =
3642 typeof window !== 'undefined'
3643 ? window
3644 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3645
3646 // global reference to slice
3647 var _slice = [].slice;
3648 var UNKNOWN_FUNCTION = '?';
3649
3650 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
3651 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
3652
3653 function getLocationHref() {
3654 if (typeof document === 'undefined' || document.location == null) return '';
3655
3656 return document.location.href;
3657 }
3658
3659 /**
3660 * TraceKit.report: cross-browser processing of unhandled exceptions
3661 *
3662 * Syntax:
3663 * TraceKit.report.subscribe(function(stackInfo) { ... })
3664 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
3665 * TraceKit.report(exception)
3666 * try { ...code... } catch(ex) { TraceKit.report(ex); }
3667 *
3668 * Supports:
3669 * - Firefox: full stack trace with line numbers, plus column number
3670 * on top frame; column number is not guaranteed
3671 * - Opera: full stack trace with line and column numbers
3672 * - Chrome: full stack trace with line and column numbers
3673 * - Safari: line and column number for the top frame only; some frames
3674 * may be missing, and column number is not guaranteed
3675 * - IE: line and column number for the top frame only; some frames
3676 * may be missing, and column number is not guaranteed
3677 *
3678 * In theory, TraceKit should work on all of the following versions:
3679 * - IE5.5+ (only 8.0 tested)
3680 * - Firefox 0.9+ (only 3.5+ tested)
3681 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
3682 * Exceptions Have Stacktrace to be enabled in opera:config)
3683 * - Safari 3+ (only 4+ tested)
3684 * - Chrome 1+ (only 5+ tested)
3685 * - Konqueror 3.5+ (untested)
3686 *
3687 * Requires TraceKit.computeStackTrace.
3688 *
3689 * Tries to catch all unhandled exceptions and report them to the
3690 * subscribed handlers. Please note that TraceKit.report will rethrow the
3691 * exception. This is REQUIRED in order to get a useful stack trace in IE.
3692 * If the exception does not reach the top of the browser, you will only
3693 * get a stack trace from the point where TraceKit.report was called.
3694 *
3695 * Handlers receive a stackInfo object as described in the
3696 * TraceKit.computeStackTrace docs.
3697 */
3698 TraceKit.report = (function reportModuleWrapper() {
3699 var handlers = [],
3700 lastArgs = null,
3701 lastException = null,
3702 lastExceptionStack = null;
3703
3704 /**
3705 * Add a crash handler.
3706 * @param {Function} handler
3707 */
3708 function subscribe(handler) {
3709 installGlobalHandler();
3710 handlers.push(handler);
3711 }
3712
3713 /**
3714 * Remove a crash handler.
3715 * @param {Function} handler
3716 */
3717 function unsubscribe(handler) {
3718 for (var i = handlers.length - 1; i >= 0; --i) {
3719 if (handlers[i] === handler) {
3720 handlers.splice(i, 1);
3721 }
3722 }
3723 }
3724
3725 /**
3726 * Remove all crash handlers.
3727 */
3728 function unsubscribeAll() {
3729 uninstallGlobalHandler();
3730 handlers = [];
3731 }
3732
3733 /**
3734 * Dispatch stack information to all handlers.
3735 * @param {Object.<string, *>} stack
3736 */
3737 function notifyHandlers(stack, isWindowError) {
3738 var exception = null;
3739 if (isWindowError && !TraceKit.collectWindowErrors) {
3740 return;
3741 }
3742 for (var i in handlers) {
3743 if (handlers.hasOwnProperty(i)) {
3744 try {
3745 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
3746 } catch (inner) {
3747 exception = inner;
3748 }
3749 }
3750 }
3751
3752 if (exception) {
3753 throw exception;
3754 }
3755 }
3756
3757 var _oldOnerrorHandler, _onErrorHandlerInstalled;
3758
3759 /**
3760 * Ensures all global unhandled exceptions are recorded.
3761 * Supported by Gecko and IE.
3762 * @param {string} message Error message.
3763 * @param {string} url URL of script that generated the exception.
3764 * @param {(number|string)} lineNo The line number at which the error
3765 * occurred.
3766 * @param {?(number|string)} colNo The column number at which the error
3767 * occurred.
3768 * @param {?Error} ex The actual Error object.
3769 */
3770 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
3771 var stack = null;
3772
3773 if (lastExceptionStack) {
3774 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
3775 lastExceptionStack,
3776 url,
3777 lineNo,
3778 message
3779 );
3780 processLastException();
3781 } else if (ex && utils.isError(ex)) {
3782 // non-string `ex` arg; attempt to extract stack trace
3783
3784 // New chrome and blink send along a real error object
3785 // Let's just report that like a normal error.
3786 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
3787 stack = TraceKit.computeStackTrace(ex);
3788 notifyHandlers(stack, true);
3789 } else {
3790 var location = {
3791 url: url,
3792 line: lineNo,
3793 column: colNo
3794 };
3795
3796 var name = undefined;
3797 var msg = message; // must be new var or will modify original `arguments`
3798 var groups;
3799 if ({}.toString.call(message) === '[object String]') {
3800 var groups = message.match(ERROR_TYPES_RE);
3801 if (groups) {
3802 name = groups[1];
3803 msg = groups[2];
3804 }
3805 }
3806
3807 location.func = UNKNOWN_FUNCTION;
3808
3809 stack = {
3810 name: name,
3811 message: msg,
3812 url: getLocationHref(),
3813 stack: [location]
3814 };
3815 notifyHandlers(stack, true);
3816 }
3817
3818 if (_oldOnerrorHandler) {
3819 return _oldOnerrorHandler.apply(this, arguments);
3820 }
3821
3822 return false;
3823 }
3824
3825 function installGlobalHandler() {
3826 if (_onErrorHandlerInstalled) {
3827 return;
3828 }
3829 _oldOnerrorHandler = _window.onerror;
3830 _window.onerror = traceKitWindowOnError;
3831 _onErrorHandlerInstalled = true;
3832 }
3833
3834 function uninstallGlobalHandler() {
3835 if (!_onErrorHandlerInstalled) {
3836 return;
3837 }
3838 _window.onerror = _oldOnerrorHandler;
3839 _onErrorHandlerInstalled = false;
3840 _oldOnerrorHandler = undefined;
3841 }
3842
3843 function processLastException() {
3844 var _lastExceptionStack = lastExceptionStack,
3845 _lastArgs = lastArgs;
3846 lastArgs = null;
3847 lastExceptionStack = null;
3848 lastException = null;
3849 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
3850 }
3851
3852 /**
3853 * Reports an unhandled Error to TraceKit.
3854 * @param {Error} ex
3855 * @param {?boolean} rethrow If false, do not re-throw the exception.
3856 * Only used for window.onerror to not cause an infinite loop of
3857 * rethrowing.
3858 */
3859 function report(ex, rethrow) {
3860 var args = _slice.call(arguments, 1);
3861 if (lastExceptionStack) {
3862 if (lastException === ex) {
3863 return; // already caught by an inner catch block, ignore
3864 } else {
3865 processLastException();
3866 }
3867 }
3868
3869 var stack = TraceKit.computeStackTrace(ex);
3870 lastExceptionStack = stack;
3871 lastException = ex;
3872 lastArgs = args;
3873
3874 // If the stack trace is incomplete, wait for 2 seconds for
3875 // slow slow IE to see if onerror occurs or not before reporting
3876 // this exception; otherwise, we will end up with an incomplete
3877 // stack trace
3878 setTimeout(function() {
3879 if (lastException === ex) {
3880 processLastException();
3881 }
3882 }, stack.incomplete ? 2000 : 0);
3883
3884 if (rethrow !== false) {
3885 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
3886 }
3887 }
3888
3889 report.subscribe = subscribe;
3890 report.unsubscribe = unsubscribe;
3891 report.uninstall = unsubscribeAll;
3892 return report;
3893 })();
3894
3895 /**
3896 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
3897 *
3898 * Syntax:
3899 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
3900 * Returns:
3901 * s.name - exception name
3902 * s.message - exception message
3903 * s.stack[i].url - JavaScript or HTML file URL
3904 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
3905 * s.stack[i].args - arguments passed to the function, if known
3906 * s.stack[i].line - line number, if known
3907 * s.stack[i].column - column number, if known
3908 *
3909 * Supports:
3910 * - Firefox: full stack trace with line numbers and unreliable column
3911 * number on top frame
3912 * - Opera 10: full stack trace with line and column numbers
3913 * - Opera 9-: full stack trace with line numbers
3914 * - Chrome: full stack trace with line and column numbers
3915 * - Safari: line and column number for the topmost stacktrace element
3916 * only
3917 * - IE: no line numbers whatsoever
3918 *
3919 * Tries to guess names of anonymous functions by looking for assignments
3920 * in the source code. In IE and Safari, we have to guess source file names
3921 * by searching for function bodies inside all page scripts. This will not
3922 * work for scripts that are loaded cross-domain.
3923 * Here be dragons: some function names may be guessed incorrectly, and
3924 * duplicate functions may be mismatched.
3925 *
3926 * TraceKit.computeStackTrace should only be used for tracing purposes.
3927 * Logging of unhandled exceptions should be done with TraceKit.report,
3928 * which builds on top of TraceKit.computeStackTrace and provides better
3929 * IE support by utilizing the window.onerror event to retrieve information
3930 * about the top of the stack.
3931 *
3932 * Note: In IE and Safari, no stack trace is recorded on the Error object,
3933 * so computeStackTrace instead walks its *own* chain of callers.
3934 * This means that:
3935 * * in Safari, some methods may be missing from the stack trace;
3936 * * in IE, the topmost function in the stack trace will always be the
3937 * caller of computeStackTrace.
3938 *
3939 * This is okay for tracing (because you are likely to be calling
3940 * computeStackTrace from the function you want to be the topmost element
3941 * of the stack trace anyway), but not okay for logging unhandled
3942 * exceptions (because your catch block will likely be far away from the
3943 * inner function that actually caused the exception).
3944 *
3945 */
3946 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
3947 // Contents of Exception in various browsers.
3948 //
3949 // SAFARI:
3950 // ex.message = Can't find variable: qq
3951 // ex.line = 59
3952 // ex.sourceId = 580238192
3953 // ex.sourceURL = http://...
3954 // ex.expressionBeginOffset = 96
3955 // ex.expressionCaretOffset = 98
3956 // ex.expressionEndOffset = 98
3957 // ex.name = ReferenceError
3958 //
3959 // FIREFOX:
3960 // ex.message = qq is not defined
3961 // ex.fileName = http://...
3962 // ex.lineNumber = 59
3963 // ex.columnNumber = 69
3964 // ex.stack = ...stack trace... (see the example below)
3965 // ex.name = ReferenceError
3966 //
3967 // CHROME:
3968 // ex.message = qq is not defined
3969 // ex.name = ReferenceError
3970 // ex.type = not_defined
3971 // ex.arguments = ['aa']
3972 // ex.stack = ...stack trace...
3973 //
3974 // INTERNET EXPLORER:
3975 // ex.message = ...
3976 // ex.name = ReferenceError
3977 //
3978 // OPERA:
3979 // ex.message = ...message... (see the example below)
3980 // ex.name = ReferenceError
3981 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
3982 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
3983
3984 /**
3985 * Computes stack trace information from the stack property.
3986 * Chrome and Gecko use this property.
3987 * @param {Error} ex
3988 * @return {?Object.<string, *>} Stack trace information.
3989 */
3990 function computeStackTraceFromStackProp(ex) {
3991 if (typeof ex.stack === 'undefined' || !ex.stack) return;
3992
3993 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
3994 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
3995 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
3996 // Used to additionally parse URL/line/column from eval frames
3997 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
3998 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
3999 lines = ex.stack.split('\n'),
4000 stack = [],
4001 submatch,
4002 parts,
4003 element,
4004 reference = /^(.*) is undefined$/.exec(ex.message);
4005
4006 for (var i = 0, j = lines.length; i < j; ++i) {
4007 if ((parts = chrome.exec(lines[i]))) {
4008 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
4009 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
4010 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
4011 // throw out eval line/column and use top-most line/column number
4012 parts[2] = submatch[1]; // url
4013 parts[3] = submatch[2]; // line
4014 parts[4] = submatch[3]; // column
4015 }
4016 element = {
4017 url: !isNative ? parts[2] : null,
4018 func: parts[1] || UNKNOWN_FUNCTION,
4019 args: isNative ? [parts[2]] : [],
4020 line: parts[3] ? +parts[3] : null,
4021 column: parts[4] ? +parts[4] : null
4022 };
4023 } else if ((parts = winjs.exec(lines[i]))) {
4024 element = {
4025 url: parts[2],
4026 func: parts[1] || UNKNOWN_FUNCTION,
4027 args: [],
4028 line: +parts[3],
4029 column: parts[4] ? +parts[4] : null
4030 };
4031 } else if ((parts = gecko.exec(lines[i]))) {
4032 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
4033 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
4034 // throw out eval line/column and use top-most line number
4035 parts[3] = submatch[1];
4036 parts[4] = submatch[2];
4037 parts[5] = null; // no column when eval
4038 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
4039 // FireFox uses this awesome columnNumber property for its top frame
4040 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
4041 // so adding 1
4042 // NOTE: this hack doesn't work if top-most frame is eval
4043 stack[0].column = ex.columnNumber + 1;
4044 }
4045 element = {
4046 url: parts[3],
4047 func: parts[1] || UNKNOWN_FUNCTION,
4048 args: parts[2] ? parts[2].split(',') : [],
4049 line: parts[4] ? +parts[4] : null,
4050 column: parts[5] ? +parts[5] : null
4051 };
4052 } else {
4053 continue;
4054 }
4055
4056 if (!element.func && element.line) {
4057 element.func = UNKNOWN_FUNCTION;
4058 }
4059
4060 stack.push(element);
4061 }
4062
4063 if (!stack.length) {
4064 return null;
4065 }
4066
4067 return {
4068 name: ex.name,
4069 message: ex.message,
4070 url: getLocationHref(),
4071 stack: stack
4072 };
4073 }
4074
4075 /**
4076 * Adds information about the first frame to incomplete stack traces.
4077 * Safari and IE require this to get complete data on the first frame.
4078 * @param {Object.<string, *>} stackInfo Stack trace information from
4079 * one of the compute* methods.
4080 * @param {string} url The URL of the script that caused an error.
4081 * @param {(number|string)} lineNo The line number of the script that
4082 * caused an error.
4083 * @param {string=} message The error generated by the browser, which
4084 * hopefully contains the name of the object that caused the error.
4085 * @return {boolean} Whether or not the stack information was
4086 * augmented.
4087 */
4088 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
4089 var initial = {
4090 url: url,
4091 line: lineNo
4092 };
4093
4094 if (initial.url && initial.line) {
4095 stackInfo.incomplete = false;
4096
4097 if (!initial.func) {
4098 initial.func = UNKNOWN_FUNCTION;
4099 }
4100
4101 if (stackInfo.stack.length > 0) {
4102 if (stackInfo.stack[0].url === initial.url) {
4103 if (stackInfo.stack[0].line === initial.line) {
4104 return false; // already in stack trace
4105 } else if (
4106 !stackInfo.stack[0].line &&
4107 stackInfo.stack[0].func === initial.func
4108 ) {
4109 stackInfo.stack[0].line = initial.line;
4110 return false;
4111 }
4112 }
4113 }
4114
4115 stackInfo.stack.unshift(initial);
4116 stackInfo.partial = true;
4117 return true;
4118 } else {
4119 stackInfo.incomplete = true;
4120 }
4121
4122 return false;
4123 }
4124
4125 /**
4126 * Computes stack trace information by walking the arguments.caller
4127 * chain at the time the exception occurred. This will cause earlier
4128 * frames to be missed but is the only way to get any stack trace in
4129 * Safari and IE. The top frame is restored by
4130 * {@link augmentStackTraceWithInitialElement}.
4131 * @param {Error} ex
4132 * @return {?Object.<string, *>} Stack trace information.
4133 */
4134 function computeStackTraceByWalkingCallerChain(ex, depth) {
4135 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
4136 stack = [],
4137 funcs = {},
4138 recursion = false,
4139 parts,
4140 item,
4141 source;
4142
4143 for (
4144 var curr = computeStackTraceByWalkingCallerChain.caller;
4145 curr && !recursion;
4146 curr = curr.caller
4147 ) {
4148 if (curr === computeStackTrace || curr === TraceKit.report) {
4149 // console.log('skipping internal function');
4150 continue;
4151 }
4152
4153 item = {
4154 url: null,
4155 func: UNKNOWN_FUNCTION,
4156 line: null,
4157 column: null
4158 };
4159
4160 if (curr.name) {
4161 item.func = curr.name;
4162 } else if ((parts = functionName.exec(curr.toString()))) {
4163 item.func = parts[1];
4164 }
4165
4166 if (typeof item.func === 'undefined') {
4167 try {
4168 item.func = parts.input.substring(0, parts.input.indexOf('{'));
4169 } catch (e) {}
4170 }
4171
4172 if (funcs['' + curr]) {
4173 recursion = true;
4174 } else {
4175 funcs['' + curr] = true;
4176 }
4177
4178 stack.push(item);
4179 }
4180
4181 if (depth) {
4182 // console.log('depth is ' + depth);
4183 // console.log('stack is ' + stack.length);
4184 stack.splice(0, depth);
4185 }
4186
4187 var result = {
4188 name: ex.name,
4189 message: ex.message,
4190 url: getLocationHref(),
4191 stack: stack
4192 };
4193 augmentStackTraceWithInitialElement(
4194 result,
4195 ex.sourceURL || ex.fileName,
4196 ex.line || ex.lineNumber,
4197 ex.message || ex.description
4198 );
4199 return result;
4200 }
4201
4202 /**
4203 * Computes a stack trace for an exception.
4204 * @param {Error} ex
4205 * @param {(string|number)=} depth
4206 */
4207 function computeStackTrace(ex, depth) {
4208 var stack = null;
4209 depth = depth == null ? 0 : +depth;
4210
4211 try {
4212 stack = computeStackTraceFromStackProp(ex);
4213 if (stack) {
4214 return stack;
4215 }
4216 } catch (e) {
4217 if (TraceKit.debug) {
4218 throw e;
4219 }
4220 }
4221
4222 try {
4223 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
4224 if (stack) {
4225 return stack;
4226 }
4227 } catch (e) {
4228 if (TraceKit.debug) {
4229 throw e;
4230 }
4231 }
4232 return {
4233 name: ex.name,
4234 message: ex.message,
4235 url: getLocationHref()
4236 };
4237 }
4238
4239 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
4240 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
4241
4242 return computeStackTrace;
4243 })();
4244
4245 module.exports = TraceKit;
4246
4247
4248 /***/ }),
4249
4250 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
4251 /*!***********************************************************************!*\
4252 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
4253 \***********************************************************************/
4254 /***/ ((module, exports) => {
4255
4256 /*
4257 json-stringify-safe
4258 Like JSON.stringify, but doesn't throw on circular references.
4259
4260 Originally forked from https://github.com/isaacs/json-stringify-safe
4261 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
4262 and IE8 compatibility. Tests for this are in test/vendor.
4263
4264 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
4265 */
4266
4267 exports = module.exports = stringify;
4268 exports.getSerialize = serializer;
4269
4270 function indexOf(haystack, needle) {
4271 for (var i = 0; i < haystack.length; ++i) {
4272 if (haystack[i] === needle) return i;
4273 }
4274 return -1;
4275 }
4276
4277 function stringify(obj, replacer, spaces, cycleReplacer) {
4278 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
4279 }
4280
4281 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
4282 function stringifyError(value) {
4283 var err = {
4284 // These properties are implemented as magical getters and don't show up in for in
4285 stack: value.stack,
4286 message: value.message,
4287 name: value.name
4288 };
4289
4290 for (var i in value) {
4291 if (Object.prototype.hasOwnProperty.call(value, i)) {
4292 err[i] = value[i];
4293 }
4294 }
4295
4296 return err;
4297 }
4298
4299 function serializer(replacer, cycleReplacer) {
4300 var stack = [];
4301 var keys = [];
4302
4303 if (cycleReplacer == null) {
4304 cycleReplacer = function(key, value) {
4305 if (stack[0] === value) {
4306 return '[Circular ~]';
4307 }
4308 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
4309 };
4310 }
4311
4312 return function(key, value) {
4313 if (stack.length > 0) {
4314 var thisPos = indexOf(stack, this);
4315 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
4316 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
4317
4318 if (~indexOf(stack, value)) {
4319 value = cycleReplacer.call(this, key, value);
4320 }
4321 } else {
4322 stack.push(value);
4323 }
4324
4325 return replacer == null
4326 ? value instanceof Error ? stringifyError(value) : value
4327 : replacer.call(this, key, value);
4328 };
4329 }
4330
4331
4332 /***/ }),
4333
4334 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
4335 /*!*****************************************************************!*\
4336 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
4337 \*****************************************************************/
4338 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4339
4340 "use strict";
4341 /** @license React v17.0.2
4342 * react-jsx-runtime.development.js
4343 *
4344 * Copyright (c) Facebook, Inc. and its affiliates.
4345 *
4346 * This source code is licensed under the MIT license found in the
4347 * LICENSE file in the root directory of this source tree.
4348 */
4349
4350
4351
4352 if (true) {
4353 (function() {
4354 'use strict';
4355
4356 var React = __webpack_require__(/*! react */ "react");
4357 var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
4358
4359 // ATTENTION
4360 // When adding new symbols to this file,
4361 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
4362 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
4363 // nor polyfill, then a plain number is used for performance.
4364 var REACT_ELEMENT_TYPE = 0xeac7;
4365 var REACT_PORTAL_TYPE = 0xeaca;
4366 exports.Fragment = 0xeacb;
4367 var REACT_STRICT_MODE_TYPE = 0xeacc;
4368 var REACT_PROFILER_TYPE = 0xead2;
4369 var REACT_PROVIDER_TYPE = 0xeacd;
4370 var REACT_CONTEXT_TYPE = 0xeace;
4371 var REACT_FORWARD_REF_TYPE = 0xead0;
4372 var REACT_SUSPENSE_TYPE = 0xead1;
4373 var REACT_SUSPENSE_LIST_TYPE = 0xead8;
4374 var REACT_MEMO_TYPE = 0xead3;
4375 var REACT_LAZY_TYPE = 0xead4;
4376 var REACT_BLOCK_TYPE = 0xead9;
4377 var REACT_SERVER_BLOCK_TYPE = 0xeada;
4378 var REACT_FUNDAMENTAL_TYPE = 0xead5;
4379 var REACT_SCOPE_TYPE = 0xead7;
4380 var REACT_OPAQUE_ID_TYPE = 0xeae0;
4381 var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
4382 var REACT_OFFSCREEN_TYPE = 0xeae2;
4383 var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
4384
4385 if (typeof Symbol === 'function' && Symbol.for) {
4386 var symbolFor = Symbol.for;
4387 REACT_ELEMENT_TYPE = symbolFor('react.element');
4388 REACT_PORTAL_TYPE = symbolFor('react.portal');
4389 exports.Fragment = symbolFor('react.fragment');
4390 REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
4391 REACT_PROFILER_TYPE = symbolFor('react.profiler');
4392 REACT_PROVIDER_TYPE = symbolFor('react.provider');
4393 REACT_CONTEXT_TYPE = symbolFor('react.context');
4394 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
4395 REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
4396 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
4397 REACT_MEMO_TYPE = symbolFor('react.memo');
4398 REACT_LAZY_TYPE = symbolFor('react.lazy');
4399 REACT_BLOCK_TYPE = symbolFor('react.block');
4400 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
4401 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
4402 REACT_SCOPE_TYPE = symbolFor('react.scope');
4403 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
4404 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
4405 REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
4406 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
4407 }
4408
4409 var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4410 var FAUX_ITERATOR_SYMBOL = '@@iterator';
4411 function getIteratorFn(maybeIterable) {
4412 if (maybeIterable === null || typeof maybeIterable !== 'object') {
4413 return null;
4414 }
4415
4416 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
4417
4418 if (typeof maybeIterator === 'function') {
4419 return maybeIterator;
4420 }
4421
4422 return null;
4423 }
4424
4425 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4426
4427 function error(format) {
4428 {
4429 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
4430 args[_key2 - 1] = arguments[_key2];
4431 }
4432
4433 printWarning('error', format, args);
4434 }
4435 }
4436
4437 function printWarning(level, format, args) {
4438 // When changing this logic, you might want to also
4439 // update consoleWithStackDev.www.js as well.
4440 {
4441 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4442 var stack = ReactDebugCurrentFrame.getStackAddendum();
4443
4444 if (stack !== '') {
4445 format += '%s';
4446 args = args.concat([stack]);
4447 }
4448
4449 var argsWithFormat = args.map(function (item) {
4450 return '' + item;
4451 }); // Careful: RN currently depends on this prefix
4452
4453 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
4454 // breaks IE9: https://github.com/facebook/react/issues/13610
4455 // eslint-disable-next-line react-internal/no-production-logging
4456
4457 Function.prototype.apply.call(console[level], console, argsWithFormat);
4458 }
4459 }
4460
4461 // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
4462
4463 var enableScopeAPI = false; // Experimental Create Event Handle API.
4464
4465 function isValidElementType(type) {
4466 if (typeof type === 'string' || typeof type === 'function') {
4467 return true;
4468 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
4469
4470
4471 if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
4472 return true;
4473 }
4474
4475 if (typeof type === 'object' && type !== null) {
4476 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
4477 return true;
4478 }
4479 }
4480
4481 return false;
4482 }
4483
4484 function getWrappedName(outerType, innerType, wrapperName) {
4485 var functionName = innerType.displayName || innerType.name || '';
4486 return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
4487 }
4488
4489 function getContextName(type) {
4490 return type.displayName || 'Context';
4491 }
4492
4493 function getComponentName(type) {
4494 if (type == null) {
4495 // Host root, text node or just invalid type.
4496 return null;
4497 }
4498
4499 {
4500 if (typeof type.tag === 'number') {
4501 error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
4502 }
4503 }
4504
4505 if (typeof type === 'function') {
4506 return type.displayName || type.name || null;
4507 }
4508
4509 if (typeof type === 'string') {
4510 return type;
4511 }
4512
4513 switch (type) {
4514 case exports.Fragment:
4515 return 'Fragment';
4516
4517 case REACT_PORTAL_TYPE:
4518 return 'Portal';
4519
4520 case REACT_PROFILER_TYPE:
4521 return 'Profiler';
4522
4523 case REACT_STRICT_MODE_TYPE:
4524 return 'StrictMode';
4525
4526 case REACT_SUSPENSE_TYPE:
4527 return 'Suspense';
4528
4529 case REACT_SUSPENSE_LIST_TYPE:
4530 return 'SuspenseList';
4531 }
4532
4533 if (typeof type === 'object') {
4534 switch (type.$$typeof) {
4535 case REACT_CONTEXT_TYPE:
4536 var context = type;
4537 return getContextName(context) + '.Consumer';
4538
4539 case REACT_PROVIDER_TYPE:
4540 var provider = type;
4541 return getContextName(provider._context) + '.Provider';
4542
4543 case REACT_FORWARD_REF_TYPE:
4544 return getWrappedName(type, type.render, 'ForwardRef');
4545
4546 case REACT_MEMO_TYPE:
4547 return getComponentName(type.type);
4548
4549 case REACT_BLOCK_TYPE:
4550 return getComponentName(type._render);
4551
4552 case REACT_LAZY_TYPE:
4553 {
4554 var lazyComponent = type;
4555 var payload = lazyComponent._payload;
4556 var init = lazyComponent._init;
4557
4558 try {
4559 return getComponentName(init(payload));
4560 } catch (x) {
4561 return null;
4562 }
4563 }
4564 }
4565 }
4566
4567 return null;
4568 }
4569
4570 // Helpers to patch console.logs to avoid logging during side-effect free
4571 // replaying on render function. This currently only patches the object
4572 // lazily which won't cover if the log function was extracted eagerly.
4573 // We could also eagerly patch the method.
4574 var disabledDepth = 0;
4575 var prevLog;
4576 var prevInfo;
4577 var prevWarn;
4578 var prevError;
4579 var prevGroup;
4580 var prevGroupCollapsed;
4581 var prevGroupEnd;
4582
4583 function disabledLog() {}
4584
4585 disabledLog.__reactDisabledLog = true;
4586 function disableLogs() {
4587 {
4588 if (disabledDepth === 0) {
4589 /* eslint-disable react-internal/no-production-logging */
4590 prevLog = console.log;
4591 prevInfo = console.info;
4592 prevWarn = console.warn;
4593 prevError = console.error;
4594 prevGroup = console.group;
4595 prevGroupCollapsed = console.groupCollapsed;
4596 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
4597
4598 var props = {
4599 configurable: true,
4600 enumerable: true,
4601 value: disabledLog,
4602 writable: true
4603 }; // $FlowFixMe Flow thinks console is immutable.
4604
4605 Object.defineProperties(console, {
4606 info: props,
4607 log: props,
4608 warn: props,
4609 error: props,
4610 group: props,
4611 groupCollapsed: props,
4612 groupEnd: props
4613 });
4614 /* eslint-enable react-internal/no-production-logging */
4615 }
4616
4617 disabledDepth++;
4618 }
4619 }
4620 function reenableLogs() {
4621 {
4622 disabledDepth--;
4623
4624 if (disabledDepth === 0) {
4625 /* eslint-disable react-internal/no-production-logging */
4626 var props = {
4627 configurable: true,
4628 enumerable: true,
4629 writable: true
4630 }; // $FlowFixMe Flow thinks console is immutable.
4631
4632 Object.defineProperties(console, {
4633 log: _assign({}, props, {
4634 value: prevLog
4635 }),
4636 info: _assign({}, props, {
4637 value: prevInfo
4638 }),
4639 warn: _assign({}, props, {
4640 value: prevWarn
4641 }),
4642 error: _assign({}, props, {
4643 value: prevError
4644 }),
4645 group: _assign({}, props, {
4646 value: prevGroup
4647 }),
4648 groupCollapsed: _assign({}, props, {
4649 value: prevGroupCollapsed
4650 }),
4651 groupEnd: _assign({}, props, {
4652 value: prevGroupEnd
4653 })
4654 });
4655 /* eslint-enable react-internal/no-production-logging */
4656 }
4657
4658 if (disabledDepth < 0) {
4659 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
4660 }
4661 }
4662 }
4663
4664 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
4665 var prefix;
4666 function describeBuiltInComponentFrame(name, source, ownerFn) {
4667 {
4668 if (prefix === undefined) {
4669 // Extract the VM specific prefix used by each line.
4670 try {
4671 throw Error();
4672 } catch (x) {
4673 var match = x.stack.trim().match(/\n( *(at )?)/);
4674 prefix = match && match[1] || '';
4675 }
4676 } // We use the prefix to ensure our stacks line up with native stack frames.
4677
4678
4679 return '\n' + prefix + name;
4680 }
4681 }
4682 var reentry = false;
4683 var componentFrameCache;
4684
4685 {
4686 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
4687 componentFrameCache = new PossiblyWeakMap();
4688 }
4689
4690 function describeNativeComponentFrame(fn, construct) {
4691 // If something asked for a stack inside a fake render, it should get ignored.
4692 if (!fn || reentry) {
4693 return '';
4694 }
4695
4696 {
4697 var frame = componentFrameCache.get(fn);
4698
4699 if (frame !== undefined) {
4700 return frame;
4701 }
4702 }
4703
4704 var control;
4705 reentry = true;
4706 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
4707
4708 Error.prepareStackTrace = undefined;
4709 var previousDispatcher;
4710
4711 {
4712 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
4713 // for warnings.
4714
4715 ReactCurrentDispatcher.current = null;
4716 disableLogs();
4717 }
4718
4719 try {
4720 // This should throw.
4721 if (construct) {
4722 // Something should be setting the props in the constructor.
4723 var Fake = function () {
4724 throw Error();
4725 }; // $FlowFixMe
4726
4727
4728 Object.defineProperty(Fake.prototype, 'props', {
4729 set: function () {
4730 // We use a throwing setter instead of frozen or non-writable props
4731 // because that won't throw in a non-strict mode function.
4732 throw Error();
4733 }
4734 });
4735
4736 if (typeof Reflect === 'object' && Reflect.construct) {
4737 // We construct a different control for this case to include any extra
4738 // frames added by the construct call.
4739 try {
4740 Reflect.construct(Fake, []);
4741 } catch (x) {
4742 control = x;
4743 }
4744
4745 Reflect.construct(fn, [], Fake);
4746 } else {
4747 try {
4748 Fake.call();
4749 } catch (x) {
4750 control = x;
4751 }
4752
4753 fn.call(Fake.prototype);
4754 }
4755 } else {
4756 try {
4757 throw Error();
4758 } catch (x) {
4759 control = x;
4760 }
4761
4762 fn();
4763 }
4764 } catch (sample) {
4765 // This is inlined manually because closure doesn't do it for us.
4766 if (sample && control && typeof sample.stack === 'string') {
4767 // This extracts the first frame from the sample that isn't also in the control.
4768 // Skipping one frame that we assume is the frame that calls the two.
4769 var sampleLines = sample.stack.split('\n');
4770 var controlLines = control.stack.split('\n');
4771 var s = sampleLines.length - 1;
4772 var c = controlLines.length - 1;
4773
4774 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
4775 // We expect at least one stack frame to be shared.
4776 // Typically this will be the root most one. However, stack frames may be
4777 // cut off due to maximum stack limits. In this case, one maybe cut off
4778 // earlier than the other. We assume that the sample is longer or the same
4779 // and there for cut off earlier. So we should find the root most frame in
4780 // the sample somewhere in the control.
4781 c--;
4782 }
4783
4784 for (; s >= 1 && c >= 0; s--, c--) {
4785 // Next we find the first one that isn't the same which should be the
4786 // frame that called our sample function and the control.
4787 if (sampleLines[s] !== controlLines[c]) {
4788 // In V8, the first line is describing the message but other VMs don't.
4789 // If we're about to return the first line, and the control is also on the same
4790 // line, that's a pretty good indicator that our sample threw at same line as
4791 // the control. I.e. before we entered the sample frame. So we ignore this result.
4792 // This can happen if you passed a class to function component, or non-function.
4793 if (s !== 1 || c !== 1) {
4794 do {
4795 s--;
4796 c--; // We may still have similar intermediate frames from the construct call.
4797 // The next one that isn't the same should be our match though.
4798
4799 if (c < 0 || sampleLines[s] !== controlLines[c]) {
4800 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
4801 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
4802
4803 {
4804 if (typeof fn === 'function') {
4805 componentFrameCache.set(fn, _frame);
4806 }
4807 } // Return the line we found.
4808
4809
4810 return _frame;
4811 }
4812 } while (s >= 1 && c >= 0);
4813 }
4814
4815 break;
4816 }
4817 }
4818 }
4819 } finally {
4820 reentry = false;
4821
4822 {
4823 ReactCurrentDispatcher.current = previousDispatcher;
4824 reenableLogs();
4825 }
4826
4827 Error.prepareStackTrace = previousPrepareStackTrace;
4828 } // Fallback to just using the name if we couldn't make it throw.
4829
4830
4831 var name = fn ? fn.displayName || fn.name : '';
4832 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
4833
4834 {
4835 if (typeof fn === 'function') {
4836 componentFrameCache.set(fn, syntheticFrame);
4837 }
4838 }
4839
4840 return syntheticFrame;
4841 }
4842 function describeFunctionComponentFrame(fn, source, ownerFn) {
4843 {
4844 return describeNativeComponentFrame(fn, false);
4845 }
4846 }
4847
4848 function shouldConstruct(Component) {
4849 var prototype = Component.prototype;
4850 return !!(prototype && prototype.isReactComponent);
4851 }
4852
4853 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
4854
4855 if (type == null) {
4856 return '';
4857 }
4858
4859 if (typeof type === 'function') {
4860 {
4861 return describeNativeComponentFrame(type, shouldConstruct(type));
4862 }
4863 }
4864
4865 if (typeof type === 'string') {
4866 return describeBuiltInComponentFrame(type);
4867 }
4868
4869 switch (type) {
4870 case REACT_SUSPENSE_TYPE:
4871 return describeBuiltInComponentFrame('Suspense');
4872
4873 case REACT_SUSPENSE_LIST_TYPE:
4874 return describeBuiltInComponentFrame('SuspenseList');
4875 }
4876
4877 if (typeof type === 'object') {
4878 switch (type.$$typeof) {
4879 case REACT_FORWARD_REF_TYPE:
4880 return describeFunctionComponentFrame(type.render);
4881
4882 case REACT_MEMO_TYPE:
4883 // Memo may contain any component type so we recursively resolve it.
4884 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
4885
4886 case REACT_BLOCK_TYPE:
4887 return describeFunctionComponentFrame(type._render);
4888
4889 case REACT_LAZY_TYPE:
4890 {
4891 var lazyComponent = type;
4892 var payload = lazyComponent._payload;
4893 var init = lazyComponent._init;
4894
4895 try {
4896 // Lazy may contain any component type so we recursively resolve it.
4897 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
4898 } catch (x) {}
4899 }
4900 }
4901 }
4902
4903 return '';
4904 }
4905
4906 var loggedTypeFailures = {};
4907 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4908
4909 function setCurrentlyValidatingElement(element) {
4910 {
4911 if (element) {
4912 var owner = element._owner;
4913 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
4914 ReactDebugCurrentFrame.setExtraStackFrame(stack);
4915 } else {
4916 ReactDebugCurrentFrame.setExtraStackFrame(null);
4917 }
4918 }
4919 }
4920
4921 function checkPropTypes(typeSpecs, values, location, componentName, element) {
4922 {
4923 // $FlowFixMe This is okay but Flow doesn't know it.
4924 var has = Function.call.bind(Object.prototype.hasOwnProperty);
4925
4926 for (var typeSpecName in typeSpecs) {
4927 if (has(typeSpecs, typeSpecName)) {
4928 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
4929 // fail the render phase where it didn't fail before. So we log it.
4930 // After these have been cleaned up, we'll let them throw.
4931
4932 try {
4933 // This is intentionally an invariant that gets caught. It's the same
4934 // behavior as without this statement except with a better message.
4935 if (typeof typeSpecs[typeSpecName] !== 'function') {
4936 var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
4937 err.name = 'Invariant Violation';
4938 throw err;
4939 }
4940
4941 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
4942 } catch (ex) {
4943 error$1 = ex;
4944 }
4945
4946 if (error$1 && !(error$1 instanceof Error)) {
4947 setCurrentlyValidatingElement(element);
4948
4949 error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
4950
4951 setCurrentlyValidatingElement(null);
4952 }
4953
4954 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
4955 // Only monitor this failure once because there tends to be a lot of the
4956 // same error.
4957 loggedTypeFailures[error$1.message] = true;
4958 setCurrentlyValidatingElement(element);
4959
4960 error('Failed %s type: %s', location, error$1.message);
4961
4962 setCurrentlyValidatingElement(null);
4963 }
4964 }
4965 }
4966 }
4967 }
4968
4969 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
4970 var hasOwnProperty = Object.prototype.hasOwnProperty;
4971 var RESERVED_PROPS = {
4972 key: true,
4973 ref: true,
4974 __self: true,
4975 __source: true
4976 };
4977 var specialPropKeyWarningShown;
4978 var specialPropRefWarningShown;
4979 var didWarnAboutStringRefs;
4980
4981 {
4982 didWarnAboutStringRefs = {};
4983 }
4984
4985 function hasValidRef(config) {
4986 {
4987 if (hasOwnProperty.call(config, 'ref')) {
4988 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
4989
4990 if (getter && getter.isReactWarning) {
4991 return false;
4992 }
4993 }
4994 }
4995
4996 return config.ref !== undefined;
4997 }
4998
4999 function hasValidKey(config) {
5000 {
5001 if (hasOwnProperty.call(config, 'key')) {
5002 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
5003
5004 if (getter && getter.isReactWarning) {
5005 return false;
5006 }
5007 }
5008 }
5009
5010 return config.key !== undefined;
5011 }
5012
5013 function warnIfStringRefCannotBeAutoConverted(config, self) {
5014 {
5015 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
5016 var componentName = getComponentName(ReactCurrentOwner.current.type);
5017
5018 if (!didWarnAboutStringRefs[componentName]) {
5019 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
5020
5021 didWarnAboutStringRefs[componentName] = true;
5022 }
5023 }
5024 }
5025 }
5026
5027 function defineKeyPropWarningGetter(props, displayName) {
5028 {
5029 var warnAboutAccessingKey = function () {
5030 if (!specialPropKeyWarningShown) {
5031 specialPropKeyWarningShown = true;
5032
5033 error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5034 }
5035 };
5036
5037 warnAboutAccessingKey.isReactWarning = true;
5038 Object.defineProperty(props, 'key', {
5039 get: warnAboutAccessingKey,
5040 configurable: true
5041 });
5042 }
5043 }
5044
5045 function defineRefPropWarningGetter(props, displayName) {
5046 {
5047 var warnAboutAccessingRef = function () {
5048 if (!specialPropRefWarningShown) {
5049 specialPropRefWarningShown = true;
5050
5051 error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5052 }
5053 };
5054
5055 warnAboutAccessingRef.isReactWarning = true;
5056 Object.defineProperty(props, 'ref', {
5057 get: warnAboutAccessingRef,
5058 configurable: true
5059 });
5060 }
5061 }
5062 /**
5063 * Factory method to create a new React element. This no longer adheres to
5064 * the class pattern, so do not use new to call it. Also, instanceof check
5065 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
5066 * if something is a React Element.
5067 *
5068 * @param {*} type
5069 * @param {*} props
5070 * @param {*} key
5071 * @param {string|object} ref
5072 * @param {*} owner
5073 * @param {*} self A *temporary* helper to detect places where `this` is
5074 * different from the `owner` when React.createElement is called, so that we
5075 * can warn. We want to get rid of owner and replace string `ref`s with arrow
5076 * functions, and as long as `this` and owner are the same, there will be no
5077 * change in behavior.
5078 * @param {*} source An annotation object (added by a transpiler or otherwise)
5079 * indicating filename, line number, and/or other information.
5080 * @internal
5081 */
5082
5083
5084 var ReactElement = function (type, key, ref, self, source, owner, props) {
5085 var element = {
5086 // This tag allows us to uniquely identify this as a React Element
5087 $$typeof: REACT_ELEMENT_TYPE,
5088 // Built-in properties that belong on the element
5089 type: type,
5090 key: key,
5091 ref: ref,
5092 props: props,
5093 // Record the component responsible for creating this element.
5094 _owner: owner
5095 };
5096
5097 {
5098 // The validation flag is currently mutative. We put it on
5099 // an external backing store so that we can freeze the whole object.
5100 // This can be replaced with a WeakMap once they are implemented in
5101 // commonly used development environments.
5102 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
5103 // the validation flag non-enumerable (where possible, which should
5104 // include every environment we run tests in), so the test framework
5105 // ignores it.
5106
5107 Object.defineProperty(element._store, 'validated', {
5108 configurable: false,
5109 enumerable: false,
5110 writable: true,
5111 value: false
5112 }); // self and source are DEV only properties.
5113
5114 Object.defineProperty(element, '_self', {
5115 configurable: false,
5116 enumerable: false,
5117 writable: false,
5118 value: self
5119 }); // Two elements created in two different places should be considered
5120 // equal for testing purposes and therefore we hide it from enumeration.
5121
5122 Object.defineProperty(element, '_source', {
5123 configurable: false,
5124 enumerable: false,
5125 writable: false,
5126 value: source
5127 });
5128
5129 if (Object.freeze) {
5130 Object.freeze(element.props);
5131 Object.freeze(element);
5132 }
5133 }
5134
5135 return element;
5136 };
5137 /**
5138 * https://github.com/reactjs/rfcs/pull/107
5139 * @param {*} type
5140 * @param {object} props
5141 * @param {string} key
5142 */
5143
5144 function jsxDEV(type, config, maybeKey, source, self) {
5145 {
5146 var propName; // Reserved names are extracted
5147
5148 var props = {};
5149 var key = null;
5150 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
5151 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
5152 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
5153 // but as an intermediary step, we will use jsxDEV for everything except
5154 // <div {...props} key="Hi" />, because we aren't currently able to tell if
5155 // key is explicitly declared to be undefined or not.
5156
5157 if (maybeKey !== undefined) {
5158 key = '' + maybeKey;
5159 }
5160
5161 if (hasValidKey(config)) {
5162 key = '' + config.key;
5163 }
5164
5165 if (hasValidRef(config)) {
5166 ref = config.ref;
5167 warnIfStringRefCannotBeAutoConverted(config, self);
5168 } // Remaining properties are added to a new props object
5169
5170
5171 for (propName in config) {
5172 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
5173 props[propName] = config[propName];
5174 }
5175 } // Resolve default props
5176
5177
5178 if (type && type.defaultProps) {
5179 var defaultProps = type.defaultProps;
5180
5181 for (propName in defaultProps) {
5182 if (props[propName] === undefined) {
5183 props[propName] = defaultProps[propName];
5184 }
5185 }
5186 }
5187
5188 if (key || ref) {
5189 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
5190
5191 if (key) {
5192 defineKeyPropWarningGetter(props, displayName);
5193 }
5194
5195 if (ref) {
5196 defineRefPropWarningGetter(props, displayName);
5197 }
5198 }
5199
5200 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
5201 }
5202 }
5203
5204 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
5205 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
5206
5207 function setCurrentlyValidatingElement$1(element) {
5208 {
5209 if (element) {
5210 var owner = element._owner;
5211 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
5212 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
5213 } else {
5214 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
5215 }
5216 }
5217 }
5218
5219 var propTypesMisspellWarningShown;
5220
5221 {
5222 propTypesMisspellWarningShown = false;
5223 }
5224 /**
5225 * Verifies the object is a ReactElement.
5226 * See https://reactjs.org/docs/react-api.html#isvalidelement
5227 * @param {?object} object
5228 * @return {boolean} True if `object` is a ReactElement.
5229 * @final
5230 */
5231
5232 function isValidElement(object) {
5233 {
5234 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
5235 }
5236 }
5237
5238 function getDeclarationErrorAddendum() {
5239 {
5240 if (ReactCurrentOwner$1.current) {
5241 var name = getComponentName(ReactCurrentOwner$1.current.type);
5242
5243 if (name) {
5244 return '\n\nCheck the render method of `' + name + '`.';
5245 }
5246 }
5247
5248 return '';
5249 }
5250 }
5251
5252 function getSourceInfoErrorAddendum(source) {
5253 {
5254 if (source !== undefined) {
5255 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
5256 var lineNumber = source.lineNumber;
5257 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
5258 }
5259
5260 return '';
5261 }
5262 }
5263 /**
5264 * Warn if there's no key explicitly set on dynamic arrays of children or
5265 * object keys are not valid. This allows us to keep track of children between
5266 * updates.
5267 */
5268
5269
5270 var ownerHasKeyUseWarning = {};
5271
5272 function getCurrentComponentErrorInfo(parentType) {
5273 {
5274 var info = getDeclarationErrorAddendum();
5275
5276 if (!info) {
5277 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
5278
5279 if (parentName) {
5280 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
5281 }
5282 }
5283
5284 return info;
5285 }
5286 }
5287 /**
5288 * Warn if the element doesn't have an explicit key assigned to it.
5289 * This element is in an array. The array could grow and shrink or be
5290 * reordered. All children that haven't already been validated are required to
5291 * have a "key" property assigned to it. Error statuses are cached so a warning
5292 * will only be shown once.
5293 *
5294 * @internal
5295 * @param {ReactElement} element Element that requires a key.
5296 * @param {*} parentType element's parent's type.
5297 */
5298
5299
5300 function validateExplicitKey(element, parentType) {
5301 {
5302 if (!element._store || element._store.validated || element.key != null) {
5303 return;
5304 }
5305
5306 element._store.validated = true;
5307 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
5308
5309 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
5310 return;
5311 }
5312
5313 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
5314 // property, it may be the creator of the child that's responsible for
5315 // assigning it a key.
5316
5317 var childOwner = '';
5318
5319 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
5320 // Give the component that originally created this child.
5321 childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
5322 }
5323
5324 setCurrentlyValidatingElement$1(element);
5325
5326 error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
5327
5328 setCurrentlyValidatingElement$1(null);
5329 }
5330 }
5331 /**
5332 * Ensure that every element either is passed in a static location, in an
5333 * array with an explicit keys property defined, or in an object literal
5334 * with valid key property.
5335 *
5336 * @internal
5337 * @param {ReactNode} node Statically passed child of any type.
5338 * @param {*} parentType node's parent's type.
5339 */
5340
5341
5342 function validateChildKeys(node, parentType) {
5343 {
5344 if (typeof node !== 'object') {
5345 return;
5346 }
5347
5348 if (Array.isArray(node)) {
5349 for (var i = 0; i < node.length; i++) {
5350 var child = node[i];
5351
5352 if (isValidElement(child)) {
5353 validateExplicitKey(child, parentType);
5354 }
5355 }
5356 } else if (isValidElement(node)) {
5357 // This element was passed in a valid location.
5358 if (node._store) {
5359 node._store.validated = true;
5360 }
5361 } else if (node) {
5362 var iteratorFn = getIteratorFn(node);
5363
5364 if (typeof iteratorFn === 'function') {
5365 // Entry iterators used to provide implicit keys,
5366 // but now we print a separate warning for them later.
5367 if (iteratorFn !== node.entries) {
5368 var iterator = iteratorFn.call(node);
5369 var step;
5370
5371 while (!(step = iterator.next()).done) {
5372 if (isValidElement(step.value)) {
5373 validateExplicitKey(step.value, parentType);
5374 }
5375 }
5376 }
5377 }
5378 }
5379 }
5380 }
5381 /**
5382 * Given an element, validate that its props follow the propTypes definition,
5383 * provided by the type.
5384 *
5385 * @param {ReactElement} element
5386 */
5387
5388
5389 function validatePropTypes(element) {
5390 {
5391 var type = element.type;
5392
5393 if (type === null || type === undefined || typeof type === 'string') {
5394 return;
5395 }
5396
5397 var propTypes;
5398
5399 if (typeof type === 'function') {
5400 propTypes = type.propTypes;
5401 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
5402 // Inner props are checked in the reconciler.
5403 type.$$typeof === REACT_MEMO_TYPE)) {
5404 propTypes = type.propTypes;
5405 } else {
5406 return;
5407 }
5408
5409 if (propTypes) {
5410 // Intentionally inside to avoid triggering lazy initializers:
5411 var name = getComponentName(type);
5412 checkPropTypes(propTypes, element.props, 'prop', name, element);
5413 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
5414 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
5415
5416 var _name = getComponentName(type);
5417
5418 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
5419 }
5420
5421 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
5422 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
5423 }
5424 }
5425 }
5426 /**
5427 * Given a fragment, validate that it can only be provided with fragment props
5428 * @param {ReactElement} fragment
5429 */
5430
5431
5432 function validateFragmentProps(fragment) {
5433 {
5434 var keys = Object.keys(fragment.props);
5435
5436 for (var i = 0; i < keys.length; i++) {
5437 var key = keys[i];
5438
5439 if (key !== 'children' && key !== 'key') {
5440 setCurrentlyValidatingElement$1(fragment);
5441
5442 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
5443
5444 setCurrentlyValidatingElement$1(null);
5445 break;
5446 }
5447 }
5448
5449 if (fragment.ref !== null) {
5450 setCurrentlyValidatingElement$1(fragment);
5451
5452 error('Invalid attribute `ref` supplied to `React.Fragment`.');
5453
5454 setCurrentlyValidatingElement$1(null);
5455 }
5456 }
5457 }
5458
5459 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
5460 {
5461 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
5462 // succeed and there will likely be errors in render.
5463
5464 if (!validType) {
5465 var info = '';
5466
5467 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
5468 info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
5469 }
5470
5471 var sourceInfo = getSourceInfoErrorAddendum(source);
5472
5473 if (sourceInfo) {
5474 info += sourceInfo;
5475 } else {
5476 info += getDeclarationErrorAddendum();
5477 }
5478
5479 var typeString;
5480
5481 if (type === null) {
5482 typeString = 'null';
5483 } else if (Array.isArray(type)) {
5484 typeString = 'array';
5485 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
5486 typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
5487 info = ' Did you accidentally export a JSX literal instead of a component?';
5488 } else {
5489 typeString = typeof type;
5490 }
5491
5492 error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
5493 }
5494
5495 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
5496 // TODO: Drop this when these are no longer allowed as the type argument.
5497
5498 if (element == null) {
5499 return element;
5500 } // Skip key warning if the type isn't valid since our key validation logic
5501 // doesn't expect a non-string/function type and can throw confusing errors.
5502 // We don't want exception behavior to differ between dev and prod.
5503 // (Rendering will throw with a helpful message and as soon as the type is
5504 // fixed, the key warnings will appear.)
5505
5506
5507 if (validType) {
5508 var children = props.children;
5509
5510 if (children !== undefined) {
5511 if (isStaticChildren) {
5512 if (Array.isArray(children)) {
5513 for (var i = 0; i < children.length; i++) {
5514 validateChildKeys(children[i], type);
5515 }
5516
5517 if (Object.freeze) {
5518 Object.freeze(children);
5519 }
5520 } else {
5521 error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
5522 }
5523 } else {
5524 validateChildKeys(children, type);
5525 }
5526 }
5527 }
5528
5529 if (type === exports.Fragment) {
5530 validateFragmentProps(element);
5531 } else {
5532 validatePropTypes(element);
5533 }
5534
5535 return element;
5536 }
5537 } // These two functions exist to still get child warnings in dev
5538 // even with the prod transform. This means that jsxDEV is purely
5539 // opt-in behavior for better messages but that we won't stop
5540 // giving you warnings if you use production apis.
5541
5542 function jsxWithValidationStatic(type, props, key) {
5543 {
5544 return jsxWithValidation(type, props, key, true);
5545 }
5546 }
5547 function jsxWithValidationDynamic(type, props, key) {
5548 {
5549 return jsxWithValidation(type, props, key, false);
5550 }
5551 }
5552
5553 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
5554 // for now we can ship identical prod functions
5555
5556 var jsxs = jsxWithValidationStatic ;
5557
5558 exports.jsx = jsx;
5559 exports.jsxs = jsxs;
5560 })();
5561 }
5562
5563
5564 /***/ }),
5565
5566 /***/ "./node_modules/react/jsx-runtime.js":
5567 /*!*******************************************!*\
5568 !*** ./node_modules/react/jsx-runtime.js ***!
5569 \*******************************************/
5570 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5571
5572 "use strict";
5573
5574
5575 if (false) {} else {
5576 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
5577 }
5578
5579
5580 /***/ }),
5581
5582 /***/ "react":
5583 /*!************************!*\
5584 !*** external "React" ***!
5585 \************************/
5586 /***/ ((module) => {
5587
5588 "use strict";
5589 module.exports = window["React"];
5590
5591 /***/ }),
5592
5593 /***/ "react-dom":
5594 /*!***************************!*\
5595 !*** external "ReactDOM" ***!
5596 \***************************/
5597 /***/ ((module) => {
5598
5599 "use strict";
5600 module.exports = window["ReactDOM"];
5601
5602 /***/ }),
5603
5604 /***/ "jquery":
5605 /*!*************************!*\
5606 !*** external "jQuery" ***!
5607 \*************************/
5608 /***/ ((module) => {
5609
5610 "use strict";
5611 module.exports = window["jQuery"];
5612
5613 /***/ }),
5614
5615 /***/ "@wordpress/i18n":
5616 /*!******************************!*\
5617 !*** external ["wp","i18n"] ***!
5618 \******************************/
5619 /***/ ((module) => {
5620
5621 "use strict";
5622 module.exports = window["wp"]["i18n"];
5623
5624 /***/ }),
5625
5626 /***/ "./node_modules/@linaria/react/dist/index.mjs":
5627 /*!****************************************************!*\
5628 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
5629 \****************************************************/
5630 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5631
5632 "use strict";
5633 __webpack_require__.r(__webpack_exports__);
5634 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5635 /* harmony export */ "styled": () => (/* binding */ styled_default)
5636 /* harmony export */ });
5637 /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js");
5638 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
5639 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
5640 // src/styled.ts
5641
5642
5643
5644 var isCapital = (ch) => ch.toUpperCase() === ch;
5645 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
5646 var omit = (obj, keys) => {
5647 const res = {};
5648 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
5649 res[key] = obj[key];
5650 });
5651 return res;
5652 };
5653 function filterProps(asIs, props, omitKeys) {
5654 const filteredProps = omit(props, omitKeys);
5655 if (!asIs) {
5656 const interopValidAttr = typeof _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] === "function" ? { default: _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] } : _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"];
5657 Object.keys(filteredProps).forEach((key) => {
5658 if (!interopValidAttr.default(key)) {
5659 delete filteredProps[key];
5660 }
5661 });
5662 }
5663 return filteredProps;
5664 }
5665 var warnIfInvalid = (value, componentName) => {
5666 if (true) {
5667 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
5668 return;
5669 }
5670 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
5671 console.warn(
5672 `An interpolation evaluated to '${stringified}' in the component '${componentName}', which is probably a mistake. You should explicitly cast or transform the value to a string.`
5673 );
5674 }
5675 };
5676 function styled(tag) {
5677 return (options) => {
5678 if (true) {
5679 if (Array.isArray(options)) {
5680 throw new Error(
5681 'Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup'
5682 );
5683 }
5684 }
5685 const render = (props, ref) => {
5686 const { as: component = tag, class: className } = props;
5687 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
5688 const filteredProps = filterProps(shouldKeepProps, props, [
5689 "as",
5690 "class"
5691 ]);
5692 filteredProps.ref = ref;
5693 filteredProps.className = options.atomic ? (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(options.class, filteredProps.className || className) : (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(filteredProps.className || className, options.class);
5694 const { vars } = options;
5695 if (vars) {
5696 const style = {};
5697 for (const name in vars) {
5698 const variable = vars[name];
5699 const result = variable[0];
5700 const unit = variable[1] || "";
5701 const value = typeof result === "function" ? result(props) : result;
5702 warnIfInvalid(value, options.name);
5703 style[`--${name}`] = `${value}${unit}`;
5704 }
5705 const ownStyle = filteredProps.style || {};
5706 const keys = Object.keys(ownStyle);
5707 if (keys.length > 0) {
5708 keys.forEach((key) => {
5709 style[key] = ownStyle[key];
5710 });
5711 }
5712 filteredProps.style = style;
5713 }
5714 if (tag.__linaria && tag !== component) {
5715 filteredProps.as = component;
5716 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
5717 }
5718 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
5719 };
5720 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
5721 const rest = omit(props, ["innerRef"]);
5722 return render(rest, props.innerRef);
5723 };
5724 Result.displayName = options.name;
5725 Result.__linaria = {
5726 className: options.class,
5727 extends: tag
5728 };
5729 return Result;
5730 };
5731 }
5732 var styled_default = true ? new Proxy(styled, {
5733 get(o, prop) {
5734 return o(prop);
5735 }
5736 }) : 0;
5737
5738 //# sourceMappingURL=index.mjs.map
5739
5740 /***/ }),
5741
5742 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
5743 /*!*******************************************************************************!*\
5744 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
5745 \*******************************************************************************/
5746 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5747
5748 "use strict";
5749 __webpack_require__.r(__webpack_exports__);
5750 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5751 /* harmony export */ "css": () => (/* binding */ css_default),
5752 /* harmony export */ "cx": () => (/* binding */ cx_default)
5753 /* harmony export */ });
5754 // src/css.ts
5755 var css = () => {
5756 throw new Error(
5757 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
5758 );
5759 };
5760 var css_default = css;
5761
5762 // src/cx.ts
5763 var cx = function cx2() {
5764 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
5765 const atomicClasses = {};
5766 const nonAtomicClasses = [];
5767 presentClassNames.forEach((arg) => {
5768 const individualClassNames = arg ? arg.split(" ") : [];
5769 individualClassNames.forEach((className) => {
5770 if (className.startsWith("atm_")) {
5771 const [, keyHash] = className.split("_");
5772 atomicClasses[keyHash] = className;
5773 } else {
5774 nonAtomicClasses.push(className);
5775 }
5776 });
5777 });
5778 const result = [];
5779 for (const keyHash in atomicClasses) {
5780 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
5781 result.push(atomicClasses[keyHash]);
5782 }
5783 }
5784 result.push(...nonAtomicClasses);
5785 return result.join(" ");
5786 };
5787 var cx_default = cx;
5788
5789 //# sourceMappingURL=index.mjs.map
5790
5791 /***/ })
5792
5793 /******/ });
5794 /************************************************************************/
5795 /******/ // The module cache
5796 /******/ var __webpack_module_cache__ = {};
5797 /******/
5798 /******/ // The require function
5799 /******/ function __webpack_require__(moduleId) {
5800 /******/ // Check if module is in cache
5801 /******/ var cachedModule = __webpack_module_cache__[moduleId];
5802 /******/ if (cachedModule !== undefined) {
5803 /******/ return cachedModule.exports;
5804 /******/ }
5805 /******/ // Create a new module (and put it into the cache)
5806 /******/ var module = __webpack_module_cache__[moduleId] = {
5807 /******/ // no module.id needed
5808 /******/ // no module.loaded needed
5809 /******/ exports: {}
5810 /******/ };
5811 /******/
5812 /******/ // Execute the module function
5813 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
5814 /******/
5815 /******/ // Return the exports of the module
5816 /******/ return module.exports;
5817 /******/ }
5818 /******/
5819 /************************************************************************/
5820 /******/ /* webpack/runtime/compat get default export */
5821 /******/ (() => {
5822 /******/ // getDefaultExport function for compatibility with non-harmony modules
5823 /******/ __webpack_require__.n = (module) => {
5824 /******/ var getter = module && module.__esModule ?
5825 /******/ () => (module['default']) :
5826 /******/ () => (module);
5827 /******/ __webpack_require__.d(getter, { a: getter });
5828 /******/ return getter;
5829 /******/ };
5830 /******/ })();
5831 /******/
5832 /******/ /* webpack/runtime/define property getters */
5833 /******/ (() => {
5834 /******/ // define getter functions for harmony exports
5835 /******/ __webpack_require__.d = (exports, definition) => {
5836 /******/ for(var key in definition) {
5837 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
5838 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
5839 /******/ }
5840 /******/ }
5841 /******/ };
5842 /******/ })();
5843 /******/
5844 /******/ /* webpack/runtime/global */
5845 /******/ (() => {
5846 /******/ __webpack_require__.g = (function() {
5847 /******/ if (typeof globalThis === 'object') return globalThis;
5848 /******/ try {
5849 /******/ return this || new Function('return this')();
5850 /******/ } catch (e) {
5851 /******/ if (typeof window === 'object') return window;
5852 /******/ }
5853 /******/ })();
5854 /******/ })();
5855 /******/
5856 /******/ /* webpack/runtime/hasOwnProperty shorthand */
5857 /******/ (() => {
5858 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
5859 /******/ })();
5860 /******/
5861 /******/ /* webpack/runtime/make namespace object */
5862 /******/ (() => {
5863 /******/ // define __esModule on exports
5864 /******/ __webpack_require__.r = (exports) => {
5865 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
5866 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5867 /******/ }
5868 /******/ Object.defineProperty(exports, '__esModule', { value: true });
5869 /******/ };
5870 /******/ })();
5871 /******/
5872 /************************************************************************/
5873 var __webpack_exports__ = {};
5874 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
5875 (() => {
5876 "use strict";
5877 /*!********************************!*\
5878 !*** ./scripts/entries/app.ts ***!
5879 \********************************/
5880 __webpack_require__.r(__webpack_exports__);
5881 /* harmony import */ var _utils_appUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/appUtils */ "./scripts/utils/appUtils.ts");
5882 /* harmony import */ var _iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../iframe/renderIframeApp */ "./scripts/iframe/renderIframeApp.tsx");
5883
5884
5885 (0,_utils_appUtils__WEBPACK_IMPORTED_MODULE_0__.initAppOnReady)(_iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__["default"]);
5886 })();
5887
5888 /******/ })()
5889 ;
5890 //# sourceMappingURL=leadin.js.map