PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.1.13
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.1.13
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.1.13, at build/leadin.js

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