PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.65
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.65
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 / gutenberg.js

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

13,617 lines 541.2 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/is-prop-valid/dist/is-prop-valid.browser.esm.js":
5 /*!*******************************************************************************!*\
6 !*** ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.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 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js");
16
17
18 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|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|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|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|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
19
20 var index = (0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
21 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
22 /* o */
23 && prop.charCodeAt(1) === 110
24 /* n */
25 && prop.charCodeAt(2) < 91;
26 }
27 /* Z+1 */
28 );
29
30 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index);
31
32
33 /***/ }),
34
35 /***/ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js":
36 /*!*******************************************************************************************************!*\
37 !*** ./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***!
38 \*******************************************************************************************************/
39 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
40
41 "use strict";
42 __webpack_require__.r(__webpack_exports__);
43 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
45 /* harmony export */ });
46 function memoize(fn) {
47 var cache = {};
48 return function (arg) {
49 if (cache[arg] === undefined) cache[arg] = fn(arg);
50 return cache[arg];
51 };
52 }
53
54 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
55
56
57 /***/ }),
58
59 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
60 /*!*******************************************************************!*\
61 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
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 */ "default": () => (/* binding */ memoize)
69 /* harmony export */ });
70 function memoize(fn) {
71 var cache = Object.create(null);
72 return function (arg) {
73 if (cache[arg] === undefined) cache[arg] = fn(arg);
74 return cache[arg];
75 };
76 }
77
78
79
80
81 /***/ }),
82
83 /***/ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js":
84 /*!*********************************************************************!*\
85 !*** ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js ***!
86 \*********************************************************************/
87 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
88
89 "use strict";
90 __webpack_require__.r(__webpack_exports__);
91 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
93 /* harmony export */ });
94 var unitlessKeys = {
95 animationIterationCount: 1,
96 borderImageOutset: 1,
97 borderImageSlice: 1,
98 borderImageWidth: 1,
99 boxFlex: 1,
100 boxFlexGroup: 1,
101 boxOrdinalGroup: 1,
102 columnCount: 1,
103 columns: 1,
104 flex: 1,
105 flexGrow: 1,
106 flexPositive: 1,
107 flexShrink: 1,
108 flexNegative: 1,
109 flexOrder: 1,
110 gridRow: 1,
111 gridRowEnd: 1,
112 gridRowSpan: 1,
113 gridRowStart: 1,
114 gridColumn: 1,
115 gridColumnEnd: 1,
116 gridColumnSpan: 1,
117 gridColumnStart: 1,
118 msGridRow: 1,
119 msGridRowSpan: 1,
120 msGridColumn: 1,
121 msGridColumnSpan: 1,
122 fontWeight: 1,
123 lineHeight: 1,
124 opacity: 1,
125 order: 1,
126 orphans: 1,
127 tabSize: 1,
128 widows: 1,
129 zIndex: 1,
130 zoom: 1,
131 WebkitLineClamp: 1,
132 // SVG-related properties
133 fillOpacity: 1,
134 floodOpacity: 1,
135 stopOpacity: 1,
136 strokeDasharray: 1,
137 strokeDashoffset: 1,
138 strokeMiterlimit: 1,
139 strokeOpacity: 1,
140 strokeWidth: 1
141 };
142
143 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unitlessKeys);
144
145
146 /***/ }),
147
148 /***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js":
149 /*!***********************************************************************************************************!*\
150 !*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***!
151 \***********************************************************************************************************/
152 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
153
154 "use strict";
155 __webpack_require__.r(__webpack_exports__);
156 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
157 /* harmony export */ "default": () => (/* binding */ isPropValid)
158 /* harmony export */ });
159 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js");
160
161
162 // eslint-disable-next-line no-undef
163 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|disableRemotePlayback|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
164
165 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
166 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
167 /* o */
168 && prop.charCodeAt(1) === 110
169 /* n */
170 && prop.charCodeAt(2) < 91;
171 }
172 /* Z+1 */
173 );
174
175
176
177
178 /***/ }),
179
180 /***/ "./scripts/api/wordpressApiClient.ts":
181 /*!*******************************************!*\
182 !*** ./scripts/api/wordpressApiClient.ts ***!
183 \*******************************************/
184 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
185
186 "use strict";
187 __webpack_require__.r(__webpack_exports__);
188 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
189 /* harmony export */ "disableInternalTracking": () => (/* binding */ disableInternalTracking),
190 /* harmony export */ "fetchAccessToken": () => (/* binding */ fetchAccessToken),
191 /* harmony export */ "fetchDisableInternalTracking": () => (/* binding */ fetchDisableInternalTracking),
192 /* harmony export */ "fetchProxyMappingsEnabled": () => (/* binding */ fetchProxyMappingsEnabled),
193 /* harmony export */ "getBusinessUnitId": () => (/* binding */ getBusinessUnitId),
194 /* harmony export */ "healthcheckRestApi": () => (/* binding */ healthcheckRestApi),
195 /* harmony export */ "refreshProxyMappingsCache": () => (/* binding */ refreshProxyMappingsCache),
196 /* harmony export */ "setBusinessUnitId": () => (/* binding */ setBusinessUnitId),
197 /* harmony export */ "skipReview": () => (/* binding */ skipReview),
198 /* harmony export */ "toggleProxyMappingsEnabled": () => (/* binding */ toggleProxyMappingsEnabled),
199 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
200 /* harmony export */ "updateHublet": () => (/* binding */ updateHublet)
201 /* harmony export */ });
202 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
203 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
204 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
205 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
206 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
207
208
209
210
211 function makeRequest(method, path) {
212 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
213 var queryParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
214 // eslint-disable-next-line compat/compat
215 var restApiUrl = new URL("".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restUrl, "leadin/v1").concat(path));
216 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_3__.addQueryObjectToUrl)(restApiUrl, queryParams);
217 return new Promise(function (resolve, reject) {
218 var payload = {
219 url: restApiUrl.toString(),
220 method: method,
221 contentType: 'application/json',
222 beforeSend: function beforeSend(xhr) {
223 return xhr.setRequestHeader('X-WP-Nonce', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restNonce);
224 },
225 success: resolve,
226 error: function error(response) {
227 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureMessage("HTTP Request to ".concat(restApiUrl, " failed with error ").concat(response.status, ": ").concat(response.responseText), {
228 fingerprint: ['{{ default }}', path, response.status, response.responseText]
229 });
230 reject(response);
231 }
232 };
233 if (method !== 'get') {
234 payload.data = JSON.stringify(data);
235 }
236 jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax(payload);
237 });
238 }
239 function healthcheckRestApi() {
240 return makeRequest('get', '/healthcheck');
241 }
242 function disableInternalTracking(value) {
243 return makeRequest('put', '/internal-tracking', value ? '1' : '0');
244 }
245 function fetchDisableInternalTracking() {
246 return makeRequest('get', '/internal-tracking').then(function (message) {
247 return {
248 message: message
249 };
250 });
251 }
252 function updateHublet(hublet) {
253 return makeRequest('put', '/hublet', {
254 hublet: hublet
255 });
256 }
257 function skipReview() {
258 return makeRequest('post', '/skip-review');
259 }
260 function trackConsent(canTrack) {
261 return makeRequest('post', '/track-consent', {
262 canTrack: canTrack
263 }).then(function (message) {
264 return {
265 message: message
266 };
267 });
268 }
269 function setBusinessUnitId(businessUnitId) {
270 return makeRequest('put', '/business-unit', {
271 businessUnitId: businessUnitId
272 });
273 }
274 function getBusinessUnitId() {
275 return makeRequest('get', '/business-unit');
276 }
277 function refreshProxyMappingsCache() {
278 return makeRequest('post', '/wp-mappings-cache-reset');
279 }
280 function fetchProxyMappingsEnabled() {
281 return makeRequest('get', '/wp-mappings-proxy-enabled');
282 }
283 function toggleProxyMappingsEnabled(value) {
284 return makeRequest('put', '/wp-mappings-proxy-enabled', value);
285 }
286 var ACCESS_TOKEN_CACHE_KEY = 'leadin_access_token';
287 var ACCESS_TOKEN_MIN_TTL_SECONDS = 300;
288 var accessTokenRequest = null;
289 function fetchAccessToken() {
290 try {
291 var cached = sessionStorage.getItem(ACCESS_TOKEN_CACHE_KEY);
292 if (cached) {
293 var _JSON$parse = JSON.parse(cached),
294 accessToken = _JSON$parse.accessToken,
295 expiresAt = _JSON$parse.expiresAt;
296 if (accessToken && expiresAt > Math.floor(Date.now() / 1000) + ACCESS_TOKEN_MIN_TTL_SECONDS) {
297 return Promise.resolve({
298 accessToken: accessToken,
299 expiresIn: expiresAt - Math.floor(Date.now() / 1000)
300 });
301 }
302 }
303 } catch (_) {}
304 if (!accessTokenRequest) {
305 accessTokenRequest = makeRequest('get', '/access-token').then(function (response) {
306 try {
307 sessionStorage.setItem(ACCESS_TOKEN_CACHE_KEY, JSON.stringify({
308 accessToken: response.accessToken,
309 expiresAt: Math.floor(Date.now() / 1000) + response.expiresIn
310 }));
311 } catch (_) {}
312 return response;
313 })["finally"](function () {
314 accessTokenRequest = null;
315 });
316 }
317 return accessTokenRequest;
318 }
319
320 /***/ }),
321
322 /***/ "./scripts/constants/defaultFormOptions.ts":
323 /*!*************************************************!*\
324 !*** ./scripts/constants/defaultFormOptions.ts ***!
325 \*************************************************/
326 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
327
328 "use strict";
329 __webpack_require__.r(__webpack_exports__);
330 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
331 /* harmony export */ "DEFAULT_OPTIONS": () => (/* binding */ DEFAULT_OPTIONS),
332 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
333 /* harmony export */ });
334 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
335 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
336
337 var BLANK_FORM = 'BLANK';
338 var NEWSLETTER_FORM = 'NEWSLETTER';
339 var CONTACT_US_FORM = 'CONTACT_US';
340 var EVENT_REGISTRATION_FORM = 'EVENT_REGISTRATION';
341 var TALK_TO_AN_EXPERT_FORM = 'TALK_TO_AN_EXPERT';
342 var BOOK_A_MEETING_FORM = 'BOOK_A_MEETING';
343 var GATED_CONTENT_FORM = 'GATED_CONTENT';
344 var DEFAULT_OPTIONS = {
345 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Templates', 'leadin'),
346 options: [{
347 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blank Form', 'leadin'),
348 value: BLANK_FORM
349 }, {
350 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Newsletter Form', 'leadin'),
351 value: NEWSLETTER_FORM
352 }, {
353 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact Us Form', 'leadin'),
354 value: CONTACT_US_FORM
355 }, {
356 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Event Registration Form', 'leadin'),
357 value: EVENT_REGISTRATION_FORM
358 }, {
359 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Talk to an Expert Form', 'leadin'),
360 value: TALK_TO_AN_EXPERT_FORM
361 }, {
362 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Book a Meeting Form', 'leadin'),
363 value: BOOK_A_MEETING_FORM
364 }, {
365 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gated Content Form', 'leadin'),
366 value: GATED_CONTENT_FORM
367 }]
368 };
369 function isDefaultForm(value) {
370 return value === BLANK_FORM || value === NEWSLETTER_FORM || value === CONTACT_US_FORM || value === EVENT_REGISTRATION_FORM || value === TALK_TO_AN_EXPERT_FORM || value === BOOK_A_MEETING_FORM || value === GATED_CONTENT_FORM;
371 }
372
373 /***/ }),
374
375 /***/ "./scripts/constants/leadinConfig.ts":
376 /*!*******************************************!*\
377 !*** ./scripts/constants/leadinConfig.ts ***!
378 \*******************************************/
379 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
380
381 "use strict";
382 __webpack_require__.r(__webpack_exports__);
383 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
384 /* harmony export */ "accountName": () => (/* binding */ accountName),
385 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
386 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
387 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
388 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
389 /* harmony export */ "decryptError": () => (/* binding */ decryptError),
390 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
391 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
392 /* harmony export */ "env": () => (/* binding */ env),
393 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
394 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
395 /* harmony export */ "hublet": () => (/* binding */ hublet),
396 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
397 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
398 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
399 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
400 /* harmony export */ "lastAuthorizeTime": () => (/* binding */ lastAuthorizeTime),
401 /* harmony export */ "lastDeauthorizeTime": () => (/* binding */ lastDeauthorizeTime),
402 /* harmony export */ "lastDisconnectTime": () => (/* binding */ lastDisconnectTime),
403 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
404 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
405 /* harmony export */ "locale": () => (/* binding */ locale),
406 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
407 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
408 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
409 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
410 /* harmony export */ "plugins": () => (/* binding */ plugins),
411 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
412 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
413 /* harmony export */ "portalId": () => (/* binding */ portalId),
414 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
415 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
416 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
417 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
418 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
419 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
420 /* harmony export */ "theme": () => (/* binding */ theme),
421 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
422 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
423 /* harmony export */ });
424 var _window$leadinConfig = window.leadinConfig,
425 accountName = _window$leadinConfig.accountName,
426 adminUrl = _window$leadinConfig.adminUrl,
427 activationTime = _window$leadinConfig.activationTime,
428 connectionStatus = _window$leadinConfig.connectionStatus,
429 deviceId = _window$leadinConfig.deviceId,
430 didDisconnect = _window$leadinConfig.didDisconnect,
431 env = _window$leadinConfig.env,
432 formsScript = _window$leadinConfig.formsScript,
433 meetingsScript = _window$leadinConfig.meetingsScript,
434 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
435 hublet = _window$leadinConfig.hublet,
436 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
437 hubspotNonce = _window$leadinConfig.hubspotNonce,
438 iframeUrl = _window$leadinConfig.iframeUrl,
439 impactLink = _window$leadinConfig.impactLink,
440 lastAuthorizeTime = _window$leadinConfig.lastAuthorizeTime,
441 lastDeauthorizeTime = _window$leadinConfig.lastDeauthorizeTime,
442 lastDisconnectTime = _window$leadinConfig.lastDisconnectTime,
443 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
444 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
445 locale = _window$leadinConfig.locale,
446 loginUrl = _window$leadinConfig.loginUrl,
447 phpVersion = _window$leadinConfig.phpVersion,
448 pluginPath = _window$leadinConfig.pluginPath,
449 plugins = _window$leadinConfig.plugins,
450 portalDomain = _window$leadinConfig.portalDomain,
451 portalEmail = _window$leadinConfig.portalEmail,
452 portalId = _window$leadinConfig.portalId,
453 redirectNonce = _window$leadinConfig.redirectNonce,
454 restNonce = _window$leadinConfig.restNonce,
455 restUrl = _window$leadinConfig.restUrl,
456 refreshToken = _window$leadinConfig.refreshToken,
457 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
458 theme = _window$leadinConfig.theme,
459 trackConsent = _window$leadinConfig.trackConsent,
460 wpVersion = _window$leadinConfig.wpVersion,
461 contentEmbed = _window$leadinConfig.contentEmbed,
462 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope,
463 decryptError = _window$leadinConfig.decryptError;
464
465
466 /***/ }),
467
468 /***/ "./scripts/gutenberg/Common/CalendarIcon.tsx":
469 /*!***************************************************!*\
470 !*** ./scripts/gutenberg/Common/CalendarIcon.tsx ***!
471 \***************************************************/
472 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
473
474 "use strict";
475 __webpack_require__.r(__webpack_exports__);
476 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
477 /* harmony export */ "default": () => (/* binding */ CalendarIcon)
478 /* harmony export */ });
479 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
480
481 function CalendarIcon() {
482 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
483 width: "18",
484 height: "18",
485 viewBox: "0 0 18 18",
486 fill: "none",
487 xmlns: "http://www.w3.org/2000/svg",
488 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
489 clipPath: "url(#clip0_903_1965)",
490 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
491 fillRule: "evenodd",
492 clipRule: "evenodd",
493 d: "M13.519 2.48009H15.069H15.0697C16.2619 2.48719 17.2262 3.45597 17.2262 4.65016V12.7434C17.223 12.9953 17.1203 13.2226 16.9549 13.3886L12.6148 17.7287C12.4488 17.8941 12.2214 17.9968 11.9689 18H3.29508C2.09637 18 1.125 17.0286 1.125 15.8299V4.65016C1.125 3.45404 2.09314 2.48396 3.28862 2.48009H4.83867V0.930032C4.83867 0.416577 5.25525 0 5.7687 0C6.28216 0 6.69874 0.416577 6.69874 0.930032V2.48009H11.6589V0.930032C11.6589 0.416577 12.0755 0 12.5889 0C13.1024 0 13.519 0.416577 13.519 0.930032V2.48009ZM2.98506 15.8312C2.99863 15.9882 3.12909 16.1115 3.28862 16.1141H11.5814L11.6589 16.0366V13.634C11.6589 12.9494 12.2143 12.394 12.899 12.394H15.2951L15.3726 12.3165V7.4338H2.98506V15.8312ZM4.83868 8.68029H6.07873H6.07937C6.42684 8.68029 6.71037 8.95478 6.72458 9.30032V14.2863C6.72458 14.6428 6.43524 14.9322 6.07873 14.9322H4.83868C4.48217 14.9322 4.19283 14.6428 4.19283 14.2863V9.32615C4.19283 8.96964 4.48217 8.68029 4.83868 8.68029ZM8.53298 8.68029H9.82469H9.82534C10.1728 8.68029 10.4563 8.95478 10.4705 9.30032V14.2863C10.4705 14.6428 10.1812 14.9322 9.82469 14.9322H8.53298C8.17647 14.9322 7.88712 14.6428 7.88712 14.2863V9.32615C7.88712 8.96964 8.17647 8.68029 8.53298 8.68029ZM13.519 8.68029H12.2789C11.9366 8.68029 11.6589 8.95801 11.6589 9.30032V10.5404C11.6589 10.8827 11.9366 11.1604 12.2789 11.1604H13.519C13.8613 11.1604 14.139 10.8827 14.139 10.5404V9.30032C14.139 8.95801 13.8613 8.68029 13.519 8.68029Z",
494 fill: "#FF7A59"
495 })
496 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
497 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath", {
498 id: "clip0_903_1965",
499 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", {
500 width: "18",
501 height: "18",
502 fill: "white"
503 })
504 })
505 })]
506 });
507 }
508
509 /***/ }),
510
511 /***/ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx":
512 /*!**********************************************************!*\
513 !*** ./scripts/gutenberg/Common/SidebarSprocketIcon.tsx ***!
514 \**********************************************************/
515 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
516
517 "use strict";
518 __webpack_require__.r(__webpack_exports__);
519 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
520 /* harmony export */ "default": () => (/* binding */ SidebarSprocketIcon)
521 /* harmony export */ });
522 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
523
524 function SidebarSprocketIcon() {
525 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", {
526 width: "20px",
527 height: "20px",
528 version: "1.1",
529 viewBox: "0 0 40 42",
530 xmlns: "http://www.w3.org/2000/svg",
531 xmlnsXlink: "http://www.w3.org/1999/xlink",
532 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
533 d: "M28.8989809,30.0402293 C25.817707,30.0402293 23.319363,27.5423949 23.319363,24.461121 C23.319363,21.3798471 25.817707,18.881758 28.8989809,18.881758 C31.98,18.881758 34.4780892,21.3798471 34.4780892,24.461121 C34.4780892,27.5423949 31.98,30.0402293 28.8989809,30.0402293 M30.5692994,13.7199745 L30.5692994,8.75717196 C31.864586,8.14519744 32.7723567,6.8346242 32.7723567,5.31360508 L32.7723567,5.1989554 C32.7723567,3.10010191 31.0546497,1.38264968 28.956051,1.38264968 L28.8414013,1.38264968 C26.7425478,1.38264968 25.0248408,3.10010191 25.0248408,5.1989554 L25.0248408,5.31360508 C25.0248408,6.8346242 25.9328662,8.14519744 27.2281529,8.75717196 L27.2281529,13.7202293 C25.2994904,14.0180637 23.5371974,14.8137325 22.0829299,15.9844331 L8.45643312,5.38417836 C8.54611464,5.0392102 8.6090446,4.6835414 8.60955416,4.310293 C8.61261148,1.93271338 6.68777072,0.00303184713 4.31019108,-2.5477707e-05 C1.93286624,-0.00308280255 0.0029299363,1.92175796 0.000127388535,4.29933756 C-0.0029299363,6.67666244 1.92191083,8.60634396 4.29949044,8.60940128 C5.07426752,8.6104204 5.7912102,8.390293 6.42,8.03284076 L19.8243312,18.4603567 C18.6842038,20.181121 18.0166879,22.2422675 18.0166879,24.461121 C18.0166879,26.7841784 18.7504458,28.9327134 19.9907006,30.7001019 L15.9142675,34.776535 C15.5919745,34.6799745 15.2574522,34.6122038 14.9033121,34.6122038 C12.9499363,34.6122038 11.3659873,36.1961529 11.3659873,38.1497834 C11.3659873,40.103414 12.9499363,41.6871084 14.9033121,41.6871084 C16.8571974,41.6871084 18.4408917,40.103414 18.4408917,38.1497834 C18.4408917,37.7958981 18.3733758,37.461121 18.2765605,37.1390828 L22.3089172,33.1067261 C24.1392357,34.5041784 26.4184713,35.3431592 28.8989809,35.3431592 C34.9089172,35.3431592 39.7810191,30.4710573 39.7810191,24.461121 C39.7810191,19.0203567 35.7840764,14.5255796 30.5692994,13.7199745",
534 id: "Fill-1",
535 fillRule: "evenodd"
536 })
537 });
538 }
539
540 /***/ }),
541
542 /***/ "./scripts/gutenberg/Common/SprocketIcon.tsx":
543 /*!***************************************************!*\
544 !*** ./scripts/gutenberg/Common/SprocketIcon.tsx ***!
545 \***************************************************/
546 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
547
548 "use strict";
549 __webpack_require__.r(__webpack_exports__);
550 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
551 /* harmony export */ "default": () => (/* binding */ SprocketIcon)
552 /* harmony export */ });
553 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
554
555 function SprocketIcon() {
556 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
557 width: "40px",
558 height: "42px",
559 viewBox: "0 0 40 42",
560 version: "1.1",
561 xmlns: "http://www.w3.org/2000/svg",
562 xmlnsXlink: "http://www.w3.org/1999/xlink",
563 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
564 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polygon", {
565 id: "path-1",
566 points: "0.000123751494 0 39.7808917 0 39.7808917 41.6871084 0.000123751494 41.6871084"
567 })
568 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
569 id: "Page-1",
570 stroke: "none",
571 strokeWidth: "1",
572 fill: "none",
573 fillRule: "evenodd",
574 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", {
575 id: "HubSpot-Sprocket---Full-Color",
576 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("mask", {
577 id: "mask-2",
578 fill: "white",
579 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("use", {
580 xlinkHref: "#path-1"
581 })
582 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
583 id: "path-1"
584 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
585 d: "M28.8989809,30.0402293 C25.817707,30.0402293 23.319363,27.5423949 23.319363,24.461121 C23.319363,21.3798471 25.817707,18.881758 28.8989809,18.881758 C31.98,18.881758 34.4780892,21.3798471 34.4780892,24.461121 C34.4780892,27.5423949 31.98,30.0402293 28.8989809,30.0402293 M30.5692994,13.7199745 L30.5692994,8.75717196 C31.864586,8.14519744 32.7723567,6.8346242 32.7723567,5.31360508 L32.7723567,5.1989554 C32.7723567,3.10010191 31.0546497,1.38264968 28.956051,1.38264968 L28.8414013,1.38264968 C26.7425478,1.38264968 25.0248408,3.10010191 25.0248408,5.1989554 L25.0248408,5.31360508 C25.0248408,6.8346242 25.9328662,8.14519744 27.2281529,8.75717196 L27.2281529,13.7202293 C25.2994904,14.0180637 23.5371974,14.8137325 22.0829299,15.9844331 L8.45643312,5.38417836 C8.54611464,5.0392102 8.6090446,4.6835414 8.60955416,4.310293 C8.61261148,1.93271338 6.68777072,0.00303184713 4.31019108,-2.5477707e-05 C1.93286624,-0.00308280255 0.0029299363,1.92175796 0.000127388535,4.29933756 C-0.0029299363,6.67666244 1.92191083,8.60634396 4.29949044,8.60940128 C5.07426752,8.6104204 5.7912102,8.390293 6.42,8.03284076 L19.8243312,18.4603567 C18.6842038,20.181121 18.0166879,22.2422675 18.0166879,24.461121 C18.0166879,26.7841784 18.7504458,28.9327134 19.9907006,30.7001019 L15.9142675,34.776535 C15.5919745,34.6799745 15.2574522,34.6122038 14.9033121,34.6122038 C12.9499363,34.6122038 11.3659873,36.1961529 11.3659873,38.1497834 C11.3659873,40.103414 12.9499363,41.6871084 14.9033121,41.6871084 C16.8571974,41.6871084 18.4408917,40.103414 18.4408917,38.1497834 C18.4408917,37.7958981 18.3733758,37.461121 18.2765605,37.1390828 L22.3089172,33.1067261 C24.1392357,34.5041784 26.4184713,35.3431592 28.8989809,35.3431592 C34.9089172,35.3431592 39.7810191,30.4710573 39.7810191,24.461121 C39.7810191,19.0203567 35.7840764,14.5255796 30.5692994,13.7199745",
586 id: "Fill-1",
587 fill: "#F3785B",
588 fillRule: "nonzero",
589 mask: "url(#mask-2)"
590 })]
591 })
592 })]
593 });
594 }
595
596 /***/ }),
597
598 /***/ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx":
599 /*!*************************************************************!*\
600 !*** ./scripts/gutenberg/Common/StylesheetErrorBondary.tsx ***!
601 \*************************************************************/
602 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
603
604 "use strict";
605 __webpack_require__.r(__webpack_exports__);
606 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
607 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
608 /* harmony export */ });
609 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
610 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
611 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
612 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
613
614
615
616 function StylesheetErrorBondary(_ref) {
617 var children = _ref.children;
618 var ref = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.useRefEffect)(function (element) {
619 var ownerDocument = element.ownerDocument;
620 if (ownerDocument && !ownerDocument.getElementById('leadin-gutenberg-css')) {
621 var link = ownerDocument.createElement('link');
622 link.id = 'leadin-gutenberg-css';
623 link.rel = 'stylesheet';
624 link.href = "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.pluginPath, "/build/gutenberg.css?ver=").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion);
625 ownerDocument.head.appendChild(link);
626 }
627 }, []);
628 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
629 ref: ref,
630 children: children
631 });
632 }
633 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StylesheetErrorBondary);
634
635 /***/ }),
636
637 /***/ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts":
638 /*!************************************************************!*\
639 !*** ./scripts/gutenberg/Common/useCustomCssBlockProps.ts ***!
640 \************************************************************/
641 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
642
643 "use strict";
644 __webpack_require__.r(__webpack_exports__);
645 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
646 /* harmony export */ "default": () => (/* binding */ useCustomCssBlockProps)
647 /* harmony export */ });
648 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
649 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
650
651 function useCustomCssBlockProps(defaultCssClasses) {
652 var blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
653 if (!blockProps.className || !blockProps.className.includes(defaultCssClasses)) {
654 blockProps.className = "".concat(blockProps.className, " ").concat(defaultCssClasses);
655 }
656 return blockProps;
657 }
658
659 /***/ }),
660
661 /***/ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx":
662 /*!*******************************************************!*\
663 !*** ./scripts/gutenberg/FormBlock/FormBlockSave.tsx ***!
664 \*******************************************************/
665 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
666
667 "use strict";
668 __webpack_require__.r(__webpack_exports__);
669 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
670 /* harmony export */ "default": () => (/* binding */ FormSaveBlock)
671 /* harmony export */ });
672 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
673 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
674 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
675 /* harmony import */ var _Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/useCustomCssBlockProps */ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts");
676 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
677 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
678 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
679 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
680 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
681 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
682
683
684
685 var DefaultCssClasses = 'wp-block-leadin-hubspot-form-block';
686 function FormSaveBlock(_ref) {
687 var attributes = _ref.attributes;
688 var portalId = attributes.portalId,
689 formId = attributes.formId,
690 embedVersion = attributes.embedVersion;
691 var blockProps = (0,_Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__["default"])(DefaultCssClasses);
692 if (portalId && formId) {
693 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, _objectSpread(_objectSpread({}, blockProps), {}, {
694 children: "[hubspot portal=\"".concat(portalId, "\" id=\"").concat(formId, "\" version=\"").concat(embedVersion, "\" type=\"form\"]")
695 }));
696 }
697 return null;
698 }
699
700 /***/ }),
701
702 /***/ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx":
703 /*!**************************************************************!*\
704 !*** ./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx ***!
705 \**************************************************************/
706 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
707
708 "use strict";
709 __webpack_require__.r(__webpack_exports__);
710 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
711 /* harmony export */ "default": () => (/* binding */ FormGutenbergPreview)
712 /* harmony export */ });
713 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
714 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
715 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
716 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
717 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
718
719
720
721
722 function FormGutenbergPreview() {
723 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
724 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
725 alt: "Create a new Hubspot Form",
726 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-form.png")
727 })
728 });
729 }
730
731 /***/ }),
732
733 /***/ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx":
734 /*!***********************************************************!*\
735 !*** ./scripts/gutenberg/FormBlock/registerFormBlock.tsx ***!
736 \***********************************************************/
737 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
738
739 "use strict";
740 __webpack_require__.r(__webpack_exports__);
741 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
742 /* harmony export */ "default": () => (/* binding */ registerFormBlock)
743 /* harmony export */ });
744 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
745 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
746 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
747 /* harmony import */ var _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/SprocketIcon */ "./scripts/gutenberg/Common/SprocketIcon.tsx");
748 /* harmony import */ var _Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/StylesheetErrorBondary */ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx");
749 /* harmony import */ var _FormBlockSave__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormBlockSave */ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx");
750 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
751 /* harmony import */ var _FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormGutenbergPreview */ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx");
752 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
753 /* harmony import */ var _shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/Form/FormEdit */ "./scripts/shared/Form/FormEdit.tsx");
754 /* harmony import */ var _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../shared/enums/connectionStatus */ "./scripts/shared/enums/connectionStatus.ts");
755 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
756 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);
757 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
758 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
759 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
760 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
761 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
762 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
763 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
764
765
766
767
768
769
770
771
772
773
774
775
776 function registerFormBlock() {
777 var editComponent = function editComponent(props) {
778 var isPreview = props.attributes.preview;
779 var isConnected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.connectionStatus === _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_9__["default"].Connected;
780 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_3__["default"], {
781 children: isPreview ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_6__["default"], {}) : isConnected ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_8__["default"], _objectSpread(_objectSpread({}, props), {}, {
782 origin: "gutenberg",
783 preview: true,
784 fullSiteEditor: (0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__.isFullSiteEditor)()
785 })) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
786 status: 401
787 })
788 });
789 };
790 // We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
791 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
792 return null;
793 }
794 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-form-block', {
795 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)('HubSpot Form', 'leadin'),
796 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)('Select and embed a HubSpot form', 'leadin'),
797 icon: _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
798 category: 'leadin-blocks',
799 attributes: {
800 portalId: {
801 type: 'string',
802 "default": ''
803 },
804 formId: {
805 type: 'string'
806 },
807 formName: {
808 type: 'string'
809 },
810 embedVersion: {
811 type: 'string'
812 },
813 preview: {
814 type: 'boolean',
815 "default": false
816 }
817 },
818 example: {
819 attributes: {
820 preview: true
821 }
822 },
823 edit: editComponent,
824 save: function save(props) {
825 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormBlockSave__WEBPACK_IMPORTED_MODULE_4__["default"], _objectSpread({}, props));
826 }
827 });
828 }
829
830 /***/ }),
831
832 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx":
833 /*!*********************************************************************!*\
834 !*** ./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx ***!
835 \*********************************************************************/
836 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
837
838 "use strict";
839 __webpack_require__.r(__webpack_exports__);
840 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
841 /* harmony export */ "default": () => (/* binding */ MeetingGutenbergPreview)
842 /* harmony export */ });
843 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
844 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
845 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
846 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
847 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
848
849
850
851
852 function MeetingGutenbergPreview() {
853 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
854 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
855 alt: "Create a new Hubspot Meeting",
856 width: "100%",
857 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-meetings.png")
858 })
859 });
860 }
861
862 /***/ }),
863
864 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx":
865 /*!**************************************************************!*\
866 !*** ./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx ***!
867 \**************************************************************/
868 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
869
870 "use strict";
871 __webpack_require__.r(__webpack_exports__);
872 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
873 /* harmony export */ "default": () => (/* binding */ MeetingSaveBlock)
874 /* harmony export */ });
875 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
876 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
877 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
878 /* harmony import */ var _Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/useCustomCssBlockProps */ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts");
879 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
880 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
881 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
882 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
883 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
884 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
885
886
887
888 var DefaultCssClasses = 'wp-block-leadin-hubspot-meeting-block';
889 function MeetingSaveBlock(_ref) {
890 var attributes = _ref.attributes;
891 var url = attributes.url;
892 var blockProps = (0,_Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__["default"])(DefaultCssClasses);
893 if (url) {
894 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, _objectSpread(_objectSpread({}, blockProps), {}, {
895 children: "[hubspot url=\"".concat(url, "\" type=\"meeting\"]")
896 }));
897 }
898 return null;
899 }
900
901 /***/ }),
902
903 /***/ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx":
904 /*!******************************************************************!*\
905 !*** ./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx ***!
906 \******************************************************************/
907 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
908
909 "use strict";
910 __webpack_require__.r(__webpack_exports__);
911 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
912 /* harmony export */ "default": () => (/* binding */ registerMeetingBlock)
913 /* harmony export */ });
914 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
915 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
916 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
917 /* harmony import */ var _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/CalendarIcon */ "./scripts/gutenberg/Common/CalendarIcon.tsx");
918 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
919 /* harmony import */ var _MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingGutenbergPreview */ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx");
920 /* harmony import */ var _MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MeetingSaveBlock */ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx");
921 /* harmony import */ var _shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Meeting/MeetingEdit */ "./scripts/shared/Meeting/MeetingEdit.tsx");
922 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
923 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
924 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
925 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
926 /* harmony import */ var _Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Common/StylesheetErrorBondary */ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx");
927 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
928 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
929 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
930 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
931 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
932 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
933
934
935
936
937
938
939
940
941
942
943
944 var ConnectionStatus = {
945 Connected: 'Connected',
946 NotConnected: 'NotConnected'
947 };
948 function registerMeetingBlock() {
949 var editComponent = function editComponent(props) {
950 var isPreview = props.attributes.preview;
951 var isConnected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.connectionStatus === ConnectionStatus.Connected;
952 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_10__["default"], {
953 children: isPreview ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__["default"], {}) : isConnected ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__["default"], _objectSpread(_objectSpread({}, props), {}, {
954 preview: true,
955 origin: "gutenberg",
956 fullSiteEditor: (0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__.isFullSiteEditor)()
957 })) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
958 status: 401
959 })
960 });
961 };
962 // We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
963 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
964 return null;
965 }
966 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-meeting-block', {
967 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Hubspot Meetings Scheduler', 'leadin'),
968 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Schedule meetings faster and forget the back-and-forth emails Your calendar stays full, and you stay productive', 'leadin'),
969 icon: _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
970 category: 'leadin-blocks',
971 attributes: {
972 url: {
973 type: 'string',
974 "default": ''
975 },
976 preview: {
977 type: 'boolean',
978 "default": false
979 }
980 },
981 example: {
982 attributes: {
983 preview: true
984 }
985 },
986 edit: editComponent,
987 save: function save(props) {
988 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__["default"], _objectSpread({}, props));
989 }
990 });
991 }
992
993 /***/ }),
994
995 /***/ "./scripts/gutenberg/Sidebar/contentType.tsx":
996 /*!***************************************************!*\
997 !*** ./scripts/gutenberg/Sidebar/contentType.tsx ***!
998 \***************************************************/
999 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1000
1001 "use strict";
1002 __webpack_require__.r(__webpack_exports__);
1003 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1004 /* harmony export */ "registerHubspotSidebar": () => (/* binding */ registerHubspotSidebar)
1005 /* harmony export */ });
1006 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1007 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1008 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1009 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
1010 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__);
1011 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
1012 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__);
1013 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1014 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
1015 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
1016 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
1017 /* harmony import */ var _UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../UIComponents/UISidebarSelectControl */ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx");
1018 /* harmony import */ var _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/SidebarSprocketIcon */ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx");
1019 /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
1020 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1021 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
1022 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1023 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
1024 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
1025 /* harmony import */ var _utils_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/isRefreshTokenAvailable */ "./scripts/utils/isRefreshTokenAvailable.ts");
1026 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
1027 var _templateObject;
1028 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
1029 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."); }
1030 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
1031 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1032 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
1033 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1034 function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050 function registerHubspotSidebar() {
1051 var ContentTypeLabelStyle = styled_components__WEBPACK_IMPORTED_MODULE_14__["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: normal;\n text-transform: none;\n "])));
1052 var ContentTypeLabel = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ContentTypeLabelStyle, {
1053 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Select the content type HubSpot Analytics uses to track this page', 'leadin')
1054 });
1055 var LeadinPluginSidebar = function LeadinPluginSidebar(_ref) {
1056 var postType = _ref.postType;
1057 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
1058 _useState2 = _slicedToArray(_useState, 2),
1059 embedder = _useState2[0],
1060 setEmbedder = _useState2[1];
1061 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1062 if ((0,_utils_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_12__.isRefreshTokenAvailable)()) {
1063 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_13__.fetchAccessToken)().then(function (_ref2) {
1064 var accessToken = _ref2.accessToken,
1065 expiresIn = _ref2.expiresIn;
1066 setEmbedder((0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__.getOrCreateBackgroundApp)(accessToken, expiresIn));
1067 })["catch"](function () {});
1068 }
1069 }, []);
1070 return postType && !(0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__.isFullSiteEditor)() ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_3__.PluginSidebar, {
1071 name: "leadin",
1072 title: "HubSpot",
1073 icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Icon, {
1074 className: "hs-plugin-sidebar-sprocket",
1075 icon: (0,_Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_7__["default"])()
1076 }),
1077 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
1078 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('HubSpot Analytics', 'leadin'),
1079 initialOpen: true,
1080 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_9__.BackgroudAppContext.Provider, {
1081 value: embedder,
1082 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_6__["default"], {
1083 metaKey: "content-type",
1084 className: "select-content-type",
1085 label: ContentTypeLabel,
1086 options: [{
1087 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Detect Automatically', 'leadin'),
1088 value: ''
1089 }, {
1090 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Blog Post', 'leadin'),
1091 value: 'blog-post'
1092 }, {
1093 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Knowledge Article', 'leadin'),
1094 value: 'knowledge-article'
1095 }, {
1096 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Landing Page', 'leadin'),
1097 value: 'landing-page'
1098 }, {
1099 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Listing Page', 'leadin'),
1100 value: 'listing-page'
1101 }, {
1102 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Standard Page', 'leadin'),
1103 value: 'standard-page'
1104 }]
1105 })
1106 })
1107 })
1108 }) : null;
1109 };
1110 var LeadinPluginSidebarWrapper = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.withSelect)(function (select) {
1111 var data = select('core/editor');
1112 return {
1113 postType: data && data.getCurrentPostType() && data.getEditedPostAttribute('meta')
1114 };
1115 })(LeadinPluginSidebar);
1116 if (_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__) {
1117 _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin('leadin', {
1118 render: LeadinPluginSidebarWrapper,
1119 icon: _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_7__["default"]
1120 });
1121 }
1122 }
1123
1124 /***/ }),
1125
1126 /***/ "./scripts/gutenberg/UIComponents/UIImage.ts":
1127 /*!***************************************************!*\
1128 !*** ./scripts/gutenberg/UIComponents/UIImage.ts ***!
1129 \***************************************************/
1130 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1131
1132 "use strict";
1133 __webpack_require__.r(__webpack_exports__);
1134 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1135 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1136 /* harmony export */ });
1137 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1138
1139 var _exp = /*#__PURE__*/function _exp() {
1140 return function (props) {
1141 return props.height ? props.height : 'auto';
1142 };
1143 };
1144 var _exp2 = /*#__PURE__*/function _exp2() {
1145 return function (props) {
1146 return props.width ? props.width : 'auto';
1147 };
1148 };
1149 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('img')({
1150 name: "UIImage0",
1151 "class": "ump7xqy",
1152 propsAsIs: false,
1153 vars: {
1154 "ump7xqy-0": [_exp()],
1155 "ump7xqy-1": [_exp2()]
1156 }
1157 }));
1158 __webpack_require__(/*! ./UIImage.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIImage.ts */ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts");
1159
1160 /***/ }),
1161
1162 /***/ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx":
1163 /*!*******************************************************************!*\
1164 !*** ./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx ***!
1165 \*******************************************************************/
1166 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1167
1168 "use strict";
1169 __webpack_require__.r(__webpack_exports__);
1170 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1171 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1172 /* harmony export */ });
1173 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1174 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1175 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
1176 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
1177 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1178 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1179 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1180 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1181 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1182 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
1183 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1184 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1185
1186
1187
1188
1189
1190 var UISidebarSelectControl = function UISidebarSelectControl(props) {
1191 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.useBackgroundAppContext)();
1192 var monitorSidebarMetaChange = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.usePostBackgroundMessage)();
1193 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, _objectSpread({
1194 value: props.metaValue,
1195 onChange: function onChange(content) {
1196 if (props.setMetaValue) {
1197 props.setMetaValue(content);
1198 }
1199 isBackgroundAppReady && monitorSidebarMetaChange({
1200 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.TrackSidebarMetaChange,
1201 payload: {
1202 metaKey: props.metaKey
1203 }
1204 });
1205 }
1206 }, props));
1207 };
1208 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__["default"])(UISidebarSelectControl));
1209
1210 /***/ }),
1211
1212 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
1213 /*!****************************************************************!*\
1214 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
1215 \****************************************************************/
1216 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1217
1218 "use strict";
1219 __webpack_require__.r(__webpack_exports__);
1220 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1221 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
1222 /* harmony export */ });
1223 var CoreMessages = {
1224 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
1225 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
1226 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
1227 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
1228 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
1229 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID',
1230 SendIntegratedAppConfig: 'INTEGRATED_APP_EMBEDDER_CONFIG'
1231 };
1232
1233 /***/ }),
1234
1235 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
1236 /*!******************************************************************!*\
1237 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
1238 \******************************************************************/
1239 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1240
1241 "use strict";
1242 __webpack_require__.r(__webpack_exports__);
1243 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1244 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
1245 /* harmony export */ });
1246 var FormMessages = {
1247 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
1248 };
1249
1250 /***/ }),
1251
1252 /***/ "./scripts/iframe/integratedMessages/index.ts":
1253 /*!****************************************************!*\
1254 !*** ./scripts/iframe/integratedMessages/index.ts ***!
1255 \****************************************************/
1256 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1257
1258 "use strict";
1259 __webpack_require__.r(__webpack_exports__);
1260 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1261 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
1262 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
1263 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
1264 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
1265 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
1266 /* harmony export */ });
1267 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
1268 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
1269 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
1270 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
1271 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
1272
1273
1274
1275
1276
1277
1278 /***/ }),
1279
1280 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
1281 /*!************************************************************************!*\
1282 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
1283 \************************************************************************/
1284 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1285
1286 "use strict";
1287 __webpack_require__.r(__webpack_exports__);
1288 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1289 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
1290 /* harmony export */ });
1291 var LiveChatMessages = {
1292 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
1293 };
1294
1295 /***/ }),
1296
1297 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
1298 /*!********************************************************************!*\
1299 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
1300 \********************************************************************/
1301 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1302
1303 "use strict";
1304 __webpack_require__.r(__webpack_exports__);
1305 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1306 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
1307 /* harmony export */ });
1308 var PluginMessages = {
1309 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
1310 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
1311 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
1312 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
1313 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
1314 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
1315 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
1316 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
1317 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
1318 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
1319 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
1320 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
1321 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
1322 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
1323 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
1324 SkipReviewError: 'SKIP_REVIEW_ERROR',
1325 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
1326 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
1327 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
1328 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
1329 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
1330 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
1331 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR',
1332 ProxyMappingsEnabledRequest: 'PROXY_MAPPINGS_ENABLED_REQUEST',
1333 ProxyMappingsEnabledResponse: 'PROXY_MAPPINGS_ENABLED_RESPONSE',
1334 ProxyMappingsEnabledError: 'PROXY_MAPPINGS_ENABLED_ERROR',
1335 ProxyMappingsEnabledChangeRequest: 'PROXY_MAPPINGS_ENABLED_CHANGE_REQUEST',
1336 ProxyMappingsEnabledChangeError: 'PROXY_MAPPINGS_ENABLED_CHANGE_ERROR',
1337 RefreshProxyMappingsRequest: 'REFRESH_PROXY_MAPPINGS_REQUEST',
1338 RefreshProxyMappingsResponse: 'REFRESH_PROXY_MAPPINGS_RESPONSE',
1339 RefreshProxyMappingsError: 'REFRESH_PROXY_MAPPINGS_ERROR'
1340 };
1341
1342 /***/ }),
1343
1344 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
1345 /*!******************************************************************!*\
1346 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
1347 \******************************************************************/
1348 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1349
1350 "use strict";
1351 __webpack_require__.r(__webpack_exports__);
1352 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1353 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
1354 /* harmony export */ });
1355 var ProxyMessages = {
1356 FetchForms: 'FETCH_FORMS',
1357 FetchForm: 'FETCH_FORM',
1358 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
1359 GetTemplateAvailability: 'GET_TEMPLATE_AVAILABILITY',
1360 FetchAuth: 'FETCH_AUTH',
1361 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
1362 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
1363 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
1364 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
1365 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
1366 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
1367 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
1368 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
1369 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
1370 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
1371 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
1372 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
1373 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
1374 };
1375
1376 /***/ }),
1377
1378 /***/ "./scripts/iframe/useBackgroundApp.ts":
1379 /*!********************************************!*\
1380 !*** ./scripts/iframe/useBackgroundApp.ts ***!
1381 \********************************************/
1382 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1383
1384 "use strict";
1385 __webpack_require__.r(__webpack_exports__);
1386 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1387 /* harmony export */ "BackgroudAppContext": () => (/* binding */ BackgroudAppContext),
1388 /* harmony export */ "useBackgroundAppContext": () => (/* binding */ useBackgroundAppContext),
1389 /* harmony export */ "usePostAsyncBackgroundMessage": () => (/* binding */ usePostAsyncBackgroundMessage),
1390 /* harmony export */ "usePostBackgroundMessage": () => (/* binding */ usePostBackgroundMessage)
1391 /* harmony export */ });
1392 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1393 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1394
1395 var BackgroudAppContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
1396 function useBackgroundAppContext() {
1397 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BackgroudAppContext);
1398 }
1399 function usePostBackgroundMessage() {
1400 var app = useBackgroundAppContext();
1401 return function (message) {
1402 app.postMessage(message);
1403 };
1404 }
1405 function usePostAsyncBackgroundMessage() {
1406 var app = useBackgroundAppContext();
1407 return function (message) {
1408 return app.postAsyncMessage(message);
1409 };
1410 }
1411
1412 /***/ }),
1413
1414 /***/ "./scripts/lib/Raven.ts":
1415 /*!******************************!*\
1416 !*** ./scripts/lib/Raven.ts ***!
1417 \******************************/
1418 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1419
1420 "use strict";
1421 __webpack_require__.r(__webpack_exports__);
1422 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1423 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
1424 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1425 /* harmony export */ });
1426 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
1427 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
1428 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1429
1430
1431 function configureRaven() {
1432 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('local') !== -1) {
1433 return;
1434 }
1435 var domain = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.replace(/https?:\/\/app/, '');
1436 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config("https://a9f08e536ef66abb0bf90becc905b09e@exceptions".concat(domain, "/v2/1"), {
1437 instrument: {
1438 tryCatch: false
1439 },
1440 shouldSendCallback: function shouldSendCallback(data) {
1441 return !!data && !!data.culprit && /plugins\/leadin\//.test(data.culprit);
1442 },
1443 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
1444 }).install();
1445 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
1446 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
1447 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
1448 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
1449 });
1450 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
1451 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
1452 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
1453 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
1454 }).join(',')
1455 });
1456 }
1457 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
1458
1459 /***/ }),
1460
1461 /***/ "./scripts/shared/Common/AsyncSelect.tsx":
1462 /*!***********************************************!*\
1463 !*** ./scripts/shared/Common/AsyncSelect.tsx ***!
1464 \***********************************************/
1465 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1466
1467 "use strict";
1468 __webpack_require__.r(__webpack_exports__);
1469 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1470 /* harmony export */ "default": () => (/* binding */ AsyncSelect)
1471 /* harmony export */ });
1472 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1473 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1474 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1475 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1476 /* harmony import */ var _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/colors */ "./scripts/shared/UIComponents/colors.ts");
1477 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1478 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1479 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
1480 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."); }
1481 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
1482 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1483 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
1484 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1485
1486
1487
1488
1489
1490
1491 var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1492 name: "Container",
1493 "class": "c1wxx7eu",
1494 propsAsIs: false
1495 });
1496 var _exp2 = /*#__PURE__*/function _exp2() {
1497 return function (props) {
1498 return props.focused ? '0' : '1px';
1499 };
1500 };
1501 var _exp3 = /*#__PURE__*/function _exp3() {
1502 return function (props) {
1503 return props.focused ? "0 0 0 2px ".concat(_UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM) : 'none';
1504 };
1505 };
1506 var ControlContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1507 name: "ControlContainer",
1508 "class": "c1rgwbep",
1509 propsAsIs: false,
1510 vars: {
1511 "c1rgwbep-0": [_exp2()],
1512 "c1rgwbep-1": [_exp3()]
1513 }
1514 });
1515 var ValueContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1516 name: "ValueContainer",
1517 "class": "v1mdmbaj",
1518 propsAsIs: false
1519 });
1520 var Placeholder = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1521 name: "Placeholder",
1522 "class": "p1gwkvxy",
1523 propsAsIs: false
1524 });
1525 var SingleValue = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1526 name: "SingleValue",
1527 "class": "s1bwlafs",
1528 propsAsIs: false
1529 });
1530 var IndicatorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1531 name: "IndicatorContainer",
1532 "class": "i196z9y5",
1533 propsAsIs: false
1534 });
1535 var DropdownIndicator = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1536 name: "DropdownIndicator",
1537 "class": "d1dfo5ow",
1538 propsAsIs: false
1539 });
1540 var InputContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1541 name: "InputContainer",
1542 "class": "if3lze",
1543 propsAsIs: false
1544 });
1545 var Input = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('input')({
1546 name: "Input",
1547 "class": "i9kxf50",
1548 propsAsIs: false
1549 });
1550 var InputShadow = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1551 name: "InputShadow",
1552 "class": "igjr3uc",
1553 propsAsIs: false
1554 });
1555 var MenuContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1556 name: "MenuContainer",
1557 "class": "mhb9if7",
1558 propsAsIs: false
1559 });
1560 var MenuList = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1561 name: "MenuList",
1562 "class": "mxaof7s",
1563 propsAsIs: false
1564 });
1565 var MenuGroup = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1566 name: "MenuGroup",
1567 "class": "mw50s5v",
1568 propsAsIs: false
1569 });
1570 var MenuGroupHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1571 name: "MenuGroupHeader",
1572 "class": "m11rzvjw",
1573 propsAsIs: false
1574 });
1575 var _exp5 = /*#__PURE__*/function _exp5() {
1576 return function (props) {
1577 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : 'transparent';
1578 };
1579 };
1580 var _exp6 = /*#__PURE__*/function _exp6() {
1581 return function (props) {
1582 return props.selected ? '#fff' : 'inherit';
1583 };
1584 };
1585 var _exp7 = /*#__PURE__*/function _exp7() {
1586 return function (props) {
1587 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_LIGHT;
1588 };
1589 };
1590 var MenuItem = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1591 name: "MenuItem",
1592 "class": "m1jcdsjv",
1593 propsAsIs: false,
1594 vars: {
1595 "m1jcdsjv-0": [_exp5()],
1596 "m1jcdsjv-1": [_exp6()],
1597 "m1jcdsjv-2": [_exp7()]
1598 }
1599 });
1600 function AsyncSelect(_ref) {
1601 var placeholder = _ref.placeholder,
1602 value = _ref.value,
1603 loadOptions = _ref.loadOptions,
1604 onChange = _ref.onChange,
1605 defaultOptions = _ref.defaultOptions;
1606 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1607 var inputShadowEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1608 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
1609 _useState2 = _slicedToArray(_useState, 2),
1610 isFocused = _useState2[0],
1611 setFocus = _useState2[1];
1612 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded),
1613 _useState4 = _slicedToArray(_useState3, 2),
1614 loadState = _useState4[0],
1615 setLoadState = _useState4[1];
1616 var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
1617 _useState6 = _slicedToArray(_useState5, 2),
1618 localValue = _useState6[0],
1619 setLocalValue = _useState6[1];
1620 var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(defaultOptions),
1621 _useState8 = _slicedToArray(_useState7, 2),
1622 options = _useState8[0],
1623 setOptions = _useState8[1];
1624 var inputSize = "".concat(inputShadowEl.current ? inputShadowEl.current.clientWidth + 10 : 2, "px");
1625 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1626 if (loadOptions && loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded) {
1627 loadOptions('', function (result) {
1628 setOptions(result);
1629 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1630 });
1631 }
1632 }, [loadOptions, loadState]);
1633 var _renderItems = function renderItems() {
1634 var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1635 var parentKey = arguments.length > 1 ? arguments[1] : undefined;
1636 return items.map(function (item, index) {
1637 if (item.options) {
1638 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MenuGroup, {
1639 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuGroupHeader, {
1640 id: "".concat(index, "-heading"),
1641 children: item.label
1642 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
1643 children: _renderItems(item.options, index)
1644 })]
1645 }, "async-select-item-".concat(index));
1646 } else {
1647 var key = "async-select-item-".concat(parentKey !== undefined ? "".concat(parentKey, "-").concat(index) : index);
1648 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuItem, {
1649 id: key,
1650 selected: value && item.value === value.value,
1651 onClick: function onClick() {
1652 onChange(item);
1653 setFocus(false);
1654 },
1655 children: item.label
1656 }, key);
1657 }
1658 });
1659 };
1660 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Container, {
1661 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ControlContainer, {
1662 id: "leadin-async-selector",
1663 focused: isFocused,
1664 onClick: function onClick() {
1665 if (isFocused) {
1666 if (inputEl.current) {
1667 inputEl.current.blur();
1668 }
1669 setFocus(false);
1670 setLocalValue('');
1671 } else {
1672 if (inputEl.current) {
1673 inputEl.current.focus();
1674 }
1675 setFocus(true);
1676 }
1677 },
1678 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ValueContainer, {
1679 children: [localValue === '' && (!value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Placeholder, {
1680 children: placeholder
1681 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SingleValue, {
1682 children: value.label
1683 })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(InputContainer, {
1684 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Input, {
1685 ref: inputEl,
1686 onFocus: function onFocus() {
1687 setFocus(true);
1688 },
1689 onChange: function onChange(e) {
1690 setLocalValue(e.target.value);
1691 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading);
1692 loadOptions && loadOptions(e.target.value, function (result) {
1693 setOptions(result);
1694 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1695 });
1696 },
1697 value: localValue,
1698 width: inputSize,
1699 id: "asycn-select-input"
1700 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputShadow, {
1701 ref: inputShadowEl,
1702 children: localValue
1703 })]
1704 })]
1705 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IndicatorContainer, {
1706 children: [loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__["default"], {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DropdownIndicator, {})]
1707 })]
1708 }), isFocused && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuContainer, {
1709 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuList, {
1710 children: _renderItems(options)
1711 })
1712 })]
1713 });
1714 }
1715 __webpack_require__(/*! ./AsyncSelect.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./AsyncSelect.tsx */ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx");
1716
1717 /***/ }),
1718
1719 /***/ "./scripts/shared/Common/ErrorHandler.tsx":
1720 /*!************************************************!*\
1721 !*** ./scripts/shared/Common/ErrorHandler.tsx ***!
1722 \************************************************/
1723 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1724
1725 "use strict";
1726 __webpack_require__.r(__webpack_exports__);
1727 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1728 /* harmony export */ "default": () => (/* binding */ ErrorHandler)
1729 /* harmony export */ });
1730 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1731 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
1732 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1733 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1734 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1735 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1736 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
1737
1738
1739
1740
1741
1742
1743
1744 function redirectToPlugin() {
1745 window.location.href = "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.adminUrl, "admin.php?page=leadin&leadin_expired=").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.redirectNonce);
1746 }
1747 function ErrorHandler(_ref) {
1748 var status = _ref.status,
1749 resetErrorState = _ref.resetErrorState,
1750 _ref$errorInfo = _ref.errorInfo,
1751 errorInfo = _ref$errorInfo === void 0 ? {
1752 header: '',
1753 message: '',
1754 action: ''
1755 } : _ref$errorInfo;
1756 var isUnauthorized = status === 401 || status === 403;
1757 var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header;
1758 var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools', 'leadin') : errorInfo.message;
1759 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
1760 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath,
1761 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], {
1762 textAlign: "center",
1763 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1764 children: errorHeader
1765 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1766 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1767 children: errorMessage
1768 })
1769 }), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1770 "data-test-id": "authorize-button",
1771 onClick: redirectToPlugin,
1772 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin')
1773 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1774 "data-test-id": "retry-button",
1775 onClick: resetErrorState,
1776 children: errorInfo.action
1777 })]
1778 })
1779 });
1780 }
1781
1782 /***/ }),
1783
1784 /***/ "./scripts/shared/Common/HubspotWrapper.ts":
1785 /*!*************************************************!*\
1786 !*** ./scripts/shared/Common/HubspotWrapper.ts ***!
1787 \*************************************************/
1788 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1789
1790 "use strict";
1791 __webpack_require__.r(__webpack_exports__);
1792 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1793 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1794 /* harmony export */ });
1795 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1796
1797 var _exp = /*#__PURE__*/function _exp() {
1798 return function (props) {
1799 return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)");
1800 };
1801 };
1802 var _exp2 = /*#__PURE__*/function _exp2() {
1803 return function (props) {
1804 return props.padding || '90px 20% 25px';
1805 };
1806 };
1807 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
1808 name: "HubspotWrapper0",
1809 "class": "h1q5v5ee",
1810 propsAsIs: false,
1811 vars: {
1812 "h1q5v5ee-0": [_exp()],
1813 "h1q5v5ee-1": [_exp2()]
1814 }
1815 }));
1816 __webpack_require__(/*! ./HubspotWrapper.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./HubspotWrapper.ts */ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts");
1817
1818 /***/ }),
1819
1820 /***/ "./scripts/shared/Common/LoadingBlock.tsx":
1821 /*!************************************************!*\
1822 !*** ./scripts/shared/Common/LoadingBlock.tsx ***!
1823 \************************************************/
1824 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1825
1826 "use strict";
1827 __webpack_require__.r(__webpack_exports__);
1828 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1829 /* harmony export */ "default": () => (/* binding */ LoadingBlock)
1830 /* harmony export */ });
1831 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1832 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1833 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1834 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1835
1836
1837
1838
1839 function LoadingBlock() {
1840 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1841 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1842 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
1843 size: 50
1844 })
1845 });
1846 }
1847
1848 /***/ }),
1849
1850 /***/ "./scripts/shared/Common/PreviewDisabled.tsx":
1851 /*!***************************************************!*\
1852 !*** ./scripts/shared/Common/PreviewDisabled.tsx ***!
1853 \***************************************************/
1854 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1855
1856 "use strict";
1857 __webpack_require__.r(__webpack_exports__);
1858 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1859 /* harmony export */ "default": () => (/* binding */ PreviewDisabled)
1860 /* harmony export */ });
1861 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1862 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1863 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1864 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1865 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1866 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
1867
1868
1869
1870
1871
1872 function PreviewDisabled() {
1873 var errorHeader = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Preview Unavailable', 'leadin');
1874 var errorMessage = "".concat((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('This block cannot be previewed within the Full Site Editor', 'leadin'), " ").concat((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Switch to the Block Editor to view the content', 'leadin'));
1875 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
1876 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1877 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__["default"], {
1878 textAlign: "center",
1879 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1880 children: errorHeader
1881 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1882 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1883 children: errorMessage
1884 })
1885 })]
1886 })
1887 });
1888 }
1889
1890 /***/ }),
1891
1892 /***/ "./scripts/shared/Form/FormEdit.tsx":
1893 /*!******************************************!*\
1894 !*** ./scripts/shared/Form/FormEdit.tsx ***!
1895 \******************************************/
1896 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1897
1898 "use strict";
1899 __webpack_require__.r(__webpack_exports__);
1900 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1901 /* harmony export */ "default": () => (/* binding */ FormEditContainer)
1902 /* harmony export */ });
1903 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1904 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1905 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1906 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1907 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
1908 /* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx");
1909 /* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx");
1910 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1911 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1912 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1913 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
1914 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1915 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1916 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1917 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
1918 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1919 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930 function FormEdit(_ref) {
1931 var attributes = _ref.attributes,
1932 isSelected = _ref.isSelected,
1933 setAttributes = _ref.setAttributes,
1934 _ref$preview = _ref.preview,
1935 preview = _ref$preview === void 0 ? true : _ref$preview,
1936 _ref$origin = _ref.origin,
1937 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
1938 fullSiteEditor = _ref.fullSiteEditor;
1939 var formId = attributes.formId,
1940 formName = attributes.formName,
1941 embedVersion = attributes.embedVersion;
1942 var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId;
1943 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)();
1944 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)();
1945 var handleChange = function handleChange(selectedForm) {
1946 setAttributes({
1947 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1948 formId: selectedForm.value,
1949 formName: selectedForm.label,
1950 embedVersion: selectedForm.embedVersion
1951 });
1952 };
1953 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1954 monitorFormPreviewRender({
1955 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender,
1956 payload: {
1957 origin: origin
1958 }
1959 });
1960 }, [origin]);
1961 return !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__["default"], {}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1962 children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], {
1963 formId: formId,
1964 formName: formName,
1965 handleChange: handleChange,
1966 origin: origin,
1967 embedVersion: embedVersion
1968 }), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1969 children: [isSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__["default"], {}), preview && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewForm__WEBPACK_IMPORTED_MODULE_4__["default"], {
1970 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1971 formId: formId,
1972 fullSiteEditor: fullSiteEditor,
1973 embedVersion: embedVersion
1974 })]
1975 })]
1976 });
1977 }
1978 function FormEditContainer(props) {
1979 var _useGetEmbedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_9__.useGetEmbedder)(),
1980 embedder = _useGetEmbedder.embedder,
1981 errorElement = _useGetEmbedder.errorElement,
1982 isLoading = _useGetEmbedder.isLoading;
1983 if (errorElement) {
1984 return errorElement;
1985 }
1986 if (isLoading) {
1987 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__["default"], {});
1988 }
1989 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, {
1990 value: embedder,
1991 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props))
1992 });
1993 }
1994
1995 /***/ }),
1996
1997 /***/ "./scripts/shared/Form/FormSelect.tsx":
1998 /*!********************************************!*\
1999 !*** ./scripts/shared/Form/FormSelect.tsx ***!
2000 \********************************************/
2001 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2002
2003 "use strict";
2004 __webpack_require__.r(__webpack_exports__);
2005 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2006 /* harmony export */ "default": () => (/* binding */ FormSelect)
2007 /* harmony export */ });
2008 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2009 /* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx");
2010 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2011 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2012 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
2013 /* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts");
2014 /* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts");
2015 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
2016 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2017
2018
2019
2020
2021
2022
2023
2024
2025 function FormSelect(_ref) {
2026 var formId = _ref.formId,
2027 formName = _ref.formName,
2028 handleChange = _ref.handleChange,
2029 _ref$origin = _ref.origin,
2030 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
2031 embedVersion = _ref.embedVersion;
2032 var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2033 search = _useForms.search,
2034 formApiError = _useForms.formApiError,
2035 reset = _useForms.reset;
2036 var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin),
2037 createFormByTemplate = _useCreateFormFromTem.createFormByTemplate,
2038 createReset = _useCreateFormFromTem.reset,
2039 isCreating = _useCreateFormFromTem.isCreating,
2040 hasError = _useCreateFormFromTem.hasError,
2041 createApiError = _useCreateFormFromTem.formApiError;
2042 var value = formId && formName ? {
2043 label: formName,
2044 value: formId,
2045 embedVersion: embedVersion
2046 } : null;
2047 var handleLocalChange = function handleLocalChange(option) {
2048 if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) {
2049 createFormByTemplate(option.value).then(function (_ref2) {
2050 var guid = _ref2.guid,
2051 name = _ref2.name;
2052 handleChange({
2053 value: guid,
2054 label: name,
2055 embedVersion: 'v4'
2056 });
2057 });
2058 } else {
2059 handleChange(option);
2060 }
2061 };
2062 return isCreating ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {}) : formApiError || createApiError ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
2063 status: formApiError ? formApiError.status : createApiError.status,
2064 resetErrorState: function resetErrorState() {
2065 if (hasError) {
2066 createReset();
2067 } else {
2068 reset();
2069 }
2070 },
2071 errorInfo: {
2072 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'),
2073 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes', 'leadin'),
2074 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin')
2075 }
2076 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], {
2077 loadOptions: search,
2078 onChange: function onChange(option) {
2079 return handleLocalChange(option);
2080 },
2081 value: value
2082 });
2083 }
2084
2085 /***/ }),
2086
2087 /***/ "./scripts/shared/Form/FormSelector.tsx":
2088 /*!**********************************************!*\
2089 !*** ./scripts/shared/Form/FormSelector.tsx ***!
2090 \**********************************************/
2091 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2092
2093 "use strict";
2094 __webpack_require__.r(__webpack_exports__);
2095 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2096 /* harmony export */ "default": () => (/* binding */ FormSelector)
2097 /* harmony export */ });
2098 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2099 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2100 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2101 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2102 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2103 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2104
2105
2106
2107
2108
2109 function FormSelector(_ref) {
2110 var loadOptions = _ref.loadOptions,
2111 onChange = _ref.onChange,
2112 value = _ref.value;
2113 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
2114 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath,
2115 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
2116 "data-test-id": "leadin-form-select",
2117 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2118 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin')
2119 })
2120 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], {
2121 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'),
2122 value: value,
2123 loadOptions: loadOptions,
2124 onChange: onChange
2125 })]
2126 });
2127 }
2128
2129 /***/ }),
2130
2131 /***/ "./scripts/shared/Form/PreviewForm.tsx":
2132 /*!*********************************************!*\
2133 !*** ./scripts/shared/Form/PreviewForm.tsx ***!
2134 \*********************************************/
2135 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2136
2137 "use strict";
2138 __webpack_require__.r(__webpack_exports__);
2139 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2140 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2141 /* harmony export */ });
2142 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2143 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2144 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2145 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2146 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2147 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2148 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2149 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2150 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2151 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2152 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2153 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2154
2155
2156
2157
2158
2159 function PreviewForm(_ref) {
2160 var portalId = _ref.portalId,
2161 formId = _ref.formId,
2162 fullSiteEditor = _ref.fullSiteEditor,
2163 embedVersion = _ref.embedVersion;
2164 var isFormV4 = embedVersion === 'v4';
2165 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2166 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2167 if (inputEl.current) {
2168 //@ts-expect-error Hubspot global
2169 var hbspt = window.parent.hbspt || window.hbspt;
2170 inputEl.current.innerHTML = '';
2171 var isQa = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScriptPayload.includes('qa');
2172 if (isFormV4) {
2173 var container = document.createElement('div');
2174 container.classList.add('hs-form-frame');
2175 container.dataset.region = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet;
2176 container.dataset.formId = formId;
2177 container.dataset.portalId = portalId.toString();
2178 container.dataset.env = isQa ? 'qa' : '';
2179 inputEl.current.appendChild(container);
2180 } else {
2181 var additionalParams = isQa ? {
2182 env: 'qa'
2183 } : {};
2184 hbspt.forms.create(_objectSpread({
2185 portalId: portalId,
2186 formId: formId,
2187 region: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet,
2188 target: "#".concat(inputEl.current.id)
2189 }, additionalParams));
2190 }
2191 }
2192 }, [formId, portalId, inputEl, isFormV4]);
2193 if (fullSiteEditor) {
2194 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__["default"], {});
2195 }
2196 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2197 ref: inputEl,
2198 id: "hbspt-previewform-".concat(formId)
2199 });
2200 }
2201
2202 /***/ }),
2203
2204 /***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts":
2205 /*!****************************************************************!*\
2206 !*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***!
2207 \****************************************************************/
2208 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2209
2210 "use strict";
2211 __webpack_require__.r(__webpack_exports__);
2212 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2213 /* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate)
2214 /* harmony export */ });
2215 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2216 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2217 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2218 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2219 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2220 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2221 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."); }
2222 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2223 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2224 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2225 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2226
2227
2228
2229
2230 function useCreateFormFromTemplate() {
2231 var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg';
2232 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2233 var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)();
2234 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle),
2235 _useState2 = _slicedToArray(_useState, 2),
2236 loadState = _useState2[0],
2237 setLoadState = _useState2[1];
2238 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2239 _useState4 = _slicedToArray(_useState3, 2),
2240 formApiError = _useState4[0],
2241 setFormApiError = _useState4[1];
2242 var createFormByTemplate = function createFormByTemplate(type) {
2243 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2244 track({
2245 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate,
2246 payload: {
2247 type: type,
2248 origin: origin
2249 }
2250 });
2251 return proxy({
2252 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate,
2253 payload: {
2254 type: type,
2255 embedVersion: 'v4'
2256 }
2257 }).then(function (form) {
2258 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2259 return form;
2260 })["catch"](function (err) {
2261 setFormApiError(err);
2262 track({
2263 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed,
2264 payload: {
2265 origin: origin
2266 }
2267 });
2268 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2269 });
2270 };
2271 return {
2272 isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading,
2273 hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed,
2274 formApiError: formApiError,
2275 createFormByTemplate: createFormByTemplate,
2276 reset: function reset() {
2277 return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2278 }
2279 };
2280 }
2281
2282 /***/ }),
2283
2284 /***/ "./scripts/shared/Form/hooks/useForms.ts":
2285 /*!***********************************************!*\
2286 !*** ./scripts/shared/Form/hooks/useForms.ts ***!
2287 \***********************************************/
2288 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2289
2290 "use strict";
2291 __webpack_require__.r(__webpack_exports__);
2292 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2293 /* harmony export */ "default": () => (/* binding */ useForms)
2294 /* harmony export */ });
2295 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2296 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2297 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
2298 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
2299 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2300 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2301 /* harmony import */ var _useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useGetTemplateAvailability */ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts");
2302 function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2303 function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2304 function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
2305 function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2306 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2307 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."); }
2308 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2309 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2310 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2311 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2312
2313
2314
2315
2316
2317 function useForms() {
2318 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2319 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2320 _useState2 = _slicedToArray(_useState, 2),
2321 formApiError = _useState2[0],
2322 setFormApiError = _useState2[1];
2323 var _useGetTemplateAvaila = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2324 availabilityPromise = _useGetTemplateAvaila.availabilityPromise;
2325 var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) {
2326 return Promise.all([availabilityPromise, proxy({
2327 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchForms,
2328 payload: {
2329 search: search
2330 }
2331 })]).then(function (_ref) {
2332 var _ref2 = _slicedToArray(_ref, 2),
2333 templateAvailabilityResponse = _ref2[0],
2334 forms = _ref2[1];
2335 var TEMPLATE_OPTIONS = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__.getTemplateOptions)(templateAvailabilityResponse.templateAvailability);
2336 callback([].concat(_toConsumableArray(forms.map(function (form) {
2337 return {
2338 label: form.name,
2339 value: form.guid,
2340 embedVersion: form.embedVersion
2341 };
2342 })), [TEMPLATE_OPTIONS]));
2343 })["catch"](function (error) {
2344 setFormApiError(error);
2345 });
2346 }, 300, {
2347 trailing: true
2348 });
2349 return {
2350 search: search,
2351 formApiError: formApiError,
2352 reset: function reset() {
2353 return setFormApiError(null);
2354 }
2355 };
2356 }
2357
2358 /***/ }),
2359
2360 /***/ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts":
2361 /*!*****************************************************************!*\
2362 !*** ./scripts/shared/Form/hooks/useGetTemplateAvailability.ts ***!
2363 \*****************************************************************/
2364 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2365
2366 "use strict";
2367 __webpack_require__.r(__webpack_exports__);
2368 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2369 /* harmony export */ "default": () => (/* binding */ useGetTemplateAvailability),
2370 /* harmony export */ "getTemplateOptions": () => (/* binding */ getTemplateOptions),
2371 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
2372 /* harmony export */ });
2373 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2374 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2375 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2376 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2377 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2378 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2379 /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../types */ "./scripts/shared/types.ts");
2380 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2381 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."); }
2382 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2383 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2384 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2385 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2386
2387
2388
2389
2390
2391 function useGetTemplateAvailability() {
2392 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2393 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2394 _useState2 = _slicedToArray(_useState, 2),
2395 templateAvailability = _useState2[0],
2396 setTemplateAvailability = _useState2[1];
2397 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function () {
2398 return new Promise(function (resolve) {
2399 proxy({
2400 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.GetTemplateAvailability,
2401 payload: {}
2402 }).then(function (data) {
2403 setTemplateAvailability(data.templateAvailability);
2404 resolve(data);
2405 });
2406 });
2407 }),
2408 _useState4 = _slicedToArray(_useState3, 1),
2409 availabilityPromise = _useState4[0];
2410 return {
2411 templateAvailability: templateAvailability,
2412 availabilityPromise: availabilityPromise
2413 };
2414 }
2415 var getTemplateOptions = function getTemplateOptions(templateAvailability) {
2416 if (!templateAvailability) {
2417 return {};
2418 }
2419 return {
2420 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Templates', 'leadin'),
2421 options: Object.keys(templateAvailability).filter(function (templateId) {
2422 var hubspotFormTemplateAvailability = templateAvailability[templateId];
2423 return (hubspotFormTemplateAvailability.canCreateWithMissingScopes || !hubspotFormTemplateAvailability.missingScopes.length) && !Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.ExcludedTemplateAvailabilityKeys).includes(templateId);
2424 }).map(function (templateId) {
2425 return {
2426 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateLabels[templateId], 'leadin'),
2427 value: _types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues[templateId]
2428 };
2429 })
2430 };
2431 };
2432 function isDefaultForm(value) {
2433 return Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues).includes(value);
2434 }
2435
2436 /***/ }),
2437
2438 /***/ "./scripts/shared/Meeting/MeetingController.tsx":
2439 /*!******************************************************!*\
2440 !*** ./scripts/shared/Meeting/MeetingController.tsx ***!
2441 \******************************************************/
2442 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2443
2444 "use strict";
2445 __webpack_require__.r(__webpack_exports__);
2446 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2447 /* harmony export */ "default": () => (/* binding */ MeetingController)
2448 /* harmony export */ });
2449 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2450 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2451 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2452 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2453 /* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx");
2454 /* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx");
2455 /* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts");
2456 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2457 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2458 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2459 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2460 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
2461 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
2462 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__);
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474 function MeetingController(_ref) {
2475 var handleChange = _ref.handleChange,
2476 url = _ref.url;
2477 var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(),
2478 meetings = _useMeetings.mappedMeetings,
2479 loading = _useMeetings.loading,
2480 error = _useMeetings.error,
2481 reload = _useMeetings.reload,
2482 connectCalendar = _useMeetings.connectCalendar;
2483 var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url);
2484 var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url);
2485 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2486 if (!url && meetings.length > 0) {
2487 handleChange(meetings[0].value);
2488 }
2489 }, [meetings, url, handleChange]);
2490 var handleLocalChange = function handleLocalChange(option) {
2491 handleChange(option.value);
2492 };
2493 var handleConnectCalendar = function handleConnectCalendar() {
2494 return connectCalendar().then(function () {
2495 reload();
2496 })["catch"](function (error) {
2497 raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', {
2498 extra: {
2499 error: error
2500 }
2501 });
2502 });
2503 };
2504 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2505 children: loading ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {}) : error ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
2506 status: error && error.status || error,
2507 resetErrorState: function resetErrorState() {
2508 return reload();
2509 },
2510 errorInfo: {
2511 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'),
2512 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes', 'leadin'),
2513 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin')
2514 }
2515 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
2516 padding: "90px 32px 24px",
2517 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath,
2518 children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], {
2519 status: selectedMeetingCalendar,
2520 onConnectCalendar: handleConnectCalendar
2521 }), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], {
2522 onChange: handleLocalChange,
2523 options: meetings,
2524 value: selectedMeetingOption
2525 })]
2526 })
2527 });
2528 }
2529
2530 /***/ }),
2531
2532 /***/ "./scripts/shared/Meeting/MeetingEdit.tsx":
2533 /*!************************************************!*\
2534 !*** ./scripts/shared/Meeting/MeetingEdit.tsx ***!
2535 \************************************************/
2536 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2537
2538 "use strict";
2539 __webpack_require__.r(__webpack_exports__);
2540 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2541 /* harmony export */ "default": () => (/* binding */ MeetingsEditContainer)
2542 /* harmony export */ });
2543 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2544 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2545 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2546 /* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx");
2547 /* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx");
2548 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2549 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2550 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2551 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
2552 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2553 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2554 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2555 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2556 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2557 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2558
2559
2560
2561
2562
2563
2564
2565
2566 function MeetingEdit(_ref) {
2567 var url = _ref.attributes.url,
2568 isSelected = _ref.isSelected,
2569 setAttributes = _ref.setAttributes,
2570 _ref$preview = _ref.preview,
2571 preview = _ref$preview === void 0 ? true : _ref$preview,
2572 _ref$origin = _ref.origin,
2573 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
2574 fullSiteEditor = _ref.fullSiteEditor;
2575 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)();
2576 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)();
2577 var handleChange = function handleChange(newUrl) {
2578 setAttributes({
2579 url: newUrl
2580 });
2581 };
2582 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2583 monitorFormPreviewRender({
2584 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__.ProxyMessages.TrackMeetingPreviewRender,
2585 payload: {
2586 origin: origin
2587 }
2588 });
2589 }, [origin]);
2590 return !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__["default"], {}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2591 children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], {
2592 url: url,
2593 handleChange: handleChange
2594 }), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], {
2595 url: url,
2596 fullSiteEditor: fullSiteEditor
2597 })]
2598 });
2599 }
2600 function MeetingsEditContainer(props) {
2601 var _useGetEmbedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_7__.useGetEmbedder)(),
2602 embedder = _useGetEmbedder.embedder,
2603 errorElement = _useGetEmbedder.errorElement,
2604 isLoading = _useGetEmbedder.isLoading;
2605 if (errorElement) {
2606 return errorElement;
2607 }
2608 if (isLoading) {
2609 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__["default"], {});
2610 }
2611 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.BackgroudAppContext.Provider, {
2612 value: embedder,
2613 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props))
2614 });
2615 }
2616
2617 /***/ }),
2618
2619 /***/ "./scripts/shared/Meeting/MeetingSelector.tsx":
2620 /*!****************************************************!*\
2621 !*** ./scripts/shared/Meeting/MeetingSelector.tsx ***!
2622 \****************************************************/
2623 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2624
2625 "use strict";
2626 __webpack_require__.r(__webpack_exports__);
2627 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2628 /* harmony export */ "default": () => (/* binding */ MeetingSelector)
2629 /* harmony export */ });
2630 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2631 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2632 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2633 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2634 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
2635 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2636 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2637
2638
2639
2640
2641
2642 function MeetingSelector(_ref) {
2643 var options = _ref.options,
2644 onChange = _ref.onChange,
2645 value = _ref.value;
2646 var optionsWrapper = [{
2647 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'),
2648 options: options
2649 }];
2650 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2651 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__["default"], {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
2652 "data-test-id": "leadin-meeting-select",
2653 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2654 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin')
2655 })
2656 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
2657 defaultOptions: optionsWrapper,
2658 onChange: onChange,
2659 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'),
2660 value: value
2661 })]
2662 });
2663 }
2664
2665 /***/ }),
2666
2667 /***/ "./scripts/shared/Meeting/MeetingWarning.tsx":
2668 /*!***************************************************!*\
2669 !*** ./scripts/shared/Meeting/MeetingWarning.tsx ***!
2670 \***************************************************/
2671 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2672
2673 "use strict";
2674 __webpack_require__.r(__webpack_exports__);
2675 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2676 /* harmony export */ "default": () => (/* binding */ MeetingWarning)
2677 /* harmony export */ });
2678 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2679 /* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx");
2680 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
2681 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts");
2682 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2683 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2684
2685
2686
2687
2688
2689 function MeetingWarning(_ref) {
2690 var status = _ref.status,
2691 onConnectCalendar = _ref.onConnectCalendar;
2692 var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING;
2693 var titleText = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Your calendar is not connected', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Calendar is not connected', 'leadin');
2694 var titleMessage = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Please connect your calendar to activate your scheduling pages', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Make sure that everybody in this meeting has connected their calendar from the Meetings page in HubSpot', 'leadin');
2695 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], {
2696 titleText: titleText,
2697 titleMessage: titleMessage,
2698 children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
2699 use: "tertiary",
2700 id: "meetings-connect-calendar",
2701 onClick: onConnectCalendar,
2702 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin')
2703 })
2704 });
2705 }
2706
2707 /***/ }),
2708
2709 /***/ "./scripts/shared/Meeting/PreviewMeeting.tsx":
2710 /*!***************************************************!*\
2711 !*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***!
2712 \***************************************************/
2713 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2714
2715 "use strict";
2716 __webpack_require__.r(__webpack_exports__);
2717 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2718 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2719 /* harmony export */ });
2720 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2721 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2722 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2723 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2724 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2725
2726
2727
2728
2729 function PreviewForm(_ref) {
2730 var url = _ref.url,
2731 fullSiteEditor = _ref.fullSiteEditor;
2732 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2733 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2734 if (inputEl.current) {
2735 //@ts-expect-error Hubspot global
2736 var hbspt = window.parent.hbspt || window.hbspt;
2737 hbspt.meetings.create('.meetings-iframe-container');
2738 }
2739 }, [url, inputEl]);
2740 if (fullSiteEditor) {
2741 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__["default"], {});
2742 }
2743 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2744 children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2745 ref: inputEl,
2746 className: "meetings-iframe-container",
2747 "data-src": "".concat(url, "?embed=true")
2748 })
2749 });
2750 }
2751
2752 /***/ }),
2753
2754 /***/ "./scripts/shared/Meeting/constants.ts":
2755 /*!*********************************************!*\
2756 !*** ./scripts/shared/Meeting/constants.ts ***!
2757 \*********************************************/
2758 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2759
2760 "use strict";
2761 __webpack_require__.r(__webpack_exports__);
2762 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2763 /* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING),
2764 /* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING)
2765 /* harmony export */ });
2766 var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING';
2767 var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING';
2768
2769 /***/ }),
2770
2771 /***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts":
2772 /*!*************************************************************!*\
2773 !*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***!
2774 \*************************************************************/
2775 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2776
2777 "use strict";
2778 __webpack_require__.r(__webpack_exports__);
2779 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2780 /* harmony export */ "default": () => (/* binding */ useCurrentUserFetch)
2781 /* harmony export */ });
2782 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2783 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2784 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2785 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2786 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2787 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2788 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."); }
2789 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2790 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2791 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2792 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2793
2794
2795
2796
2797 var user = null;
2798 function useCurrentUserFetch() {
2799 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2800 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2801 _useState2 = _slicedToArray(_useState, 2),
2802 loadState = _useState2[0],
2803 setLoadState = _useState2[1];
2804 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2805 _useState4 = _slicedToArray(_useState3, 2),
2806 error = _useState4[0],
2807 setError = _useState4[1];
2808 var createUser = function createUser() {
2809 if (!user) {
2810 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2811 }
2812 };
2813 var reload = function reload() {
2814 user = null;
2815 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2816 setError(null);
2817 };
2818 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2819 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) {
2820 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2821 proxy({
2822 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser
2823 }).then(function (data) {
2824 user = data;
2825 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2826 })["catch"](function (err) {
2827 setError(err);
2828 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2829 });
2830 }
2831 }, [loadState]);
2832 return {
2833 user: user,
2834 loadUserState: loadState,
2835 error: error,
2836 createUser: createUser,
2837 reload: reload
2838 };
2839 }
2840
2841 /***/ }),
2842
2843 /***/ "./scripts/shared/Meeting/hooks/useMeetings.ts":
2844 /*!*****************************************************!*\
2845 !*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***!
2846 \*****************************************************/
2847 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2848
2849 "use strict";
2850 __webpack_require__.r(__webpack_exports__);
2851 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2852 /* harmony export */ "default": () => (/* binding */ useMeetings),
2853 /* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting),
2854 /* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar)
2855 /* harmony export */ });
2856 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2857 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2858 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2859 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2860 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts");
2861 /* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts");
2862 /* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts");
2863 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2864 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2865 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2866 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2867 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2868 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2869 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2870 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2871 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2872 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2873 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."); }
2874 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2875 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2876 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2877 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2878
2879
2880
2881
2882
2883
2884
2885
2886 function getDefaultMeetingName(meeting, currentUser, meetingUsers) {
2887 var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1),
2888 meetingOwnerId = _meeting$meetingsUser[0];
2889 var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin');
2890 if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) {
2891 var user = meetingUsers[meetingOwnerId];
2892 result += " (".concat(user.userProfile.fullName, ")");
2893 }
2894 return result;
2895 }
2896 function hasCalendarObject(user) {
2897 return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email;
2898 }
2899 function useMeetings() {
2900 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)();
2901 var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(),
2902 meetings = _useMeetingsFetch.meetings,
2903 meetingUsers = _useMeetingsFetch.meetingUsers,
2904 meetingsError = _useMeetingsFetch.error,
2905 loadMeetingsState = _useMeetingsFetch.loadMeetingsState,
2906 reloadMeetings = _useMeetingsFetch.reload;
2907 var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2908 currentUser = _useCurrentUserFetch.user,
2909 userError = _useCurrentUserFetch.error,
2910 loadUserState = _useCurrentUserFetch.loadUserState,
2911 reloadUser = _useCurrentUserFetch.reload;
2912 var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
2913 reloadUser();
2914 reloadMeetings();
2915 }, [reloadUser, reloadMeetings]);
2916 var connectCalendar = function connectCalendar() {
2917 return proxy({
2918 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar
2919 });
2920 };
2921 return {
2922 mappedMeetings: meetings.map(function (meet) {
2923 return {
2924 label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers),
2925 value: meet.link
2926 };
2927 }),
2928 meetings: meetings,
2929 meetingUsers: meetingUsers,
2930 currentUser: currentUser,
2931 error: meetingsError || userError,
2932 loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading,
2933 reload: reload,
2934 connectCalendar: connectCalendar
2935 };
2936 }
2937 function useSelectedMeeting(url) {
2938 var _useMeetings = useMeetings(),
2939 meetings = _useMeetings.mappedMeetings;
2940 var option = meetings.find(function (_ref) {
2941 var value = _ref.value;
2942 return value === url;
2943 });
2944 return option;
2945 }
2946 function useSelectedMeetingCalendar(url) {
2947 var _useMeetings2 = useMeetings(),
2948 meetings = _useMeetings2.meetings,
2949 meetingUsers = _useMeetings2.meetingUsers,
2950 currentUser = _useMeetings2.currentUser;
2951 var meeting = meetings.find(function (meet) {
2952 return meet.link === url;
2953 });
2954 var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) {
2955 return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
2956 }, {});
2957 if (!meeting) {
2958 return null;
2959 } else {
2960 var meetingsUserIds = meeting.meetingsUserIds;
2961 if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) {
2962 return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING;
2963 } else if (meetingsUserIds.map(function (id) {
2964 return mappedMeetingUsersId[id];
2965 }).some(function (user) {
2966 return !hasCalendarObject(user);
2967 })) {
2968 return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING;
2969 } else {
2970 return null;
2971 }
2972 }
2973 }
2974
2975 /***/ }),
2976
2977 /***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts":
2978 /*!**********************************************************!*\
2979 !*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***!
2980 \**********************************************************/
2981 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2982
2983 "use strict";
2984 __webpack_require__.r(__webpack_exports__);
2985 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2986 /* harmony export */ "default": () => (/* binding */ useMeetingsFetch)
2987 /* harmony export */ });
2988 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2989 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2990 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2991 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2992 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2993 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2994 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."); }
2995 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2996 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2997 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
2998 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2999
3000
3001
3002
3003 var meetings = [];
3004 var meetingUsers = [];
3005 function useMeetingsFetch() {
3006 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
3007 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
3008 _useState2 = _slicedToArray(_useState, 2),
3009 loadState = _useState2[0],
3010 setLoadState = _useState2[1];
3011 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3012 _useState4 = _slicedToArray(_useState3, 2),
3013 error = _useState4[0],
3014 setError = _useState4[1];
3015 var reload = function reload() {
3016 meetings = [];
3017 setError(null);
3018 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
3019 };
3020 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
3021 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) {
3022 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
3023 proxy({
3024 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers
3025 }).then(function (data) {
3026 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded);
3027 meetings = data && data.meetingLinks;
3028 meetingUsers = data && data.meetingUsers;
3029 })["catch"](function (e) {
3030 setError(e);
3031 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
3032 });
3033 }
3034 }, [loadState]);
3035 return {
3036 meetings: meetings,
3037 meetingUsers: meetingUsers,
3038 loadMeetingsState: loadState,
3039 error: error,
3040 reload: reload
3041 };
3042 }
3043
3044 /***/ }),
3045
3046 /***/ "./scripts/shared/UIComponents/UIAlert.tsx":
3047 /*!*************************************************!*\
3048 !*** ./scripts/shared/UIComponents/UIAlert.tsx ***!
3049 \*************************************************/
3050 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3051
3052 "use strict";
3053 __webpack_require__.r(__webpack_exports__);
3054 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3055 /* harmony export */ "default": () => (/* binding */ UIAlert)
3056 /* harmony export */ });
3057 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3058 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3059
3060
3061 var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3062 name: "AlertContainer",
3063 "class": "a1h8m4fo",
3064 propsAsIs: false
3065 });
3066 var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3067 name: "Title",
3068 "class": "tyndzxk",
3069 propsAsIs: false
3070 });
3071 var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3072 name: "Message",
3073 "class": "m1m9sbk4",
3074 propsAsIs: false
3075 });
3076 var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3077 name: "MessageContainer",
3078 "class": "mg5o421",
3079 propsAsIs: false
3080 });
3081 function UIAlert(_ref) {
3082 var titleText = _ref.titleText,
3083 titleMessage = _ref.titleMessage,
3084 children = _ref.children;
3085 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, {
3086 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, {
3087 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, {
3088 children: titleText
3089 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, {
3090 children: titleMessage
3091 })]
3092 }), children]
3093 });
3094 }
3095 __webpack_require__(/*! ./UIAlert.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIAlert.tsx */ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx");
3096
3097 /***/ }),
3098
3099 /***/ "./scripts/shared/UIComponents/UIButton.ts":
3100 /*!*************************************************!*\
3101 !*** ./scripts/shared/UIComponents/UIButton.ts ***!
3102 \*************************************************/
3103 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3104
3105 "use strict";
3106 __webpack_require__.r(__webpack_exports__);
3107 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3108 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3109 /* harmony export */ });
3110 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3111 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3112
3113
3114 var _exp2 = /*#__PURE__*/function _exp2() {
3115 return function (props) {
3116 return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX;
3117 };
3118 };
3119 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({
3120 name: "UIButton0",
3121 "class": "ug152ch",
3122 propsAsIs: false,
3123 vars: {
3124 "ug152ch-0": [_exp2()]
3125 }
3126 }));
3127 __webpack_require__(/*! ./UIButton.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIButton.ts */ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts");
3128
3129 /***/ }),
3130
3131 /***/ "./scripts/shared/UIComponents/UIContainer.ts":
3132 /*!****************************************************!*\
3133 !*** ./scripts/shared/UIComponents/UIContainer.ts ***!
3134 \****************************************************/
3135 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3136
3137 "use strict";
3138 __webpack_require__.r(__webpack_exports__);
3139 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3140 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3141 /* harmony export */ });
3142 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3143
3144 var _exp = /*#__PURE__*/function _exp() {
3145 return function (props) {
3146 return props.textAlign ? props.textAlign : 'inherit';
3147 };
3148 };
3149 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3150 name: "UIContainer0",
3151 "class": "ua13n1c",
3152 propsAsIs: false,
3153 vars: {
3154 "ua13n1c-0": [_exp()]
3155 }
3156 }));
3157 __webpack_require__(/*! ./UIContainer.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIContainer.ts */ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts");
3158
3159 /***/ }),
3160
3161 /***/ "./scripts/shared/UIComponents/UIOverlay.ts":
3162 /*!**************************************************!*\
3163 !*** ./scripts/shared/UIComponents/UIOverlay.ts ***!
3164 \**************************************************/
3165 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3166
3167 "use strict";
3168 __webpack_require__.r(__webpack_exports__);
3169 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3170 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3171 /* harmony export */ });
3172 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3173
3174 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3175 name: "UIOverlay0",
3176 "class": "u1q7a48k",
3177 propsAsIs: false
3178 }));
3179 __webpack_require__(/*! ./UIOverlay.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIOverlay.ts */ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts");
3180
3181 /***/ }),
3182
3183 /***/ "./scripts/shared/UIComponents/UISpacer.ts":
3184 /*!*************************************************!*\
3185 !*** ./scripts/shared/UIComponents/UISpacer.ts ***!
3186 \*************************************************/
3187 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3188
3189 "use strict";
3190 __webpack_require__.r(__webpack_exports__);
3191 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3192 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3193 /* harmony export */ });
3194 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3195
3196 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3197 name: "UISpacer0",
3198 "class": "u3qxofx",
3199 propsAsIs: false
3200 }));
3201 __webpack_require__(/*! ./UISpacer.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UISpacer.ts */ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts");
3202
3203 /***/ }),
3204
3205 /***/ "./scripts/shared/UIComponents/UISpinner.tsx":
3206 /*!***************************************************!*\
3207 !*** ./scripts/shared/UIComponents/UISpinner.tsx ***!
3208 \***************************************************/
3209 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3210
3211 "use strict";
3212 __webpack_require__.r(__webpack_exports__);
3213 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3214 /* harmony export */ "default": () => (/* binding */ UISpinner)
3215 /* harmony export */ });
3216 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3217 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3218 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3219
3220
3221
3222 var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3223 name: "SpinnerOuter",
3224 "class": "sxa9zrc",
3225 propsAsIs: false
3226 });
3227 var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3228 name: "SpinnerInner",
3229 "class": "s14430wa",
3230 propsAsIs: false
3231 });
3232 var _exp = /*#__PURE__*/function _exp() {
3233 return function (props) {
3234 return props.color;
3235 };
3236 };
3237 var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3238 name: "Circle",
3239 "class": "ct87ghk",
3240 propsAsIs: true,
3241 vars: {
3242 "ct87ghk-0": [_exp()]
3243 }
3244 });
3245 var _exp2 = /*#__PURE__*/function _exp2() {
3246 return function (props) {
3247 return props.color;
3248 };
3249 };
3250 var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3251 name: "AnimatedCircle",
3252 "class": "avili0h",
3253 propsAsIs: true,
3254 vars: {
3255 "avili0h-0": [_exp2()]
3256 }
3257 });
3258 function UISpinner(_ref) {
3259 var _ref$size = _ref.size,
3260 size = _ref$size === void 0 ? 20 : _ref$size;
3261 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, {
3262 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, {
3263 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
3264 height: size,
3265 width: size,
3266 viewBox: "0 0 50 50",
3267 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, {
3268 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM,
3269 cx: "25",
3270 cy: "25",
3271 r: "22.5"
3272 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, {
3273 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO,
3274 cx: "25",
3275 cy: "25",
3276 r: "22.5"
3277 })]
3278 })
3279 })
3280 });
3281 }
3282 __webpack_require__(/*! ./UISpinner.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UISpinner.tsx */ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx");
3283
3284 /***/ }),
3285
3286 /***/ "./scripts/shared/UIComponents/colors.ts":
3287 /*!***********************************************!*\
3288 !*** ./scripts/shared/UIComponents/colors.ts ***!
3289 \***********************************************/
3290 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3291
3292 "use strict";
3293 __webpack_require__.r(__webpack_exports__);
3294 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3295 /* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO),
3296 /* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT),
3297 /* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM),
3298 /* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP),
3299 /* harmony export */ "LORAX": () => (/* binding */ LORAX),
3300 /* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT),
3301 /* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM),
3302 /* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN),
3303 /* harmony export */ "OLAF": () => (/* binding */ OLAF)
3304 /* harmony export */ });
3305 var CALYPSO = '#00a4bd';
3306 var CALYPSO_MEDIUM = '#7fd1de';
3307 var CALYPSO_LIGHT = '#e5f5f8';
3308 var LORAX = '#ff7a59';
3309 var OLAF = '#ffffff';
3310 var HEFFALUMP = '#425b76';
3311 var MARIGOLD_LIGHT = '#fef8f0';
3312 var MARIGOLD_MEDIUM = '#fae0b5';
3313 var OBSIDIAN = '#33475b';
3314
3315 /***/ }),
3316
3317 /***/ "./scripts/shared/enums/connectionStatus.ts":
3318 /*!**************************************************!*\
3319 !*** ./scripts/shared/enums/connectionStatus.ts ***!
3320 \**************************************************/
3321 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3322
3323 "use strict";
3324 __webpack_require__.r(__webpack_exports__);
3325 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3326 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3327 /* harmony export */ });
3328 var ConnectionStatus = {
3329 Connected: 'Connected',
3330 NotConnected: 'NotConnected'
3331 };
3332 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus);
3333
3334 /***/ }),
3335
3336 /***/ "./scripts/shared/enums/loadState.ts":
3337 /*!*******************************************!*\
3338 !*** ./scripts/shared/enums/loadState.ts ***!
3339 \*******************************************/
3340 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3341
3342 "use strict";
3343 __webpack_require__.r(__webpack_exports__);
3344 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3345 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3346 /* harmony export */ });
3347 var LoadState = {
3348 NotLoaded: 'NotLoaded',
3349 Loading: 'Loading',
3350 Loaded: 'Loaded',
3351 Idle: 'Idle',
3352 Failed: 'Failed'
3353 };
3354 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState);
3355
3356 /***/ }),
3357
3358 /***/ "./scripts/shared/types.ts":
3359 /*!*********************************!*\
3360 !*** ./scripts/shared/types.ts ***!
3361 \*********************************/
3362 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3363
3364 "use strict";
3365 __webpack_require__.r(__webpack_exports__);
3366 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3367 /* harmony export */ "ExcludedTemplateAvailabilityKeys": () => (/* binding */ ExcludedTemplateAvailabilityKeys),
3368 /* harmony export */ "HubSpotFormTemplateAvailabilityKeys": () => (/* binding */ HubSpotFormTemplateAvailabilityKeys),
3369 /* harmony export */ "TemplateLabels": () => (/* binding */ TemplateLabels),
3370 /* harmony export */ "TemplateValues": () => (/* binding */ TemplateValues)
3371 /* harmony export */ });
3372 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3373 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3374 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3375 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3376 var HubSpotFormTemplateAvailabilityKeys;
3377 (function (HubSpotFormTemplateAvailabilityKeys) {
3378 HubSpotFormTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3379 HubSpotFormTemplateAvailabilityKeys["BLANK"] = "blank";
3380 HubSpotFormTemplateAvailabilityKeys["NEWSLETTER"] = "newsletter";
3381 HubSpotFormTemplateAvailabilityKeys["CONTACT_US"] = "contact-us";
3382 HubSpotFormTemplateAvailabilityKeys["EVENT_REGISTRATION"] = "event-registration";
3383 HubSpotFormTemplateAvailabilityKeys["TALK_TO_AN_EXPERT"] = "talk-to-an-expert";
3384 HubSpotFormTemplateAvailabilityKeys["BOOK_A_MEETING"] = "book-a-meeting";
3385 HubSpotFormTemplateAvailabilityKeys["GATED_CONTENT"] = "gated-content";
3386 HubSpotFormTemplateAvailabilityKeys["SUPPORT"] = "support";
3387 })(HubSpotFormTemplateAvailabilityKeys || (HubSpotFormTemplateAvailabilityKeys = {}));
3388 var ExcludedTemplateAvailabilityKeys;
3389 (function (ExcludedTemplateAvailabilityKeys) {
3390 ExcludedTemplateAvailabilityKeys["SUPPORT"] = "support";
3391 ExcludedTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3392 })(ExcludedTemplateAvailabilityKeys || (ExcludedTemplateAvailabilityKeys = {}));
3393 var TemplateLabels = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HubSpotFormTemplateAvailabilityKeys.BLANK, 'Blank Form'), HubSpotFormTemplateAvailabilityKeys.NEWSLETTER, 'Newsletter Form'), HubSpotFormTemplateAvailabilityKeys.CONTACT_US, 'Contact Us Form'), HubSpotFormTemplateAvailabilityKeys.EVENT_REGISTRATION, 'Event Registration Form'), HubSpotFormTemplateAvailabilityKeys.TALK_TO_AN_EXPERT, 'Talk to an Expert Form'), HubSpotFormTemplateAvailabilityKeys.BOOK_A_MEETING, 'Book a Meeting Form'), HubSpotFormTemplateAvailabilityKeys.GATED_CONTENT, 'Gated Content Form');
3394 var TemplateValues = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HubSpotFormTemplateAvailabilityKeys.BLANK, 'BLANK'), HubSpotFormTemplateAvailabilityKeys.NEWSLETTER, 'NEWSLETTER'), HubSpotFormTemplateAvailabilityKeys.CONTACT_US, 'CONTACT_US'), HubSpotFormTemplateAvailabilityKeys.EVENT_REGISTRATION, 'EVENT_REGISTRATION'), HubSpotFormTemplateAvailabilityKeys.TALK_TO_AN_EXPERT, 'TALK_TO_AN_EXPERT'), HubSpotFormTemplateAvailabilityKeys.BOOK_A_MEETING, 'BOOK_A_MEETING'), HubSpotFormTemplateAvailabilityKeys.GATED_CONTENT, 'GATED_CONTENT');
3395
3396 /***/ }),
3397
3398 /***/ "./scripts/utils/appUtils.ts":
3399 /*!***********************************!*\
3400 !*** ./scripts/utils/appUtils.ts ***!
3401 \***********************************/
3402 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3403
3404 "use strict";
3405 __webpack_require__.r(__webpack_exports__);
3406 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3407 /* harmony export */ "initApp": () => (/* binding */ initApp),
3408 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
3409 /* harmony export */ });
3410 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
3411 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
3412 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3413
3414
3415 function initApp(initFn) {
3416 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
3417 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
3418 }
3419 function initAppOnReady(initFn) {
3420 function main() {
3421 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
3422 }
3423 initApp(main);
3424 }
3425
3426 /***/ }),
3427
3428 /***/ "./scripts/utils/backgroundAppUtils.ts":
3429 /*!*********************************************!*\
3430 !*** ./scripts/utils/backgroundAppUtils.ts ***!
3431 \*********************************************/
3432 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3433
3434 "use strict";
3435 __webpack_require__.r(__webpack_exports__);
3436 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3437 /* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp),
3438 /* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp)
3439 /* harmony export */ });
3440 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3441 /* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts");
3442 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
3443
3444
3445
3446 function initBackgroundApp(initFn) {
3447 function main() {
3448 if (Array.isArray(initFn)) {
3449 initFn.forEach(function (callback) {
3450 return callback();
3451 });
3452 } else {
3453 initFn();
3454 }
3455 }
3456 (0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main);
3457 }
3458 var getLeadinConfig = function getLeadinConfig() {
3459 return {
3460 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.leadinPluginVersion
3461 };
3462 };
3463 var getOrCreateBackgroundApp = function getOrCreateBackgroundApp() {
3464 var accessToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3465 var expiresIn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3466 if (window.LeadinBackgroundApp) {
3467 return window.LeadinBackgroundApp;
3468 }
3469 var _window = window,
3470 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3471 IntegratedAppOptions = _window.IntegratedAppOptions;
3472 var options = new IntegratedAppOptions().setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.deviceId).setLeadinConfig(getLeadinConfig()).setAccessToken(accessToken, expiresIn);
3473 var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options);
3474 embedder.attachTo(document.body, false);
3475 embedder.setTokenRenewalCallback(_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__.fetchAccessToken);
3476 embedder.postStartAppMessage(); // lets the app know all data has been passed to it
3477 window.LeadinBackgroundApp = embedder;
3478 return window.LeadinBackgroundApp;
3479 };
3480
3481 /***/ }),
3482
3483 /***/ "./scripts/utils/isRefreshTokenAvailable.ts":
3484 /*!**************************************************!*\
3485 !*** ./scripts/utils/isRefreshTokenAvailable.ts ***!
3486 \**************************************************/
3487 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3488
3489 "use strict";
3490 __webpack_require__.r(__webpack_exports__);
3491 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3492 /* harmony export */ "isRefreshTokenAvailable": () => (/* binding */ isRefreshTokenAvailable)
3493 /* harmony export */ });
3494 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3495
3496 function isRefreshTokenAvailable() {
3497 return _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.connectionStatus === 'Connected';
3498 }
3499
3500 /***/ }),
3501
3502 /***/ "./scripts/utils/queryParams.ts":
3503 /*!**************************************!*\
3504 !*** ./scripts/utils/queryParams.ts ***!
3505 \**************************************/
3506 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3507
3508 "use strict";
3509 __webpack_require__.r(__webpack_exports__);
3510 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3511 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
3512 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
3513 /* harmony export */ });
3514 function addQueryObjectToUrl(urlObject, queryParams) {
3515 Object.keys(queryParams).forEach(function (key) {
3516 urlObject.searchParams.append(key, queryParams[key]);
3517 });
3518 }
3519 function removeQueryParamFromLocation(key) {
3520 var location = new URL(window.location.href);
3521 location.searchParams["delete"](key);
3522 window.history.replaceState(null, '', location.href);
3523 }
3524
3525 /***/ }),
3526
3527 /***/ "./scripts/utils/useGetEmbedder.ts":
3528 /*!*****************************************!*\
3529 !*** ./scripts/utils/useGetEmbedder.ts ***!
3530 \*****************************************/
3531 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3532
3533 "use strict";
3534 __webpack_require__.r(__webpack_exports__);
3535 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3536 /* harmony export */ "useGetEmbedder": () => (/* binding */ useGetEmbedder)
3537 /* harmony export */ });
3538 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3539 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
3540 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
3541 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
3542 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
3543 /* harmony import */ var _backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
3544 /* harmony import */ var _isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRefreshTokenAvailable */ "./scripts/utils/isRefreshTokenAvailable.ts");
3545 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
3546 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3547 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."); }
3548 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3549 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3550 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
3551 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
3552
3553
3554
3555
3556
3557
3558
3559 function useGetEmbedder() {
3560 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3561 _useState2 = _slicedToArray(_useState, 2),
3562 embedder = _useState2[0],
3563 setEmbedder = _useState2[1];
3564 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3565 _useState4 = _slicedToArray(_useState3, 2),
3566 errorStatus = _useState4[0],
3567 setErrorStatus = _useState4[1];
3568 var loadEmbedder = function loadEmbedder() {
3569 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__.fetchAccessToken)().then(function (_ref) {
3570 var accessToken = _ref.accessToken,
3571 expiresIn = _ref.expiresIn;
3572 setEmbedder((0,_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__.getOrCreateBackgroundApp)(accessToken, expiresIn));
3573 })["catch"](function (err) {
3574 return setErrorStatus(err && err.status || 500);
3575 });
3576 };
3577 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
3578 if ((0,_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__.isRefreshTokenAvailable)()) {
3579 loadEmbedder();
3580 }
3581 }, []);
3582 var errorElement = errorStatus !== null ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_5__["default"], {
3583 status: errorStatus,
3584 resetErrorState: function resetErrorState() {
3585 setErrorStatus(null);
3586 loadEmbedder();
3587 },
3588 errorInfo: {
3589 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Unable to load HubSpot', 'leadin'),
3590 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('There was a problem connecting to HubSpot. Please try again.', 'leadin'),
3591 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'leadin')
3592 }
3593 }) : null;
3594 return {
3595 embedder: embedder,
3596 errorElement: errorElement,
3597 isLoading: (0,_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__.isRefreshTokenAvailable)() && embedder === null && errorStatus === null
3598 };
3599 }
3600
3601 /***/ }),
3602
3603 /***/ "./scripts/utils/withMetaData.ts":
3604 /*!***************************************!*\
3605 !*** ./scripts/utils/withMetaData.ts ***!
3606 \***************************************/
3607 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3608
3609 "use strict";
3610 __webpack_require__.r(__webpack_exports__);
3611 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3612 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
3613 /* harmony export */ "isFullSiteEditor": () => (/* binding */ isFullSiteEditor)
3614 /* harmony export */ });
3615 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3616 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3617 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3618 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3619 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3620 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3621
3622 // from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599
3623 var isFullSiteEditor = function isFullSiteEditor() {
3624 return _wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select && !!(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/edit-site');
3625 };
3626 var applyWithSelect = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)(function (select, props) {
3627 return {
3628 metaValue: select('core/editor').getEditedPostAttribute('meta')[props.metaKey]
3629 };
3630 });
3631 var applyWithDispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch)(function (dispatch, props) {
3632 return {
3633 setMetaValue: function setMetaValue(value) {
3634 dispatch('core/editor').editPost({
3635 meta: _defineProperty({}, props.metaKey, value)
3636 });
3637 }
3638 };
3639 });
3640 function apply(el) {
3641 return applyWithSelect(applyWithDispatch(el));
3642 }
3643 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);
3644
3645 /***/ }),
3646
3647 /***/ "./node_modules/is-what/dist/index.esm.js":
3648 /*!************************************************!*\
3649 !*** ./node_modules/is-what/dist/index.esm.js ***!
3650 \************************************************/
3651 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3652
3653 "use strict";
3654 __webpack_require__.r(__webpack_exports__);
3655 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3656 /* harmony export */ "getType": () => (/* binding */ getType),
3657 /* harmony export */ "isAnyObject": () => (/* binding */ isAnyObject),
3658 /* harmony export */ "isArray": () => (/* binding */ isArray),
3659 /* harmony export */ "isBlob": () => (/* binding */ isBlob),
3660 /* harmony export */ "isBoolean": () => (/* binding */ isBoolean),
3661 /* harmony export */ "isDate": () => (/* binding */ isDate),
3662 /* harmony export */ "isEmptyArray": () => (/* binding */ isEmptyArray),
3663 /* harmony export */ "isEmptyObject": () => (/* binding */ isEmptyObject),
3664 /* harmony export */ "isEmptyString": () => (/* binding */ isEmptyString),
3665 /* harmony export */ "isError": () => (/* binding */ isError),
3666 /* harmony export */ "isFile": () => (/* binding */ isFile),
3667 /* harmony export */ "isFullArray": () => (/* binding */ isFullArray),
3668 /* harmony export */ "isFullObject": () => (/* binding */ isFullObject),
3669 /* harmony export */ "isFullString": () => (/* binding */ isFullString),
3670 /* harmony export */ "isFunction": () => (/* binding */ isFunction),
3671 /* harmony export */ "isMap": () => (/* binding */ isMap),
3672 /* harmony export */ "isNaNValue": () => (/* binding */ isNaNValue),
3673 /* harmony export */ "isNull": () => (/* binding */ isNull),
3674 /* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined),
3675 /* harmony export */ "isNumber": () => (/* binding */ isNumber),
3676 /* harmony export */ "isObject": () => (/* binding */ isObject),
3677 /* harmony export */ "isObjectLike": () => (/* binding */ isObjectLike),
3678 /* harmony export */ "isOneOf": () => (/* binding */ isOneOf),
3679 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
3680 /* harmony export */ "isPrimitive": () => (/* binding */ isPrimitive),
3681 /* harmony export */ "isPromise": () => (/* binding */ isPromise),
3682 /* harmony export */ "isRegExp": () => (/* binding */ isRegExp),
3683 /* harmony export */ "isSet": () => (/* binding */ isSet),
3684 /* harmony export */ "isString": () => (/* binding */ isString),
3685 /* harmony export */ "isSymbol": () => (/* binding */ isSymbol),
3686 /* harmony export */ "isType": () => (/* binding */ isType),
3687 /* harmony export */ "isUndefined": () => (/* binding */ isUndefined),
3688 /* harmony export */ "isWeakMap": () => (/* binding */ isWeakMap),
3689 /* harmony export */ "isWeakSet": () => (/* binding */ isWeakSet)
3690 /* harmony export */ });
3691 /**
3692 * Returns the object type of the given payload
3693 *
3694 * @param {*} payload
3695 * @returns {string}
3696 */
3697 function getType(payload) {
3698 return Object.prototype.toString.call(payload).slice(8, -1);
3699 }
3700 /**
3701 * Returns whether the payload is undefined
3702 *
3703 * @param {*} payload
3704 * @returns {payload is undefined}
3705 */
3706 function isUndefined(payload) {
3707 return getType(payload) === 'Undefined';
3708 }
3709 /**
3710 * Returns whether the payload is null
3711 *
3712 * @param {*} payload
3713 * @returns {payload is null}
3714 */
3715 function isNull(payload) {
3716 return getType(payload) === 'Null';
3717 }
3718 /**
3719 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3720 *
3721 * @param {*} payload
3722 * @returns {payload is PlainObject}
3723 */
3724 function isPlainObject(payload) {
3725 if (getType(payload) !== 'Object')
3726 return false;
3727 return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
3728 }
3729 /**
3730 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3731 *
3732 * @param {*} payload
3733 * @returns {payload is PlainObject}
3734 */
3735 function isObject(payload) {
3736 return isPlainObject(payload);
3737 }
3738 /**
3739 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3740 *
3741 * @param {*} payload
3742 * @returns {payload is { [K in any]: never }}
3743 */
3744 function isEmptyObject(payload) {
3745 return isPlainObject(payload) && Object.keys(payload).length === 0;
3746 }
3747 /**
3748 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3749 *
3750 * @param {*} payload
3751 * @returns {payload is PlainObject}
3752 */
3753 function isFullObject(payload) {
3754 return isPlainObject(payload) && Object.keys(payload).length > 0;
3755 }
3756 /**
3757 * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
3758 *
3759 * @param {*} payload
3760 * @returns {payload is PlainObject}
3761 */
3762 function isAnyObject(payload) {
3763 return getType(payload) === 'Object';
3764 }
3765 /**
3766 * Returns whether the payload is an object like a type passed in < >
3767 *
3768 * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
3769 *
3770 * @template T this must be passed in < >
3771 * @param {*} payload
3772 * @returns {payload is T}
3773 */
3774 function isObjectLike(payload) {
3775 return isAnyObject(payload);
3776 }
3777 /**
3778 * Returns whether the payload is a function (regular or async)
3779 *
3780 * @param {*} payload
3781 * @returns {payload is AnyFunction}
3782 */
3783 function isFunction(payload) {
3784 return typeof payload === 'function';
3785 }
3786 /**
3787 * Returns whether the payload is an array
3788 *
3789 * @param {any} payload
3790 * @returns {payload is any[]}
3791 */
3792 function isArray(payload) {
3793 return getType(payload) === 'Array';
3794 }
3795 /**
3796 * Returns whether the payload is a an array with at least 1 item
3797 *
3798 * @param {*} payload
3799 * @returns {payload is any[]}
3800 */
3801 function isFullArray(payload) {
3802 return isArray(payload) && payload.length > 0;
3803 }
3804 /**
3805 * Returns whether the payload is a an empty array
3806 *
3807 * @param {*} payload
3808 * @returns {payload is []}
3809 */
3810 function isEmptyArray(payload) {
3811 return isArray(payload) && payload.length === 0;
3812 }
3813 /**
3814 * Returns whether the payload is a string
3815 *
3816 * @param {*} payload
3817 * @returns {payload is string}
3818 */
3819 function isString(payload) {
3820 return getType(payload) === 'String';
3821 }
3822 /**
3823 * Returns whether the payload is a string, BUT returns false for ''
3824 *
3825 * @param {*} payload
3826 * @returns {payload is string}
3827 */
3828 function isFullString(payload) {
3829 return isString(payload) && payload !== '';
3830 }
3831 /**
3832 * Returns whether the payload is ''
3833 *
3834 * @param {*} payload
3835 * @returns {payload is string}
3836 */
3837 function isEmptyString(payload) {
3838 return payload === '';
3839 }
3840 /**
3841 * Returns whether the payload is a number (but not NaN)
3842 *
3843 * This will return `false` for `NaN`!!
3844 *
3845 * @param {*} payload
3846 * @returns {payload is number}
3847 */
3848 function isNumber(payload) {
3849 return getType(payload) === 'Number' && !isNaN(payload);
3850 }
3851 /**
3852 * Returns whether the payload is a boolean
3853 *
3854 * @param {*} payload
3855 * @returns {payload is boolean}
3856 */
3857 function isBoolean(payload) {
3858 return getType(payload) === 'Boolean';
3859 }
3860 /**
3861 * Returns whether the payload is a regular expression (RegExp)
3862 *
3863 * @param {*} payload
3864 * @returns {payload is RegExp}
3865 */
3866 function isRegExp(payload) {
3867 return getType(payload) === 'RegExp';
3868 }
3869 /**
3870 * Returns whether the payload is a Map
3871 *
3872 * @param {*} payload
3873 * @returns {payload is Map<any, any>}
3874 */
3875 function isMap(payload) {
3876 return getType(payload) === 'Map';
3877 }
3878 /**
3879 * Returns whether the payload is a WeakMap
3880 *
3881 * @param {*} payload
3882 * @returns {payload is WeakMap<any, any>}
3883 */
3884 function isWeakMap(payload) {
3885 return getType(payload) === 'WeakMap';
3886 }
3887 /**
3888 * Returns whether the payload is a Set
3889 *
3890 * @param {*} payload
3891 * @returns {payload is Set<any>}
3892 */
3893 function isSet(payload) {
3894 return getType(payload) === 'Set';
3895 }
3896 /**
3897 * Returns whether the payload is a WeakSet
3898 *
3899 * @param {*} payload
3900 * @returns {payload is WeakSet<any>}
3901 */
3902 function isWeakSet(payload) {
3903 return getType(payload) === 'WeakSet';
3904 }
3905 /**
3906 * Returns whether the payload is a Symbol
3907 *
3908 * @param {*} payload
3909 * @returns {payload is symbol}
3910 */
3911 function isSymbol(payload) {
3912 return getType(payload) === 'Symbol';
3913 }
3914 /**
3915 * Returns whether the payload is a Date, and that the date is valid
3916 *
3917 * @param {*} payload
3918 * @returns {payload is Date}
3919 */
3920 function isDate(payload) {
3921 return getType(payload) === 'Date' && !isNaN(payload);
3922 }
3923 /**
3924 * Returns whether the payload is a Blob
3925 *
3926 * @param {*} payload
3927 * @returns {payload is Blob}
3928 */
3929 function isBlob(payload) {
3930 return getType(payload) === 'Blob';
3931 }
3932 /**
3933 * Returns whether the payload is a File
3934 *
3935 * @param {*} payload
3936 * @returns {payload is File}
3937 */
3938 function isFile(payload) {
3939 return getType(payload) === 'File';
3940 }
3941 /**
3942 * Returns whether the payload is a Promise
3943 *
3944 * @param {*} payload
3945 * @returns {payload is Promise<any>}
3946 */
3947 function isPromise(payload) {
3948 return getType(payload) === 'Promise';
3949 }
3950 /**
3951 * Returns whether the payload is an Error
3952 *
3953 * @param {*} payload
3954 * @returns {payload is Error}
3955 */
3956 function isError(payload) {
3957 return getType(payload) === 'Error';
3958 }
3959 /**
3960 * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
3961 *
3962 * @param {*} payload
3963 * @returns {payload is typeof NaN}
3964 */
3965 function isNaNValue(payload) {
3966 return getType(payload) === 'Number' && isNaN(payload);
3967 }
3968 /**
3969 * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
3970 *
3971 * @param {*} payload
3972 * @returns {(payload is boolean | null | undefined | number | string | symbol)}
3973 */
3974 function isPrimitive(payload) {
3975 return (isBoolean(payload) ||
3976 isNull(payload) ||
3977 isUndefined(payload) ||
3978 isNumber(payload) ||
3979 isString(payload) ||
3980 isSymbol(payload));
3981 }
3982 /**
3983 * Returns true whether the payload is null or undefined
3984 *
3985 * @param {*} payload
3986 * @returns {(payload is null | undefined)}
3987 */
3988 var isNullOrUndefined = isOneOf(isNull, isUndefined);
3989 function isOneOf(a, b, c, d, e) {
3990 return function (value) {
3991 return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));
3992 };
3993 }
3994 /**
3995 * Does a generic check to check that the given payload is of a given type.
3996 * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
3997 * It will, however, differentiate between object and null
3998 *
3999 * @template T
4000 * @param {*} payload
4001 * @param {T} type
4002 * @throws {TypeError} Will throw type error if type is an invalid type
4003 * @returns {payload is T}
4004 */
4005 function isType(payload, type) {
4006 if (!(type instanceof Function)) {
4007 throw new TypeError('Type must be a function');
4008 }
4009 if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
4010 throw new TypeError('Type is not a class');
4011 }
4012 // Classes usually have names (as functions usually have names)
4013 var name = type.name;
4014 return getType(payload) === name || Boolean(payload && payload.constructor === type);
4015 }
4016
4017
4018
4019
4020 /***/ }),
4021
4022 /***/ "./node_modules/lodash/_Symbol.js":
4023 /*!****************************************!*\
4024 !*** ./node_modules/lodash/_Symbol.js ***!
4025 \****************************************/
4026 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4027
4028 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4029
4030 /** Built-in value references. */
4031 var Symbol = root.Symbol;
4032
4033 module.exports = Symbol;
4034
4035
4036 /***/ }),
4037
4038 /***/ "./node_modules/lodash/_baseGetTag.js":
4039 /*!********************************************!*\
4040 !*** ./node_modules/lodash/_baseGetTag.js ***!
4041 \********************************************/
4042 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4043
4044 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
4045 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
4046 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
4047
4048 /** `Object#toString` result references. */
4049 var nullTag = '[object Null]',
4050 undefinedTag = '[object Undefined]';
4051
4052 /** Built-in value references. */
4053 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4054
4055 /**
4056 * The base implementation of `getTag` without fallbacks for buggy environments.
4057 *
4058 * @private
4059 * @param {*} value The value to query.
4060 * @returns {string} Returns the `toStringTag`.
4061 */
4062 function baseGetTag(value) {
4063 if (value == null) {
4064 return value === undefined ? undefinedTag : nullTag;
4065 }
4066 return (symToStringTag && symToStringTag in Object(value))
4067 ? getRawTag(value)
4068 : objectToString(value);
4069 }
4070
4071 module.exports = baseGetTag;
4072
4073
4074 /***/ }),
4075
4076 /***/ "./node_modules/lodash/_baseTrim.js":
4077 /*!******************************************!*\
4078 !*** ./node_modules/lodash/_baseTrim.js ***!
4079 \******************************************/
4080 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4081
4082 var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
4083
4084 /** Used to match leading whitespace. */
4085 var reTrimStart = /^\s+/;
4086
4087 /**
4088 * The base implementation of `_.trim`.
4089 *
4090 * @private
4091 * @param {string} string The string to trim.
4092 * @returns {string} Returns the trimmed string.
4093 */
4094 function baseTrim(string) {
4095 return string
4096 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
4097 : string;
4098 }
4099
4100 module.exports = baseTrim;
4101
4102
4103 /***/ }),
4104
4105 /***/ "./node_modules/lodash/_freeGlobal.js":
4106 /*!********************************************!*\
4107 !*** ./node_modules/lodash/_freeGlobal.js ***!
4108 \********************************************/
4109 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4110
4111 /** Detect free variable `global` from Node.js. */
4112 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
4113
4114 module.exports = freeGlobal;
4115
4116
4117 /***/ }),
4118
4119 /***/ "./node_modules/lodash/_getRawTag.js":
4120 /*!*******************************************!*\
4121 !*** ./node_modules/lodash/_getRawTag.js ***!
4122 \*******************************************/
4123 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4124
4125 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
4126
4127 /** Used for built-in method references. */
4128 var objectProto = Object.prototype;
4129
4130 /** Used to check objects for own properties. */
4131 var hasOwnProperty = objectProto.hasOwnProperty;
4132
4133 /**
4134 * Used to resolve the
4135 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4136 * of values.
4137 */
4138 var nativeObjectToString = objectProto.toString;
4139
4140 /** Built-in value references. */
4141 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4142
4143 /**
4144 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
4145 *
4146 * @private
4147 * @param {*} value The value to query.
4148 * @returns {string} Returns the raw `toStringTag`.
4149 */
4150 function getRawTag(value) {
4151 var isOwn = hasOwnProperty.call(value, symToStringTag),
4152 tag = value[symToStringTag];
4153
4154 try {
4155 value[symToStringTag] = undefined;
4156 var unmasked = true;
4157 } catch (e) {}
4158
4159 var result = nativeObjectToString.call(value);
4160 if (unmasked) {
4161 if (isOwn) {
4162 value[symToStringTag] = tag;
4163 } else {
4164 delete value[symToStringTag];
4165 }
4166 }
4167 return result;
4168 }
4169
4170 module.exports = getRawTag;
4171
4172
4173 /***/ }),
4174
4175 /***/ "./node_modules/lodash/_objectToString.js":
4176 /*!************************************************!*\
4177 !*** ./node_modules/lodash/_objectToString.js ***!
4178 \************************************************/
4179 /***/ ((module) => {
4180
4181 /** Used for built-in method references. */
4182 var objectProto = Object.prototype;
4183
4184 /**
4185 * Used to resolve the
4186 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4187 * of values.
4188 */
4189 var nativeObjectToString = objectProto.toString;
4190
4191 /**
4192 * Converts `value` to a string using `Object.prototype.toString`.
4193 *
4194 * @private
4195 * @param {*} value The value to convert.
4196 * @returns {string} Returns the converted string.
4197 */
4198 function objectToString(value) {
4199 return nativeObjectToString.call(value);
4200 }
4201
4202 module.exports = objectToString;
4203
4204
4205 /***/ }),
4206
4207 /***/ "./node_modules/lodash/_root.js":
4208 /*!**************************************!*\
4209 !*** ./node_modules/lodash/_root.js ***!
4210 \**************************************/
4211 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4212
4213 var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
4214
4215 /** Detect free variable `self`. */
4216 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4217
4218 /** Used as a reference to the global object. */
4219 var root = freeGlobal || freeSelf || Function('return this')();
4220
4221 module.exports = root;
4222
4223
4224 /***/ }),
4225
4226 /***/ "./node_modules/lodash/_trimmedEndIndex.js":
4227 /*!*************************************************!*\
4228 !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
4229 \*************************************************/
4230 /***/ ((module) => {
4231
4232 /** Used to match a single whitespace character. */
4233 var reWhitespace = /\s/;
4234
4235 /**
4236 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
4237 * character of `string`.
4238 *
4239 * @private
4240 * @param {string} string The string to inspect.
4241 * @returns {number} Returns the index of the last non-whitespace character.
4242 */
4243 function trimmedEndIndex(string) {
4244 var index = string.length;
4245
4246 while (index-- && reWhitespace.test(string.charAt(index))) {}
4247 return index;
4248 }
4249
4250 module.exports = trimmedEndIndex;
4251
4252
4253 /***/ }),
4254
4255 /***/ "./node_modules/lodash/debounce.js":
4256 /*!*****************************************!*\
4257 !*** ./node_modules/lodash/debounce.js ***!
4258 \*****************************************/
4259 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4260
4261 var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4262 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
4263 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
4264
4265 /** Error message constants. */
4266 var FUNC_ERROR_TEXT = 'Expected a function';
4267
4268 /* Built-in method references for those with the same name as other `lodash` methods. */
4269 var nativeMax = Math.max,
4270 nativeMin = Math.min;
4271
4272 /**
4273 * Creates a debounced function that delays invoking `func` until after `wait`
4274 * milliseconds have elapsed since the last time the debounced function was
4275 * invoked. The debounced function comes with a `cancel` method to cancel
4276 * delayed `func` invocations and a `flush` method to immediately invoke them.
4277 * Provide `options` to indicate whether `func` should be invoked on the
4278 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
4279 * with the last arguments provided to the debounced function. Subsequent
4280 * calls to the debounced function return the result of the last `func`
4281 * invocation.
4282 *
4283 * **Note:** If `leading` and `trailing` options are `true`, `func` is
4284 * invoked on the trailing edge of the timeout only if the debounced function
4285 * is invoked more than once during the `wait` timeout.
4286 *
4287 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
4288 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
4289 *
4290 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
4291 * for details over the differences between `_.debounce` and `_.throttle`.
4292 *
4293 * @static
4294 * @memberOf _
4295 * @since 0.1.0
4296 * @category Function
4297 * @param {Function} func The function to debounce.
4298 * @param {number} [wait=0] The number of milliseconds to delay.
4299 * @param {Object} [options={}] The options object.
4300 * @param {boolean} [options.leading=false]
4301 * Specify invoking on the leading edge of the timeout.
4302 * @param {number} [options.maxWait]
4303 * The maximum time `func` is allowed to be delayed before it's invoked.
4304 * @param {boolean} [options.trailing=true]
4305 * Specify invoking on the trailing edge of the timeout.
4306 * @returns {Function} Returns the new debounced function.
4307 * @example
4308 *
4309 * // Avoid costly calculations while the window size is in flux.
4310 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
4311 *
4312 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
4313 * jQuery(element).on('click', _.debounce(sendMail, 300, {
4314 * 'leading': true,
4315 * 'trailing': false
4316 * }));
4317 *
4318 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
4319 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
4320 * var source = new EventSource('/stream');
4321 * jQuery(source).on('message', debounced);
4322 *
4323 * // Cancel the trailing debounced invocation.
4324 * jQuery(window).on('popstate', debounced.cancel);
4325 */
4326 function debounce(func, wait, options) {
4327 var lastArgs,
4328 lastThis,
4329 maxWait,
4330 result,
4331 timerId,
4332 lastCallTime,
4333 lastInvokeTime = 0,
4334 leading = false,
4335 maxing = false,
4336 trailing = true;
4337
4338 if (typeof func != 'function') {
4339 throw new TypeError(FUNC_ERROR_TEXT);
4340 }
4341 wait = toNumber(wait) || 0;
4342 if (isObject(options)) {
4343 leading = !!options.leading;
4344 maxing = 'maxWait' in options;
4345 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
4346 trailing = 'trailing' in options ? !!options.trailing : trailing;
4347 }
4348
4349 function invokeFunc(time) {
4350 var args = lastArgs,
4351 thisArg = lastThis;
4352
4353 lastArgs = lastThis = undefined;
4354 lastInvokeTime = time;
4355 result = func.apply(thisArg, args);
4356 return result;
4357 }
4358
4359 function leadingEdge(time) {
4360 // Reset any `maxWait` timer.
4361 lastInvokeTime = time;
4362 // Start the timer for the trailing edge.
4363 timerId = setTimeout(timerExpired, wait);
4364 // Invoke the leading edge.
4365 return leading ? invokeFunc(time) : result;
4366 }
4367
4368 function remainingWait(time) {
4369 var timeSinceLastCall = time - lastCallTime,
4370 timeSinceLastInvoke = time - lastInvokeTime,
4371 timeWaiting = wait - timeSinceLastCall;
4372
4373 return maxing
4374 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
4375 : timeWaiting;
4376 }
4377
4378 function shouldInvoke(time) {
4379 var timeSinceLastCall = time - lastCallTime,
4380 timeSinceLastInvoke = time - lastInvokeTime;
4381
4382 // Either this is the first call, activity has stopped and we're at the
4383 // trailing edge, the system time has gone backwards and we're treating
4384 // it as the trailing edge, or we've hit the `maxWait` limit.
4385 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
4386 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
4387 }
4388
4389 function timerExpired() {
4390 var time = now();
4391 if (shouldInvoke(time)) {
4392 return trailingEdge(time);
4393 }
4394 // Restart the timer.
4395 timerId = setTimeout(timerExpired, remainingWait(time));
4396 }
4397
4398 function trailingEdge(time) {
4399 timerId = undefined;
4400
4401 // Only invoke if we have `lastArgs` which means `func` has been
4402 // debounced at least once.
4403 if (trailing && lastArgs) {
4404 return invokeFunc(time);
4405 }
4406 lastArgs = lastThis = undefined;
4407 return result;
4408 }
4409
4410 function cancel() {
4411 if (timerId !== undefined) {
4412 clearTimeout(timerId);
4413 }
4414 lastInvokeTime = 0;
4415 lastArgs = lastCallTime = lastThis = timerId = undefined;
4416 }
4417
4418 function flush() {
4419 return timerId === undefined ? result : trailingEdge(now());
4420 }
4421
4422 function debounced() {
4423 var time = now(),
4424 isInvoking = shouldInvoke(time);
4425
4426 lastArgs = arguments;
4427 lastThis = this;
4428 lastCallTime = time;
4429
4430 if (isInvoking) {
4431 if (timerId === undefined) {
4432 return leadingEdge(lastCallTime);
4433 }
4434 if (maxing) {
4435 // Handle invocations in a tight loop.
4436 clearTimeout(timerId);
4437 timerId = setTimeout(timerExpired, wait);
4438 return invokeFunc(lastCallTime);
4439 }
4440 }
4441 if (timerId === undefined) {
4442 timerId = setTimeout(timerExpired, wait);
4443 }
4444 return result;
4445 }
4446 debounced.cancel = cancel;
4447 debounced.flush = flush;
4448 return debounced;
4449 }
4450
4451 module.exports = debounce;
4452
4453
4454 /***/ }),
4455
4456 /***/ "./node_modules/lodash/isObject.js":
4457 /*!*****************************************!*\
4458 !*** ./node_modules/lodash/isObject.js ***!
4459 \*****************************************/
4460 /***/ ((module) => {
4461
4462 /**
4463 * Checks if `value` is the
4464 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4465 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4466 *
4467 * @static
4468 * @memberOf _
4469 * @since 0.1.0
4470 * @category Lang
4471 * @param {*} value The value to check.
4472 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4473 * @example
4474 *
4475 * _.isObject({});
4476 * // => true
4477 *
4478 * _.isObject([1, 2, 3]);
4479 * // => true
4480 *
4481 * _.isObject(_.noop);
4482 * // => true
4483 *
4484 * _.isObject(null);
4485 * // => false
4486 */
4487 function isObject(value) {
4488 var type = typeof value;
4489 return value != null && (type == 'object' || type == 'function');
4490 }
4491
4492 module.exports = isObject;
4493
4494
4495 /***/ }),
4496
4497 /***/ "./node_modules/lodash/isObjectLike.js":
4498 /*!*********************************************!*\
4499 !*** ./node_modules/lodash/isObjectLike.js ***!
4500 \*********************************************/
4501 /***/ ((module) => {
4502
4503 /**
4504 * Checks if `value` is object-like. A value is object-like if it's not `null`
4505 * and has a `typeof` result of "object".
4506 *
4507 * @static
4508 * @memberOf _
4509 * @since 4.0.0
4510 * @category Lang
4511 * @param {*} value The value to check.
4512 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4513 * @example
4514 *
4515 * _.isObjectLike({});
4516 * // => true
4517 *
4518 * _.isObjectLike([1, 2, 3]);
4519 * // => true
4520 *
4521 * _.isObjectLike(_.noop);
4522 * // => false
4523 *
4524 * _.isObjectLike(null);
4525 * // => false
4526 */
4527 function isObjectLike(value) {
4528 return value != null && typeof value == 'object';
4529 }
4530
4531 module.exports = isObjectLike;
4532
4533
4534 /***/ }),
4535
4536 /***/ "./node_modules/lodash/isSymbol.js":
4537 /*!*****************************************!*\
4538 !*** ./node_modules/lodash/isSymbol.js ***!
4539 \*****************************************/
4540 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4541
4542 var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
4543 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
4544
4545 /** `Object#toString` result references. */
4546 var symbolTag = '[object Symbol]';
4547
4548 /**
4549 * Checks if `value` is classified as a `Symbol` primitive or object.
4550 *
4551 * @static
4552 * @memberOf _
4553 * @since 4.0.0
4554 * @category Lang
4555 * @param {*} value The value to check.
4556 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4557 * @example
4558 *
4559 * _.isSymbol(Symbol.iterator);
4560 * // => true
4561 *
4562 * _.isSymbol('abc');
4563 * // => false
4564 */
4565 function isSymbol(value) {
4566 return typeof value == 'symbol' ||
4567 (isObjectLike(value) && baseGetTag(value) == symbolTag);
4568 }
4569
4570 module.exports = isSymbol;
4571
4572
4573 /***/ }),
4574
4575 /***/ "./node_modules/lodash/now.js":
4576 /*!************************************!*\
4577 !*** ./node_modules/lodash/now.js ***!
4578 \************************************/
4579 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4580
4581 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4582
4583 /**
4584 * Gets the timestamp of the number of milliseconds that have elapsed since
4585 * the Unix epoch (1 January 1970 00:00:00 UTC).
4586 *
4587 * @static
4588 * @memberOf _
4589 * @since 2.4.0
4590 * @category Date
4591 * @returns {number} Returns the timestamp.
4592 * @example
4593 *
4594 * _.defer(function(stamp) {
4595 * console.log(_.now() - stamp);
4596 * }, _.now());
4597 * // => Logs the number of milliseconds it took for the deferred invocation.
4598 */
4599 var now = function() {
4600 return root.Date.now();
4601 };
4602
4603 module.exports = now;
4604
4605
4606 /***/ }),
4607
4608 /***/ "./node_modules/lodash/toNumber.js":
4609 /*!*****************************************!*\
4610 !*** ./node_modules/lodash/toNumber.js ***!
4611 \*****************************************/
4612 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4613
4614 var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
4615 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4616 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
4617
4618 /** Used as references for various `Number` constants. */
4619 var NAN = 0 / 0;
4620
4621 /** Used to detect bad signed hexadecimal string values. */
4622 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
4623
4624 /** Used to detect binary string values. */
4625 var reIsBinary = /^0b[01]+$/i;
4626
4627 /** Used to detect octal string values. */
4628 var reIsOctal = /^0o[0-7]+$/i;
4629
4630 /** Built-in method references without a dependency on `root`. */
4631 var freeParseInt = parseInt;
4632
4633 /**
4634 * Converts `value` to a number.
4635 *
4636 * @static
4637 * @memberOf _
4638 * @since 4.0.0
4639 * @category Lang
4640 * @param {*} value The value to process.
4641 * @returns {number} Returns the number.
4642 * @example
4643 *
4644 * _.toNumber(3.2);
4645 * // => 3.2
4646 *
4647 * _.toNumber(Number.MIN_VALUE);
4648 * // => 5e-324
4649 *
4650 * _.toNumber(Infinity);
4651 * // => Infinity
4652 *
4653 * _.toNumber('3.2');
4654 * // => 3.2
4655 */
4656 function toNumber(value) {
4657 if (typeof value == 'number') {
4658 return value;
4659 }
4660 if (isSymbol(value)) {
4661 return NAN;
4662 }
4663 if (isObject(value)) {
4664 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
4665 value = isObject(other) ? (other + '') : other;
4666 }
4667 if (typeof value != 'string') {
4668 return value === 0 ? value : +value;
4669 }
4670 value = baseTrim(value);
4671 var isBinary = reIsBinary.test(value);
4672 return (isBinary || reIsOctal.test(value))
4673 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
4674 : (reIsBadHex.test(value) ? NAN : +value);
4675 }
4676
4677 module.exports = toNumber;
4678
4679
4680 /***/ }),
4681
4682 /***/ "./node_modules/memoize-one/dist/memoize-one.esm.js":
4683 /*!**********************************************************!*\
4684 !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***!
4685 \**********************************************************/
4686 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4687
4688 "use strict";
4689 __webpack_require__.r(__webpack_exports__);
4690 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4691 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4692 /* harmony export */ });
4693 var safeIsNaN = Number.isNaN ||
4694 function ponyfill(value) {
4695 return typeof value === 'number' && value !== value;
4696 };
4697 function isEqual(first, second) {
4698 if (first === second) {
4699 return true;
4700 }
4701 if (safeIsNaN(first) && safeIsNaN(second)) {
4702 return true;
4703 }
4704 return false;
4705 }
4706 function areInputsEqual(newInputs, lastInputs) {
4707 if (newInputs.length !== lastInputs.length) {
4708 return false;
4709 }
4710 for (var i = 0; i < newInputs.length; i++) {
4711 if (!isEqual(newInputs[i], lastInputs[i])) {
4712 return false;
4713 }
4714 }
4715 return true;
4716 }
4717
4718 function memoizeOne(resultFn, isEqual) {
4719 if (isEqual === void 0) { isEqual = areInputsEqual; }
4720 var lastThis;
4721 var lastArgs = [];
4722 var lastResult;
4723 var calledOnce = false;
4724 function memoized() {
4725 var newArgs = [];
4726 for (var _i = 0; _i < arguments.length; _i++) {
4727 newArgs[_i] = arguments[_i];
4728 }
4729 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
4730 return lastResult;
4731 }
4732 lastResult = resultFn.apply(this, newArgs);
4733 calledOnce = true;
4734 lastThis = this;
4735 lastArgs = newArgs;
4736 return lastResult;
4737 }
4738 return memoized;
4739 }
4740
4741 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeOne);
4742
4743
4744 /***/ }),
4745
4746 /***/ "./node_modules/merge-anything/dist/index.esm.js":
4747 /*!*******************************************************!*\
4748 !*** ./node_modules/merge-anything/dist/index.esm.js ***!
4749 \*******************************************************/
4750 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4751
4752 "use strict";
4753 __webpack_require__.r(__webpack_exports__);
4754 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4755 /* harmony export */ "concatArrays": () => (/* binding */ concatArrays),
4756 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4757 /* harmony export */ "merge": () => (/* binding */ merge)
4758 /* harmony export */ });
4759 /* harmony import */ var is_what__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-what */ "./node_modules/is-what/dist/index.esm.js");
4760
4761
4762 /*! *****************************************************************************
4763 Copyright (c) Microsoft Corporation. All rights reserved.
4764 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4765 this file except in compliance with the License. You may obtain a copy of the
4766 License at http://www.apache.org/licenses/LICENSE-2.0
4767
4768 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4769 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
4770 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
4771 MERCHANTABLITY OR NON-INFRINGEMENT.
4772
4773 See the Apache Version 2.0 License for specific language governing permissions
4774 and limitations under the License.
4775 ***************************************************************************** */
4776
4777 function __spreadArrays() {
4778 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4779 for (var r = Array(s), k = 0, i = 0; i < il; i++)
4780 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4781 r[k] = a[j];
4782 return r;
4783 }
4784
4785 function assignProp(carry, key, newVal, originalObject) {
4786 var propType = originalObject.propertyIsEnumerable(key)
4787 ? 'enumerable'
4788 : 'nonenumerable';
4789 if (propType === 'enumerable')
4790 carry[key] = newVal;
4791 if (propType === 'nonenumerable') {
4792 Object.defineProperty(carry, key, {
4793 value: newVal,
4794 enumerable: false,
4795 writable: true,
4796 configurable: true
4797 });
4798 }
4799 }
4800 function mergeRecursively(origin, newComer, extensions) {
4801 // work directly on newComer if its not an object
4802 if (!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newComer)) {
4803 // extend merge rules
4804 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4805 extensions.forEach(function (extend) {
4806 newComer = extend(origin, newComer);
4807 });
4808 }
4809 return newComer;
4810 }
4811 // define newObject to merge all values upon
4812 var newObject = {};
4813 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin)) {
4814 var props_1 = Object.getOwnPropertyNames(origin);
4815 var symbols_1 = Object.getOwnPropertySymbols(origin);
4816 newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {
4817 // @ts-ignore
4818 var targetVal = origin[key];
4819 if ((!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||
4820 ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {
4821 assignProp(carry, key, targetVal, origin);
4822 }
4823 return carry;
4824 }, {});
4825 }
4826 var props = Object.getOwnPropertyNames(newComer);
4827 var symbols = Object.getOwnPropertySymbols(newComer);
4828 var result = __spreadArrays(props, symbols).reduce(function (carry, key) {
4829 // re-define the origin and newComer as targetVal and newVal
4830 var newVal = newComer[key];
4831 var targetVal = ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin))
4832 // @ts-ignore
4833 ? origin[key]
4834 : undefined;
4835 // extend merge rules
4836 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4837 extensions.forEach(function (extend) {
4838 newVal = extend(targetVal, newVal);
4839 });
4840 }
4841 // When newVal is an object do the merge recursively
4842 if (targetVal !== undefined && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newVal)) {
4843 newVal = mergeRecursively(targetVal, newVal, extensions);
4844 }
4845 assignProp(carry, key, newVal, newComer);
4846 return carry;
4847 }, newObject);
4848 return result;
4849 }
4850 /**
4851 * Merge anything recursively.
4852 * Objects get merged, special objects (classes etc.) are re-assigned "as is".
4853 * Basic types overwrite objects or other basic types.
4854 *
4855 * @param {(IConfig | any)} origin
4856 * @param {...any[]} newComers
4857 * @returns the result
4858 */
4859 function merge(origin) {
4860 var newComers = [];
4861 for (var _i = 1; _i < arguments.length; _i++) {
4862 newComers[_i - 1] = arguments[_i];
4863 }
4864 var extensions = null;
4865 var base = origin;
4866 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin) && origin.extensions && Object.keys(origin).length === 1) {
4867 base = {};
4868 extensions = origin.extensions;
4869 }
4870 return newComers.reduce(function (result, newComer) {
4871 return mergeRecursively(result, newComer, extensions);
4872 }, base);
4873 }
4874
4875 function concatArrays(originVal, newVal) {
4876 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(originVal) && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(newVal)) {
4877 // concat logic
4878 return originVal.concat(newVal);
4879 }
4880 return newVal; // always return newVal as fallback!!
4881 }
4882
4883 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);
4884
4885
4886
4887 /***/ }),
4888
4889 /***/ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts":
4890 /*!****************************************************************************************************************************************************************************************!*\
4891 !*** ./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts ***!
4892 \****************************************************************************************************************************************************************************************/
4893 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4894
4895 "use strict";
4896 __webpack_require__.r(__webpack_exports__);
4897 // extracted by mini-css-extract-plugin
4898
4899
4900 /***/ }),
4901
4902 /***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx":
4903 /*!*******************************************************************************************************************************************************************************!*\
4904 !*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***!
4905 \*******************************************************************************************************************************************************************************/
4906 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4907
4908 "use strict";
4909 __webpack_require__.r(__webpack_exports__);
4910 // extracted by mini-css-extract-plugin
4911
4912
4913 /***/ }),
4914
4915 /***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts":
4916 /*!************************************************************************************************************************************************************************************!*\
4917 !*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***!
4918 \************************************************************************************************************************************************************************************/
4919 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4920
4921 "use strict";
4922 __webpack_require__.r(__webpack_exports__);
4923 // extracted by mini-css-extract-plugin
4924
4925
4926 /***/ }),
4927
4928 /***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx":
4929 /*!***********************************************************************************************************************************************************************************!*\
4930 !*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***!
4931 \***********************************************************************************************************************************************************************************/
4932 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4933
4934 "use strict";
4935 __webpack_require__.r(__webpack_exports__);
4936 // extracted by mini-css-extract-plugin
4937
4938
4939 /***/ }),
4940
4941 /***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts":
4942 /*!************************************************************************************************************************************************************************************!*\
4943 !*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***!
4944 \************************************************************************************************************************************************************************************/
4945 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4946
4947 "use strict";
4948 __webpack_require__.r(__webpack_exports__);
4949 // extracted by mini-css-extract-plugin
4950
4951
4952 /***/ }),
4953
4954 /***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts":
4955 /*!******************************************************************************************************************************************************************************************!*\
4956 !*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***!
4957 \******************************************************************************************************************************************************************************************/
4958 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4959
4960 "use strict";
4961 __webpack_require__.r(__webpack_exports__);
4962 // extracted by mini-css-extract-plugin
4963
4964
4965 /***/ }),
4966
4967 /***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts":
4968 /*!**************************************************************************************************************************************************************************************!*\
4969 !*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***!
4970 \**************************************************************************************************************************************************************************************/
4971 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4972
4973 "use strict";
4974 __webpack_require__.r(__webpack_exports__);
4975 // extracted by mini-css-extract-plugin
4976
4977
4978 /***/ }),
4979
4980 /***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts":
4981 /*!************************************************************************************************************************************************************************************!*\
4982 !*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***!
4983 \************************************************************************************************************************************************************************************/
4984 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4985
4986 "use strict";
4987 __webpack_require__.r(__webpack_exports__);
4988 // extracted by mini-css-extract-plugin
4989
4990
4991 /***/ }),
4992
4993 /***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx":
4994 /*!***************************************************************************************************************************************************************************************!*\
4995 !*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***!
4996 \***************************************************************************************************************************************************************************************/
4997 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4998
4999 "use strict";
5000 __webpack_require__.r(__webpack_exports__);
5001 // extracted by mini-css-extract-plugin
5002
5003
5004 /***/ }),
5005
5006 /***/ "./node_modules/object-assign/index.js":
5007 /*!*********************************************!*\
5008 !*** ./node_modules/object-assign/index.js ***!
5009 \*********************************************/
5010 /***/ ((module) => {
5011
5012 "use strict";
5013 /*
5014 object-assign
5015 (c) Sindre Sorhus
5016 @license MIT
5017 */
5018
5019
5020 /* eslint-disable no-unused-vars */
5021 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5022 var hasOwnProperty = Object.prototype.hasOwnProperty;
5023 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
5024
5025 function toObject(val) {
5026 if (val === null || val === undefined) {
5027 throw new TypeError('Object.assign cannot be called with null or undefined');
5028 }
5029
5030 return Object(val);
5031 }
5032
5033 function shouldUseNative() {
5034 try {
5035 if (!Object.assign) {
5036 return false;
5037 }
5038
5039 // Detect buggy property enumeration order in older V8 versions.
5040
5041 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
5042 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
5043 test1[5] = 'de';
5044 if (Object.getOwnPropertyNames(test1)[0] === '5') {
5045 return false;
5046 }
5047
5048 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5049 var test2 = {};
5050 for (var i = 0; i < 10; i++) {
5051 test2['_' + String.fromCharCode(i)] = i;
5052 }
5053 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
5054 return test2[n];
5055 });
5056 if (order2.join('') !== '0123456789') {
5057 return false;
5058 }
5059
5060 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5061 var test3 = {};
5062 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
5063 test3[letter] = letter;
5064 });
5065 if (Object.keys(Object.assign({}, test3)).join('') !==
5066 'abcdefghijklmnopqrst') {
5067 return false;
5068 }
5069
5070 return true;
5071 } catch (err) {
5072 // We don't expect any of the above to throw, but better to be safe.
5073 return false;
5074 }
5075 }
5076
5077 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
5078 var from;
5079 var to = toObject(target);
5080 var symbols;
5081
5082 for (var s = 1; s < arguments.length; s++) {
5083 from = Object(arguments[s]);
5084
5085 for (var key in from) {
5086 if (hasOwnProperty.call(from, key)) {
5087 to[key] = from[key];
5088 }
5089 }
5090
5091 if (getOwnPropertySymbols) {
5092 symbols = getOwnPropertySymbols(from);
5093 for (var i = 0; i < symbols.length; i++) {
5094 if (propIsEnumerable.call(from, symbols[i])) {
5095 to[symbols[i]] = from[symbols[i]];
5096 }
5097 }
5098 }
5099 }
5100
5101 return to;
5102 };
5103
5104
5105 /***/ }),
5106
5107 /***/ "./node_modules/prop-types/checkPropTypes.js":
5108 /*!***************************************************!*\
5109 !*** ./node_modules/prop-types/checkPropTypes.js ***!
5110 \***************************************************/
5111 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5112
5113 "use strict";
5114 /**
5115 * Copyright (c) 2013-present, Facebook, Inc.
5116 *
5117 * This source code is licensed under the MIT license found in the
5118 * LICENSE file in the root directory of this source tree.
5119 */
5120
5121
5122
5123 var printWarning = function() {};
5124
5125 if (true) {
5126 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5127 var loggedTypeFailures = {};
5128 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5129
5130 printWarning = function(text) {
5131 var message = 'Warning: ' + text;
5132 if (typeof console !== 'undefined') {
5133 console.error(message);
5134 }
5135 try {
5136 // --- Welcome to debugging React ---
5137 // This error was thrown as a convenience so that you can use this stack
5138 // to find the callsite that caused this warning to fire.
5139 throw new Error(message);
5140 } catch (x) { /**/ }
5141 };
5142 }
5143
5144 /**
5145 * Assert that the values match with the type specs.
5146 * Error messages are memorized and will only be shown once.
5147 *
5148 * @param {object} typeSpecs Map of name to a ReactPropType
5149 * @param {object} values Runtime values that need to be type-checked
5150 * @param {string} location e.g. "prop", "context", "child context"
5151 * @param {string} componentName Name of the component for error messages.
5152 * @param {?Function} getStack Returns the component stack.
5153 * @private
5154 */
5155 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
5156 if (true) {
5157 for (var typeSpecName in typeSpecs) {
5158 if (has(typeSpecs, typeSpecName)) {
5159 var error;
5160 // Prop type validation may throw. In case they do, we don't want to
5161 // fail the render phase where it didn't fail before. So we log it.
5162 // After these have been cleaned up, we'll let them throw.
5163 try {
5164 // This is intentionally an invariant that gets caught. It's the same
5165 // behavior as without this statement except with a better message.
5166 if (typeof typeSpecs[typeSpecName] !== 'function') {
5167 var err = Error(
5168 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
5169 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
5170 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
5171 );
5172 err.name = 'Invariant Violation';
5173 throw err;
5174 }
5175 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
5176 } catch (ex) {
5177 error = ex;
5178 }
5179 if (error && !(error instanceof Error)) {
5180 printWarning(
5181 (componentName || 'React class') + ': type specification of ' +
5182 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
5183 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
5184 'You may have forgotten to pass an argument to the type checker ' +
5185 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
5186 'shape all require an argument).'
5187 );
5188 }
5189 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
5190 // Only monitor this failure once because there tends to be a lot of the
5191 // same error.
5192 loggedTypeFailures[error.message] = true;
5193
5194 var stack = getStack ? getStack() : '';
5195
5196 printWarning(
5197 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
5198 );
5199 }
5200 }
5201 }
5202 }
5203 }
5204
5205 /**
5206 * Resets warning cache when testing.
5207 *
5208 * @private
5209 */
5210 checkPropTypes.resetWarningCache = function() {
5211 if (true) {
5212 loggedTypeFailures = {};
5213 }
5214 }
5215
5216 module.exports = checkPropTypes;
5217
5218
5219 /***/ }),
5220
5221 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
5222 /*!************************************************************!*\
5223 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
5224 \************************************************************/
5225 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5226
5227 "use strict";
5228 /**
5229 * Copyright (c) 2013-present, Facebook, Inc.
5230 *
5231 * This source code is licensed under the MIT license found in the
5232 * LICENSE file in the root directory of this source tree.
5233 */
5234
5235
5236
5237 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5238 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
5239
5240 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5241 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5242 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
5243
5244 var printWarning = function() {};
5245
5246 if (true) {
5247 printWarning = function(text) {
5248 var message = 'Warning: ' + text;
5249 if (typeof console !== 'undefined') {
5250 console.error(message);
5251 }
5252 try {
5253 // --- Welcome to debugging React ---
5254 // This error was thrown as a convenience so that you can use this stack
5255 // to find the callsite that caused this warning to fire.
5256 throw new Error(message);
5257 } catch (x) {}
5258 };
5259 }
5260
5261 function emptyFunctionThatReturnsNull() {
5262 return null;
5263 }
5264
5265 module.exports = function(isValidElement, throwOnDirectAccess) {
5266 /* global Symbol */
5267 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
5268 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
5269
5270 /**
5271 * Returns the iterator method function contained on the iterable object.
5272 *
5273 * Be sure to invoke the function with the iterable as context:
5274 *
5275 * var iteratorFn = getIteratorFn(myIterable);
5276 * if (iteratorFn) {
5277 * var iterator = iteratorFn.call(myIterable);
5278 * ...
5279 * }
5280 *
5281 * @param {?object} maybeIterable
5282 * @return {?function}
5283 */
5284 function getIteratorFn(maybeIterable) {
5285 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
5286 if (typeof iteratorFn === 'function') {
5287 return iteratorFn;
5288 }
5289 }
5290
5291 /**
5292 * Collection of methods that allow declaration and validation of props that are
5293 * supplied to React components. Example usage:
5294 *
5295 * var Props = require('ReactPropTypes');
5296 * var MyArticle = React.createClass({
5297 * propTypes: {
5298 * // An optional string prop named "description".
5299 * description: Props.string,
5300 *
5301 * // A required enum prop named "category".
5302 * category: Props.oneOf(['News','Photos']).isRequired,
5303 *
5304 * // A prop named "dialog" that requires an instance of Dialog.
5305 * dialog: Props.instanceOf(Dialog).isRequired
5306 * },
5307 * render: function() { ... }
5308 * });
5309 *
5310 * A more formal specification of how these methods are used:
5311 *
5312 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
5313 * decl := ReactPropTypes.{type}(.isRequired)?
5314 *
5315 * Each and every declaration produces a function with the same signature. This
5316 * allows the creation of custom validation functions. For example:
5317 *
5318 * var MyLink = React.createClass({
5319 * propTypes: {
5320 * // An optional string or URI prop named "href".
5321 * href: function(props, propName, componentName) {
5322 * var propValue = props[propName];
5323 * if (propValue != null && typeof propValue !== 'string' &&
5324 * !(propValue instanceof URI)) {
5325 * return new Error(
5326 * 'Expected a string or an URI for ' + propName + ' in ' +
5327 * componentName
5328 * );
5329 * }
5330 * }
5331 * },
5332 * render: function() {...}
5333 * });
5334 *
5335 * @internal
5336 */
5337
5338 var ANONYMOUS = '<<anonymous>>';
5339
5340 // Important!
5341 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
5342 var ReactPropTypes = {
5343 array: createPrimitiveTypeChecker('array'),
5344 bigint: createPrimitiveTypeChecker('bigint'),
5345 bool: createPrimitiveTypeChecker('boolean'),
5346 func: createPrimitiveTypeChecker('function'),
5347 number: createPrimitiveTypeChecker('number'),
5348 object: createPrimitiveTypeChecker('object'),
5349 string: createPrimitiveTypeChecker('string'),
5350 symbol: createPrimitiveTypeChecker('symbol'),
5351
5352 any: createAnyTypeChecker(),
5353 arrayOf: createArrayOfTypeChecker,
5354 element: createElementTypeChecker(),
5355 elementType: createElementTypeTypeChecker(),
5356 instanceOf: createInstanceTypeChecker,
5357 node: createNodeChecker(),
5358 objectOf: createObjectOfTypeChecker,
5359 oneOf: createEnumTypeChecker,
5360 oneOfType: createUnionTypeChecker,
5361 shape: createShapeTypeChecker,
5362 exact: createStrictShapeTypeChecker,
5363 };
5364
5365 /**
5366 * inlined Object.is polyfill to avoid requiring consumers ship their own
5367 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5368 */
5369 /*eslint-disable no-self-compare*/
5370 function is(x, y) {
5371 // SameValue algorithm
5372 if (x === y) {
5373 // Steps 1-5, 7-10
5374 // Steps 6.b-6.e: +0 != -0
5375 return x !== 0 || 1 / x === 1 / y;
5376 } else {
5377 // Step 6.a: NaN == NaN
5378 return x !== x && y !== y;
5379 }
5380 }
5381 /*eslint-enable no-self-compare*/
5382
5383 /**
5384 * We use an Error-like object for backward compatibility as people may call
5385 * PropTypes directly and inspect their output. However, we don't use real
5386 * Errors anymore. We don't inspect their stack anyway, and creating them
5387 * is prohibitively expensive if they are created too often, such as what
5388 * happens in oneOfType() for any type before the one that matched.
5389 */
5390 function PropTypeError(message, data) {
5391 this.message = message;
5392 this.data = data && typeof data === 'object' ? data: {};
5393 this.stack = '';
5394 }
5395 // Make `instanceof Error` still work for returned errors.
5396 PropTypeError.prototype = Error.prototype;
5397
5398 function createChainableTypeChecker(validate) {
5399 if (true) {
5400 var manualPropTypeCallCache = {};
5401 var manualPropTypeWarningCount = 0;
5402 }
5403 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5404 componentName = componentName || ANONYMOUS;
5405 propFullName = propFullName || propName;
5406
5407 if (secret !== ReactPropTypesSecret) {
5408 if (throwOnDirectAccess) {
5409 // New behavior only for users of `prop-types` package
5410 var err = new Error(
5411 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
5412 'Use `PropTypes.checkPropTypes()` to call them. ' +
5413 'Read more at http://fb.me/use-check-prop-types'
5414 );
5415 err.name = 'Invariant Violation';
5416 throw err;
5417 } else if ( true && typeof console !== 'undefined') {
5418 // Old behavior for people using React.PropTypes
5419 var cacheKey = componentName + ':' + propName;
5420 if (
5421 !manualPropTypeCallCache[cacheKey] &&
5422 // Avoid spamming the console because they are often not actionable except for lib authors
5423 manualPropTypeWarningCount < 3
5424 ) {
5425 printWarning(
5426 'You are manually calling a React.PropTypes validation ' +
5427 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
5428 'and will throw in the standalone `prop-types` package. ' +
5429 'You may be seeing this warning due to a third-party PropTypes ' +
5430 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
5431 );
5432 manualPropTypeCallCache[cacheKey] = true;
5433 manualPropTypeWarningCount++;
5434 }
5435 }
5436 }
5437 if (props[propName] == null) {
5438 if (isRequired) {
5439 if (props[propName] === null) {
5440 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5441 }
5442 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5443 }
5444 return null;
5445 } else {
5446 return validate(props, propName, componentName, location, propFullName);
5447 }
5448 }
5449
5450 var chainedCheckType = checkType.bind(null, false);
5451 chainedCheckType.isRequired = checkType.bind(null, true);
5452
5453 return chainedCheckType;
5454 }
5455
5456 function createPrimitiveTypeChecker(expectedType) {
5457 function validate(props, propName, componentName, location, propFullName, secret) {
5458 var propValue = props[propName];
5459 var propType = getPropType(propValue);
5460 if (propType !== expectedType) {
5461 // `propValue` being instance of, say, date/regexp, pass the 'object'
5462 // check, but we can offer a more precise error message here rather than
5463 // 'of type `object`'.
5464 var preciseType = getPreciseType(propValue);
5465
5466 return new PropTypeError(
5467 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
5468 {expectedType: expectedType}
5469 );
5470 }
5471 return null;
5472 }
5473 return createChainableTypeChecker(validate);
5474 }
5475
5476 function createAnyTypeChecker() {
5477 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5478 }
5479
5480 function createArrayOfTypeChecker(typeChecker) {
5481 function validate(props, propName, componentName, location, propFullName) {
5482 if (typeof typeChecker !== 'function') {
5483 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5484 }
5485 var propValue = props[propName];
5486 if (!Array.isArray(propValue)) {
5487 var propType = getPropType(propValue);
5488 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5489 }
5490 for (var i = 0; i < propValue.length; i++) {
5491 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5492 if (error instanceof Error) {
5493 return error;
5494 }
5495 }
5496 return null;
5497 }
5498 return createChainableTypeChecker(validate);
5499 }
5500
5501 function createElementTypeChecker() {
5502 function validate(props, propName, componentName, location, propFullName) {
5503 var propValue = props[propName];
5504 if (!isValidElement(propValue)) {
5505 var propType = getPropType(propValue);
5506 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5507 }
5508 return null;
5509 }
5510 return createChainableTypeChecker(validate);
5511 }
5512
5513 function createElementTypeTypeChecker() {
5514 function validate(props, propName, componentName, location, propFullName) {
5515 var propValue = props[propName];
5516 if (!ReactIs.isValidElementType(propValue)) {
5517 var propType = getPropType(propValue);
5518 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5519 }
5520 return null;
5521 }
5522 return createChainableTypeChecker(validate);
5523 }
5524
5525 function createInstanceTypeChecker(expectedClass) {
5526 function validate(props, propName, componentName, location, propFullName) {
5527 if (!(props[propName] instanceof expectedClass)) {
5528 var expectedClassName = expectedClass.name || ANONYMOUS;
5529 var actualClassName = getClassName(props[propName]);
5530 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5531 }
5532 return null;
5533 }
5534 return createChainableTypeChecker(validate);
5535 }
5536
5537 function createEnumTypeChecker(expectedValues) {
5538 if (!Array.isArray(expectedValues)) {
5539 if (true) {
5540 if (arguments.length > 1) {
5541 printWarning(
5542 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
5543 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
5544 );
5545 } else {
5546 printWarning('Invalid argument supplied to oneOf, expected an array.');
5547 }
5548 }
5549 return emptyFunctionThatReturnsNull;
5550 }
5551
5552 function validate(props, propName, componentName, location, propFullName) {
5553 var propValue = props[propName];
5554 for (var i = 0; i < expectedValues.length; i++) {
5555 if (is(propValue, expectedValues[i])) {
5556 return null;
5557 }
5558 }
5559
5560 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5561 var type = getPreciseType(value);
5562 if (type === 'symbol') {
5563 return String(value);
5564 }
5565 return value;
5566 });
5567 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5568 }
5569 return createChainableTypeChecker(validate);
5570 }
5571
5572 function createObjectOfTypeChecker(typeChecker) {
5573 function validate(props, propName, componentName, location, propFullName) {
5574 if (typeof typeChecker !== 'function') {
5575 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5576 }
5577 var propValue = props[propName];
5578 var propType = getPropType(propValue);
5579 if (propType !== 'object') {
5580 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5581 }
5582 for (var key in propValue) {
5583 if (has(propValue, key)) {
5584 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5585 if (error instanceof Error) {
5586 return error;
5587 }
5588 }
5589 }
5590 return null;
5591 }
5592 return createChainableTypeChecker(validate);
5593 }
5594
5595 function createUnionTypeChecker(arrayOfTypeCheckers) {
5596 if (!Array.isArray(arrayOfTypeCheckers)) {
5597 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
5598 return emptyFunctionThatReturnsNull;
5599 }
5600
5601 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5602 var checker = arrayOfTypeCheckers[i];
5603 if (typeof checker !== 'function') {
5604 printWarning(
5605 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
5606 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
5607 );
5608 return emptyFunctionThatReturnsNull;
5609 }
5610 }
5611
5612 function validate(props, propName, componentName, location, propFullName) {
5613 var expectedTypes = [];
5614 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5615 var checker = arrayOfTypeCheckers[i];
5616 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5617 if (checkerResult == null) {
5618 return null;
5619 }
5620 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5621 expectedTypes.push(checkerResult.data.expectedType);
5622 }
5623 }
5624 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
5625 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5626 }
5627 return createChainableTypeChecker(validate);
5628 }
5629
5630 function createNodeChecker() {
5631 function validate(props, propName, componentName, location, propFullName) {
5632 if (!isNode(props[propName])) {
5633 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5634 }
5635 return null;
5636 }
5637 return createChainableTypeChecker(validate);
5638 }
5639
5640 function invalidValidatorError(componentName, location, propFullName, key, type) {
5641 return new PropTypeError(
5642 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
5643 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
5644 );
5645 }
5646
5647 function createShapeTypeChecker(shapeTypes) {
5648 function validate(props, propName, componentName, location, propFullName) {
5649 var propValue = props[propName];
5650 var propType = getPropType(propValue);
5651 if (propType !== 'object') {
5652 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5653 }
5654 for (var key in shapeTypes) {
5655 var checker = shapeTypes[key];
5656 if (typeof checker !== 'function') {
5657 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5658 }
5659 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5660 if (error) {
5661 return error;
5662 }
5663 }
5664 return null;
5665 }
5666 return createChainableTypeChecker(validate);
5667 }
5668
5669 function createStrictShapeTypeChecker(shapeTypes) {
5670 function validate(props, propName, componentName, location, propFullName) {
5671 var propValue = props[propName];
5672 var propType = getPropType(propValue);
5673 if (propType !== 'object') {
5674 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5675 }
5676 // We need to check all keys in case some are required but missing from props.
5677 var allKeys = assign({}, props[propName], shapeTypes);
5678 for (var key in allKeys) {
5679 var checker = shapeTypes[key];
5680 if (has(shapeTypes, key) && typeof checker !== 'function') {
5681 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5682 }
5683 if (!checker) {
5684 return new PropTypeError(
5685 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
5686 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
5687 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
5688 );
5689 }
5690 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5691 if (error) {
5692 return error;
5693 }
5694 }
5695 return null;
5696 }
5697
5698 return createChainableTypeChecker(validate);
5699 }
5700
5701 function isNode(propValue) {
5702 switch (typeof propValue) {
5703 case 'number':
5704 case 'string':
5705 case 'undefined':
5706 return true;
5707 case 'boolean':
5708 return !propValue;
5709 case 'object':
5710 if (Array.isArray(propValue)) {
5711 return propValue.every(isNode);
5712 }
5713 if (propValue === null || isValidElement(propValue)) {
5714 return true;
5715 }
5716
5717 var iteratorFn = getIteratorFn(propValue);
5718 if (iteratorFn) {
5719 var iterator = iteratorFn.call(propValue);
5720 var step;
5721 if (iteratorFn !== propValue.entries) {
5722 while (!(step = iterator.next()).done) {
5723 if (!isNode(step.value)) {
5724 return false;
5725 }
5726 }
5727 } else {
5728 // Iterator will provide entry [k,v] tuples rather than values.
5729 while (!(step = iterator.next()).done) {
5730 var entry = step.value;
5731 if (entry) {
5732 if (!isNode(entry[1])) {
5733 return false;
5734 }
5735 }
5736 }
5737 }
5738 } else {
5739 return false;
5740 }
5741
5742 return true;
5743 default:
5744 return false;
5745 }
5746 }
5747
5748 function isSymbol(propType, propValue) {
5749 // Native Symbol.
5750 if (propType === 'symbol') {
5751 return true;
5752 }
5753
5754 // falsy value can't be a Symbol
5755 if (!propValue) {
5756 return false;
5757 }
5758
5759 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5760 if (propValue['@@toStringTag'] === 'Symbol') {
5761 return true;
5762 }
5763
5764 // Fallback for non-spec compliant Symbols which are polyfilled.
5765 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
5766 return true;
5767 }
5768
5769 return false;
5770 }
5771
5772 // Equivalent of `typeof` but with special handling for array and regexp.
5773 function getPropType(propValue) {
5774 var propType = typeof propValue;
5775 if (Array.isArray(propValue)) {
5776 return 'array';
5777 }
5778 if (propValue instanceof RegExp) {
5779 // Old webkits (at least until Android 4.0) return 'function' rather than
5780 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
5781 // passes PropTypes.object.
5782 return 'object';
5783 }
5784 if (isSymbol(propType, propValue)) {
5785 return 'symbol';
5786 }
5787 return propType;
5788 }
5789
5790 // This handles more types than `getPropType`. Only used for error messages.
5791 // See `createPrimitiveTypeChecker`.
5792 function getPreciseType(propValue) {
5793 if (typeof propValue === 'undefined' || propValue === null) {
5794 return '' + propValue;
5795 }
5796 var propType = getPropType(propValue);
5797 if (propType === 'object') {
5798 if (propValue instanceof Date) {
5799 return 'date';
5800 } else if (propValue instanceof RegExp) {
5801 return 'regexp';
5802 }
5803 }
5804 return propType;
5805 }
5806
5807 // Returns a string that is postfixed to a warning about an invalid type.
5808 // For example, "undefined" or "of type array"
5809 function getPostfixForTypeWarning(value) {
5810 var type = getPreciseType(value);
5811 switch (type) {
5812 case 'array':
5813 case 'object':
5814 return 'an ' + type;
5815 case 'boolean':
5816 case 'date':
5817 case 'regexp':
5818 return 'a ' + type;
5819 default:
5820 return type;
5821 }
5822 }
5823
5824 // Returns class name of the object, if any.
5825 function getClassName(propValue) {
5826 if (!propValue.constructor || !propValue.constructor.name) {
5827 return ANONYMOUS;
5828 }
5829 return propValue.constructor.name;
5830 }
5831
5832 ReactPropTypes.checkPropTypes = checkPropTypes;
5833 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
5834 ReactPropTypes.PropTypes = ReactPropTypes;
5835
5836 return ReactPropTypes;
5837 };
5838
5839
5840 /***/ }),
5841
5842 /***/ "./node_modules/prop-types/index.js":
5843 /*!******************************************!*\
5844 !*** ./node_modules/prop-types/index.js ***!
5845 \******************************************/
5846 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5847
5848 /**
5849 * Copyright (c) 2013-present, Facebook, Inc.
5850 *
5851 * This source code is licensed under the MIT license found in the
5852 * LICENSE file in the root directory of this source tree.
5853 */
5854
5855 if (true) {
5856 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5857
5858 // By explicitly using `prop-types` you are opting into new development behavior.
5859 // http://fb.me/prop-types-in-prod
5860 var throwOnDirectAccess = true;
5861 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
5862 } else {}
5863
5864
5865 /***/ }),
5866
5867 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
5868 /*!*************************************************************!*\
5869 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
5870 \*************************************************************/
5871 /***/ ((module) => {
5872
5873 "use strict";
5874 /**
5875 * Copyright (c) 2013-present, Facebook, Inc.
5876 *
5877 * This source code is licensed under the MIT license found in the
5878 * LICENSE file in the root directory of this source tree.
5879 */
5880
5881
5882
5883 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5884
5885 module.exports = ReactPropTypesSecret;
5886
5887
5888 /***/ }),
5889
5890 /***/ "./node_modules/prop-types/lib/has.js":
5891 /*!********************************************!*\
5892 !*** ./node_modules/prop-types/lib/has.js ***!
5893 \********************************************/
5894 /***/ ((module) => {
5895
5896 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
5897
5898
5899 /***/ }),
5900
5901 /***/ "./node_modules/raven-js/src/configError.js":
5902 /*!**************************************************!*\
5903 !*** ./node_modules/raven-js/src/configError.js ***!
5904 \**************************************************/
5905 /***/ ((module) => {
5906
5907 function RavenConfigError(message) {
5908 this.name = 'RavenConfigError';
5909 this.message = message;
5910 }
5911 RavenConfigError.prototype = new Error();
5912 RavenConfigError.prototype.constructor = RavenConfigError;
5913
5914 module.exports = RavenConfigError;
5915
5916
5917 /***/ }),
5918
5919 /***/ "./node_modules/raven-js/src/console.js":
5920 /*!**********************************************!*\
5921 !*** ./node_modules/raven-js/src/console.js ***!
5922 \**********************************************/
5923 /***/ ((module) => {
5924
5925 var wrapMethod = function(console, level, callback) {
5926 var originalConsoleLevel = console[level];
5927 var originalConsole = console;
5928
5929 if (!(level in console)) {
5930 return;
5931 }
5932
5933 var sentryLevel = level === 'warn' ? 'warning' : level;
5934
5935 console[level] = function() {
5936 var args = [].slice.call(arguments);
5937
5938 var msg = '' + args.join(' ');
5939 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
5940
5941 if (level === 'assert') {
5942 if (args[0] === false) {
5943 // Default browsers message
5944 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
5945 data.extra.arguments = args.slice(1);
5946 callback && callback(msg, data);
5947 }
5948 } else {
5949 callback && callback(msg, data);
5950 }
5951
5952 // this fails for some browsers. :(
5953 if (originalConsoleLevel) {
5954 // IE9 doesn't allow calling apply on console functions directly
5955 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
5956 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
5957 }
5958 };
5959 };
5960
5961 module.exports = {
5962 wrapMethod: wrapMethod
5963 };
5964
5965
5966 /***/ }),
5967
5968 /***/ "./node_modules/raven-js/src/raven.js":
5969 /*!********************************************!*\
5970 !*** ./node_modules/raven-js/src/raven.js ***!
5971 \********************************************/
5972 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5973
5974 /*global XDomainRequest:false */
5975
5976 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
5977 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
5978 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
5979
5980 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
5981 var isError = utils.isError;
5982 var isObject = utils.isObject;
5983 var isObject = utils.isObject;
5984 var isErrorEvent = utils.isErrorEvent;
5985 var isUndefined = utils.isUndefined;
5986 var isFunction = utils.isFunction;
5987 var isString = utils.isString;
5988 var isEmptyObject = utils.isEmptyObject;
5989 var each = utils.each;
5990 var objectMerge = utils.objectMerge;
5991 var truncate = utils.truncate;
5992 var objectFrozen = utils.objectFrozen;
5993 var hasKey = utils.hasKey;
5994 var joinRegExp = utils.joinRegExp;
5995 var urlencode = utils.urlencode;
5996 var uuid4 = utils.uuid4;
5997 var htmlTreeAsString = utils.htmlTreeAsString;
5998 var isSameException = utils.isSameException;
5999 var isSameStacktrace = utils.isSameStacktrace;
6000 var parseUrl = utils.parseUrl;
6001 var fill = utils.fill;
6002
6003 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
6004
6005 var dsnKeys = 'source protocol user pass host port path'.split(' '),
6006 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
6007
6008 function now() {
6009 return +new Date();
6010 }
6011
6012 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
6013 var _window =
6014 typeof window !== 'undefined'
6015 ? window
6016 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
6017 var _document = _window.document;
6018 var _navigator = _window.navigator;
6019
6020 function keepOriginalCallback(original, callback) {
6021 return isFunction(callback)
6022 ? function(data) {
6023 return callback(data, original);
6024 }
6025 : callback;
6026 }
6027
6028 // First, check for JSON support
6029 // If there is no JSON, we no-op the core features of Raven
6030 // since JSON is required to encode the payload
6031 function Raven() {
6032 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
6033 // Raven can run in contexts where there's no document (react-native)
6034 this._hasDocument = !isUndefined(_document);
6035 this._hasNavigator = !isUndefined(_navigator);
6036 this._lastCapturedException = null;
6037 this._lastData = null;
6038 this._lastEventId = null;
6039 this._globalServer = null;
6040 this._globalKey = null;
6041 this._globalProject = null;
6042 this._globalContext = {};
6043 this._globalOptions = {
6044 logger: 'javascript',
6045 ignoreErrors: [],
6046 ignoreUrls: [],
6047 whitelistUrls: [],
6048 includePaths: [],
6049 collectWindowErrors: true,
6050 maxMessageLength: 0,
6051
6052 // By default, truncates URL values to 250 chars
6053 maxUrlLength: 250,
6054 stackTraceLimit: 50,
6055 autoBreadcrumbs: true,
6056 instrument: true,
6057 sampleRate: 1
6058 };
6059 this._ignoreOnError = 0;
6060 this._isRavenInstalled = false;
6061 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
6062 // capture references to window.console *and* all its methods first
6063 // before the console plugin has a chance to monkey patch
6064 this._originalConsole = _window.console || {};
6065 this._originalConsoleMethods = {};
6066 this._plugins = [];
6067 this._startTime = now();
6068 this._wrappedBuiltIns = [];
6069 this._breadcrumbs = [];
6070 this._lastCapturedEvent = null;
6071 this._keypressTimeout;
6072 this._location = _window.location;
6073 this._lastHref = this._location && this._location.href;
6074 this._resetBackoff();
6075
6076 // eslint-disable-next-line guard-for-in
6077 for (var method in this._originalConsole) {
6078 this._originalConsoleMethods[method] = this._originalConsole[method];
6079 }
6080 }
6081
6082 /*
6083 * The core Raven singleton
6084 *
6085 * @this {Raven}
6086 */
6087
6088 Raven.prototype = {
6089 // Hardcode version string so that raven source can be loaded directly via
6090 // webpack (using a build step causes webpack #1617). Grunt verifies that
6091 // this value matches package.json during build.
6092 // See: https://github.com/getsentry/raven-js/issues/465
6093 VERSION: '3.19.1',
6094
6095 debug: false,
6096
6097 TraceKit: TraceKit, // alias to TraceKit
6098
6099 /*
6100 * Configure Raven with a DSN and extra options
6101 *
6102 * @param {string} dsn The public Sentry DSN
6103 * @param {object} options Set of global options [optional]
6104 * @return {Raven}
6105 */
6106 config: function(dsn, options) {
6107 var self = this;
6108
6109 if (self._globalServer) {
6110 this._logDebug('error', 'Error: Raven has already been configured');
6111 return self;
6112 }
6113 if (!dsn) return self;
6114
6115 var globalOptions = self._globalOptions;
6116
6117 // merge in options
6118 if (options) {
6119 each(options, function(key, value) {
6120 // tags and extra are special and need to be put into context
6121 if (key === 'tags' || key === 'extra' || key === 'user') {
6122 self._globalContext[key] = value;
6123 } else {
6124 globalOptions[key] = value;
6125 }
6126 });
6127 }
6128
6129 self.setDSN(dsn);
6130
6131 // "Script error." is hard coded into browsers for errors that it can't read.
6132 // this is the result of a script being pulled in from an external domain and CORS.
6133 globalOptions.ignoreErrors.push(/^Script error\.?$/);
6134 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
6135
6136 // join regexp rules into one big rule
6137 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
6138 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
6139 ? joinRegExp(globalOptions.ignoreUrls)
6140 : false;
6141 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
6142 ? joinRegExp(globalOptions.whitelistUrls)
6143 : false;
6144 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
6145 globalOptions.maxBreadcrumbs = Math.max(
6146 0,
6147 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
6148 ); // default and hard limit is 100
6149
6150 var autoBreadcrumbDefaults = {
6151 xhr: true,
6152 console: true,
6153 dom: true,
6154 location: true
6155 };
6156
6157 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
6158 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
6159 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
6160 } else if (autoBreadcrumbs !== false) {
6161 autoBreadcrumbs = autoBreadcrumbDefaults;
6162 }
6163 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
6164
6165 var instrumentDefaults = {
6166 tryCatch: true
6167 };
6168
6169 var instrument = globalOptions.instrument;
6170 if ({}.toString.call(instrument) === '[object Object]') {
6171 instrument = objectMerge(instrumentDefaults, instrument);
6172 } else if (instrument !== false) {
6173 instrument = instrumentDefaults;
6174 }
6175 globalOptions.instrument = instrument;
6176
6177 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
6178
6179 // return for chaining
6180 return self;
6181 },
6182
6183 /*
6184 * Installs a global window.onerror error handler
6185 * to capture and report uncaught exceptions.
6186 * At this point, install() is required to be called due
6187 * to the way TraceKit is set up.
6188 *
6189 * @return {Raven}
6190 */
6191 install: function() {
6192 var self = this;
6193 if (self.isSetup() && !self._isRavenInstalled) {
6194 TraceKit.report.subscribe(function() {
6195 self._handleOnErrorStackInfo.apply(self, arguments);
6196 });
6197 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
6198 self._instrumentTryCatch();
6199 }
6200
6201 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
6202
6203 // Install all of the plugins
6204 self._drainPlugins();
6205
6206 self._isRavenInstalled = true;
6207 }
6208
6209 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
6210 return this;
6211 },
6212
6213 /*
6214 * Set the DSN (can be called multiple time unlike config)
6215 *
6216 * @param {string} dsn The public Sentry DSN
6217 */
6218 setDSN: function(dsn) {
6219 var self = this,
6220 uri = self._parseDSN(dsn),
6221 lastSlash = uri.path.lastIndexOf('/'),
6222 path = uri.path.substr(1, lastSlash);
6223
6224 self._dsn = dsn;
6225 self._globalKey = uri.user;
6226 self._globalSecret = uri.pass && uri.pass.substr(1);
6227 self._globalProject = uri.path.substr(lastSlash + 1);
6228
6229 self._globalServer = self._getGlobalServer(uri);
6230
6231 self._globalEndpoint =
6232 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
6233
6234 // Reset backoff state since we may be pointing at a
6235 // new project/server
6236 this._resetBackoff();
6237 },
6238
6239 /*
6240 * Wrap code within a context so Raven can capture errors
6241 * reliably across domains that is executed immediately.
6242 *
6243 * @param {object} options A specific set of options for this context [optional]
6244 * @param {function} func The callback to be immediately executed within the context
6245 * @param {array} args An array of arguments to be called with the callback [optional]
6246 */
6247 context: function(options, func, args) {
6248 if (isFunction(options)) {
6249 args = func || [];
6250 func = options;
6251 options = undefined;
6252 }
6253
6254 return this.wrap(options, func).apply(this, args);
6255 },
6256
6257 /*
6258 * Wrap code within a context and returns back a new function to be executed
6259 *
6260 * @param {object} options A specific set of options for this context [optional]
6261 * @param {function} func The function to be wrapped in a new context
6262 * @param {function} func A function to call before the try/catch wrapper [optional, private]
6263 * @return {function} The newly wrapped functions with a context
6264 */
6265 wrap: function(options, func, _before) {
6266 var self = this;
6267 // 1 argument has been passed, and it's not a function
6268 // so just return it
6269 if (isUndefined(func) && !isFunction(options)) {
6270 return options;
6271 }
6272
6273 // options is optional
6274 if (isFunction(options)) {
6275 func = options;
6276 options = undefined;
6277 }
6278
6279 // At this point, we've passed along 2 arguments, and the second one
6280 // is not a function either, so we'll just return the second argument.
6281 if (!isFunction(func)) {
6282 return func;
6283 }
6284
6285 // We don't wanna wrap it twice!
6286 try {
6287 if (func.__raven__) {
6288 return func;
6289 }
6290
6291 // If this has already been wrapped in the past, return that
6292 if (func.__raven_wrapper__) {
6293 return func.__raven_wrapper__;
6294 }
6295 } catch (e) {
6296 // Just accessing custom props in some Selenium environments
6297 // can cause a "Permission denied" exception (see raven-js#495).
6298 // Bail on wrapping and return the function as-is (defers to window.onerror).
6299 return func;
6300 }
6301
6302 function wrapped() {
6303 var args = [],
6304 i = arguments.length,
6305 deep = !options || (options && options.deep !== false);
6306
6307 if (_before && isFunction(_before)) {
6308 _before.apply(this, arguments);
6309 }
6310
6311 // Recursively wrap all of a function's arguments that are
6312 // functions themselves.
6313 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
6314
6315 try {
6316 // Attempt to invoke user-land function
6317 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
6318 // means Raven caught an error invoking your application code. This is
6319 // expected behavior and NOT indicative of a bug with Raven.js.
6320 return func.apply(this, args);
6321 } catch (e) {
6322 self._ignoreNextOnError();
6323 self.captureException(e, options);
6324 throw e;
6325 }
6326 }
6327
6328 // copy over properties of the old function
6329 for (var property in func) {
6330 if (hasKey(func, property)) {
6331 wrapped[property] = func[property];
6332 }
6333 }
6334 wrapped.prototype = func.prototype;
6335
6336 func.__raven_wrapper__ = wrapped;
6337 // Signal that this function has been wrapped already
6338 // for both debugging and to prevent it to being wrapped twice
6339 wrapped.__raven__ = true;
6340 wrapped.__inner__ = func;
6341
6342 return wrapped;
6343 },
6344
6345 /*
6346 * Uninstalls the global error handler.
6347 *
6348 * @return {Raven}
6349 */
6350 uninstall: function() {
6351 TraceKit.report.uninstall();
6352
6353 this._restoreBuiltIns();
6354
6355 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
6356 this._isRavenInstalled = false;
6357
6358 return this;
6359 },
6360
6361 /*
6362 * Manually capture an exception and send it over to Sentry
6363 *
6364 * @param {error} ex An exception to be logged
6365 * @param {object} options A specific set of options for this error [optional]
6366 * @return {Raven}
6367 */
6368 captureException: function(ex, options) {
6369 // Cases for sending ex as a message, rather than an exception
6370 var isNotError = !isError(ex);
6371 var isNotErrorEvent = !isErrorEvent(ex);
6372 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
6373
6374 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
6375 return this.captureMessage(
6376 ex,
6377 objectMerge(
6378 {
6379 trimHeadFrames: 1,
6380 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
6381 },
6382 options
6383 )
6384 );
6385 }
6386
6387 // Get actual Error from ErrorEvent
6388 if (isErrorEvent(ex)) ex = ex.error;
6389
6390 // Store the raw exception object for potential debugging and introspection
6391 this._lastCapturedException = ex;
6392
6393 // TraceKit.report will re-raise any exception passed to it,
6394 // which means you have to wrap it in try/catch. Instead, we
6395 // can wrap it here and only re-raise if TraceKit.report
6396 // raises an exception different from the one we asked to
6397 // report on.
6398 try {
6399 var stack = TraceKit.computeStackTrace(ex);
6400 this._handleStackInfo(stack, options);
6401 } catch (ex1) {
6402 if (ex !== ex1) {
6403 throw ex1;
6404 }
6405 }
6406
6407 return this;
6408 },
6409
6410 /*
6411 * Manually send a message to Sentry
6412 *
6413 * @param {string} msg A plain message to be captured in Sentry
6414 * @param {object} options A specific set of options for this message [optional]
6415 * @return {Raven}
6416 */
6417 captureMessage: function(msg, options) {
6418 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
6419 // early call; we'll error on the side of logging anything called before configuration since it's
6420 // probably something you should see:
6421 if (
6422 !!this._globalOptions.ignoreErrors.test &&
6423 this._globalOptions.ignoreErrors.test(msg)
6424 ) {
6425 return;
6426 }
6427
6428 options = options || {};
6429
6430 var data = objectMerge(
6431 {
6432 message: msg + '' // Make sure it's actually a string
6433 },
6434 options
6435 );
6436
6437 var ex;
6438 // Generate a "synthetic" stack trace from this point.
6439 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
6440 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
6441 // or if it catches a thrown object without a "stack" property.
6442 try {
6443 throw new Error(msg);
6444 } catch (ex1) {
6445 ex = ex1;
6446 }
6447
6448 // null exception name so `Error` isn't prefixed to msg
6449 ex.name = null;
6450 var stack = TraceKit.computeStackTrace(ex);
6451
6452 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
6453 var initialCall = stack.stack[1];
6454
6455 var fileurl = (initialCall && initialCall.url) || '';
6456
6457 if (
6458 !!this._globalOptions.ignoreUrls.test &&
6459 this._globalOptions.ignoreUrls.test(fileurl)
6460 ) {
6461 return;
6462 }
6463
6464 if (
6465 !!this._globalOptions.whitelistUrls.test &&
6466 !this._globalOptions.whitelistUrls.test(fileurl)
6467 ) {
6468 return;
6469 }
6470
6471 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
6472 options = objectMerge(
6473 {
6474 // fingerprint on msg, not stack trace (legacy behavior, could be
6475 // revisited)
6476 fingerprint: msg,
6477 // since we know this is a synthetic trace, the top N-most frames
6478 // MUST be from Raven.js, so mark them as in_app later by setting
6479 // trimHeadFrames
6480 trimHeadFrames: (options.trimHeadFrames || 0) + 1
6481 },
6482 options
6483 );
6484
6485 var frames = this._prepareFrames(stack, options);
6486 data.stacktrace = {
6487 // Sentry expects frames oldest to newest
6488 frames: frames.reverse()
6489 };
6490 }
6491
6492 // Fire away!
6493 this._send(data);
6494
6495 return this;
6496 },
6497
6498 captureBreadcrumb: function(obj) {
6499 var crumb = objectMerge(
6500 {
6501 timestamp: now() / 1000
6502 },
6503 obj
6504 );
6505
6506 if (isFunction(this._globalOptions.breadcrumbCallback)) {
6507 var result = this._globalOptions.breadcrumbCallback(crumb);
6508
6509 if (isObject(result) && !isEmptyObject(result)) {
6510 crumb = result;
6511 } else if (result === false) {
6512 return this;
6513 }
6514 }
6515
6516 this._breadcrumbs.push(crumb);
6517 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
6518 this._breadcrumbs.shift();
6519 }
6520 return this;
6521 },
6522
6523 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
6524 var pluginArgs = [].slice.call(arguments, 1);
6525
6526 this._plugins.push([plugin, pluginArgs]);
6527 if (this._isRavenInstalled) {
6528 this._drainPlugins();
6529 }
6530
6531 return this;
6532 },
6533
6534 /*
6535 * Set/clear a user to be sent along with the payload.
6536 *
6537 * @param {object} user An object representing user data [optional]
6538 * @return {Raven}
6539 */
6540 setUserContext: function(user) {
6541 // Intentionally do not merge here since that's an unexpected behavior.
6542 this._globalContext.user = user;
6543
6544 return this;
6545 },
6546
6547 /*
6548 * Merge extra attributes to be sent along with the payload.
6549 *
6550 * @param {object} extra An object representing extra data [optional]
6551 * @return {Raven}
6552 */
6553 setExtraContext: function(extra) {
6554 this._mergeContext('extra', extra);
6555
6556 return this;
6557 },
6558
6559 /*
6560 * Merge tags to be sent along with the payload.
6561 *
6562 * @param {object} tags An object representing tags [optional]
6563 * @return {Raven}
6564 */
6565 setTagsContext: function(tags) {
6566 this._mergeContext('tags', tags);
6567
6568 return this;
6569 },
6570
6571 /*
6572 * Clear all of the context.
6573 *
6574 * @return {Raven}
6575 */
6576 clearContext: function() {
6577 this._globalContext = {};
6578
6579 return this;
6580 },
6581
6582 /*
6583 * Get a copy of the current context. This cannot be mutated.
6584 *
6585 * @return {object} copy of context
6586 */
6587 getContext: function() {
6588 // lol javascript
6589 return JSON.parse(stringify(this._globalContext));
6590 },
6591
6592 /*
6593 * Set environment of application
6594 *
6595 * @param {string} environment Typically something like 'production'.
6596 * @return {Raven}
6597 */
6598 setEnvironment: function(environment) {
6599 this._globalOptions.environment = environment;
6600
6601 return this;
6602 },
6603
6604 /*
6605 * Set release version of application
6606 *
6607 * @param {string} release Typically something like a git SHA to identify version
6608 * @return {Raven}
6609 */
6610 setRelease: function(release) {
6611 this._globalOptions.release = release;
6612
6613 return this;
6614 },
6615
6616 /*
6617 * Set the dataCallback option
6618 *
6619 * @param {function} callback The callback to run which allows the
6620 * data blob to be mutated before sending
6621 * @return {Raven}
6622 */
6623 setDataCallback: function(callback) {
6624 var original = this._globalOptions.dataCallback;
6625 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
6626 return this;
6627 },
6628
6629 /*
6630 * Set the breadcrumbCallback option
6631 *
6632 * @param {function} callback The callback to run which allows filtering
6633 * or mutating breadcrumbs
6634 * @return {Raven}
6635 */
6636 setBreadcrumbCallback: function(callback) {
6637 var original = this._globalOptions.breadcrumbCallback;
6638 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
6639 return this;
6640 },
6641
6642 /*
6643 * Set the shouldSendCallback option
6644 *
6645 * @param {function} callback The callback to run which allows
6646 * introspecting the blob before sending
6647 * @return {Raven}
6648 */
6649 setShouldSendCallback: function(callback) {
6650 var original = this._globalOptions.shouldSendCallback;
6651 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
6652 return this;
6653 },
6654
6655 /**
6656 * Override the default HTTP transport mechanism that transmits data
6657 * to the Sentry server.
6658 *
6659 * @param {function} transport Function invoked instead of the default
6660 * `makeRequest` handler.
6661 *
6662 * @return {Raven}
6663 */
6664 setTransport: function(transport) {
6665 this._globalOptions.transport = transport;
6666
6667 return this;
6668 },
6669
6670 /*
6671 * Get the latest raw exception that was captured by Raven.
6672 *
6673 * @return {error}
6674 */
6675 lastException: function() {
6676 return this._lastCapturedException;
6677 },
6678
6679 /*
6680 * Get the last event id
6681 *
6682 * @return {string}
6683 */
6684 lastEventId: function() {
6685 return this._lastEventId;
6686 },
6687
6688 /*
6689 * Determine if Raven is setup and ready to go.
6690 *
6691 * @return {boolean}
6692 */
6693 isSetup: function() {
6694 if (!this._hasJSON) return false; // needs JSON support
6695 if (!this._globalServer) {
6696 if (!this.ravenNotConfiguredError) {
6697 this.ravenNotConfiguredError = true;
6698 this._logDebug('error', 'Error: Raven has not been configured.');
6699 }
6700 return false;
6701 }
6702 return true;
6703 },
6704
6705 afterLoad: function() {
6706 // TODO: remove window dependence?
6707
6708 // Attempt to initialize Raven on load
6709 var RavenConfig = _window.RavenConfig;
6710 if (RavenConfig) {
6711 this.config(RavenConfig.dsn, RavenConfig.config).install();
6712 }
6713 },
6714
6715 showReportDialog: function(options) {
6716 if (
6717 !_document // doesn't work without a document (React native)
6718 )
6719 return;
6720
6721 options = options || {};
6722
6723 var lastEventId = options.eventId || this.lastEventId();
6724 if (!lastEventId) {
6725 throw new RavenConfigError('Missing eventId');
6726 }
6727
6728 var dsn = options.dsn || this._dsn;
6729 if (!dsn) {
6730 throw new RavenConfigError('Missing DSN');
6731 }
6732
6733 var encode = encodeURIComponent;
6734 var qs = '';
6735 qs += '?eventId=' + encode(lastEventId);
6736 qs += '&dsn=' + encode(dsn);
6737
6738 var user = options.user || this._globalContext.user;
6739 if (user) {
6740 if (user.name) qs += '&name=' + encode(user.name);
6741 if (user.email) qs += '&email=' + encode(user.email);
6742 }
6743
6744 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
6745
6746 var script = _document.createElement('script');
6747 script.async = true;
6748 script.src = globalServer + '/api/embed/error-page/' + qs;
6749 (_document.head || _document.body).appendChild(script);
6750 },
6751
6752 /**** Private functions ****/
6753 _ignoreNextOnError: function() {
6754 var self = this;
6755 this._ignoreOnError += 1;
6756 setTimeout(function() {
6757 // onerror should trigger before setTimeout
6758 self._ignoreOnError -= 1;
6759 });
6760 },
6761
6762 _triggerEvent: function(eventType, options) {
6763 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
6764 var evt, key;
6765
6766 if (!this._hasDocument) return;
6767
6768 options = options || {};
6769
6770 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
6771
6772 if (_document.createEvent) {
6773 evt = _document.createEvent('HTMLEvents');
6774 evt.initEvent(eventType, true, true);
6775 } else {
6776 evt = _document.createEventObject();
6777 evt.eventType = eventType;
6778 }
6779
6780 for (key in options)
6781 if (hasKey(options, key)) {
6782 evt[key] = options[key];
6783 }
6784
6785 if (_document.createEvent) {
6786 // IE9 if standards
6787 _document.dispatchEvent(evt);
6788 } else {
6789 // IE8 regardless of Quirks or Standards
6790 // IE9 if quirks
6791 try {
6792 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
6793 } catch (e) {
6794 // Do nothing
6795 }
6796 }
6797 },
6798
6799 /**
6800 * Wraps addEventListener to capture UI breadcrumbs
6801 * @param evtName the event name (e.g. "click")
6802 * @returns {Function}
6803 * @private
6804 */
6805 _breadcrumbEventHandler: function(evtName) {
6806 var self = this;
6807 return function(evt) {
6808 // reset keypress timeout; e.g. triggering a 'click' after
6809 // a 'keypress' will reset the keypress debounce so that a new
6810 // set of keypresses can be recorded
6811 self._keypressTimeout = null;
6812
6813 // It's possible this handler might trigger multiple times for the same
6814 // event (e.g. event propagation through node ancestors). Ignore if we've
6815 // already captured the event.
6816 if (self._lastCapturedEvent === evt) return;
6817
6818 self._lastCapturedEvent = evt;
6819
6820 // try/catch both:
6821 // - accessing evt.target (see getsentry/raven-js#838, #768)
6822 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
6823 // can throw an exception in some circumstances.
6824 var target;
6825 try {
6826 target = htmlTreeAsString(evt.target);
6827 } catch (e) {
6828 target = '<unknown>';
6829 }
6830
6831 self.captureBreadcrumb({
6832 category: 'ui.' + evtName, // e.g. ui.click, ui.input
6833 message: target
6834 });
6835 };
6836 },
6837
6838 /**
6839 * Wraps addEventListener to capture keypress UI events
6840 * @returns {Function}
6841 * @private
6842 */
6843 _keypressEventHandler: function() {
6844 var self = this,
6845 debounceDuration = 1000; // milliseconds
6846
6847 // TODO: if somehow user switches keypress target before
6848 // debounce timeout is triggered, we will only capture
6849 // a single breadcrumb from the FIRST target (acceptable?)
6850 return function(evt) {
6851 var target;
6852 try {
6853 target = evt.target;
6854 } catch (e) {
6855 // just accessing event properties can throw an exception in some rare circumstances
6856 // see: https://github.com/getsentry/raven-js/issues/838
6857 return;
6858 }
6859 var tagName = target && target.tagName;
6860
6861 // only consider keypress events on actual input elements
6862 // this will disregard keypresses targeting body (e.g. tabbing
6863 // through elements, hotkeys, etc)
6864 if (
6865 !tagName ||
6866 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
6867 )
6868 return;
6869
6870 // record first keypress in a series, but ignore subsequent
6871 // keypresses until debounce clears
6872 var timeout = self._keypressTimeout;
6873 if (!timeout) {
6874 self._breadcrumbEventHandler('input')(evt);
6875 }
6876 clearTimeout(timeout);
6877 self._keypressTimeout = setTimeout(function() {
6878 self._keypressTimeout = null;
6879 }, debounceDuration);
6880 };
6881 },
6882
6883 /**
6884 * Captures a breadcrumb of type "navigation", normalizing input URLs
6885 * @param to the originating URL
6886 * @param from the target URL
6887 * @private
6888 */
6889 _captureUrlChange: function(from, to) {
6890 var parsedLoc = parseUrl(this._location.href);
6891 var parsedTo = parseUrl(to);
6892 var parsedFrom = parseUrl(from);
6893
6894 // because onpopstate only tells you the "new" (to) value of location.href, and
6895 // not the previous (from) value, we need to track the value of the current URL
6896 // state ourselves
6897 this._lastHref = to;
6898
6899 // Use only the path component of the URL if the URL matches the current
6900 // document (almost all the time when using pushState)
6901 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
6902 to = parsedTo.relative;
6903 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
6904 from = parsedFrom.relative;
6905
6906 this.captureBreadcrumb({
6907 category: 'navigation',
6908 data: {
6909 to: to,
6910 from: from
6911 }
6912 });
6913 },
6914
6915 /**
6916 * Wrap timer functions and event targets to catch errors and provide
6917 * better metadata.
6918 */
6919 _instrumentTryCatch: function() {
6920 var self = this;
6921
6922 var wrappedBuiltIns = self._wrappedBuiltIns;
6923
6924 function wrapTimeFn(orig) {
6925 return function(fn, t) {
6926 // preserve arity
6927 // Make a copy of the arguments to prevent deoptimization
6928 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6929 var args = new Array(arguments.length);
6930 for (var i = 0; i < args.length; ++i) {
6931 args[i] = arguments[i];
6932 }
6933 var originalCallback = args[0];
6934 if (isFunction(originalCallback)) {
6935 args[0] = self.wrap(originalCallback);
6936 }
6937
6938 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
6939 // also supports only two arguments and doesn't care what this is, so we
6940 // can just call the original function directly.
6941 if (orig.apply) {
6942 return orig.apply(this, args);
6943 } else {
6944 return orig(args[0], args[1]);
6945 }
6946 };
6947 }
6948
6949 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6950
6951 function wrapEventTarget(global) {
6952 var proto = _window[global] && _window[global].prototype;
6953 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
6954 fill(
6955 proto,
6956 'addEventListener',
6957 function(orig) {
6958 return function(evtName, fn, capture, secure) {
6959 // preserve arity
6960 try {
6961 if (fn && fn.handleEvent) {
6962 fn.handleEvent = self.wrap(fn.handleEvent);
6963 }
6964 } catch (err) {
6965 // can sometimes get 'Permission denied to access property "handle Event'
6966 }
6967
6968 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
6969 // so that we don't have more than one wrapper function
6970 var before, clickHandler, keypressHandler;
6971
6972 if (
6973 autoBreadcrumbs &&
6974 autoBreadcrumbs.dom &&
6975 (global === 'EventTarget' || global === 'Node')
6976 ) {
6977 // NOTE: generating multiple handlers per addEventListener invocation, should
6978 // revisit and verify we can just use one (almost certainly)
6979 clickHandler = self._breadcrumbEventHandler('click');
6980 keypressHandler = self._keypressEventHandler();
6981 before = function(evt) {
6982 // need to intercept every DOM event in `before` argument, in case that
6983 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
6984 // see #724
6985 if (!evt) return;
6986
6987 var eventType;
6988 try {
6989 eventType = evt.type;
6990 } catch (e) {
6991 // just accessing event properties can throw an exception in some rare circumstances
6992 // see: https://github.com/getsentry/raven-js/issues/838
6993 return;
6994 }
6995 if (eventType === 'click') return clickHandler(evt);
6996 else if (eventType === 'keypress') return keypressHandler(evt);
6997 };
6998 }
6999 return orig.call(
7000 this,
7001 evtName,
7002 self.wrap(fn, undefined, before),
7003 capture,
7004 secure
7005 );
7006 };
7007 },
7008 wrappedBuiltIns
7009 );
7010 fill(
7011 proto,
7012 'removeEventListener',
7013 function(orig) {
7014 return function(evt, fn, capture, secure) {
7015 try {
7016 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
7017 } catch (e) {
7018 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
7019 }
7020 return orig.call(this, evt, fn, capture, secure);
7021 };
7022 },
7023 wrappedBuiltIns
7024 );
7025 }
7026 }
7027
7028 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
7029 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
7030 if (_window.requestAnimationFrame) {
7031 fill(
7032 _window,
7033 'requestAnimationFrame',
7034 function(orig) {
7035 return function(cb) {
7036 return orig(self.wrap(cb));
7037 };
7038 },
7039 wrappedBuiltIns
7040 );
7041 }
7042
7043 // event targets borrowed from bugsnag-js:
7044 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
7045 var eventTargets = [
7046 'EventTarget',
7047 'Window',
7048 'Node',
7049 'ApplicationCache',
7050 'AudioTrackList',
7051 'ChannelMergerNode',
7052 'CryptoOperation',
7053 'EventSource',
7054 'FileReader',
7055 'HTMLUnknownElement',
7056 'IDBDatabase',
7057 'IDBRequest',
7058 'IDBTransaction',
7059 'KeyOperation',
7060 'MediaController',
7061 'MessagePort',
7062 'ModalWindow',
7063 'Notification',
7064 'SVGElementInstance',
7065 'Screen',
7066 'TextTrack',
7067 'TextTrackCue',
7068 'TextTrackList',
7069 'WebSocket',
7070 'WebSocketWorker',
7071 'Worker',
7072 'XMLHttpRequest',
7073 'XMLHttpRequestEventTarget',
7074 'XMLHttpRequestUpload'
7075 ];
7076 for (var i = 0; i < eventTargets.length; i++) {
7077 wrapEventTarget(eventTargets[i]);
7078 }
7079 },
7080
7081 /**
7082 * Instrument browser built-ins w/ breadcrumb capturing
7083 * - XMLHttpRequests
7084 * - DOM interactions (click/typing)
7085 * - window.location changes
7086 * - console
7087 *
7088 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
7089 */
7090 _instrumentBreadcrumbs: function() {
7091 var self = this;
7092 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
7093
7094 var wrappedBuiltIns = self._wrappedBuiltIns;
7095
7096 function wrapProp(prop, xhr) {
7097 if (prop in xhr && isFunction(xhr[prop])) {
7098 fill(xhr, prop, function(orig) {
7099 return self.wrap(orig);
7100 }); // intentionally don't track filled methods on XHR instances
7101 }
7102 }
7103
7104 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
7105 var xhrproto = XMLHttpRequest.prototype;
7106 fill(
7107 xhrproto,
7108 'open',
7109 function(origOpen) {
7110 return function(method, url) {
7111 // preserve arity
7112
7113 // if Sentry key appears in URL, don't capture
7114 if (isString(url) && url.indexOf(self._globalKey) === -1) {
7115 this.__raven_xhr = {
7116 method: method,
7117 url: url,
7118 status_code: null
7119 };
7120 }
7121
7122 return origOpen.apply(this, arguments);
7123 };
7124 },
7125 wrappedBuiltIns
7126 );
7127
7128 fill(
7129 xhrproto,
7130 'send',
7131 function(origSend) {
7132 return function(data) {
7133 // preserve arity
7134 var xhr = this;
7135
7136 function onreadystatechangeHandler() {
7137 if (xhr.__raven_xhr && xhr.readyState === 4) {
7138 try {
7139 // touching statusCode in some platforms throws
7140 // an exception
7141 xhr.__raven_xhr.status_code = xhr.status;
7142 } catch (e) {
7143 /* do nothing */
7144 }
7145
7146 self.captureBreadcrumb({
7147 type: 'http',
7148 category: 'xhr',
7149 data: xhr.__raven_xhr
7150 });
7151 }
7152 }
7153
7154 var props = ['onload', 'onerror', 'onprogress'];
7155 for (var j = 0; j < props.length; j++) {
7156 wrapProp(props[j], xhr);
7157 }
7158
7159 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
7160 fill(
7161 xhr,
7162 'onreadystatechange',
7163 function(orig) {
7164 return self.wrap(orig, undefined, onreadystatechangeHandler);
7165 } /* intentionally don't track this instrumentation */
7166 );
7167 } else {
7168 // if onreadystatechange wasn't actually set by the page on this xhr, we
7169 // are free to set our own and capture the breadcrumb
7170 xhr.onreadystatechange = onreadystatechangeHandler;
7171 }
7172
7173 return origSend.apply(this, arguments);
7174 };
7175 },
7176 wrappedBuiltIns
7177 );
7178 }
7179
7180 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
7181 fill(
7182 _window,
7183 'fetch',
7184 function(origFetch) {
7185 return function(fn, t) {
7186 // preserve arity
7187 // Make a copy of the arguments to prevent deoptimization
7188 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
7189 var args = new Array(arguments.length);
7190 for (var i = 0; i < args.length; ++i) {
7191 args[i] = arguments[i];
7192 }
7193
7194 var fetchInput = args[0];
7195 var method = 'GET';
7196 var url;
7197
7198 if (typeof fetchInput === 'string') {
7199 url = fetchInput;
7200 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
7201 url = fetchInput.url;
7202 if (fetchInput.method) {
7203 method = fetchInput.method;
7204 }
7205 } else {
7206 url = '' + fetchInput;
7207 }
7208
7209 if (args[1] && args[1].method) {
7210 method = args[1].method;
7211 }
7212
7213 var fetchData = {
7214 method: method,
7215 url: url,
7216 status_code: null
7217 };
7218
7219 self.captureBreadcrumb({
7220 type: 'http',
7221 category: 'fetch',
7222 data: fetchData
7223 });
7224
7225 return origFetch.apply(this, args).then(function(response) {
7226 fetchData.status_code = response.status;
7227
7228 return response;
7229 });
7230 };
7231 },
7232 wrappedBuiltIns
7233 );
7234 }
7235
7236 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
7237 // to the document. Do this before we instrument addEventListener.
7238 if (autoBreadcrumbs.dom && this._hasDocument) {
7239 if (_document.addEventListener) {
7240 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
7241 _document.addEventListener('keypress', self._keypressEventHandler(), false);
7242 } else {
7243 // IE8 Compatibility
7244 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
7245 _document.attachEvent('onkeypress', self._keypressEventHandler());
7246 }
7247 }
7248
7249 // record navigation (URL) changes
7250 // NOTE: in Chrome App environment, touching history.pushState, *even inside
7251 // a try/catch block*, will cause Chrome to output an error to console.error
7252 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
7253 var chrome = _window.chrome;
7254 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
7255 var hasPushAndReplaceState =
7256 !isChromePackagedApp &&
7257 _window.history &&
7258 history.pushState &&
7259 history.replaceState;
7260 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
7261 // TODO: remove onpopstate handler on uninstall()
7262 var oldOnPopState = _window.onpopstate;
7263 _window.onpopstate = function() {
7264 var currentHref = self._location.href;
7265 self._captureUrlChange(self._lastHref, currentHref);
7266
7267 if (oldOnPopState) {
7268 return oldOnPopState.apply(this, arguments);
7269 }
7270 };
7271
7272 var historyReplacementFunction = function(origHistFunction) {
7273 // note history.pushState.length is 0; intentionally not declaring
7274 // params to preserve 0 arity
7275 return function(/* state, title, url */) {
7276 var url = arguments.length > 2 ? arguments[2] : undefined;
7277
7278 // url argument is optional
7279 if (url) {
7280 // coerce to string (this is what pushState does)
7281 self._captureUrlChange(self._lastHref, url + '');
7282 }
7283
7284 return origHistFunction.apply(this, arguments);
7285 };
7286 };
7287
7288 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
7289 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
7290 }
7291
7292 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
7293 // console
7294 var consoleMethodCallback = function(msg, data) {
7295 self.captureBreadcrumb({
7296 message: msg,
7297 level: data.level,
7298 category: 'console'
7299 });
7300 };
7301
7302 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
7303 wrapConsoleMethod(console, level, consoleMethodCallback);
7304 });
7305 }
7306 },
7307
7308 _restoreBuiltIns: function() {
7309 // restore any wrapped builtins
7310 var builtin;
7311 while (this._wrappedBuiltIns.length) {
7312 builtin = this._wrappedBuiltIns.shift();
7313
7314 var obj = builtin[0],
7315 name = builtin[1],
7316 orig = builtin[2];
7317
7318 obj[name] = orig;
7319 }
7320 },
7321
7322 _drainPlugins: function() {
7323 var self = this;
7324
7325 // FIX ME TODO
7326 each(this._plugins, function(_, plugin) {
7327 var installer = plugin[0];
7328 var args = plugin[1];
7329 installer.apply(self, [self].concat(args));
7330 });
7331 },
7332
7333 _parseDSN: function(str) {
7334 var m = dsnPattern.exec(str),
7335 dsn = {},
7336 i = 7;
7337
7338 try {
7339 while (i--) dsn[dsnKeys[i]] = m[i] || '';
7340 } catch (e) {
7341 throw new RavenConfigError('Invalid DSN: ' + str);
7342 }
7343
7344 if (dsn.pass && !this._globalOptions.allowSecretKey) {
7345 throw new RavenConfigError(
7346 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
7347 );
7348 }
7349
7350 return dsn;
7351 },
7352
7353 _getGlobalServer: function(uri) {
7354 // assemble the endpoint from the uri pieces
7355 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
7356
7357 if (uri.protocol) {
7358 globalServer = uri.protocol + ':' + globalServer;
7359 }
7360 return globalServer;
7361 },
7362
7363 _handleOnErrorStackInfo: function() {
7364 // if we are intentionally ignoring errors via onerror, bail out
7365 if (!this._ignoreOnError) {
7366 this._handleStackInfo.apply(this, arguments);
7367 }
7368 },
7369
7370 _handleStackInfo: function(stackInfo, options) {
7371 var frames = this._prepareFrames(stackInfo, options);
7372
7373 this._triggerEvent('handle', {
7374 stackInfo: stackInfo,
7375 options: options
7376 });
7377
7378 this._processException(
7379 stackInfo.name,
7380 stackInfo.message,
7381 stackInfo.url,
7382 stackInfo.lineno,
7383 frames,
7384 options
7385 );
7386 },
7387
7388 _prepareFrames: function(stackInfo, options) {
7389 var self = this;
7390 var frames = [];
7391 if (stackInfo.stack && stackInfo.stack.length) {
7392 each(stackInfo.stack, function(i, stack) {
7393 var frame = self._normalizeFrame(stack, stackInfo.url);
7394 if (frame) {
7395 frames.push(frame);
7396 }
7397 });
7398
7399 // e.g. frames captured via captureMessage throw
7400 if (options && options.trimHeadFrames) {
7401 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
7402 frames[j].in_app = false;
7403 }
7404 }
7405 }
7406 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
7407 return frames;
7408 },
7409
7410 _normalizeFrame: function(frame, stackInfoUrl) {
7411 // normalize the frames data
7412 var normalized = {
7413 filename: frame.url,
7414 lineno: frame.line,
7415 colno: frame.column,
7416 function: frame.func || '?'
7417 };
7418
7419 // Case when we don't have any information about the error
7420 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
7421 // Generating synthetic error doesn't add any value here
7422 //
7423 // We should probably somehow let a user know that they should fix their code
7424 if (!frame.url) {
7425 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
7426 }
7427
7428 normalized.in_app = !// determine if an exception came from outside of our app
7429 // first we check the global includePaths list.
7430 (
7431 (!!this._globalOptions.includePaths.test &&
7432 !this._globalOptions.includePaths.test(normalized.filename)) ||
7433 // Now we check for fun, if the function name is Raven or TraceKit
7434 /(Raven|TraceKit)\./.test(normalized['function']) ||
7435 // finally, we do a last ditch effort and check for raven.min.js
7436 /raven\.(min\.)?js$/.test(normalized.filename)
7437 );
7438
7439 return normalized;
7440 },
7441
7442 _processException: function(type, message, fileurl, lineno, frames, options) {
7443 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
7444 if (
7445 !!this._globalOptions.ignoreErrors.test &&
7446 (this._globalOptions.ignoreErrors.test(message) ||
7447 this._globalOptions.ignoreErrors.test(prefixedMessage))
7448 ) {
7449 return;
7450 }
7451
7452 var stacktrace;
7453
7454 if (frames && frames.length) {
7455 fileurl = frames[0].filename || fileurl;
7456 // Sentry expects frames oldest to newest
7457 // and JS sends them as newest to oldest
7458 frames.reverse();
7459 stacktrace = {frames: frames};
7460 } else if (fileurl) {
7461 stacktrace = {
7462 frames: [
7463 {
7464 filename: fileurl,
7465 lineno: lineno,
7466 in_app: true
7467 }
7468 ]
7469 };
7470 }
7471
7472 if (
7473 !!this._globalOptions.ignoreUrls.test &&
7474 this._globalOptions.ignoreUrls.test(fileurl)
7475 ) {
7476 return;
7477 }
7478
7479 if (
7480 !!this._globalOptions.whitelistUrls.test &&
7481 !this._globalOptions.whitelistUrls.test(fileurl)
7482 ) {
7483 return;
7484 }
7485
7486 var data = objectMerge(
7487 {
7488 // sentry.interfaces.Exception
7489 exception: {
7490 values: [
7491 {
7492 type: type,
7493 value: message,
7494 stacktrace: stacktrace
7495 }
7496 ]
7497 },
7498 culprit: fileurl
7499 },
7500 options
7501 );
7502
7503 // Fire away!
7504 this._send(data);
7505 },
7506
7507 _trimPacket: function(data) {
7508 // For now, we only want to truncate the two different messages
7509 // but this could/should be expanded to just trim everything
7510 var max = this._globalOptions.maxMessageLength;
7511 if (data.message) {
7512 data.message = truncate(data.message, max);
7513 }
7514 if (data.exception) {
7515 var exception = data.exception.values[0];
7516 exception.value = truncate(exception.value, max);
7517 }
7518
7519 var request = data.request;
7520 if (request) {
7521 if (request.url) {
7522 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
7523 }
7524 if (request.Referer) {
7525 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
7526 }
7527 }
7528
7529 if (data.breadcrumbs && data.breadcrumbs.values)
7530 this._trimBreadcrumbs(data.breadcrumbs);
7531
7532 return data;
7533 },
7534
7535 /**
7536 * Truncate breadcrumb values (right now just URLs)
7537 */
7538 _trimBreadcrumbs: function(breadcrumbs) {
7539 // known breadcrumb properties with urls
7540 // TODO: also consider arbitrary prop values that start with (https?)?://
7541 var urlProps = ['to', 'from', 'url'],
7542 urlProp,
7543 crumb,
7544 data;
7545
7546 for (var i = 0; i < breadcrumbs.values.length; ++i) {
7547 crumb = breadcrumbs.values[i];
7548 if (
7549 !crumb.hasOwnProperty('data') ||
7550 !isObject(crumb.data) ||
7551 objectFrozen(crumb.data)
7552 )
7553 continue;
7554
7555 data = objectMerge({}, crumb.data);
7556 for (var j = 0; j < urlProps.length; ++j) {
7557 urlProp = urlProps[j];
7558 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
7559 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
7560 }
7561 }
7562 breadcrumbs.values[i].data = data;
7563 }
7564 },
7565
7566 _getHttpData: function() {
7567 if (!this._hasNavigator && !this._hasDocument) return;
7568 var httpData = {};
7569
7570 if (this._hasNavigator && _navigator.userAgent) {
7571 httpData.headers = {
7572 'User-Agent': navigator.userAgent
7573 };
7574 }
7575
7576 if (this._hasDocument) {
7577 if (_document.location && _document.location.href) {
7578 httpData.url = _document.location.href;
7579 }
7580 if (_document.referrer) {
7581 if (!httpData.headers) httpData.headers = {};
7582 httpData.headers.Referer = _document.referrer;
7583 }
7584 }
7585
7586 return httpData;
7587 },
7588
7589 _resetBackoff: function() {
7590 this._backoffDuration = 0;
7591 this._backoffStart = null;
7592 },
7593
7594 _shouldBackoff: function() {
7595 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
7596 },
7597
7598 /**
7599 * Returns true if the in-process data payload matches the signature
7600 * of the previously-sent data
7601 *
7602 * NOTE: This has to be done at this level because TraceKit can generate
7603 * data from window.onerror WITHOUT an exception object (IE8, IE9,
7604 * other old browsers). This can take the form of an "exception"
7605 * data object with a single frame (derived from the onerror args).
7606 */
7607 _isRepeatData: function(current) {
7608 var last = this._lastData;
7609
7610 if (
7611 !last ||
7612 current.message !== last.message || // defined for captureMessage
7613 current.culprit !== last.culprit // defined for captureException/onerror
7614 )
7615 return false;
7616
7617 // Stacktrace interface (i.e. from captureMessage)
7618 if (current.stacktrace || last.stacktrace) {
7619 return isSameStacktrace(current.stacktrace, last.stacktrace);
7620 } else if (current.exception || last.exception) {
7621 // Exception interface (i.e. from captureException/onerror)
7622 return isSameException(current.exception, last.exception);
7623 }
7624
7625 return true;
7626 },
7627
7628 _setBackoffState: function(request) {
7629 // If we are already in a backoff state, don't change anything
7630 if (this._shouldBackoff()) {
7631 return;
7632 }
7633
7634 var status = request.status;
7635
7636 // 400 - project_id doesn't exist or some other fatal
7637 // 401 - invalid/revoked dsn
7638 // 429 - too many requests
7639 if (!(status === 400 || status === 401 || status === 429)) return;
7640
7641 var retry;
7642 try {
7643 // If Retry-After is not in Access-Control-Expose-Headers, most
7644 // browsers will throw an exception trying to access it
7645 retry = request.getResponseHeader('Retry-After');
7646 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
7647 } catch (e) {
7648 /* eslint no-empty:0 */
7649 }
7650
7651 this._backoffDuration = retry
7652 ? // If Sentry server returned a Retry-After value, use it
7653 retry
7654 : // Otherwise, double the last backoff duration (starts at 1 sec)
7655 this._backoffDuration * 2 || 1000;
7656
7657 this._backoffStart = now();
7658 },
7659
7660 _send: function(data) {
7661 var globalOptions = this._globalOptions;
7662
7663 var baseData = {
7664 project: this._globalProject,
7665 logger: globalOptions.logger,
7666 platform: 'javascript'
7667 },
7668 httpData = this._getHttpData();
7669
7670 if (httpData) {
7671 baseData.request = httpData;
7672 }
7673
7674 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
7675 if (data.trimHeadFrames) delete data.trimHeadFrames;
7676
7677 data = objectMerge(baseData, data);
7678
7679 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
7680 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
7681 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
7682
7683 // Send along our own collected metadata with extra
7684 data.extra['session:duration'] = now() - this._startTime;
7685
7686 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
7687 // intentionally make shallow copy so that additions
7688 // to breadcrumbs aren't accidentally sent in this request
7689 data.breadcrumbs = {
7690 values: [].slice.call(this._breadcrumbs, 0)
7691 };
7692 }
7693
7694 // If there are no tags/extra, strip the key from the payload alltogther.
7695 if (isEmptyObject(data.tags)) delete data.tags;
7696
7697 if (this._globalContext.user) {
7698 // sentry.interfaces.User
7699 data.user = this._globalContext.user;
7700 }
7701
7702 // Include the environment if it's defined in globalOptions
7703 if (globalOptions.environment) data.environment = globalOptions.environment;
7704
7705 // Include the release if it's defined in globalOptions
7706 if (globalOptions.release) data.release = globalOptions.release;
7707
7708 // Include server_name if it's defined in globalOptions
7709 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
7710
7711 if (isFunction(globalOptions.dataCallback)) {
7712 data = globalOptions.dataCallback(data) || data;
7713 }
7714
7715 // Why??????????
7716 if (!data || isEmptyObject(data)) {
7717 return;
7718 }
7719
7720 // Check if the request should be filtered or not
7721 if (
7722 isFunction(globalOptions.shouldSendCallback) &&
7723 !globalOptions.shouldSendCallback(data)
7724 ) {
7725 return;
7726 }
7727
7728 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
7729 // so drop requests until "cool-off" period has elapsed.
7730 if (this._shouldBackoff()) {
7731 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
7732 return;
7733 }
7734
7735 if (typeof globalOptions.sampleRate === 'number') {
7736 if (Math.random() < globalOptions.sampleRate) {
7737 this._sendProcessedPayload(data);
7738 }
7739 } else {
7740 this._sendProcessedPayload(data);
7741 }
7742 },
7743
7744 _getUuid: function() {
7745 return uuid4();
7746 },
7747
7748 _sendProcessedPayload: function(data, callback) {
7749 var self = this;
7750 var globalOptions = this._globalOptions;
7751
7752 if (!this.isSetup()) return;
7753
7754 // Try and clean up the packet before sending by truncating long values
7755 data = this._trimPacket(data);
7756
7757 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
7758 // but this would require copying an un-truncated copy of the data packet, which can be
7759 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
7760 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
7761 this._logDebug('warn', 'Raven dropped repeat event: ', data);
7762 return;
7763 }
7764
7765 // Send along an event_id if not explicitly passed.
7766 // This event_id can be used to reference the error within Sentry itself.
7767 // Set lastEventId after we know the error should actually be sent
7768 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
7769
7770 // Store outbound payload after trim
7771 this._lastData = data;
7772
7773 this._logDebug('debug', 'Raven about to send:', data);
7774
7775 var auth = {
7776 sentry_version: '7',
7777 sentry_client: 'raven-js/' + this.VERSION,
7778 sentry_key: this._globalKey
7779 };
7780
7781 if (this._globalSecret) {
7782 auth.sentry_secret = this._globalSecret;
7783 }
7784
7785 var exception = data.exception && data.exception.values[0];
7786 this.captureBreadcrumb({
7787 category: 'sentry',
7788 message: exception
7789 ? (exception.type ? exception.type + ': ' : '') + exception.value
7790 : data.message,
7791 event_id: data.event_id,
7792 level: data.level || 'error' // presume error unless specified
7793 });
7794
7795 var url = this._globalEndpoint;
7796 (globalOptions.transport || this._makeRequest).call(this, {
7797 url: url,
7798 auth: auth,
7799 data: data,
7800 options: globalOptions,
7801 onSuccess: function success() {
7802 self._resetBackoff();
7803
7804 self._triggerEvent('success', {
7805 data: data,
7806 src: url
7807 });
7808 callback && callback();
7809 },
7810 onError: function failure(error) {
7811 self._logDebug('error', 'Raven transport failed to send: ', error);
7812
7813 if (error.request) {
7814 self._setBackoffState(error.request);
7815 }
7816
7817 self._triggerEvent('failure', {
7818 data: data,
7819 src: url
7820 });
7821 error = error || new Error('Raven send failed (no additional details provided)');
7822 callback && callback(error);
7823 }
7824 });
7825 },
7826
7827 _makeRequest: function(opts) {
7828 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
7829 if (!request) return;
7830
7831 // if browser doesn't support CORS (e.g. IE7), we are out of luck
7832 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
7833
7834 if (!hasCORS) return;
7835
7836 var url = opts.url;
7837
7838 if ('withCredentials' in request) {
7839 request.onreadystatechange = function() {
7840 if (request.readyState !== 4) {
7841 return;
7842 } else if (request.status === 200) {
7843 opts.onSuccess && opts.onSuccess();
7844 } else if (opts.onError) {
7845 var err = new Error('Sentry error code: ' + request.status);
7846 err.request = request;
7847 opts.onError(err);
7848 }
7849 };
7850 } else {
7851 request = new XDomainRequest();
7852 // xdomainrequest cannot go http -> https (or vice versa),
7853 // so always use protocol relative
7854 url = url.replace(/^https?:/, '');
7855
7856 // onreadystatechange not supported by XDomainRequest
7857 if (opts.onSuccess) {
7858 request.onload = opts.onSuccess;
7859 }
7860 if (opts.onError) {
7861 request.onerror = function() {
7862 var err = new Error('Sentry error code: XDomainRequest');
7863 err.request = request;
7864 opts.onError(err);
7865 };
7866 }
7867 }
7868
7869 // NOTE: auth is intentionally sent as part of query string (NOT as custom
7870 // HTTP header) so as to avoid preflight CORS requests
7871 request.open('POST', url + '?' + urlencode(opts.auth));
7872 request.send(stringify(opts.data));
7873 },
7874
7875 _logDebug: function(level) {
7876 if (this._originalConsoleMethods[level] && this.debug) {
7877 // In IE<10 console methods do not have their own 'apply' method
7878 Function.prototype.apply.call(
7879 this._originalConsoleMethods[level],
7880 this._originalConsole,
7881 [].slice.call(arguments, 1)
7882 );
7883 }
7884 },
7885
7886 _mergeContext: function(key, context) {
7887 if (isUndefined(context)) {
7888 delete this._globalContext[key];
7889 } else {
7890 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
7891 }
7892 }
7893 };
7894
7895 // Deprecations
7896 Raven.prototype.setUser = Raven.prototype.setUserContext;
7897 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
7898
7899 module.exports = Raven;
7900
7901
7902 /***/ }),
7903
7904 /***/ "./node_modules/raven-js/src/singleton.js":
7905 /*!************************************************!*\
7906 !*** ./node_modules/raven-js/src/singleton.js ***!
7907 \************************************************/
7908 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7909
7910 /**
7911 * Enforces a single instance of the Raven client, and the
7912 * main entry point for Raven. If you are a consumer of the
7913 * Raven library, you SHOULD load this file (vs raven.js).
7914 **/
7915
7916 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
7917
7918 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7919 var _window =
7920 typeof window !== 'undefined'
7921 ? window
7922 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7923 var _Raven = _window.Raven;
7924
7925 var Raven = new RavenConstructor();
7926
7927 /*
7928 * Allow multiple versions of Raven to be installed.
7929 * Strip Raven from the global context and returns the instance.
7930 *
7931 * @return {Raven}
7932 */
7933 Raven.noConflict = function() {
7934 _window.Raven = _Raven;
7935 return Raven;
7936 };
7937
7938 Raven.afterLoad();
7939
7940 module.exports = Raven;
7941
7942
7943 /***/ }),
7944
7945 /***/ "./node_modules/raven-js/src/utils.js":
7946 /*!********************************************!*\
7947 !*** ./node_modules/raven-js/src/utils.js ***!
7948 \********************************************/
7949 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7950
7951 var _window =
7952 typeof window !== 'undefined'
7953 ? window
7954 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7955
7956 function isObject(what) {
7957 return typeof what === 'object' && what !== null;
7958 }
7959
7960 // Yanked from https://git.io/vS8DV re-used under CC0
7961 // with some tiny modifications
7962 function isError(value) {
7963 switch ({}.toString.call(value)) {
7964 case '[object Error]':
7965 return true;
7966 case '[object Exception]':
7967 return true;
7968 case '[object DOMException]':
7969 return true;
7970 default:
7971 return value instanceof Error;
7972 }
7973 }
7974
7975 function isErrorEvent(value) {
7976 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
7977 }
7978
7979 function isUndefined(what) {
7980 return what === void 0;
7981 }
7982
7983 function isFunction(what) {
7984 return typeof what === 'function';
7985 }
7986
7987 function isString(what) {
7988 return Object.prototype.toString.call(what) === '[object String]';
7989 }
7990
7991 function isEmptyObject(what) {
7992 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
7993 return true;
7994 }
7995
7996 function supportsErrorEvent() {
7997 try {
7998 new ErrorEvent(''); // eslint-disable-line no-new
7999 return true;
8000 } catch (e) {
8001 return false;
8002 }
8003 }
8004
8005 function wrappedCallback(callback) {
8006 function dataCallback(data, original) {
8007 var normalizedData = callback(data) || data;
8008 if (original) {
8009 return original(normalizedData) || normalizedData;
8010 }
8011 return normalizedData;
8012 }
8013
8014 return dataCallback;
8015 }
8016
8017 function each(obj, callback) {
8018 var i, j;
8019
8020 if (isUndefined(obj.length)) {
8021 for (i in obj) {
8022 if (hasKey(obj, i)) {
8023 callback.call(null, i, obj[i]);
8024 }
8025 }
8026 } else {
8027 j = obj.length;
8028 if (j) {
8029 for (i = 0; i < j; i++) {
8030 callback.call(null, i, obj[i]);
8031 }
8032 }
8033 }
8034 }
8035
8036 function objectMerge(obj1, obj2) {
8037 if (!obj2) {
8038 return obj1;
8039 }
8040 each(obj2, function(key, value) {
8041 obj1[key] = value;
8042 });
8043 return obj1;
8044 }
8045
8046 /**
8047 * This function is only used for react-native.
8048 * react-native freezes object that have already been sent over the
8049 * js bridge. We need this function in order to check if the object is frozen.
8050 * So it's ok that objectFrozen returns false if Object.isFrozen is not
8051 * supported because it's not relevant for other "platforms". See related issue:
8052 * https://github.com/getsentry/react-native-sentry/issues/57
8053 */
8054 function objectFrozen(obj) {
8055 if (!Object.isFrozen) {
8056 return false;
8057 }
8058 return Object.isFrozen(obj);
8059 }
8060
8061 function truncate(str, max) {
8062 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
8063 }
8064
8065 /**
8066 * hasKey, a better form of hasOwnProperty
8067 * Example: hasKey(MainHostObject, property) === true/false
8068 *
8069 * @param {Object} host object to check property
8070 * @param {string} key to check
8071 */
8072 function hasKey(object, key) {
8073 return Object.prototype.hasOwnProperty.call(object, key);
8074 }
8075
8076 function joinRegExp(patterns) {
8077 // Combine an array of regular expressions and strings into one large regexp
8078 // Be mad.
8079 var sources = [],
8080 i = 0,
8081 len = patterns.length,
8082 pattern;
8083
8084 for (; i < len; i++) {
8085 pattern = patterns[i];
8086 if (isString(pattern)) {
8087 // If it's a string, we need to escape it
8088 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
8089 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
8090 } else if (pattern && pattern.source) {
8091 // If it's a regexp already, we want to extract the source
8092 sources.push(pattern.source);
8093 }
8094 // Intentionally skip other cases
8095 }
8096 return new RegExp(sources.join('|'), 'i');
8097 }
8098
8099 function urlencode(o) {
8100 var pairs = [];
8101 each(o, function(key, value) {
8102 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
8103 });
8104 return pairs.join('&');
8105 }
8106
8107 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
8108 // intentionally using regex and not <a/> href parsing trick because React Native and other
8109 // environments where DOM might not be available
8110 function parseUrl(url) {
8111 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
8112 if (!match) return {};
8113
8114 // coerce to undefined values to empty string so we don't get 'undefined'
8115 var query = match[6] || '';
8116 var fragment = match[8] || '';
8117 return {
8118 protocol: match[2],
8119 host: match[4],
8120 path: match[5],
8121 relative: match[5] + query + fragment // everything minus origin
8122 };
8123 }
8124 function uuid4() {
8125 var crypto = _window.crypto || _window.msCrypto;
8126
8127 if (!isUndefined(crypto) && crypto.getRandomValues) {
8128 // Use window.crypto API if available
8129 // eslint-disable-next-line no-undef
8130 var arr = new Uint16Array(8);
8131 crypto.getRandomValues(arr);
8132
8133 // set 4 in byte 7
8134 arr[3] = (arr[3] & 0xfff) | 0x4000;
8135 // set 2 most significant bits of byte 9 to '10'
8136 arr[4] = (arr[4] & 0x3fff) | 0x8000;
8137
8138 var pad = function(num) {
8139 var v = num.toString(16);
8140 while (v.length < 4) {
8141 v = '0' + v;
8142 }
8143 return v;
8144 };
8145
8146 return (
8147 pad(arr[0]) +
8148 pad(arr[1]) +
8149 pad(arr[2]) +
8150 pad(arr[3]) +
8151 pad(arr[4]) +
8152 pad(arr[5]) +
8153 pad(arr[6]) +
8154 pad(arr[7])
8155 );
8156 } else {
8157 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
8158 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
8159 var r = (Math.random() * 16) | 0,
8160 v = c === 'x' ? r : (r & 0x3) | 0x8;
8161 return v.toString(16);
8162 });
8163 }
8164 }
8165
8166 /**
8167 * Given a child DOM element, returns a query-selector statement describing that
8168 * and its ancestors
8169 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
8170 * @param elem
8171 * @returns {string}
8172 */
8173 function htmlTreeAsString(elem) {
8174 /* eslint no-extra-parens:0*/
8175 var MAX_TRAVERSE_HEIGHT = 5,
8176 MAX_OUTPUT_LEN = 80,
8177 out = [],
8178 height = 0,
8179 len = 0,
8180 separator = ' > ',
8181 sepLength = separator.length,
8182 nextStr;
8183
8184 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
8185 nextStr = htmlElementAsString(elem);
8186 // bail out if
8187 // - nextStr is the 'html' element
8188 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
8189 // (ignore this limit if we are on the first iteration)
8190 if (
8191 nextStr === 'html' ||
8192 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
8193 ) {
8194 break;
8195 }
8196
8197 out.push(nextStr);
8198
8199 len += nextStr.length;
8200 elem = elem.parentNode;
8201 }
8202
8203 return out.reverse().join(separator);
8204 }
8205
8206 /**
8207 * Returns a simple, query-selector representation of a DOM element
8208 * e.g. [HTMLElement] => input#foo.btn[name=baz]
8209 * @param HTMLElement
8210 * @returns {string}
8211 */
8212 function htmlElementAsString(elem) {
8213 var out = [],
8214 className,
8215 classes,
8216 key,
8217 attr,
8218 i;
8219
8220 if (!elem || !elem.tagName) {
8221 return '';
8222 }
8223
8224 out.push(elem.tagName.toLowerCase());
8225 if (elem.id) {
8226 out.push('#' + elem.id);
8227 }
8228
8229 className = elem.className;
8230 if (className && isString(className)) {
8231 classes = className.split(/\s+/);
8232 for (i = 0; i < classes.length; i++) {
8233 out.push('.' + classes[i]);
8234 }
8235 }
8236 var attrWhitelist = ['type', 'name', 'title', 'alt'];
8237 for (i = 0; i < attrWhitelist.length; i++) {
8238 key = attrWhitelist[i];
8239 attr = elem.getAttribute(key);
8240 if (attr) {
8241 out.push('[' + key + '="' + attr + '"]');
8242 }
8243 }
8244 return out.join('');
8245 }
8246
8247 /**
8248 * Returns true if either a OR b is truthy, but not both
8249 */
8250 function isOnlyOneTruthy(a, b) {
8251 return !!(!!a ^ !!b);
8252 }
8253
8254 /**
8255 * Returns true if the two input exception interfaces have the same content
8256 */
8257 function isSameException(ex1, ex2) {
8258 if (isOnlyOneTruthy(ex1, ex2)) return false;
8259
8260 ex1 = ex1.values[0];
8261 ex2 = ex2.values[0];
8262
8263 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
8264
8265 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
8266 }
8267
8268 /**
8269 * Returns true if the two input stack trace interfaces have the same content
8270 */
8271 function isSameStacktrace(stack1, stack2) {
8272 if (isOnlyOneTruthy(stack1, stack2)) return false;
8273
8274 var frames1 = stack1.frames;
8275 var frames2 = stack2.frames;
8276
8277 // Exit early if frame count differs
8278 if (frames1.length !== frames2.length) return false;
8279
8280 // Iterate through every frame; bail out if anything differs
8281 var a, b;
8282 for (var i = 0; i < frames1.length; i++) {
8283 a = frames1[i];
8284 b = frames2[i];
8285 if (
8286 a.filename !== b.filename ||
8287 a.lineno !== b.lineno ||
8288 a.colno !== b.colno ||
8289 a['function'] !== b['function']
8290 )
8291 return false;
8292 }
8293 return true;
8294 }
8295
8296 /**
8297 * Polyfill a method
8298 * @param obj object e.g. `document`
8299 * @param name method name present on object e.g. `addEventListener`
8300 * @param replacement replacement function
8301 * @param track {optional} record instrumentation to an array
8302 */
8303 function fill(obj, name, replacement, track) {
8304 var orig = obj[name];
8305 obj[name] = replacement(orig);
8306 if (track) {
8307 track.push([obj, name, orig]);
8308 }
8309 }
8310
8311 module.exports = {
8312 isObject: isObject,
8313 isError: isError,
8314 isErrorEvent: isErrorEvent,
8315 isUndefined: isUndefined,
8316 isFunction: isFunction,
8317 isString: isString,
8318 isEmptyObject: isEmptyObject,
8319 supportsErrorEvent: supportsErrorEvent,
8320 wrappedCallback: wrappedCallback,
8321 each: each,
8322 objectMerge: objectMerge,
8323 truncate: truncate,
8324 objectFrozen: objectFrozen,
8325 hasKey: hasKey,
8326 joinRegExp: joinRegExp,
8327 urlencode: urlencode,
8328 uuid4: uuid4,
8329 htmlTreeAsString: htmlTreeAsString,
8330 htmlElementAsString: htmlElementAsString,
8331 isSameException: isSameException,
8332 isSameStacktrace: isSameStacktrace,
8333 parseUrl: parseUrl,
8334 fill: fill
8335 };
8336
8337
8338 /***/ }),
8339
8340 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
8341 /*!***********************************************************!*\
8342 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
8343 \***********************************************************/
8344 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8345
8346 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
8347
8348 /*
8349 TraceKit - Cross brower stack traces
8350
8351 This was originally forked from github.com/occ/TraceKit, but has since been
8352 largely re-written and is now maintained as part of raven-js. Tests for
8353 this are in test/vendor.
8354
8355 MIT license
8356 */
8357
8358 var TraceKit = {
8359 collectWindowErrors: true,
8360 debug: false
8361 };
8362
8363 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
8364 var _window =
8365 typeof window !== 'undefined'
8366 ? window
8367 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
8368
8369 // global reference to slice
8370 var _slice = [].slice;
8371 var UNKNOWN_FUNCTION = '?';
8372
8373 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
8374 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
8375
8376 function getLocationHref() {
8377 if (typeof document === 'undefined' || document.location == null) return '';
8378
8379 return document.location.href;
8380 }
8381
8382 /**
8383 * TraceKit.report: cross-browser processing of unhandled exceptions
8384 *
8385 * Syntax:
8386 * TraceKit.report.subscribe(function(stackInfo) { ... })
8387 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
8388 * TraceKit.report(exception)
8389 * try { ...code... } catch(ex) { TraceKit.report(ex); }
8390 *
8391 * Supports:
8392 * - Firefox: full stack trace with line numbers, plus column number
8393 * on top frame; column number is not guaranteed
8394 * - Opera: full stack trace with line and column numbers
8395 * - Chrome: full stack trace with line and column numbers
8396 * - Safari: line and column number for the top frame only; some frames
8397 * may be missing, and column number is not guaranteed
8398 * - IE: line and column number for the top frame only; some frames
8399 * may be missing, and column number is not guaranteed
8400 *
8401 * In theory, TraceKit should work on all of the following versions:
8402 * - IE5.5+ (only 8.0 tested)
8403 * - Firefox 0.9+ (only 3.5+ tested)
8404 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
8405 * Exceptions Have Stacktrace to be enabled in opera:config)
8406 * - Safari 3+ (only 4+ tested)
8407 * - Chrome 1+ (only 5+ tested)
8408 * - Konqueror 3.5+ (untested)
8409 *
8410 * Requires TraceKit.computeStackTrace.
8411 *
8412 * Tries to catch all unhandled exceptions and report them to the
8413 * subscribed handlers. Please note that TraceKit.report will rethrow the
8414 * exception. This is REQUIRED in order to get a useful stack trace in IE.
8415 * If the exception does not reach the top of the browser, you will only
8416 * get a stack trace from the point where TraceKit.report was called.
8417 *
8418 * Handlers receive a stackInfo object as described in the
8419 * TraceKit.computeStackTrace docs.
8420 */
8421 TraceKit.report = (function reportModuleWrapper() {
8422 var handlers = [],
8423 lastArgs = null,
8424 lastException = null,
8425 lastExceptionStack = null;
8426
8427 /**
8428 * Add a crash handler.
8429 * @param {Function} handler
8430 */
8431 function subscribe(handler) {
8432 installGlobalHandler();
8433 handlers.push(handler);
8434 }
8435
8436 /**
8437 * Remove a crash handler.
8438 * @param {Function} handler
8439 */
8440 function unsubscribe(handler) {
8441 for (var i = handlers.length - 1; i >= 0; --i) {
8442 if (handlers[i] === handler) {
8443 handlers.splice(i, 1);
8444 }
8445 }
8446 }
8447
8448 /**
8449 * Remove all crash handlers.
8450 */
8451 function unsubscribeAll() {
8452 uninstallGlobalHandler();
8453 handlers = [];
8454 }
8455
8456 /**
8457 * Dispatch stack information to all handlers.
8458 * @param {Object.<string, *>} stack
8459 */
8460 function notifyHandlers(stack, isWindowError) {
8461 var exception = null;
8462 if (isWindowError && !TraceKit.collectWindowErrors) {
8463 return;
8464 }
8465 for (var i in handlers) {
8466 if (handlers.hasOwnProperty(i)) {
8467 try {
8468 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
8469 } catch (inner) {
8470 exception = inner;
8471 }
8472 }
8473 }
8474
8475 if (exception) {
8476 throw exception;
8477 }
8478 }
8479
8480 var _oldOnerrorHandler, _onErrorHandlerInstalled;
8481
8482 /**
8483 * Ensures all global unhandled exceptions are recorded.
8484 * Supported by Gecko and IE.
8485 * @param {string} message Error message.
8486 * @param {string} url URL of script that generated the exception.
8487 * @param {(number|string)} lineNo The line number at which the error
8488 * occurred.
8489 * @param {?(number|string)} colNo The column number at which the error
8490 * occurred.
8491 * @param {?Error} ex The actual Error object.
8492 */
8493 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
8494 var stack = null;
8495
8496 if (lastExceptionStack) {
8497 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
8498 lastExceptionStack,
8499 url,
8500 lineNo,
8501 message
8502 );
8503 processLastException();
8504 } else if (ex && utils.isError(ex)) {
8505 // non-string `ex` arg; attempt to extract stack trace
8506
8507 // New chrome and blink send along a real error object
8508 // Let's just report that like a normal error.
8509 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
8510 stack = TraceKit.computeStackTrace(ex);
8511 notifyHandlers(stack, true);
8512 } else {
8513 var location = {
8514 url: url,
8515 line: lineNo,
8516 column: colNo
8517 };
8518
8519 var name = undefined;
8520 var msg = message; // must be new var or will modify original `arguments`
8521 var groups;
8522 if ({}.toString.call(message) === '[object String]') {
8523 var groups = message.match(ERROR_TYPES_RE);
8524 if (groups) {
8525 name = groups[1];
8526 msg = groups[2];
8527 }
8528 }
8529
8530 location.func = UNKNOWN_FUNCTION;
8531
8532 stack = {
8533 name: name,
8534 message: msg,
8535 url: getLocationHref(),
8536 stack: [location]
8537 };
8538 notifyHandlers(stack, true);
8539 }
8540
8541 if (_oldOnerrorHandler) {
8542 return _oldOnerrorHandler.apply(this, arguments);
8543 }
8544
8545 return false;
8546 }
8547
8548 function installGlobalHandler() {
8549 if (_onErrorHandlerInstalled) {
8550 return;
8551 }
8552 _oldOnerrorHandler = _window.onerror;
8553 _window.onerror = traceKitWindowOnError;
8554 _onErrorHandlerInstalled = true;
8555 }
8556
8557 function uninstallGlobalHandler() {
8558 if (!_onErrorHandlerInstalled) {
8559 return;
8560 }
8561 _window.onerror = _oldOnerrorHandler;
8562 _onErrorHandlerInstalled = false;
8563 _oldOnerrorHandler = undefined;
8564 }
8565
8566 function processLastException() {
8567 var _lastExceptionStack = lastExceptionStack,
8568 _lastArgs = lastArgs;
8569 lastArgs = null;
8570 lastExceptionStack = null;
8571 lastException = null;
8572 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
8573 }
8574
8575 /**
8576 * Reports an unhandled Error to TraceKit.
8577 * @param {Error} ex
8578 * @param {?boolean} rethrow If false, do not re-throw the exception.
8579 * Only used for window.onerror to not cause an infinite loop of
8580 * rethrowing.
8581 */
8582 function report(ex, rethrow) {
8583 var args = _slice.call(arguments, 1);
8584 if (lastExceptionStack) {
8585 if (lastException === ex) {
8586 return; // already caught by an inner catch block, ignore
8587 } else {
8588 processLastException();
8589 }
8590 }
8591
8592 var stack = TraceKit.computeStackTrace(ex);
8593 lastExceptionStack = stack;
8594 lastException = ex;
8595 lastArgs = args;
8596
8597 // If the stack trace is incomplete, wait for 2 seconds for
8598 // slow slow IE to see if onerror occurs or not before reporting
8599 // this exception; otherwise, we will end up with an incomplete
8600 // stack trace
8601 setTimeout(function() {
8602 if (lastException === ex) {
8603 processLastException();
8604 }
8605 }, stack.incomplete ? 2000 : 0);
8606
8607 if (rethrow !== false) {
8608 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
8609 }
8610 }
8611
8612 report.subscribe = subscribe;
8613 report.unsubscribe = unsubscribe;
8614 report.uninstall = unsubscribeAll;
8615 return report;
8616 })();
8617
8618 /**
8619 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
8620 *
8621 * Syntax:
8622 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
8623 * Returns:
8624 * s.name - exception name
8625 * s.message - exception message
8626 * s.stack[i].url - JavaScript or HTML file URL
8627 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
8628 * s.stack[i].args - arguments passed to the function, if known
8629 * s.stack[i].line - line number, if known
8630 * s.stack[i].column - column number, if known
8631 *
8632 * Supports:
8633 * - Firefox: full stack trace with line numbers and unreliable column
8634 * number on top frame
8635 * - Opera 10: full stack trace with line and column numbers
8636 * - Opera 9-: full stack trace with line numbers
8637 * - Chrome: full stack trace with line and column numbers
8638 * - Safari: line and column number for the topmost stacktrace element
8639 * only
8640 * - IE: no line numbers whatsoever
8641 *
8642 * Tries to guess names of anonymous functions by looking for assignments
8643 * in the source code. In IE and Safari, we have to guess source file names
8644 * by searching for function bodies inside all page scripts. This will not
8645 * work for scripts that are loaded cross-domain.
8646 * Here be dragons: some function names may be guessed incorrectly, and
8647 * duplicate functions may be mismatched.
8648 *
8649 * TraceKit.computeStackTrace should only be used for tracing purposes.
8650 * Logging of unhandled exceptions should be done with TraceKit.report,
8651 * which builds on top of TraceKit.computeStackTrace and provides better
8652 * IE support by utilizing the window.onerror event to retrieve information
8653 * about the top of the stack.
8654 *
8655 * Note: In IE and Safari, no stack trace is recorded on the Error object,
8656 * so computeStackTrace instead walks its *own* chain of callers.
8657 * This means that:
8658 * * in Safari, some methods may be missing from the stack trace;
8659 * * in IE, the topmost function in the stack trace will always be the
8660 * caller of computeStackTrace.
8661 *
8662 * This is okay for tracing (because you are likely to be calling
8663 * computeStackTrace from the function you want to be the topmost element
8664 * of the stack trace anyway), but not okay for logging unhandled
8665 * exceptions (because your catch block will likely be far away from the
8666 * inner function that actually caused the exception).
8667 *
8668 */
8669 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
8670 // Contents of Exception in various browsers.
8671 //
8672 // SAFARI:
8673 // ex.message = Can't find variable: qq
8674 // ex.line = 59
8675 // ex.sourceId = 580238192
8676 // ex.sourceURL = http://...
8677 // ex.expressionBeginOffset = 96
8678 // ex.expressionCaretOffset = 98
8679 // ex.expressionEndOffset = 98
8680 // ex.name = ReferenceError
8681 //
8682 // FIREFOX:
8683 // ex.message = qq is not defined
8684 // ex.fileName = http://...
8685 // ex.lineNumber = 59
8686 // ex.columnNumber = 69
8687 // ex.stack = ...stack trace... (see the example below)
8688 // ex.name = ReferenceError
8689 //
8690 // CHROME:
8691 // ex.message = qq is not defined
8692 // ex.name = ReferenceError
8693 // ex.type = not_defined
8694 // ex.arguments = ['aa']
8695 // ex.stack = ...stack trace...
8696 //
8697 // INTERNET EXPLORER:
8698 // ex.message = ...
8699 // ex.name = ReferenceError
8700 //
8701 // OPERA:
8702 // ex.message = ...message... (see the example below)
8703 // ex.name = ReferenceError
8704 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
8705 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
8706
8707 /**
8708 * Computes stack trace information from the stack property.
8709 * Chrome and Gecko use this property.
8710 * @param {Error} ex
8711 * @return {?Object.<string, *>} Stack trace information.
8712 */
8713 function computeStackTraceFromStackProp(ex) {
8714 if (typeof ex.stack === 'undefined' || !ex.stack) return;
8715
8716 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
8717 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
8718 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
8719 // Used to additionally parse URL/line/column from eval frames
8720 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
8721 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
8722 lines = ex.stack.split('\n'),
8723 stack = [],
8724 submatch,
8725 parts,
8726 element,
8727 reference = /^(.*) is undefined$/.exec(ex.message);
8728
8729 for (var i = 0, j = lines.length; i < j; ++i) {
8730 if ((parts = chrome.exec(lines[i]))) {
8731 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
8732 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
8733 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
8734 // throw out eval line/column and use top-most line/column number
8735 parts[2] = submatch[1]; // url
8736 parts[3] = submatch[2]; // line
8737 parts[4] = submatch[3]; // column
8738 }
8739 element = {
8740 url: !isNative ? parts[2] : null,
8741 func: parts[1] || UNKNOWN_FUNCTION,
8742 args: isNative ? [parts[2]] : [],
8743 line: parts[3] ? +parts[3] : null,
8744 column: parts[4] ? +parts[4] : null
8745 };
8746 } else if ((parts = winjs.exec(lines[i]))) {
8747 element = {
8748 url: parts[2],
8749 func: parts[1] || UNKNOWN_FUNCTION,
8750 args: [],
8751 line: +parts[3],
8752 column: parts[4] ? +parts[4] : null
8753 };
8754 } else if ((parts = gecko.exec(lines[i]))) {
8755 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
8756 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
8757 // throw out eval line/column and use top-most line number
8758 parts[3] = submatch[1];
8759 parts[4] = submatch[2];
8760 parts[5] = null; // no column when eval
8761 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
8762 // FireFox uses this awesome columnNumber property for its top frame
8763 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
8764 // so adding 1
8765 // NOTE: this hack doesn't work if top-most frame is eval
8766 stack[0].column = ex.columnNumber + 1;
8767 }
8768 element = {
8769 url: parts[3],
8770 func: parts[1] || UNKNOWN_FUNCTION,
8771 args: parts[2] ? parts[2].split(',') : [],
8772 line: parts[4] ? +parts[4] : null,
8773 column: parts[5] ? +parts[5] : null
8774 };
8775 } else {
8776 continue;
8777 }
8778
8779 if (!element.func && element.line) {
8780 element.func = UNKNOWN_FUNCTION;
8781 }
8782
8783 stack.push(element);
8784 }
8785
8786 if (!stack.length) {
8787 return null;
8788 }
8789
8790 return {
8791 name: ex.name,
8792 message: ex.message,
8793 url: getLocationHref(),
8794 stack: stack
8795 };
8796 }
8797
8798 /**
8799 * Adds information about the first frame to incomplete stack traces.
8800 * Safari and IE require this to get complete data on the first frame.
8801 * @param {Object.<string, *>} stackInfo Stack trace information from
8802 * one of the compute* methods.
8803 * @param {string} url The URL of the script that caused an error.
8804 * @param {(number|string)} lineNo The line number of the script that
8805 * caused an error.
8806 * @param {string=} message The error generated by the browser, which
8807 * hopefully contains the name of the object that caused the error.
8808 * @return {boolean} Whether or not the stack information was
8809 * augmented.
8810 */
8811 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
8812 var initial = {
8813 url: url,
8814 line: lineNo
8815 };
8816
8817 if (initial.url && initial.line) {
8818 stackInfo.incomplete = false;
8819
8820 if (!initial.func) {
8821 initial.func = UNKNOWN_FUNCTION;
8822 }
8823
8824 if (stackInfo.stack.length > 0) {
8825 if (stackInfo.stack[0].url === initial.url) {
8826 if (stackInfo.stack[0].line === initial.line) {
8827 return false; // already in stack trace
8828 } else if (
8829 !stackInfo.stack[0].line &&
8830 stackInfo.stack[0].func === initial.func
8831 ) {
8832 stackInfo.stack[0].line = initial.line;
8833 return false;
8834 }
8835 }
8836 }
8837
8838 stackInfo.stack.unshift(initial);
8839 stackInfo.partial = true;
8840 return true;
8841 } else {
8842 stackInfo.incomplete = true;
8843 }
8844
8845 return false;
8846 }
8847
8848 /**
8849 * Computes stack trace information by walking the arguments.caller
8850 * chain at the time the exception occurred. This will cause earlier
8851 * frames to be missed but is the only way to get any stack trace in
8852 * Safari and IE. The top frame is restored by
8853 * {@link augmentStackTraceWithInitialElement}.
8854 * @param {Error} ex
8855 * @return {?Object.<string, *>} Stack trace information.
8856 */
8857 function computeStackTraceByWalkingCallerChain(ex, depth) {
8858 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
8859 stack = [],
8860 funcs = {},
8861 recursion = false,
8862 parts,
8863 item,
8864 source;
8865
8866 for (
8867 var curr = computeStackTraceByWalkingCallerChain.caller;
8868 curr && !recursion;
8869 curr = curr.caller
8870 ) {
8871 if (curr === computeStackTrace || curr === TraceKit.report) {
8872 // console.log('skipping internal function');
8873 continue;
8874 }
8875
8876 item = {
8877 url: null,
8878 func: UNKNOWN_FUNCTION,
8879 line: null,
8880 column: null
8881 };
8882
8883 if (curr.name) {
8884 item.func = curr.name;
8885 } else if ((parts = functionName.exec(curr.toString()))) {
8886 item.func = parts[1];
8887 }
8888
8889 if (typeof item.func === 'undefined') {
8890 try {
8891 item.func = parts.input.substring(0, parts.input.indexOf('{'));
8892 } catch (e) {}
8893 }
8894
8895 if (funcs['' + curr]) {
8896 recursion = true;
8897 } else {
8898 funcs['' + curr] = true;
8899 }
8900
8901 stack.push(item);
8902 }
8903
8904 if (depth) {
8905 // console.log('depth is ' + depth);
8906 // console.log('stack is ' + stack.length);
8907 stack.splice(0, depth);
8908 }
8909
8910 var result = {
8911 name: ex.name,
8912 message: ex.message,
8913 url: getLocationHref(),
8914 stack: stack
8915 };
8916 augmentStackTraceWithInitialElement(
8917 result,
8918 ex.sourceURL || ex.fileName,
8919 ex.line || ex.lineNumber,
8920 ex.message || ex.description
8921 );
8922 return result;
8923 }
8924
8925 /**
8926 * Computes a stack trace for an exception.
8927 * @param {Error} ex
8928 * @param {(string|number)=} depth
8929 */
8930 function computeStackTrace(ex, depth) {
8931 var stack = null;
8932 depth = depth == null ? 0 : +depth;
8933
8934 try {
8935 stack = computeStackTraceFromStackProp(ex);
8936 if (stack) {
8937 return stack;
8938 }
8939 } catch (e) {
8940 if (TraceKit.debug) {
8941 throw e;
8942 }
8943 }
8944
8945 try {
8946 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
8947 if (stack) {
8948 return stack;
8949 }
8950 } catch (e) {
8951 if (TraceKit.debug) {
8952 throw e;
8953 }
8954 }
8955 return {
8956 name: ex.name,
8957 message: ex.message,
8958 url: getLocationHref()
8959 };
8960 }
8961
8962 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
8963 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
8964
8965 return computeStackTrace;
8966 })();
8967
8968 module.exports = TraceKit;
8969
8970
8971 /***/ }),
8972
8973 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
8974 /*!***********************************************************************!*\
8975 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
8976 \***********************************************************************/
8977 /***/ ((module, exports) => {
8978
8979 /*
8980 json-stringify-safe
8981 Like JSON.stringify, but doesn't throw on circular references.
8982
8983 Originally forked from https://github.com/isaacs/json-stringify-safe
8984 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
8985 and IE8 compatibility. Tests for this are in test/vendor.
8986
8987 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
8988 */
8989
8990 exports = module.exports = stringify;
8991 exports.getSerialize = serializer;
8992
8993 function indexOf(haystack, needle) {
8994 for (var i = 0; i < haystack.length; ++i) {
8995 if (haystack[i] === needle) return i;
8996 }
8997 return -1;
8998 }
8999
9000 function stringify(obj, replacer, spaces, cycleReplacer) {
9001 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
9002 }
9003
9004 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
9005 function stringifyError(value) {
9006 var err = {
9007 // These properties are implemented as magical getters and don't show up in for in
9008 stack: value.stack,
9009 message: value.message,
9010 name: value.name
9011 };
9012
9013 for (var i in value) {
9014 if (Object.prototype.hasOwnProperty.call(value, i)) {
9015 err[i] = value[i];
9016 }
9017 }
9018
9019 return err;
9020 }
9021
9022 function serializer(replacer, cycleReplacer) {
9023 var stack = [];
9024 var keys = [];
9025
9026 if (cycleReplacer == null) {
9027 cycleReplacer = function(key, value) {
9028 if (stack[0] === value) {
9029 return '[Circular ~]';
9030 }
9031 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
9032 };
9033 }
9034
9035 return function(key, value) {
9036 if (stack.length > 0) {
9037 var thisPos = indexOf(stack, this);
9038 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
9039 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
9040
9041 if (~indexOf(stack, value)) {
9042 value = cycleReplacer.call(this, key, value);
9043 }
9044 } else {
9045 stack.push(value);
9046 }
9047
9048 return replacer == null
9049 ? value instanceof Error ? stringifyError(value) : value
9050 : replacer.call(this, key, value);
9051 };
9052 }
9053
9054
9055 /***/ }),
9056
9057 /***/ "./node_modules/react-is/cjs/react-is.development.js":
9058 /*!***********************************************************!*\
9059 !*** ./node_modules/react-is/cjs/react-is.development.js ***!
9060 \***********************************************************/
9061 /***/ ((__unused_webpack_module, exports) => {
9062
9063 "use strict";
9064 /** @license React v16.13.1
9065 * react-is.development.js
9066 *
9067 * Copyright (c) Facebook, Inc. and its affiliates.
9068 *
9069 * This source code is licensed under the MIT license found in the
9070 * LICENSE file in the root directory of this source tree.
9071 */
9072
9073
9074
9075
9076
9077 if (true) {
9078 (function() {
9079 'use strict';
9080
9081 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
9082 // nor polyfill, then a plain number is used for performance.
9083 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
9084 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
9085 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
9086 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
9087 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
9088 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
9089 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
9090 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
9091 // (unstable) APIs that have been removed. Can we remove the symbols?
9092
9093 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
9094 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
9095 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
9096 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
9097 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
9098 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
9099 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
9100 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
9101 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
9102 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
9103 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
9104
9105 function isValidElementType(type) {
9106 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
9107 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
9108 }
9109
9110 function typeOf(object) {
9111 if (typeof object === 'object' && object !== null) {
9112 var $$typeof = object.$$typeof;
9113
9114 switch ($$typeof) {
9115 case REACT_ELEMENT_TYPE:
9116 var type = object.type;
9117
9118 switch (type) {
9119 case REACT_ASYNC_MODE_TYPE:
9120 case REACT_CONCURRENT_MODE_TYPE:
9121 case REACT_FRAGMENT_TYPE:
9122 case REACT_PROFILER_TYPE:
9123 case REACT_STRICT_MODE_TYPE:
9124 case REACT_SUSPENSE_TYPE:
9125 return type;
9126
9127 default:
9128 var $$typeofType = type && type.$$typeof;
9129
9130 switch ($$typeofType) {
9131 case REACT_CONTEXT_TYPE:
9132 case REACT_FORWARD_REF_TYPE:
9133 case REACT_LAZY_TYPE:
9134 case REACT_MEMO_TYPE:
9135 case REACT_PROVIDER_TYPE:
9136 return $$typeofType;
9137
9138 default:
9139 return $$typeof;
9140 }
9141
9142 }
9143
9144 case REACT_PORTAL_TYPE:
9145 return $$typeof;
9146 }
9147 }
9148
9149 return undefined;
9150 } // AsyncMode is deprecated along with isAsyncMode
9151
9152 var AsyncMode = REACT_ASYNC_MODE_TYPE;
9153 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
9154 var ContextConsumer = REACT_CONTEXT_TYPE;
9155 var ContextProvider = REACT_PROVIDER_TYPE;
9156 var Element = REACT_ELEMENT_TYPE;
9157 var ForwardRef = REACT_FORWARD_REF_TYPE;
9158 var Fragment = REACT_FRAGMENT_TYPE;
9159 var Lazy = REACT_LAZY_TYPE;
9160 var Memo = REACT_MEMO_TYPE;
9161 var Portal = REACT_PORTAL_TYPE;
9162 var Profiler = REACT_PROFILER_TYPE;
9163 var StrictMode = REACT_STRICT_MODE_TYPE;
9164 var Suspense = REACT_SUSPENSE_TYPE;
9165 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
9166
9167 function isAsyncMode(object) {
9168 {
9169 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
9170 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
9171
9172 console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
9173 }
9174 }
9175
9176 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
9177 }
9178 function isConcurrentMode(object) {
9179 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
9180 }
9181 function isContextConsumer(object) {
9182 return typeOf(object) === REACT_CONTEXT_TYPE;
9183 }
9184 function isContextProvider(object) {
9185 return typeOf(object) === REACT_PROVIDER_TYPE;
9186 }
9187 function isElement(object) {
9188 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9189 }
9190 function isForwardRef(object) {
9191 return typeOf(object) === REACT_FORWARD_REF_TYPE;
9192 }
9193 function isFragment(object) {
9194 return typeOf(object) === REACT_FRAGMENT_TYPE;
9195 }
9196 function isLazy(object) {
9197 return typeOf(object) === REACT_LAZY_TYPE;
9198 }
9199 function isMemo(object) {
9200 return typeOf(object) === REACT_MEMO_TYPE;
9201 }
9202 function isPortal(object) {
9203 return typeOf(object) === REACT_PORTAL_TYPE;
9204 }
9205 function isProfiler(object) {
9206 return typeOf(object) === REACT_PROFILER_TYPE;
9207 }
9208 function isStrictMode(object) {
9209 return typeOf(object) === REACT_STRICT_MODE_TYPE;
9210 }
9211 function isSuspense(object) {
9212 return typeOf(object) === REACT_SUSPENSE_TYPE;
9213 }
9214
9215 exports.AsyncMode = AsyncMode;
9216 exports.ConcurrentMode = ConcurrentMode;
9217 exports.ContextConsumer = ContextConsumer;
9218 exports.ContextProvider = ContextProvider;
9219 exports.Element = Element;
9220 exports.ForwardRef = ForwardRef;
9221 exports.Fragment = Fragment;
9222 exports.Lazy = Lazy;
9223 exports.Memo = Memo;
9224 exports.Portal = Portal;
9225 exports.Profiler = Profiler;
9226 exports.StrictMode = StrictMode;
9227 exports.Suspense = Suspense;
9228 exports.isAsyncMode = isAsyncMode;
9229 exports.isConcurrentMode = isConcurrentMode;
9230 exports.isContextConsumer = isContextConsumer;
9231 exports.isContextProvider = isContextProvider;
9232 exports.isElement = isElement;
9233 exports.isForwardRef = isForwardRef;
9234 exports.isFragment = isFragment;
9235 exports.isLazy = isLazy;
9236 exports.isMemo = isMemo;
9237 exports.isPortal = isPortal;
9238 exports.isProfiler = isProfiler;
9239 exports.isStrictMode = isStrictMode;
9240 exports.isSuspense = isSuspense;
9241 exports.isValidElementType = isValidElementType;
9242 exports.typeOf = typeOf;
9243 })();
9244 }
9245
9246
9247 /***/ }),
9248
9249 /***/ "./node_modules/react-is/index.js":
9250 /*!****************************************!*\
9251 !*** ./node_modules/react-is/index.js ***!
9252 \****************************************/
9253 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9254
9255 "use strict";
9256
9257
9258 if (false) {} else {
9259 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
9260 }
9261
9262
9263 /***/ }),
9264
9265 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
9266 /*!*****************************************************************!*\
9267 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
9268 \*****************************************************************/
9269 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9270
9271 "use strict";
9272 /**
9273 * @license React
9274 * react-jsx-runtime.development.js
9275 *
9276 * Copyright (c) Facebook, Inc. and its affiliates.
9277 *
9278 * This source code is licensed under the MIT license found in the
9279 * LICENSE file in the root directory of this source tree.
9280 */
9281
9282
9283
9284 if (true) {
9285 (function() {
9286 'use strict';
9287
9288 var React = __webpack_require__(/*! react */ "react");
9289
9290 // ATTENTION
9291 // When adding new symbols to this file,
9292 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
9293 // The Symbol used to tag the ReactElement-like types.
9294 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
9295 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
9296 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
9297 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
9298 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
9299 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
9300 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
9301 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
9302 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
9303 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
9304 var REACT_MEMO_TYPE = Symbol.for('react.memo');
9305 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
9306 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
9307 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
9308 var FAUX_ITERATOR_SYMBOL = '@@iterator';
9309 function getIteratorFn(maybeIterable) {
9310 if (maybeIterable === null || typeof maybeIterable !== 'object') {
9311 return null;
9312 }
9313
9314 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
9315
9316 if (typeof maybeIterator === 'function') {
9317 return maybeIterator;
9318 }
9319
9320 return null;
9321 }
9322
9323 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
9324
9325 function error(format) {
9326 {
9327 {
9328 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
9329 args[_key2 - 1] = arguments[_key2];
9330 }
9331
9332 printWarning('error', format, args);
9333 }
9334 }
9335 }
9336
9337 function printWarning(level, format, args) {
9338 // When changing this logic, you might want to also
9339 // update consoleWithStackDev.www.js as well.
9340 {
9341 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9342 var stack = ReactDebugCurrentFrame.getStackAddendum();
9343
9344 if (stack !== '') {
9345 format += '%s';
9346 args = args.concat([stack]);
9347 } // eslint-disable-next-line react-internal/safe-string-coercion
9348
9349
9350 var argsWithFormat = args.map(function (item) {
9351 return String(item);
9352 }); // Careful: RN currently depends on this prefix
9353
9354 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
9355 // breaks IE9: https://github.com/facebook/react/issues/13610
9356 // eslint-disable-next-line react-internal/no-production-logging
9357
9358 Function.prototype.apply.call(console[level], console, argsWithFormat);
9359 }
9360 }
9361
9362 // -----------------------------------------------------------------------------
9363
9364 var enableScopeAPI = false; // Experimental Create Event Handle API.
9365 var enableCacheElement = false;
9366 var enableTransitionTracing = false; // No known bugs, but needs performance testing
9367
9368 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
9369 // stuff. Intended to enable React core members to more easily debug scheduling
9370 // issues in DEV builds.
9371
9372 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
9373
9374 var REACT_MODULE_REFERENCE;
9375
9376 {
9377 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
9378 }
9379
9380 function isValidElementType(type) {
9381 if (typeof type === 'string' || typeof type === 'function') {
9382 return true;
9383 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
9384
9385
9386 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
9387 return true;
9388 }
9389
9390 if (typeof type === 'object' && type !== null) {
9391 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 || // This needs to include all possible module reference object
9392 // types supported by any Flight configuration anywhere since
9393 // we don't know which Flight build this will end up being used
9394 // with.
9395 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
9396 return true;
9397 }
9398 }
9399
9400 return false;
9401 }
9402
9403 function getWrappedName(outerType, innerType, wrapperName) {
9404 var displayName = outerType.displayName;
9405
9406 if (displayName) {
9407 return displayName;
9408 }
9409
9410 var functionName = innerType.displayName || innerType.name || '';
9411 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
9412 } // Keep in sync with react-reconciler/getComponentNameFromFiber
9413
9414
9415 function getContextName(type) {
9416 return type.displayName || 'Context';
9417 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
9418
9419
9420 function getComponentNameFromType(type) {
9421 if (type == null) {
9422 // Host root, text node or just invalid type.
9423 return null;
9424 }
9425
9426 {
9427 if (typeof type.tag === 'number') {
9428 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
9429 }
9430 }
9431
9432 if (typeof type === 'function') {
9433 return type.displayName || type.name || null;
9434 }
9435
9436 if (typeof type === 'string') {
9437 return type;
9438 }
9439
9440 switch (type) {
9441 case REACT_FRAGMENT_TYPE:
9442 return 'Fragment';
9443
9444 case REACT_PORTAL_TYPE:
9445 return 'Portal';
9446
9447 case REACT_PROFILER_TYPE:
9448 return 'Profiler';
9449
9450 case REACT_STRICT_MODE_TYPE:
9451 return 'StrictMode';
9452
9453 case REACT_SUSPENSE_TYPE:
9454 return 'Suspense';
9455
9456 case REACT_SUSPENSE_LIST_TYPE:
9457 return 'SuspenseList';
9458
9459 }
9460
9461 if (typeof type === 'object') {
9462 switch (type.$$typeof) {
9463 case REACT_CONTEXT_TYPE:
9464 var context = type;
9465 return getContextName(context) + '.Consumer';
9466
9467 case REACT_PROVIDER_TYPE:
9468 var provider = type;
9469 return getContextName(provider._context) + '.Provider';
9470
9471 case REACT_FORWARD_REF_TYPE:
9472 return getWrappedName(type, type.render, 'ForwardRef');
9473
9474 case REACT_MEMO_TYPE:
9475 var outerName = type.displayName || null;
9476
9477 if (outerName !== null) {
9478 return outerName;
9479 }
9480
9481 return getComponentNameFromType(type.type) || 'Memo';
9482
9483 case REACT_LAZY_TYPE:
9484 {
9485 var lazyComponent = type;
9486 var payload = lazyComponent._payload;
9487 var init = lazyComponent._init;
9488
9489 try {
9490 return getComponentNameFromType(init(payload));
9491 } catch (x) {
9492 return null;
9493 }
9494 }
9495
9496 // eslint-disable-next-line no-fallthrough
9497 }
9498 }
9499
9500 return null;
9501 }
9502
9503 var assign = Object.assign;
9504
9505 // Helpers to patch console.logs to avoid logging during side-effect free
9506 // replaying on render function. This currently only patches the object
9507 // lazily which won't cover if the log function was extracted eagerly.
9508 // We could also eagerly patch the method.
9509 var disabledDepth = 0;
9510 var prevLog;
9511 var prevInfo;
9512 var prevWarn;
9513 var prevError;
9514 var prevGroup;
9515 var prevGroupCollapsed;
9516 var prevGroupEnd;
9517
9518 function disabledLog() {}
9519
9520 disabledLog.__reactDisabledLog = true;
9521 function disableLogs() {
9522 {
9523 if (disabledDepth === 0) {
9524 /* eslint-disable react-internal/no-production-logging */
9525 prevLog = console.log;
9526 prevInfo = console.info;
9527 prevWarn = console.warn;
9528 prevError = console.error;
9529 prevGroup = console.group;
9530 prevGroupCollapsed = console.groupCollapsed;
9531 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
9532
9533 var props = {
9534 configurable: true,
9535 enumerable: true,
9536 value: disabledLog,
9537 writable: true
9538 }; // $FlowFixMe Flow thinks console is immutable.
9539
9540 Object.defineProperties(console, {
9541 info: props,
9542 log: props,
9543 warn: props,
9544 error: props,
9545 group: props,
9546 groupCollapsed: props,
9547 groupEnd: props
9548 });
9549 /* eslint-enable react-internal/no-production-logging */
9550 }
9551
9552 disabledDepth++;
9553 }
9554 }
9555 function reenableLogs() {
9556 {
9557 disabledDepth--;
9558
9559 if (disabledDepth === 0) {
9560 /* eslint-disable react-internal/no-production-logging */
9561 var props = {
9562 configurable: true,
9563 enumerable: true,
9564 writable: true
9565 }; // $FlowFixMe Flow thinks console is immutable.
9566
9567 Object.defineProperties(console, {
9568 log: assign({}, props, {
9569 value: prevLog
9570 }),
9571 info: assign({}, props, {
9572 value: prevInfo
9573 }),
9574 warn: assign({}, props, {
9575 value: prevWarn
9576 }),
9577 error: assign({}, props, {
9578 value: prevError
9579 }),
9580 group: assign({}, props, {
9581 value: prevGroup
9582 }),
9583 groupCollapsed: assign({}, props, {
9584 value: prevGroupCollapsed
9585 }),
9586 groupEnd: assign({}, props, {
9587 value: prevGroupEnd
9588 })
9589 });
9590 /* eslint-enable react-internal/no-production-logging */
9591 }
9592
9593 if (disabledDepth < 0) {
9594 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
9595 }
9596 }
9597 }
9598
9599 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9600 var prefix;
9601 function describeBuiltInComponentFrame(name, source, ownerFn) {
9602 {
9603 if (prefix === undefined) {
9604 // Extract the VM specific prefix used by each line.
9605 try {
9606 throw Error();
9607 } catch (x) {
9608 var match = x.stack.trim().match(/\n( *(at )?)/);
9609 prefix = match && match[1] || '';
9610 }
9611 } // We use the prefix to ensure our stacks line up with native stack frames.
9612
9613
9614 return '\n' + prefix + name;
9615 }
9616 }
9617 var reentry = false;
9618 var componentFrameCache;
9619
9620 {
9621 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
9622 componentFrameCache = new PossiblyWeakMap();
9623 }
9624
9625 function describeNativeComponentFrame(fn, construct) {
9626 // If something asked for a stack inside a fake render, it should get ignored.
9627 if ( !fn || reentry) {
9628 return '';
9629 }
9630
9631 {
9632 var frame = componentFrameCache.get(fn);
9633
9634 if (frame !== undefined) {
9635 return frame;
9636 }
9637 }
9638
9639 var control;
9640 reentry = true;
9641 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
9642
9643 Error.prepareStackTrace = undefined;
9644 var previousDispatcher;
9645
9646 {
9647 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
9648 // for warnings.
9649
9650 ReactCurrentDispatcher.current = null;
9651 disableLogs();
9652 }
9653
9654 try {
9655 // This should throw.
9656 if (construct) {
9657 // Something should be setting the props in the constructor.
9658 var Fake = function () {
9659 throw Error();
9660 }; // $FlowFixMe
9661
9662
9663 Object.defineProperty(Fake.prototype, 'props', {
9664 set: function () {
9665 // We use a throwing setter instead of frozen or non-writable props
9666 // because that won't throw in a non-strict mode function.
9667 throw Error();
9668 }
9669 });
9670
9671 if (typeof Reflect === 'object' && Reflect.construct) {
9672 // We construct a different control for this case to include any extra
9673 // frames added by the construct call.
9674 try {
9675 Reflect.construct(Fake, []);
9676 } catch (x) {
9677 control = x;
9678 }
9679
9680 Reflect.construct(fn, [], Fake);
9681 } else {
9682 try {
9683 Fake.call();
9684 } catch (x) {
9685 control = x;
9686 }
9687
9688 fn.call(Fake.prototype);
9689 }
9690 } else {
9691 try {
9692 throw Error();
9693 } catch (x) {
9694 control = x;
9695 }
9696
9697 fn();
9698 }
9699 } catch (sample) {
9700 // This is inlined manually because closure doesn't do it for us.
9701 if (sample && control && typeof sample.stack === 'string') {
9702 // This extracts the first frame from the sample that isn't also in the control.
9703 // Skipping one frame that we assume is the frame that calls the two.
9704 var sampleLines = sample.stack.split('\n');
9705 var controlLines = control.stack.split('\n');
9706 var s = sampleLines.length - 1;
9707 var c = controlLines.length - 1;
9708
9709 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
9710 // We expect at least one stack frame to be shared.
9711 // Typically this will be the root most one. However, stack frames may be
9712 // cut off due to maximum stack limits. In this case, one maybe cut off
9713 // earlier than the other. We assume that the sample is longer or the same
9714 // and there for cut off earlier. So we should find the root most frame in
9715 // the sample somewhere in the control.
9716 c--;
9717 }
9718
9719 for (; s >= 1 && c >= 0; s--, c--) {
9720 // Next we find the first one that isn't the same which should be the
9721 // frame that called our sample function and the control.
9722 if (sampleLines[s] !== controlLines[c]) {
9723 // In V8, the first line is describing the message but other VMs don't.
9724 // If we're about to return the first line, and the control is also on the same
9725 // line, that's a pretty good indicator that our sample threw at same line as
9726 // the control. I.e. before we entered the sample frame. So we ignore this result.
9727 // This can happen if you passed a class to function component, or non-function.
9728 if (s !== 1 || c !== 1) {
9729 do {
9730 s--;
9731 c--; // We may still have similar intermediate frames from the construct call.
9732 // The next one that isn't the same should be our match though.
9733
9734 if (c < 0 || sampleLines[s] !== controlLines[c]) {
9735 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
9736 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
9737 // but we have a user-provided "displayName"
9738 // splice it in to make the stack more readable.
9739
9740
9741 if (fn.displayName && _frame.includes('<anonymous>')) {
9742 _frame = _frame.replace('<anonymous>', fn.displayName);
9743 }
9744
9745 {
9746 if (typeof fn === 'function') {
9747 componentFrameCache.set(fn, _frame);
9748 }
9749 } // Return the line we found.
9750
9751
9752 return _frame;
9753 }
9754 } while (s >= 1 && c >= 0);
9755 }
9756
9757 break;
9758 }
9759 }
9760 }
9761 } finally {
9762 reentry = false;
9763
9764 {
9765 ReactCurrentDispatcher.current = previousDispatcher;
9766 reenableLogs();
9767 }
9768
9769 Error.prepareStackTrace = previousPrepareStackTrace;
9770 } // Fallback to just using the name if we couldn't make it throw.
9771
9772
9773 var name = fn ? fn.displayName || fn.name : '';
9774 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
9775
9776 {
9777 if (typeof fn === 'function') {
9778 componentFrameCache.set(fn, syntheticFrame);
9779 }
9780 }
9781
9782 return syntheticFrame;
9783 }
9784 function describeFunctionComponentFrame(fn, source, ownerFn) {
9785 {
9786 return describeNativeComponentFrame(fn, false);
9787 }
9788 }
9789
9790 function shouldConstruct(Component) {
9791 var prototype = Component.prototype;
9792 return !!(prototype && prototype.isReactComponent);
9793 }
9794
9795 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
9796
9797 if (type == null) {
9798 return '';
9799 }
9800
9801 if (typeof type === 'function') {
9802 {
9803 return describeNativeComponentFrame(type, shouldConstruct(type));
9804 }
9805 }
9806
9807 if (typeof type === 'string') {
9808 return describeBuiltInComponentFrame(type);
9809 }
9810
9811 switch (type) {
9812 case REACT_SUSPENSE_TYPE:
9813 return describeBuiltInComponentFrame('Suspense');
9814
9815 case REACT_SUSPENSE_LIST_TYPE:
9816 return describeBuiltInComponentFrame('SuspenseList');
9817 }
9818
9819 if (typeof type === 'object') {
9820 switch (type.$$typeof) {
9821 case REACT_FORWARD_REF_TYPE:
9822 return describeFunctionComponentFrame(type.render);
9823
9824 case REACT_MEMO_TYPE:
9825 // Memo may contain any component type so we recursively resolve it.
9826 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
9827
9828 case REACT_LAZY_TYPE:
9829 {
9830 var lazyComponent = type;
9831 var payload = lazyComponent._payload;
9832 var init = lazyComponent._init;
9833
9834 try {
9835 // Lazy may contain any component type so we recursively resolve it.
9836 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
9837 } catch (x) {}
9838 }
9839 }
9840 }
9841
9842 return '';
9843 }
9844
9845 var hasOwnProperty = Object.prototype.hasOwnProperty;
9846
9847 var loggedTypeFailures = {};
9848 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9849
9850 function setCurrentlyValidatingElement(element) {
9851 {
9852 if (element) {
9853 var owner = element._owner;
9854 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9855 ReactDebugCurrentFrame.setExtraStackFrame(stack);
9856 } else {
9857 ReactDebugCurrentFrame.setExtraStackFrame(null);
9858 }
9859 }
9860 }
9861
9862 function checkPropTypes(typeSpecs, values, location, componentName, element) {
9863 {
9864 // $FlowFixMe This is okay but Flow doesn't know it.
9865 var has = Function.call.bind(hasOwnProperty);
9866
9867 for (var typeSpecName in typeSpecs) {
9868 if (has(typeSpecs, typeSpecName)) {
9869 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
9870 // fail the render phase where it didn't fail before. So we log it.
9871 // After these have been cleaned up, we'll let them throw.
9872
9873 try {
9874 // This is intentionally an invariant that gets caught. It's the same
9875 // behavior as without this statement except with a better message.
9876 if (typeof typeSpecs[typeSpecName] !== 'function') {
9877 // eslint-disable-next-line react-internal/prod-error-codes
9878 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`.');
9879 err.name = 'Invariant Violation';
9880 throw err;
9881 }
9882
9883 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
9884 } catch (ex) {
9885 error$1 = ex;
9886 }
9887
9888 if (error$1 && !(error$1 instanceof Error)) {
9889 setCurrentlyValidatingElement(element);
9890
9891 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);
9892
9893 setCurrentlyValidatingElement(null);
9894 }
9895
9896 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
9897 // Only monitor this failure once because there tends to be a lot of the
9898 // same error.
9899 loggedTypeFailures[error$1.message] = true;
9900 setCurrentlyValidatingElement(element);
9901
9902 error('Failed %s type: %s', location, error$1.message);
9903
9904 setCurrentlyValidatingElement(null);
9905 }
9906 }
9907 }
9908 }
9909 }
9910
9911 var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
9912
9913 function isArray(a) {
9914 return isArrayImpl(a);
9915 }
9916
9917 /*
9918 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
9919 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
9920 *
9921 * The functions in this module will throw an easier-to-understand,
9922 * easier-to-debug exception with a clear errors message message explaining the
9923 * problem. (Instead of a confusing exception thrown inside the implementation
9924 * of the `value` object).
9925 */
9926 // $FlowFixMe only called in DEV, so void return is not possible.
9927 function typeName(value) {
9928 {
9929 // toStringTag is needed for namespaced types like Temporal.Instant
9930 var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
9931 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
9932 return type;
9933 }
9934 } // $FlowFixMe only called in DEV, so void return is not possible.
9935
9936
9937 function willCoercionThrow(value) {
9938 {
9939 try {
9940 testStringCoercion(value);
9941 return false;
9942 } catch (e) {
9943 return true;
9944 }
9945 }
9946 }
9947
9948 function testStringCoercion(value) {
9949 // If you ended up here by following an exception call stack, here's what's
9950 // happened: you supplied an object or symbol value to React (as a prop, key,
9951 // DOM attribute, CSS property, string ref, etc.) and when React tried to
9952 // coerce it to a string using `'' + value`, an exception was thrown.
9953 //
9954 // The most common types that will cause this exception are `Symbol` instances
9955 // and Temporal objects like `Temporal.Instant`. But any object that has a
9956 // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
9957 // exception. (Library authors do this to prevent users from using built-in
9958 // numeric operators like `+` or comparison operators like `>=` because custom
9959 // methods are needed to perform accurate arithmetic or comparison.)
9960 //
9961 // To fix the problem, coerce this object or symbol value to a string before
9962 // passing it to React. The most reliable way is usually `String(value)`.
9963 //
9964 // To find which value is throwing, check the browser or debugger console.
9965 // Before this exception was thrown, there should be `console.error` output
9966 // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
9967 // problem and how that type was used: key, atrribute, input value prop, etc.
9968 // In most cases, this console output also shows the component and its
9969 // ancestor components where the exception happened.
9970 //
9971 // eslint-disable-next-line react-internal/safe-string-coercion
9972 return '' + value;
9973 }
9974 function checkKeyStringCoercion(value) {
9975 {
9976 if (willCoercionThrow(value)) {
9977 error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
9978
9979 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
9980 }
9981 }
9982 }
9983
9984 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
9985 var RESERVED_PROPS = {
9986 key: true,
9987 ref: true,
9988 __self: true,
9989 __source: true
9990 };
9991 var specialPropKeyWarningShown;
9992 var specialPropRefWarningShown;
9993 var didWarnAboutStringRefs;
9994
9995 {
9996 didWarnAboutStringRefs = {};
9997 }
9998
9999 function hasValidRef(config) {
10000 {
10001 if (hasOwnProperty.call(config, 'ref')) {
10002 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
10003
10004 if (getter && getter.isReactWarning) {
10005 return false;
10006 }
10007 }
10008 }
10009
10010 return config.ref !== undefined;
10011 }
10012
10013 function hasValidKey(config) {
10014 {
10015 if (hasOwnProperty.call(config, 'key')) {
10016 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
10017
10018 if (getter && getter.isReactWarning) {
10019 return false;
10020 }
10021 }
10022 }
10023
10024 return config.key !== undefined;
10025 }
10026
10027 function warnIfStringRefCannotBeAutoConverted(config, self) {
10028 {
10029 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
10030 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
10031
10032 if (!didWarnAboutStringRefs[componentName]) {
10033 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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
10034
10035 didWarnAboutStringRefs[componentName] = true;
10036 }
10037 }
10038 }
10039 }
10040
10041 function defineKeyPropWarningGetter(props, displayName) {
10042 {
10043 var warnAboutAccessingKey = function () {
10044 if (!specialPropKeyWarningShown) {
10045 specialPropKeyWarningShown = true;
10046
10047 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);
10048 }
10049 };
10050
10051 warnAboutAccessingKey.isReactWarning = true;
10052 Object.defineProperty(props, 'key', {
10053 get: warnAboutAccessingKey,
10054 configurable: true
10055 });
10056 }
10057 }
10058
10059 function defineRefPropWarningGetter(props, displayName) {
10060 {
10061 var warnAboutAccessingRef = function () {
10062 if (!specialPropRefWarningShown) {
10063 specialPropRefWarningShown = true;
10064
10065 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);
10066 }
10067 };
10068
10069 warnAboutAccessingRef.isReactWarning = true;
10070 Object.defineProperty(props, 'ref', {
10071 get: warnAboutAccessingRef,
10072 configurable: true
10073 });
10074 }
10075 }
10076 /**
10077 * Factory method to create a new React element. This no longer adheres to
10078 * the class pattern, so do not use new to call it. Also, instanceof check
10079 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
10080 * if something is a React Element.
10081 *
10082 * @param {*} type
10083 * @param {*} props
10084 * @param {*} key
10085 * @param {string|object} ref
10086 * @param {*} owner
10087 * @param {*} self A *temporary* helper to detect places where `this` is
10088 * different from the `owner` when React.createElement is called, so that we
10089 * can warn. We want to get rid of owner and replace string `ref`s with arrow
10090 * functions, and as long as `this` and owner are the same, there will be no
10091 * change in behavior.
10092 * @param {*} source An annotation object (added by a transpiler or otherwise)
10093 * indicating filename, line number, and/or other information.
10094 * @internal
10095 */
10096
10097
10098 var ReactElement = function (type, key, ref, self, source, owner, props) {
10099 var element = {
10100 // This tag allows us to uniquely identify this as a React Element
10101 $$typeof: REACT_ELEMENT_TYPE,
10102 // Built-in properties that belong on the element
10103 type: type,
10104 key: key,
10105 ref: ref,
10106 props: props,
10107 // Record the component responsible for creating this element.
10108 _owner: owner
10109 };
10110
10111 {
10112 // The validation flag is currently mutative. We put it on
10113 // an external backing store so that we can freeze the whole object.
10114 // This can be replaced with a WeakMap once they are implemented in
10115 // commonly used development environments.
10116 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
10117 // the validation flag non-enumerable (where possible, which should
10118 // include every environment we run tests in), so the test framework
10119 // ignores it.
10120
10121 Object.defineProperty(element._store, 'validated', {
10122 configurable: false,
10123 enumerable: false,
10124 writable: true,
10125 value: false
10126 }); // self and source are DEV only properties.
10127
10128 Object.defineProperty(element, '_self', {
10129 configurable: false,
10130 enumerable: false,
10131 writable: false,
10132 value: self
10133 }); // Two elements created in two different places should be considered
10134 // equal for testing purposes and therefore we hide it from enumeration.
10135
10136 Object.defineProperty(element, '_source', {
10137 configurable: false,
10138 enumerable: false,
10139 writable: false,
10140 value: source
10141 });
10142
10143 if (Object.freeze) {
10144 Object.freeze(element.props);
10145 Object.freeze(element);
10146 }
10147 }
10148
10149 return element;
10150 };
10151 /**
10152 * https://github.com/reactjs/rfcs/pull/107
10153 * @param {*} type
10154 * @param {object} props
10155 * @param {string} key
10156 */
10157
10158 function jsxDEV(type, config, maybeKey, source, self) {
10159 {
10160 var propName; // Reserved names are extracted
10161
10162 var props = {};
10163 var key = null;
10164 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
10165 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
10166 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
10167 // but as an intermediary step, we will use jsxDEV for everything except
10168 // <div {...props} key="Hi" />, because we aren't currently able to tell if
10169 // key is explicitly declared to be undefined or not.
10170
10171 if (maybeKey !== undefined) {
10172 {
10173 checkKeyStringCoercion(maybeKey);
10174 }
10175
10176 key = '' + maybeKey;
10177 }
10178
10179 if (hasValidKey(config)) {
10180 {
10181 checkKeyStringCoercion(config.key);
10182 }
10183
10184 key = '' + config.key;
10185 }
10186
10187 if (hasValidRef(config)) {
10188 ref = config.ref;
10189 warnIfStringRefCannotBeAutoConverted(config, self);
10190 } // Remaining properties are added to a new props object
10191
10192
10193 for (propName in config) {
10194 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10195 props[propName] = config[propName];
10196 }
10197 } // Resolve default props
10198
10199
10200 if (type && type.defaultProps) {
10201 var defaultProps = type.defaultProps;
10202
10203 for (propName in defaultProps) {
10204 if (props[propName] === undefined) {
10205 props[propName] = defaultProps[propName];
10206 }
10207 }
10208 }
10209
10210 if (key || ref) {
10211 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
10212
10213 if (key) {
10214 defineKeyPropWarningGetter(props, displayName);
10215 }
10216
10217 if (ref) {
10218 defineRefPropWarningGetter(props, displayName);
10219 }
10220 }
10221
10222 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10223 }
10224 }
10225
10226 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
10227 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
10228
10229 function setCurrentlyValidatingElement$1(element) {
10230 {
10231 if (element) {
10232 var owner = element._owner;
10233 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
10234 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
10235 } else {
10236 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
10237 }
10238 }
10239 }
10240
10241 var propTypesMisspellWarningShown;
10242
10243 {
10244 propTypesMisspellWarningShown = false;
10245 }
10246 /**
10247 * Verifies the object is a ReactElement.
10248 * See https://reactjs.org/docs/react-api.html#isvalidelement
10249 * @param {?object} object
10250 * @return {boolean} True if `object` is a ReactElement.
10251 * @final
10252 */
10253
10254
10255 function isValidElement(object) {
10256 {
10257 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10258 }
10259 }
10260
10261 function getDeclarationErrorAddendum() {
10262 {
10263 if (ReactCurrentOwner$1.current) {
10264 var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
10265
10266 if (name) {
10267 return '\n\nCheck the render method of `' + name + '`.';
10268 }
10269 }
10270
10271 return '';
10272 }
10273 }
10274
10275 function getSourceInfoErrorAddendum(source) {
10276 {
10277 if (source !== undefined) {
10278 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
10279 var lineNumber = source.lineNumber;
10280 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
10281 }
10282
10283 return '';
10284 }
10285 }
10286 /**
10287 * Warn if there's no key explicitly set on dynamic arrays of children or
10288 * object keys are not valid. This allows us to keep track of children between
10289 * updates.
10290 */
10291
10292
10293 var ownerHasKeyUseWarning = {};
10294
10295 function getCurrentComponentErrorInfo(parentType) {
10296 {
10297 var info = getDeclarationErrorAddendum();
10298
10299 if (!info) {
10300 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10301
10302 if (parentName) {
10303 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
10304 }
10305 }
10306
10307 return info;
10308 }
10309 }
10310 /**
10311 * Warn if the element doesn't have an explicit key assigned to it.
10312 * This element is in an array. The array could grow and shrink or be
10313 * reordered. All children that haven't already been validated are required to
10314 * have a "key" property assigned to it. Error statuses are cached so a warning
10315 * will only be shown once.
10316 *
10317 * @internal
10318 * @param {ReactElement} element Element that requires a key.
10319 * @param {*} parentType element's parent's type.
10320 */
10321
10322
10323 function validateExplicitKey(element, parentType) {
10324 {
10325 if (!element._store || element._store.validated || element.key != null) {
10326 return;
10327 }
10328
10329 element._store.validated = true;
10330 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
10331
10332 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
10333 return;
10334 }
10335
10336 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
10337 // property, it may be the creator of the child that's responsible for
10338 // assigning it a key.
10339
10340 var childOwner = '';
10341
10342 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
10343 // Give the component that originally created this child.
10344 childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
10345 }
10346
10347 setCurrentlyValidatingElement$1(element);
10348
10349 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);
10350
10351 setCurrentlyValidatingElement$1(null);
10352 }
10353 }
10354 /**
10355 * Ensure that every element either is passed in a static location, in an
10356 * array with an explicit keys property defined, or in an object literal
10357 * with valid key property.
10358 *
10359 * @internal
10360 * @param {ReactNode} node Statically passed child of any type.
10361 * @param {*} parentType node's parent's type.
10362 */
10363
10364
10365 function validateChildKeys(node, parentType) {
10366 {
10367 if (typeof node !== 'object') {
10368 return;
10369 }
10370
10371 if (isArray(node)) {
10372 for (var i = 0; i < node.length; i++) {
10373 var child = node[i];
10374
10375 if (isValidElement(child)) {
10376 validateExplicitKey(child, parentType);
10377 }
10378 }
10379 } else if (isValidElement(node)) {
10380 // This element was passed in a valid location.
10381 if (node._store) {
10382 node._store.validated = true;
10383 }
10384 } else if (node) {
10385 var iteratorFn = getIteratorFn(node);
10386
10387 if (typeof iteratorFn === 'function') {
10388 // Entry iterators used to provide implicit keys,
10389 // but now we print a separate warning for them later.
10390 if (iteratorFn !== node.entries) {
10391 var iterator = iteratorFn.call(node);
10392 var step;
10393
10394 while (!(step = iterator.next()).done) {
10395 if (isValidElement(step.value)) {
10396 validateExplicitKey(step.value, parentType);
10397 }
10398 }
10399 }
10400 }
10401 }
10402 }
10403 }
10404 /**
10405 * Given an element, validate that its props follow the propTypes definition,
10406 * provided by the type.
10407 *
10408 * @param {ReactElement} element
10409 */
10410
10411
10412 function validatePropTypes(element) {
10413 {
10414 var type = element.type;
10415
10416 if (type === null || type === undefined || typeof type === 'string') {
10417 return;
10418 }
10419
10420 var propTypes;
10421
10422 if (typeof type === 'function') {
10423 propTypes = type.propTypes;
10424 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
10425 // Inner props are checked in the reconciler.
10426 type.$$typeof === REACT_MEMO_TYPE)) {
10427 propTypes = type.propTypes;
10428 } else {
10429 return;
10430 }
10431
10432 if (propTypes) {
10433 // Intentionally inside to avoid triggering lazy initializers:
10434 var name = getComponentNameFromType(type);
10435 checkPropTypes(propTypes, element.props, 'prop', name, element);
10436 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
10437 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
10438
10439 var _name = getComponentNameFromType(type);
10440
10441 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
10442 }
10443
10444 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
10445 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
10446 }
10447 }
10448 }
10449 /**
10450 * Given a fragment, validate that it can only be provided with fragment props
10451 * @param {ReactElement} fragment
10452 */
10453
10454
10455 function validateFragmentProps(fragment) {
10456 {
10457 var keys = Object.keys(fragment.props);
10458
10459 for (var i = 0; i < keys.length; i++) {
10460 var key = keys[i];
10461
10462 if (key !== 'children' && key !== 'key') {
10463 setCurrentlyValidatingElement$1(fragment);
10464
10465 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
10466
10467 setCurrentlyValidatingElement$1(null);
10468 break;
10469 }
10470 }
10471
10472 if (fragment.ref !== null) {
10473 setCurrentlyValidatingElement$1(fragment);
10474
10475 error('Invalid attribute `ref` supplied to `React.Fragment`.');
10476
10477 setCurrentlyValidatingElement$1(null);
10478 }
10479 }
10480 }
10481
10482 var didWarnAboutKeySpread = {};
10483 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
10484 {
10485 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
10486 // succeed and there will likely be errors in render.
10487
10488 if (!validType) {
10489 var info = '';
10490
10491 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
10492 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.";
10493 }
10494
10495 var sourceInfo = getSourceInfoErrorAddendum(source);
10496
10497 if (sourceInfo) {
10498 info += sourceInfo;
10499 } else {
10500 info += getDeclarationErrorAddendum();
10501 }
10502
10503 var typeString;
10504
10505 if (type === null) {
10506 typeString = 'null';
10507 } else if (isArray(type)) {
10508 typeString = 'array';
10509 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
10510 typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
10511 info = ' Did you accidentally export a JSX literal instead of a component?';
10512 } else {
10513 typeString = typeof type;
10514 }
10515
10516 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);
10517 }
10518
10519 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
10520 // TODO: Drop this when these are no longer allowed as the type argument.
10521
10522 if (element == null) {
10523 return element;
10524 } // Skip key warning if the type isn't valid since our key validation logic
10525 // doesn't expect a non-string/function type and can throw confusing errors.
10526 // We don't want exception behavior to differ between dev and prod.
10527 // (Rendering will throw with a helpful message and as soon as the type is
10528 // fixed, the key warnings will appear.)
10529
10530
10531 if (validType) {
10532 var children = props.children;
10533
10534 if (children !== undefined) {
10535 if (isStaticChildren) {
10536 if (isArray(children)) {
10537 for (var i = 0; i < children.length; i++) {
10538 validateChildKeys(children[i], type);
10539 }
10540
10541 if (Object.freeze) {
10542 Object.freeze(children);
10543 }
10544 } else {
10545 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.');
10546 }
10547 } else {
10548 validateChildKeys(children, type);
10549 }
10550 }
10551 }
10552
10553 {
10554 if (hasOwnProperty.call(props, 'key')) {
10555 var componentName = getComponentNameFromType(type);
10556 var keys = Object.keys(props).filter(function (k) {
10557 return k !== 'key';
10558 });
10559 var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
10560
10561 if (!didWarnAboutKeySpread[componentName + beforeExample]) {
10562 var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
10563
10564 error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
10565
10566 didWarnAboutKeySpread[componentName + beforeExample] = true;
10567 }
10568 }
10569 }
10570
10571 if (type === REACT_FRAGMENT_TYPE) {
10572 validateFragmentProps(element);
10573 } else {
10574 validatePropTypes(element);
10575 }
10576
10577 return element;
10578 }
10579 } // These two functions exist to still get child warnings in dev
10580 // even with the prod transform. This means that jsxDEV is purely
10581 // opt-in behavior for better messages but that we won't stop
10582 // giving you warnings if you use production apis.
10583
10584 function jsxWithValidationStatic(type, props, key) {
10585 {
10586 return jsxWithValidation(type, props, key, true);
10587 }
10588 }
10589 function jsxWithValidationDynamic(type, props, key) {
10590 {
10591 return jsxWithValidation(type, props, key, false);
10592 }
10593 }
10594
10595 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
10596 // for now we can ship identical prod functions
10597
10598 var jsxs = jsxWithValidationStatic ;
10599
10600 exports.Fragment = REACT_FRAGMENT_TYPE;
10601 exports.jsx = jsx;
10602 exports.jsxs = jsxs;
10603 })();
10604 }
10605
10606
10607 /***/ }),
10608
10609 /***/ "./node_modules/react/jsx-runtime.js":
10610 /*!*******************************************!*\
10611 !*** ./node_modules/react/jsx-runtime.js ***!
10612 \*******************************************/
10613 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10614
10615 "use strict";
10616
10617
10618 if (false) {} else {
10619 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
10620 }
10621
10622
10623 /***/ }),
10624
10625 /***/ "./node_modules/styled-components/dist/styled-components.browser.esm.js":
10626 /*!******************************************************************************!*\
10627 !*** ./node_modules/styled-components/dist/styled-components.browser.esm.js ***!
10628 \******************************************************************************/
10629 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10630
10631 "use strict";
10632 __webpack_require__.r(__webpack_exports__);
10633 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10634 /* harmony export */ "ServerStyleSheet": () => (/* binding */ ServerStyleSheet),
10635 /* harmony export */ "StyleSheetConsumer": () => (/* binding */ StyleSheetConsumer),
10636 /* harmony export */ "StyleSheetContext": () => (/* binding */ StyleSheetContext),
10637 /* harmony export */ "StyleSheetManager": () => (/* binding */ StyleSheetManager),
10638 /* harmony export */ "ThemeConsumer": () => (/* binding */ ThemeConsumer),
10639 /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
10640 /* harmony export */ "ThemeProvider": () => (/* binding */ ThemeProvider),
10641 /* harmony export */ "__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS": () => (/* binding */ __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS),
10642 /* harmony export */ "createGlobalStyle": () => (/* binding */ createGlobalStyle),
10643 /* harmony export */ "css": () => (/* binding */ css),
10644 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10645 /* harmony export */ "isStyledComponent": () => (/* binding */ isStyledComponent),
10646 /* harmony export */ "keyframes": () => (/* binding */ keyframes),
10647 /* harmony export */ "withTheme": () => (/* binding */ withTheme)
10648 /* harmony export */ });
10649 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis/stylis.min */ "./node_modules/stylis/stylis.min.js");
10650 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__);
10651 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis-rule-sheet */ "./node_modules/stylis-rule-sheet/index.js");
10652 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__);
10653 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
10654 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
10655 /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
10656 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
10657 /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js");
10658 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
10659 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
10660 /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js");
10661 /* harmony import */ var merge_anything__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! merge-anything */ "./node_modules/merge-anything/dist/index.esm.js");
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672 //
10673
10674 var interleave = (function (strings, interpolations) {
10675 var result = [strings[0]];
10676
10677 for (var i = 0, len = interpolations.length; i < len; i += 1) {
10678 result.push(interpolations[i], strings[i + 1]);
10679 }
10680
10681 return result;
10682 });
10683
10684 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
10685 return typeof obj;
10686 } : function (obj) {
10687 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
10688 };
10689
10690 var classCallCheck = function (instance, Constructor) {
10691 if (!(instance instanceof Constructor)) {
10692 throw new TypeError("Cannot call a class as a function");
10693 }
10694 };
10695
10696 var createClass = function () {
10697 function defineProperties(target, props) {
10698 for (var i = 0; i < props.length; i++) {
10699 var descriptor = props[i];
10700 descriptor.enumerable = descriptor.enumerable || false;
10701 descriptor.configurable = true;
10702 if ("value" in descriptor) descriptor.writable = true;
10703 Object.defineProperty(target, descriptor.key, descriptor);
10704 }
10705 }
10706
10707 return function (Constructor, protoProps, staticProps) {
10708 if (protoProps) defineProperties(Constructor.prototype, protoProps);
10709 if (staticProps) defineProperties(Constructor, staticProps);
10710 return Constructor;
10711 };
10712 }();
10713
10714 var _extends = Object.assign || function (target) {
10715 for (var i = 1; i < arguments.length; i++) {
10716 var source = arguments[i];
10717
10718 for (var key in source) {
10719 if (Object.prototype.hasOwnProperty.call(source, key)) {
10720 target[key] = source[key];
10721 }
10722 }
10723 }
10724
10725 return target;
10726 };
10727
10728 var inherits = function (subClass, superClass) {
10729 if (typeof superClass !== "function" && superClass !== null) {
10730 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
10731 }
10732
10733 subClass.prototype = Object.create(superClass && superClass.prototype, {
10734 constructor: {
10735 value: subClass,
10736 enumerable: false,
10737 writable: true,
10738 configurable: true
10739 }
10740 });
10741 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10742 };
10743
10744 var objectWithoutProperties = function (obj, keys) {
10745 var target = {};
10746
10747 for (var i in obj) {
10748 if (keys.indexOf(i) >= 0) continue;
10749 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
10750 target[i] = obj[i];
10751 }
10752
10753 return target;
10754 };
10755
10756 var possibleConstructorReturn = function (self, call) {
10757 if (!self) {
10758 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10759 }
10760
10761 return call && (typeof call === "object" || typeof call === "function") ? call : self;
10762 };
10763
10764 //
10765 var isPlainObject = (function (x) {
10766 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
10767 });
10768
10769 //
10770 var EMPTY_ARRAY = Object.freeze([]);
10771 var EMPTY_OBJECT = Object.freeze({});
10772
10773 //
10774 function isFunction(test) {
10775 return typeof test === 'function';
10776 }
10777
10778 //
10779
10780 function getComponentName(target) {
10781 return ( true ? typeof target === 'string' && target : 0) || target.displayName || target.name || 'Component';
10782 }
10783
10784 //
10785 function isStatelessFunction(test) {
10786 return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
10787 }
10788
10789 //
10790 function isStyledComponent(target) {
10791 return target && typeof target.styledComponentId === 'string';
10792 }
10793
10794 //
10795
10796 var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
10797
10798 var SC_VERSION_ATTR = 'data-styled-version';
10799
10800 var SC_STREAM_ATTR = 'data-styled-streamed';
10801
10802 var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
10803
10804 var DISABLE_SPEEDY = typeof SC_DISABLE_SPEEDY === 'boolean' && SC_DISABLE_SPEEDY || typeof process !== 'undefined' && (process.env.REACT_APP_SC_DISABLE_SPEEDY || process.env.SC_DISABLE_SPEEDY) || "development" !== 'production';
10805
10806 // Shared empty execution context when generating static styles
10807 var STATIC_EXECUTION_CONTEXT = {};
10808
10809 //
10810
10811
10812 /**
10813 * Parse errors.md and turn it into a simple hash of code: message
10814 */
10815 var ERRORS = true ? {
10816 "1": "Cannot create styled-component for component: %s.\n\n",
10817 "2": "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",
10818 "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
10819 "4": "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",
10820 "5": "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",
10821 "6": "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",
10822 "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
10823 "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
10824 "9": "Missing document `<head>`\n\n",
10825 "10": "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",
10826 "11": "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",
10827 "12": "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",
10828 "13": "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n"
10829 } : 0;
10830
10831 /**
10832 * super basic version of sprintf
10833 */
10834 function format() {
10835 var a = arguments.length <= 0 ? undefined : arguments[0];
10836 var b = [];
10837
10838 for (var c = 1, len = arguments.length; c < len; c += 1) {
10839 b.push(arguments.length <= c ? undefined : arguments[c]);
10840 }
10841
10842 b.forEach(function (d) {
10843 a = a.replace(/%[a-z]/, d);
10844 });
10845
10846 return a;
10847 }
10848
10849 /**
10850 * Create an error file out of errors.md for development and a simple web link to the full errors
10851 * in production mode.
10852 */
10853
10854 var StyledComponentsError = function (_Error) {
10855 inherits(StyledComponentsError, _Error);
10856
10857 function StyledComponentsError(code) {
10858 classCallCheck(this, StyledComponentsError);
10859
10860 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10861 interpolations[_key - 1] = arguments[_key];
10862 }
10863
10864 if (false) { var _this; } else {
10865 var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
10866 }
10867 return possibleConstructorReturn(_this);
10868 }
10869
10870 return StyledComponentsError;
10871 }(Error);
10872
10873 //
10874 var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
10875
10876 var extractComps = (function (maybeCSS) {
10877 var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
10878 var existingComponents = [];
10879 css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
10880 existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
10881 return match;
10882 });
10883 return existingComponents.map(function (_ref, i) {
10884 var componentId = _ref.componentId,
10885 matchIndex = _ref.matchIndex;
10886
10887 var nextComp = existingComponents[i + 1];
10888 var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
10889 return { componentId: componentId, cssFromDOM: cssFromDOM };
10890 });
10891 });
10892
10893 //
10894
10895 var COMMENT_REGEX = /^\s*\/\/.*$/gm;
10896
10897 // NOTE: This stylis instance is only used to split rules from SSR'd style tags
10898 var stylisSplitter = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10899 global: false,
10900 cascade: true,
10901 keyframe: false,
10902 prefix: false,
10903 compress: false,
10904 semicolon: true
10905 });
10906
10907 var stylis = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10908 global: false,
10909 cascade: true,
10910 keyframe: false,
10911 prefix: true,
10912 compress: false,
10913 semicolon: false // NOTE: This means "autocomplete missing semicolons"
10914 });
10915
10916 // Wrap `insertRulePlugin to build a list of rules,
10917 // and then make our own plugin to return the rules. This
10918 // makes it easier to hook into the existing SSR architecture
10919
10920 var parsingRules = [];
10921
10922 // eslint-disable-next-line consistent-return
10923 var returnRulesPlugin = function returnRulesPlugin(context) {
10924 if (context === -2) {
10925 var parsedRules = parsingRules;
10926 parsingRules = [];
10927 return parsedRules;
10928 }
10929 };
10930
10931 var parseRulesPlugin = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) {
10932 parsingRules.push(rule);
10933 });
10934
10935 var _componentId = void 0;
10936 var _selector = void 0;
10937 var _selectorRegexp = void 0;
10938
10939 var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
10940 if (
10941 // the first self-ref is always untouched
10942 offset > 0 &&
10943 // there should be at least two self-refs to do a replacement (.b > .b)
10944 string.slice(0, offset).indexOf(_selector) !== -1 &&
10945 // no consecutive self refs (.b.b); that is a precedence boost and treated differently
10946 string.slice(offset - _selector.length, offset) !== _selector) {
10947 return '.' + _componentId;
10948 }
10949
10950 return match;
10951 };
10952
10953 /**
10954 * When writing a style like
10955 *
10956 * & + & {
10957 * color: red;
10958 * }
10959 *
10960 * The second ampersand should be a reference to the static component class. stylis
10961 * has no knowledge of static class so we have to intelligently replace the base selector.
10962 */
10963 var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
10964 if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
10965 // eslint-disable-next-line no-param-reassign
10966 selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
10967 }
10968 };
10969
10970 stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
10971 stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
10972
10973 var splitByRules = function splitByRules(css) {
10974 return stylisSplitter('', css);
10975 };
10976
10977 function stringifyRules(rules, selector, prefix) {
10978 var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
10979
10980 var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
10981
10982 var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
10983
10984 // stylis has no concept of state to be passed to plugins
10985 // but since JS is single=threaded, we can rely on that to ensure
10986 // these properties stay in sync with the current stylis run
10987 _componentId = componentId;
10988 _selector = selector;
10989 _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
10990
10991 return stylis(prefix || !selector ? '' : selector, cssStr);
10992 }
10993
10994 //
10995 /* eslint-disable camelcase, no-undef */
10996
10997 var getNonce = (function () {
10998 return true ? __webpack_require__.nc : 0;
10999 });
11000
11001 //
11002 /* These are helpers for the StyleTags to keep track of the injected
11003 * rule names for each (component) ID that they're keeping track of.
11004 * They're crucial for detecting whether a name has already been
11005 * injected.
11006 * (This excludes rehydrated names) */
11007
11008 /* adds a new ID:name pairing to a names dictionary */
11009 var addNameForId = function addNameForId(names, id, name) {
11010 if (name) {
11011 // eslint-disable-next-line no-param-reassign
11012 var namesForId = names[id] || (names[id] = Object.create(null));
11013 namesForId[name] = true;
11014 }
11015 };
11016
11017 /* resets an ID entirely by overwriting it in the dictionary */
11018 var resetIdNames = function resetIdNames(names, id) {
11019 // eslint-disable-next-line no-param-reassign
11020 names[id] = Object.create(null);
11021 };
11022
11023 /* factory for a names dictionary checking the existance of an ID:name pairing */
11024 var hasNameForId = function hasNameForId(names) {
11025 return function (id, name) {
11026 return names[id] !== undefined && names[id][name];
11027 };
11028 };
11029
11030 /* stringifies names for the html/element output */
11031 var stringifyNames = function stringifyNames(names) {
11032 var str = '';
11033 // eslint-disable-next-line guard-for-in
11034 for (var id in names) {
11035 str += Object.keys(names[id]).join(' ') + ' ';
11036 }
11037 return str.trim();
11038 };
11039
11040 /* clones the nested names dictionary */
11041 var cloneNames = function cloneNames(names) {
11042 var clone = Object.create(null);
11043 // eslint-disable-next-line guard-for-in
11044 for (var id in names) {
11045 clone[id] = _extends({}, names[id]);
11046 }
11047 return clone;
11048 };
11049
11050 //
11051
11052 /* These are helpers that deal with the insertRule (aka speedy) API
11053 * They are used in the StyleTags and specifically the speedy tag
11054 */
11055
11056 /* retrieve a sheet for a given style tag */
11057 var sheetForTag = function sheetForTag(tag) {
11058 // $FlowFixMe
11059 if (tag.sheet) return tag.sheet;
11060
11061 /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
11062 var size = tag.ownerDocument.styleSheets.length;
11063 for (var i = 0; i < size; i += 1) {
11064 var sheet = tag.ownerDocument.styleSheets[i];
11065 // $FlowFixMe
11066 if (sheet.ownerNode === tag) return sheet;
11067 }
11068
11069 /* we should always be able to find a tag */
11070 throw new StyledComponentsError(10);
11071 };
11072
11073 /* insert a rule safely and return whether it was actually injected */
11074 var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
11075 /* abort early if cssRule string is falsy */
11076 if (!cssRule) return false;
11077
11078 var maxIndex = sheet.cssRules.length;
11079
11080 try {
11081 /* use insertRule and cap passed index with maxIndex (no of cssRules) */
11082 sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
11083 } catch (err) {
11084 /* any error indicates an invalid rule */
11085 return false;
11086 }
11087
11088 return true;
11089 };
11090
11091 /* deletes `size` rules starting from `removalIndex` */
11092 var deleteRules = function deleteRules(sheet, removalIndex, size) {
11093 var lowerBound = removalIndex - size;
11094 for (var i = removalIndex; i > lowerBound; i -= 1) {
11095 sheet.deleteRule(i);
11096 }
11097 };
11098
11099 //
11100
11101 /* this marker separates component styles and is important for rehydration */
11102 var makeTextMarker = function makeTextMarker(id) {
11103 return '\n/* sc-component-id: ' + id + ' */\n';
11104 };
11105
11106 /* add up all numbers in array up until and including the index */
11107 var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
11108 var totalUpToIndex = 0;
11109 for (var i = 0; i <= index; i += 1) {
11110 totalUpToIndex += sizes[i];
11111 }
11112
11113 return totalUpToIndex;
11114 };
11115
11116 /* create a new style tag after lastEl */
11117 var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
11118 var targetDocument = document;
11119 if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;
11120
11121 var el = targetDocument.createElement('style');
11122 el.setAttribute(SC_ATTR, '');
11123 el.setAttribute(SC_VERSION_ATTR, "4.4.1");
11124
11125 var nonce = getNonce();
11126 if (nonce) {
11127 el.setAttribute('nonce', nonce);
11128 }
11129
11130 /* Work around insertRule quirk in EdgeHTML */
11131 el.appendChild(targetDocument.createTextNode(''));
11132
11133 if (target && !tagEl) {
11134 /* Append to target when no previous element was passed */
11135 target.appendChild(el);
11136 } else {
11137 if (!tagEl || !target || !tagEl.parentNode) {
11138 throw new StyledComponentsError(6);
11139 }
11140
11141 /* Insert new style tag after the previous one */
11142 tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
11143 }
11144
11145 return el;
11146 };
11147
11148 /* takes a css factory function and outputs an html styled tag factory */
11149 var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
11150 return function (additionalAttrs) {
11151 var nonce = getNonce();
11152 var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.4.1" + '"', additionalAttrs];
11153
11154 var htmlAttr = attrs.filter(Boolean).join(' ');
11155 return '<style ' + htmlAttr + '>' + css() + '</style>';
11156 };
11157 };
11158
11159 /* takes a css factory function and outputs an element factory */
11160 var wrapAsElement = function wrapAsElement(css, names) {
11161 return function () {
11162 var _props;
11163
11164 var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.4.1", _props);
11165
11166 var nonce = getNonce();
11167 if (nonce) {
11168 // $FlowFixMe
11169 props.nonce = nonce;
11170 }
11171
11172 // eslint-disable-next-line react/no-danger
11173 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
11174 };
11175 };
11176
11177 var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
11178 return function () {
11179 return Object.keys(markers);
11180 };
11181 };
11182
11183 /* speedy tags utilise insertRule */
11184 var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
11185 var names = Object.create(null);
11186 var markers = Object.create(null);
11187 var sizes = [];
11188
11189 var extractImport = getImportRuleTag !== undefined;
11190 /* indicates whether getImportRuleTag was called */
11191 var usedImportRuleTag = false;
11192
11193 var insertMarker = function insertMarker(id) {
11194 var prev = markers[id];
11195 if (prev !== undefined) {
11196 return prev;
11197 }
11198
11199 markers[id] = sizes.length;
11200 sizes.push(0);
11201 resetIdNames(names, id);
11202
11203 return markers[id];
11204 };
11205
11206 var insertRules = function insertRules(id, cssRules, name) {
11207 var marker = insertMarker(id);
11208 var sheet = sheetForTag(el);
11209 var insertIndex = addUpUntilIndex(sizes, marker);
11210
11211 var injectedRules = 0;
11212 var importRules = [];
11213 var cssRulesSize = cssRules.length;
11214
11215 for (var i = 0; i < cssRulesSize; i += 1) {
11216 var cssRule = cssRules[i];
11217 var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
11218 if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
11219 importRules.push(cssRule);
11220 } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
11221 mayHaveImport = false;
11222 injectedRules += 1;
11223 }
11224 }
11225
11226 if (extractImport && importRules.length > 0) {
11227 usedImportRuleTag = true;
11228 // $FlowFixMe
11229 getImportRuleTag().insertRules(id + '-import', importRules);
11230 }
11231
11232 sizes[marker] += injectedRules; /* add up no of injected rules */
11233 addNameForId(names, id, name);
11234 };
11235
11236 var removeRules = function removeRules(id) {
11237 var marker = markers[id];
11238 if (marker === undefined) return;
11239 // $FlowFixMe
11240 if (el.isConnected === false) return;
11241
11242 var size = sizes[marker];
11243 var sheet = sheetForTag(el);
11244 var removalIndex = addUpUntilIndex(sizes, marker) - 1;
11245 deleteRules(sheet, removalIndex, size);
11246 sizes[marker] = 0;
11247 resetIdNames(names, id);
11248
11249 if (extractImport && usedImportRuleTag) {
11250 // $FlowFixMe
11251 getImportRuleTag().removeRules(id + '-import');
11252 }
11253 };
11254
11255 var css = function css() {
11256 var _sheetForTag = sheetForTag(el),
11257 cssRules = _sheetForTag.cssRules;
11258
11259 var str = '';
11260
11261 // eslint-disable-next-line guard-for-in
11262 for (var id in markers) {
11263 str += makeTextMarker(id);
11264 var marker = markers[id];
11265 var end = addUpUntilIndex(sizes, marker);
11266 var size = sizes[marker];
11267 for (var i = end - size; i < end; i += 1) {
11268 var rule = cssRules[i];
11269 if (rule !== undefined) {
11270 str += rule.cssText;
11271 }
11272 }
11273 }
11274
11275 return str;
11276 };
11277
11278 return {
11279 clone: function clone() {
11280 throw new StyledComponentsError(5);
11281 },
11282
11283 css: css,
11284 getIds: getIdsFromMarkersFactory(markers),
11285 hasNameForId: hasNameForId(names),
11286 insertMarker: insertMarker,
11287 insertRules: insertRules,
11288 removeRules: removeRules,
11289 sealed: false,
11290 styleTag: el,
11291 toElement: wrapAsElement(css, names),
11292 toHTML: wrapAsHtmlTag(css, names)
11293 };
11294 };
11295
11296 var makeTextNode = function makeTextNode(targetDocument, id) {
11297 return targetDocument.createTextNode(makeTextMarker(id));
11298 };
11299
11300 var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
11301 var names = Object.create(null);
11302 var markers = Object.create(null);
11303
11304 var extractImport = getImportRuleTag !== undefined;
11305
11306 /* indicates whether getImportRuleTag was called */
11307 var usedImportRuleTag = false;
11308
11309 var insertMarker = function insertMarker(id) {
11310 var prev = markers[id];
11311 if (prev !== undefined) {
11312 return prev;
11313 }
11314
11315 markers[id] = makeTextNode(el.ownerDocument, id);
11316 el.appendChild(markers[id]);
11317 names[id] = Object.create(null);
11318
11319 return markers[id];
11320 };
11321
11322 var insertRules = function insertRules(id, cssRules, name) {
11323 var marker = insertMarker(id);
11324 var importRules = [];
11325 var cssRulesSize = cssRules.length;
11326
11327 for (var i = 0; i < cssRulesSize; i += 1) {
11328 var rule = cssRules[i];
11329 var mayHaveImport = extractImport;
11330 if (mayHaveImport && rule.indexOf('@import') !== -1) {
11331 importRules.push(rule);
11332 } else {
11333 mayHaveImport = false;
11334 var separator = i === cssRulesSize - 1 ? '' : ' ';
11335 marker.appendData('' + rule + separator);
11336 }
11337 }
11338
11339 addNameForId(names, id, name);
11340
11341 if (extractImport && importRules.length > 0) {
11342 usedImportRuleTag = true;
11343 // $FlowFixMe
11344 getImportRuleTag().insertRules(id + '-import', importRules);
11345 }
11346 };
11347
11348 var removeRules = function removeRules(id) {
11349 var marker = markers[id];
11350 if (marker === undefined) return;
11351
11352 /* create new empty text node and replace the current one */
11353 var newMarker = makeTextNode(el.ownerDocument, id);
11354 el.replaceChild(newMarker, marker);
11355 markers[id] = newMarker;
11356 resetIdNames(names, id);
11357
11358 if (extractImport && usedImportRuleTag) {
11359 // $FlowFixMe
11360 getImportRuleTag().removeRules(id + '-import');
11361 }
11362 };
11363
11364 var css = function css() {
11365 var str = '';
11366
11367 // eslint-disable-next-line guard-for-in
11368 for (var id in markers) {
11369 str += markers[id].data;
11370 }
11371
11372 return str;
11373 };
11374
11375 return {
11376 clone: function clone() {
11377 throw new StyledComponentsError(5);
11378 },
11379
11380 css: css,
11381 getIds: getIdsFromMarkersFactory(markers),
11382 hasNameForId: hasNameForId(names),
11383 insertMarker: insertMarker,
11384 insertRules: insertRules,
11385 removeRules: removeRules,
11386 sealed: false,
11387 styleTag: el,
11388 toElement: wrapAsElement(css, names),
11389 toHTML: wrapAsHtmlTag(css, names)
11390 };
11391 };
11392
11393 var makeServerTag = function makeServerTag(namesArg, markersArg) {
11394 var names = namesArg === undefined ? Object.create(null) : namesArg;
11395 var markers = markersArg === undefined ? Object.create(null) : markersArg;
11396
11397 var insertMarker = function insertMarker(id) {
11398 var prev = markers[id];
11399 if (prev !== undefined) {
11400 return prev;
11401 }
11402
11403 return markers[id] = [''];
11404 };
11405
11406 var insertRules = function insertRules(id, cssRules, name) {
11407 var marker = insertMarker(id);
11408 marker[0] += cssRules.join(' ');
11409 addNameForId(names, id, name);
11410 };
11411
11412 var removeRules = function removeRules(id) {
11413 var marker = markers[id];
11414 if (marker === undefined) return;
11415 marker[0] = '';
11416 resetIdNames(names, id);
11417 };
11418
11419 var css = function css() {
11420 var str = '';
11421 // eslint-disable-next-line guard-for-in
11422 for (var id in markers) {
11423 var cssForId = markers[id][0];
11424 if (cssForId) {
11425 str += makeTextMarker(id) + cssForId;
11426 }
11427 }
11428 return str;
11429 };
11430
11431 var clone = function clone() {
11432 var namesClone = cloneNames(names);
11433 var markersClone = Object.create(null);
11434
11435 // eslint-disable-next-line guard-for-in
11436 for (var id in markers) {
11437 markersClone[id] = [markers[id][0]];
11438 }
11439
11440 return makeServerTag(namesClone, markersClone);
11441 };
11442
11443 var tag = {
11444 clone: clone,
11445 css: css,
11446 getIds: getIdsFromMarkersFactory(markers),
11447 hasNameForId: hasNameForId(names),
11448 insertMarker: insertMarker,
11449 insertRules: insertRules,
11450 removeRules: removeRules,
11451 sealed: false,
11452 styleTag: null,
11453 toElement: wrapAsElement(css, names),
11454 toHTML: wrapAsHtmlTag(css, names)
11455 };
11456
11457 return tag;
11458 };
11459
11460 var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
11461 if (IS_BROWSER && !forceServer) {
11462 var el = makeStyleTag(target, tagEl, insertBefore);
11463
11464 if (DISABLE_SPEEDY) {
11465 return makeBrowserTag(el, getImportRuleTag);
11466 } else {
11467 return makeSpeedyTag(el, getImportRuleTag);
11468 }
11469 }
11470
11471 return makeServerTag();
11472 };
11473
11474 var rehydrate = function rehydrate(tag, els, extracted) {
11475 /* add all extracted components to the new tag */
11476 for (var i = 0, len = extracted.length; i < len; i += 1) {
11477 var _extracted$i = extracted[i],
11478 componentId = _extracted$i.componentId,
11479 cssFromDOM = _extracted$i.cssFromDOM;
11480
11481 var cssRules = splitByRules(cssFromDOM);
11482 tag.insertRules(componentId, cssRules);
11483 }
11484
11485 /* remove old HTMLStyleElements, since they have been rehydrated */
11486 for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
11487 var el = els[_i];
11488 if (el.parentNode) {
11489 el.parentNode.removeChild(el);
11490 }
11491 }
11492 };
11493
11494 //
11495
11496 var SPLIT_REGEX = /\s+/;
11497
11498 /* determine the maximum number of components before tags are sharded */
11499 var MAX_SIZE = void 0;
11500 if (IS_BROWSER) {
11501 /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
11502 MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
11503 } else {
11504 /* for servers we do not need to shard at all */
11505 MAX_SIZE = -1;
11506 }
11507
11508 var sheetRunningId = 0;
11509 var master = void 0;
11510
11511 var StyleSheet = function () {
11512
11513 /* a map from ids to tags */
11514
11515 /* deferred rules for a given id */
11516
11517 /* this is used for not reinjecting rules via hasNameForId() */
11518
11519 /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
11520
11521 /* a list of tags belonging to this StyleSheet */
11522
11523 /* a tag for import rules */
11524
11525 /* current capacity until a new tag must be created */
11526
11527 /* children (aka clones) of this StyleSheet inheriting all and future injections */
11528
11529 function StyleSheet() {
11530 var _this = this;
11531
11532 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
11533 var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11534 classCallCheck(this, StyleSheet);
11535
11536 this.getImportRuleTag = function () {
11537 var importRuleTag = _this.importRuleTag;
11538
11539 if (importRuleTag !== undefined) {
11540 return importRuleTag;
11541 }
11542
11543 var firstTag = _this.tags[0];
11544 var insertBefore = true;
11545
11546 return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
11547 };
11548
11549 sheetRunningId += 1;
11550 this.id = sheetRunningId;
11551 this.forceServer = forceServer;
11552 this.target = forceServer ? null : target;
11553 this.tagMap = {};
11554 this.deferred = {};
11555 this.rehydratedNames = {};
11556 this.ignoreRehydratedNames = {};
11557 this.tags = [];
11558 this.capacity = 1;
11559 this.clones = [];
11560 }
11561
11562 /* rehydrate all SSR'd style tags */
11563
11564
11565 StyleSheet.prototype.rehydrate = function rehydrate$$1() {
11566 if (!IS_BROWSER || this.forceServer) return this;
11567
11568 var els = [];
11569 var extracted = [];
11570 var isStreamed = false;
11571
11572 /* retrieve all of our SSR style elements from the DOM */
11573 var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.4.1" + '"]');
11574
11575 var nodesSize = nodes.length;
11576
11577 /* abort rehydration if no previous style tags were found */
11578 if (!nodesSize) return this;
11579
11580 for (var i = 0; i < nodesSize; i += 1) {
11581 var el = nodes[i];
11582
11583 /* check if style tag is a streamed tag */
11584 if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
11585
11586 /* retrieve all component names */
11587 var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
11588 var elNamesSize = elNames.length;
11589 for (var j = 0, name; j < elNamesSize; j += 1) {
11590 name = elNames[j];
11591 /* add rehydrated name to sheet to avoid re-adding styles */
11592 this.rehydratedNames[name] = true;
11593 }
11594
11595 /* extract all components and their CSS */
11596 extracted.push.apply(extracted, extractComps(el.textContent));
11597
11598 /* store original HTMLStyleElement */
11599 els.push(el);
11600 }
11601
11602 /* abort rehydration if nothing was extracted */
11603 var extractedSize = extracted.length;
11604 if (!extractedSize) return this;
11605
11606 /* create a tag to be used for rehydration */
11607 var tag = this.makeTag(null);
11608
11609 rehydrate(tag, els, extracted);
11610
11611 /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
11612 this.capacity = Math.max(1, MAX_SIZE - extractedSize);
11613 this.tags.push(tag);
11614
11615 /* retrieve all component ids */
11616 for (var _j = 0; _j < extractedSize; _j += 1) {
11617 this.tagMap[extracted[_j].componentId] = tag;
11618 }
11619
11620 return this;
11621 };
11622
11623 /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
11624 * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
11625 * StyleSheetManager's context */
11626
11627
11628 /* reset the internal "master" instance */
11629 StyleSheet.reset = function reset() {
11630 var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
11631
11632 master = new StyleSheet(undefined, forceServer).rehydrate();
11633 };
11634
11635 /* adds "children" to the StyleSheet that inherit all of the parents' rules
11636 * while their own rules do not affect the parent */
11637
11638
11639 StyleSheet.prototype.clone = function clone() {
11640 var sheet = new StyleSheet(this.target, this.forceServer);
11641
11642 /* add to clone array */
11643 this.clones.push(sheet);
11644
11645 /* clone all tags */
11646 sheet.tags = this.tags.map(function (tag) {
11647 var ids = tag.getIds();
11648 var newTag = tag.clone();
11649
11650 /* reconstruct tagMap */
11651 for (var i = 0; i < ids.length; i += 1) {
11652 sheet.tagMap[ids[i]] = newTag;
11653 }
11654
11655 return newTag;
11656 });
11657
11658 /* clone other maps */
11659 sheet.rehydratedNames = _extends({}, this.rehydratedNames);
11660 sheet.deferred = _extends({}, this.deferred);
11661
11662 return sheet;
11663 };
11664
11665 /* force StyleSheet to create a new tag on the next injection */
11666
11667
11668 StyleSheet.prototype.sealAllTags = function sealAllTags() {
11669 this.capacity = 1;
11670
11671 this.tags.forEach(function (tag) {
11672 // eslint-disable-next-line no-param-reassign
11673 tag.sealed = true;
11674 });
11675 };
11676
11677 StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
11678 var lastEl = tag ? tag.styleTag : null;
11679 var insertBefore = false;
11680
11681 return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
11682 };
11683
11684 /* get a tag for a given componentId, assign the componentId to one, or shard */
11685 StyleSheet.prototype.getTagForId = function getTagForId(id) {
11686 /* simply return a tag, when the componentId was already assigned one */
11687 var prev = this.tagMap[id];
11688 if (prev !== undefined && !prev.sealed) {
11689 return prev;
11690 }
11691
11692 var tag = this.tags[this.tags.length - 1];
11693
11694 /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
11695 this.capacity -= 1;
11696
11697 if (this.capacity === 0) {
11698 this.capacity = MAX_SIZE;
11699 tag = this.makeTag(tag);
11700 this.tags.push(tag);
11701 }
11702
11703 return this.tagMap[id] = tag;
11704 };
11705
11706 /* mainly for createGlobalStyle to check for its id */
11707
11708
11709 StyleSheet.prototype.hasId = function hasId(id) {
11710 return this.tagMap[id] !== undefined;
11711 };
11712
11713 /* caching layer checking id+name to already have a corresponding tag and injected rules */
11714
11715
11716 StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
11717 /* exception for rehydrated names which are checked separately */
11718 if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
11719 return true;
11720 }
11721
11722 var tag = this.tagMap[id];
11723 return tag !== undefined && tag.hasNameForId(id, name);
11724 };
11725
11726 /* registers a componentId and registers it on its tag */
11727
11728
11729 StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
11730 /* don't inject when the id is already registered */
11731 if (this.tagMap[id] !== undefined) return;
11732
11733 var clones = this.clones;
11734
11735 for (var i = 0; i < clones.length; i += 1) {
11736 clones[i].deferredInject(id, cssRules);
11737 }
11738
11739 this.getTagForId(id).insertMarker(id);
11740 this.deferred[id] = cssRules;
11741 };
11742
11743 /* injects rules for a given id with a name that will need to be cached */
11744
11745
11746 StyleSheet.prototype.inject = function inject(id, cssRules, name) {
11747 var clones = this.clones;
11748
11749
11750 for (var i = 0; i < clones.length; i += 1) {
11751 clones[i].inject(id, cssRules, name);
11752 }
11753
11754 var tag = this.getTagForId(id);
11755
11756 /* add deferred rules for component */
11757 if (this.deferred[id] !== undefined) {
11758 // Combine passed cssRules with previously deferred CSS rules
11759 // NOTE: We cannot mutate the deferred array itself as all clones
11760 // do the same (see clones[i].inject)
11761 var rules = this.deferred[id].concat(cssRules);
11762 tag.insertRules(id, rules, name);
11763
11764 this.deferred[id] = undefined;
11765 } else {
11766 tag.insertRules(id, cssRules, name);
11767 }
11768 };
11769
11770 /* removes all rules for a given id, which doesn't remove its marker but resets it */
11771
11772
11773 StyleSheet.prototype.remove = function remove(id) {
11774 var tag = this.tagMap[id];
11775 if (tag === undefined) return;
11776
11777 var clones = this.clones;
11778
11779 for (var i = 0; i < clones.length; i += 1) {
11780 clones[i].remove(id);
11781 }
11782
11783 /* remove all rules from the tag */
11784 tag.removeRules(id);
11785
11786 /* ignore possible rehydrated names */
11787 this.ignoreRehydratedNames[id] = true;
11788
11789 /* delete possible deferred rules */
11790 this.deferred[id] = undefined;
11791 };
11792
11793 StyleSheet.prototype.toHTML = function toHTML() {
11794 return this.tags.map(function (tag) {
11795 return tag.toHTML();
11796 }).join('');
11797 };
11798
11799 StyleSheet.prototype.toReactElements = function toReactElements() {
11800 var id = this.id;
11801
11802
11803 return this.tags.map(function (tag, i) {
11804 var key = 'sc-' + id + '-' + i;
11805 return (0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(tag.toElement(), { key: key });
11806 });
11807 };
11808
11809 createClass(StyleSheet, null, [{
11810 key: 'master',
11811 get: function get$$1() {
11812 return master || (master = new StyleSheet().rehydrate());
11813 }
11814
11815 /* NOTE: This is just for backwards-compatibility with jest-styled-components */
11816
11817 }, {
11818 key: 'instance',
11819 get: function get$$1() {
11820 return StyleSheet.master;
11821 }
11822 }]);
11823 return StyleSheet;
11824 }();
11825
11826 //
11827
11828 var Keyframes = function () {
11829 function Keyframes(name, rules) {
11830 var _this = this;
11831
11832 classCallCheck(this, Keyframes);
11833
11834 this.inject = function (styleSheet) {
11835 if (!styleSheet.hasNameForId(_this.id, _this.name)) {
11836 styleSheet.inject(_this.id, _this.rules, _this.name);
11837 }
11838 };
11839
11840 this.toString = function () {
11841 throw new StyledComponentsError(12, String(_this.name));
11842 };
11843
11844 this.name = name;
11845 this.rules = rules;
11846
11847 this.id = 'sc-keyframes-' + name;
11848 }
11849
11850 Keyframes.prototype.getName = function getName() {
11851 return this.name;
11852 };
11853
11854 return Keyframes;
11855 }();
11856
11857 //
11858
11859 /**
11860 * inlined version of
11861 * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
11862 */
11863
11864 var uppercasePattern = /([A-Z])/g;
11865 var msPattern = /^ms-/;
11866
11867 /**
11868 * Hyphenates a camelcased CSS property name, for example:
11869 *
11870 * > hyphenateStyleName('backgroundColor')
11871 * < "background-color"
11872 * > hyphenateStyleName('MozTransition')
11873 * < "-moz-transition"
11874 * > hyphenateStyleName('msTransition')
11875 * < "-ms-transition"
11876 *
11877 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
11878 * is converted to `-ms-`.
11879 *
11880 * @param {string} string
11881 * @return {string}
11882 */
11883 function hyphenateStyleName(string) {
11884 return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
11885 }
11886
11887 //
11888
11889 // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
11890 function addUnitIfNeeded(name, value) {
11891 // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
11892 // $FlowFixMe
11893 if (value == null || typeof value === 'boolean' || value === '') {
11894 return '';
11895 }
11896
11897 if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__["default"])) {
11898 return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
11899 }
11900
11901 return String(value).trim();
11902 }
11903
11904 //
11905
11906 /**
11907 * It's falsish not falsy because 0 is allowed.
11908 */
11909 var isFalsish = function isFalsish(chunk) {
11910 return chunk === undefined || chunk === null || chunk === false || chunk === '';
11911 };
11912
11913 var objToCssArray = function objToCssArray(obj, prevKey) {
11914 var rules = [];
11915 var keys = Object.keys(obj);
11916
11917 keys.forEach(function (key) {
11918 if (!isFalsish(obj[key])) {
11919 if (isPlainObject(obj[key])) {
11920 rules.push.apply(rules, objToCssArray(obj[key], key));
11921
11922 return rules;
11923 } else if (isFunction(obj[key])) {
11924 rules.push(hyphenateStyleName(key) + ':', obj[key], ';');
11925
11926 return rules;
11927 }
11928 rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');
11929 }
11930 return rules;
11931 });
11932
11933 return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;
11934 };
11935
11936 function flatten(chunk, executionContext, styleSheet) {
11937 if (Array.isArray(chunk)) {
11938 var ruleSet = [];
11939
11940 for (var i = 0, len = chunk.length, result; i < len; i += 1) {
11941 result = flatten(chunk[i], executionContext, styleSheet);
11942
11943 if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
11944 }
11945
11946 return ruleSet;
11947 }
11948
11949 if (isFalsish(chunk)) {
11950 return null;
11951 }
11952
11953 /* Handle other components */
11954 if (isStyledComponent(chunk)) {
11955 return '.' + chunk.styledComponentId;
11956 }
11957
11958 /* Either execute or defer the function */
11959 if (isFunction(chunk)) {
11960 if (isStatelessFunction(chunk) && executionContext) {
11961 var _result = chunk(executionContext);
11962
11963 if ( true && (0,react_is__WEBPACK_IMPORTED_MODULE_4__.isElement)(_result)) {
11964 // eslint-disable-next-line no-console
11965 console.warn(getComponentName(chunk) + ' is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.');
11966 }
11967
11968 return flatten(_result, executionContext, styleSheet);
11969 } else return chunk;
11970 }
11971
11972 if (chunk instanceof Keyframes) {
11973 if (styleSheet) {
11974 chunk.inject(styleSheet);
11975 return chunk.getName();
11976 } else return chunk;
11977 }
11978
11979 /* Handle objects */
11980 return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
11981 }
11982
11983 //
11984
11985 function css(styles) {
11986 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11987 interpolations[_key - 1] = arguments[_key];
11988 }
11989
11990 if (isFunction(styles) || isPlainObject(styles)) {
11991 // $FlowFixMe
11992 return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
11993 }
11994
11995 // $FlowFixMe
11996 return flatten(interleave(styles, interpolations));
11997 }
11998
11999 //
12000
12001 function constructWithOptions(componentConstructor, tag) {
12002 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
12003
12004 if (!(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(tag)) {
12005 throw new StyledComponentsError(1, String(tag));
12006 }
12007
12008 /* This is callable directly as a template function */
12009 // $FlowFixMe: Not typed to avoid destructuring arguments
12010 var templateFunction = function templateFunction() {
12011 return componentConstructor(tag, options, css.apply(undefined, arguments));
12012 };
12013
12014 /* If config methods are called, wrap up a new template function and merge options */
12015 templateFunction.withConfig = function (config) {
12016 return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
12017 };
12018
12019 /* Modify/inject new props at runtime */
12020 templateFunction.attrs = function (attrs) {
12021 return constructWithOptions(componentConstructor, tag, _extends({}, options, {
12022 attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
12023 }));
12024 };
12025
12026 return templateFunction;
12027 }
12028
12029 //
12030 // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
12031 function murmurhash(c) {
12032 for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
12033 b = c.charCodeAt(d) & 255 | (c.charCodeAt(++d) & 255) << 8 | (c.charCodeAt(++d) & 255) << 16 | (c.charCodeAt(++d) & 255) << 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), b ^= b >>> 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16) ^ b, e -= 4, ++d;
12034 }
12035 switch (e) {
12036 case 3:
12037 a ^= (c.charCodeAt(d + 2) & 255) << 16;
12038 case 2:
12039 a ^= (c.charCodeAt(d + 1) & 255) << 8;
12040 case 1:
12041 a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
12042 }
12043 a ^= a >>> 13;
12044 a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
12045 return (a ^ a >>> 15) >>> 0;
12046 }
12047
12048 //
12049 /* eslint-disable no-bitwise */
12050
12051 /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
12052 * counterparts */
12053 var charsLength = 52;
12054
12055 /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
12056 var getAlphabeticChar = function getAlphabeticChar(code) {
12057 return String.fromCharCode(code + (code > 25 ? 39 : 97));
12058 };
12059
12060 /* input a number, usually a hash and convert it to base-52 */
12061 function generateAlphabeticName(code) {
12062 var name = '';
12063 var x = void 0;
12064
12065 /* get a char and divide by alphabet-length */
12066 for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
12067 name = getAlphabeticChar(x % charsLength) + name;
12068 }
12069
12070 return getAlphabeticChar(x % charsLength) + name;
12071 }
12072
12073 //
12074
12075 function hasFunctionObjectKey(obj) {
12076 // eslint-disable-next-line guard-for-in, no-restricted-syntax
12077 for (var key in obj) {
12078 if (isFunction(obj[key])) {
12079 return true;
12080 }
12081 }
12082
12083 return false;
12084 }
12085
12086 function isStaticRules(rules, attrs) {
12087 for (var i = 0; i < rules.length; i += 1) {
12088 var rule = rules[i];
12089
12090 // recursive case
12091 if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
12092 return false;
12093 } else if (isFunction(rule) && !isStyledComponent(rule)) {
12094 // functions are allowed to be static if they're just being
12095 // used to get the classname of a nested styled component
12096 return false;
12097 }
12098 }
12099
12100 if (attrs.some(function (x) {
12101 return isFunction(x) || hasFunctionObjectKey(x);
12102 })) return false;
12103
12104 return true;
12105 }
12106
12107 //
12108
12109 /* combines hashStr (murmurhash) and nameGenerator for convenience */
12110 var hasher = function hasher(str) {
12111 return generateAlphabeticName(murmurhash(str));
12112 };
12113
12114 /*
12115 ComponentStyle is all the CSS-specific stuff, not
12116 the React-specific stuff.
12117 */
12118
12119 var ComponentStyle = function () {
12120 function ComponentStyle(rules, attrs, componentId) {
12121 classCallCheck(this, ComponentStyle);
12122
12123 this.rules = rules;
12124 this.isStatic = false && 0;
12125 this.componentId = componentId;
12126
12127 if (!StyleSheet.master.hasId(componentId)) {
12128 StyleSheet.master.deferredInject(componentId, []);
12129 }
12130 }
12131
12132 /*
12133 * Flattens a rule set into valid CSS
12134 * Hashes it, wraps the whole chunk in a .hash1234 {}
12135 * Returns the hash to be injected on render()
12136 * */
12137
12138
12139 ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
12140 var isStatic = this.isStatic,
12141 componentId = this.componentId,
12142 lastClassName = this.lastClassName;
12143
12144 if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
12145 return lastClassName;
12146 }
12147
12148 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12149 var name = hasher(this.componentId + flatCSS.join(''));
12150 if (!styleSheet.hasNameForId(componentId, name)) {
12151 styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
12152 }
12153
12154 this.lastClassName = name;
12155 return name;
12156 };
12157
12158 ComponentStyle.generateName = function generateName(str) {
12159 return hasher(str);
12160 };
12161
12162 return ComponentStyle;
12163 }();
12164
12165 //
12166
12167 var LIMIT = 200;
12168
12169 var createWarnTooManyClasses = (function (displayName) {
12170 var generatedClasses = {};
12171 var warningSeen = false;
12172
12173 return function (className) {
12174 if (!warningSeen) {
12175 generatedClasses[className] = true;
12176 if (Object.keys(generatedClasses).length >= LIMIT) {
12177 // Unable to find latestRule in test environment.
12178 /* eslint-disable no-console, prefer-template */
12179 console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + ' const Component = styled.div.attrs(props => ({\n' + ' style: {\n' + ' background: props.background,\n' + ' },\n' + ' }))`width: 100%;`\n\n' + ' <Component />');
12180 warningSeen = true;
12181 generatedClasses = {};
12182 }
12183 }
12184 };
12185 });
12186
12187 //
12188
12189 var determineTheme = (function (props, fallbackTheme) {
12190 var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
12191
12192 // Props should take precedence over ThemeProvider, which should take precedence over
12193 // defaultProps, but React automatically puts defaultProps on props.
12194
12195 /* eslint-disable react/prop-types, flowtype-errors/show-errors */
12196 var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
12197 var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
12198 /* eslint-enable */
12199
12200 return theme;
12201 });
12202
12203 //
12204 var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
12205 var dashesAtEnds = /(^-|-$)/g;
12206
12207 /**
12208 * TODO: Explore using CSS.escape when it becomes more available
12209 * in evergreen browsers.
12210 */
12211 function escape(str) {
12212 return str
12213 // Replace all possible CSS selectors
12214 .replace(escapeRegex, '-')
12215
12216 // Remove extraneous hyphens at the start and end
12217 .replace(dashesAtEnds, '');
12218 }
12219
12220 //
12221
12222 function isTag(target) {
12223 return typeof target === 'string' && ( true ? target.charAt(0) === target.charAt(0).toLowerCase() : 0);
12224 }
12225
12226 //
12227
12228 function generateDisplayName(target) {
12229 // $FlowFixMe
12230 return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
12231 }
12232
12233 var _TYPE_STATICS;
12234
12235 var REACT_STATICS = {
12236 childContextTypes: true,
12237 contextTypes: true,
12238 defaultProps: true,
12239 displayName: true,
12240 getDerivedStateFromProps: true,
12241 propTypes: true,
12242 type: true
12243 };
12244
12245 var KNOWN_STATICS = {
12246 name: true,
12247 length: true,
12248 prototype: true,
12249 caller: true,
12250 callee: true,
12251 arguments: true,
12252 arity: true
12253 };
12254
12255 var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__.ForwardRef] = {
12256 $$typeof: true,
12257 render: true
12258 }, _TYPE_STATICS);
12259
12260 var defineProperty$1 = Object.defineProperty,
12261 getOwnPropertyNames = Object.getOwnPropertyNames,
12262 _Object$getOwnPropert = Object.getOwnPropertySymbols,
12263 getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
12264 return [];
12265 } : _Object$getOwnPropert,
12266 getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
12267 getPrototypeOf = Object.getPrototypeOf,
12268 objectPrototype = Object.prototype;
12269 var arrayPrototype = Array.prototype;
12270
12271
12272 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
12273 if (typeof sourceComponent !== 'string') {
12274 // don't hoist over string (html) components
12275
12276 var inheritedComponent = getPrototypeOf(sourceComponent);
12277
12278 if (inheritedComponent && inheritedComponent !== objectPrototype) {
12279 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
12280 }
12281
12282 var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
12283 // $FlowFixMe
12284 getOwnPropertySymbols(sourceComponent));
12285
12286 var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
12287
12288 var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
12289
12290 var i = keys.length;
12291 var descriptor = void 0;
12292 var key = void 0;
12293
12294 // eslint-disable-next-line no-plusplus
12295 while (i--) {
12296 key = keys[i];
12297
12298 if (
12299 // $FlowFixMe
12300 !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
12301 // $FlowFixMe
12302 !(targetStatics && targetStatics[key])) {
12303 descriptor = getOwnPropertyDescriptor(sourceComponent, key);
12304
12305 if (descriptor) {
12306 try {
12307 // Avoid failures from read-only properties
12308 defineProperty$1(targetComponent, key, descriptor);
12309 } catch (e) {
12310 /* fail silently */
12311 }
12312 }
12313 }
12314 }
12315
12316 return targetComponent;
12317 }
12318
12319 return targetComponent;
12320 }
12321
12322 //
12323 function isDerivedReactComponent(fn) {
12324 return !!(fn && fn.prototype && fn.prototype.isReactComponent);
12325 }
12326
12327 //
12328 // Helper to call a given function, only once
12329 var once = (function (cb) {
12330 var called = false;
12331
12332 return function () {
12333 if (!called) {
12334 called = true;
12335 cb.apply(undefined, arguments);
12336 }
12337 };
12338 });
12339
12340 //
12341
12342 var ThemeContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12343
12344 var ThemeConsumer = ThemeContext.Consumer;
12345
12346 /**
12347 * Provide a theme to an entire react component tree via context
12348 */
12349
12350 var ThemeProvider = function (_Component) {
12351 inherits(ThemeProvider, _Component);
12352
12353 function ThemeProvider(props) {
12354 classCallCheck(this, ThemeProvider);
12355
12356 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12357
12358 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext.bind(_this));
12359 _this.renderInner = _this.renderInner.bind(_this);
12360 return _this;
12361 }
12362
12363 ThemeProvider.prototype.render = function render() {
12364 if (!this.props.children) return null;
12365
12366 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12367 ThemeContext.Consumer,
12368 null,
12369 this.renderInner
12370 );
12371 };
12372
12373 ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
12374 var context = this.getContext(this.props.theme, outerTheme);
12375
12376 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12377 ThemeContext.Provider,
12378 { value: context },
12379 this.props.children
12380 );
12381 };
12382
12383 /**
12384 * Get the theme from the props, supporting both (outerTheme) => {}
12385 * as well as object notation
12386 */
12387
12388
12389 ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
12390 if (isFunction(theme)) {
12391 var mergedTheme = theme(outerTheme);
12392
12393 if ( true && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
12394 throw new StyledComponentsError(7);
12395 }
12396
12397 return mergedTheme;
12398 }
12399
12400 if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
12401 throw new StyledComponentsError(8);
12402 }
12403
12404 return _extends({}, outerTheme, theme);
12405 };
12406
12407 ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
12408 return this.getTheme(theme, outerTheme);
12409 };
12410
12411 return ThemeProvider;
12412 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12413
12414 //
12415
12416 var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
12417
12418 var ServerStyleSheet = function () {
12419 function ServerStyleSheet() {
12420 classCallCheck(this, ServerStyleSheet);
12421
12422 /* The master sheet might be reset, so keep a reference here */
12423 this.masterSheet = StyleSheet.master;
12424 this.instance = this.masterSheet.clone();
12425 this.sealed = false;
12426 }
12427
12428 /**
12429 * Mark the ServerStyleSheet as being fully emitted and manually GC it from the
12430 * StyleSheet singleton.
12431 */
12432
12433
12434 ServerStyleSheet.prototype.seal = function seal() {
12435 if (!this.sealed) {
12436 /* Remove sealed StyleSheets from the master sheet */
12437 var index = this.masterSheet.clones.indexOf(this.instance);
12438 this.masterSheet.clones.splice(index, 1);
12439 this.sealed = true;
12440 }
12441 };
12442
12443 ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
12444 if (this.sealed) {
12445 throw new StyledComponentsError(2);
12446 }
12447
12448 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12449 StyleSheetManager,
12450 { sheet: this.instance },
12451 children
12452 );
12453 };
12454
12455 ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
12456 this.seal();
12457 return this.instance.toHTML();
12458 };
12459
12460 ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
12461 this.seal();
12462 return this.instance.toReactElements();
12463 };
12464
12465 ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
12466 var _this = this;
12467
12468 {
12469 throw new StyledComponentsError(3);
12470 }
12471
12472 /* the tag index keeps track of which tags have already been emitted */
12473 var instance = this.instance;
12474
12475 var instanceTagIndex = 0;
12476
12477 var streamAttr = SC_STREAM_ATTR + '="true"';
12478
12479 var transformer = new stream.Transform({
12480 transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
12481 var tags = instance.tags;
12482
12483 var html = '';
12484
12485 /* retrieve html for each new style tag */
12486 for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
12487 var tag = tags[instanceTagIndex];
12488 html += tag.toHTML(streamAttr);
12489 }
12490
12491 /* force our StyleSheets to emit entirely new tags */
12492 instance.sealAllTags();
12493
12494 var renderedHtml = chunk.toString();
12495
12496 /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
12497 if (CLOSING_TAG_R.test(renderedHtml)) {
12498 var endOfClosingTag = renderedHtml.indexOf('>');
12499
12500 this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
12501 } else this.push(html + renderedHtml);
12502
12503 callback();
12504 }
12505 });
12506
12507 readableStream.on('end', function () {
12508 return _this.seal();
12509 });
12510
12511 readableStream.on('error', function (err) {
12512 _this.seal();
12513
12514 // forward the error to the transform stream
12515 transformer.emit('error', err);
12516 });
12517
12518 return readableStream.pipe(transformer);
12519 };
12520
12521 return ServerStyleSheet;
12522 }();
12523
12524 //
12525
12526 var StyleSheetContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12527 var StyleSheetConsumer = StyleSheetContext.Consumer;
12528
12529 var StyleSheetManager = function (_Component) {
12530 inherits(StyleSheetManager, _Component);
12531
12532 function StyleSheetManager(props) {
12533 classCallCheck(this, StyleSheetManager);
12534
12535 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12536
12537 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext);
12538 return _this;
12539 }
12540
12541 StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
12542 if (sheet) {
12543 return sheet;
12544 } else if (target) {
12545 return new StyleSheet(target);
12546 } else {
12547 throw new StyledComponentsError(4);
12548 }
12549 };
12550
12551 StyleSheetManager.prototype.render = function render() {
12552 var _props = this.props,
12553 children = _props.children,
12554 sheet = _props.sheet,
12555 target = _props.target;
12556
12557
12558 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12559 StyleSheetContext.Provider,
12560 { value: this.getContext(sheet, target) },
12561 true ? react__WEBPACK_IMPORTED_MODULE_2___default().Children.only(children) : 0
12562 );
12563 };
12564
12565 return StyleSheetManager;
12566 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12567 true ? StyleSheetManager.propTypes = {
12568 sheet: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8___default().instanceOf(StyleSheet), prop_types__WEBPACK_IMPORTED_MODULE_8___default().instanceOf(ServerStyleSheet)]),
12569
12570 target: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
12571 appendChild: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func.isRequired)
12572 })
12573 } : 0;
12574
12575 //
12576
12577 var identifiers = {};
12578
12579 /* We depend on components having unique IDs */
12580 function generateId(_ComponentStyle, _displayName, parentComponentId) {
12581 var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
12582
12583 /**
12584 * This ensures uniqueness if two components happen to share
12585 * the same displayName.
12586 */
12587 var nr = (identifiers[displayName] || 0) + 1;
12588 identifiers[displayName] = nr;
12589
12590 var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
12591
12592 return parentComponentId ? parentComponentId + '-' + componentId : componentId;
12593 }
12594
12595 // $FlowFixMe
12596
12597 var StyledComponent = function (_Component) {
12598 inherits(StyledComponent, _Component);
12599
12600 function StyledComponent() {
12601 classCallCheck(this, StyledComponent);
12602
12603 var _this = possibleConstructorReturn(this, _Component.call(this));
12604
12605 _this.attrs = {};
12606
12607 _this.renderOuter = _this.renderOuter.bind(_this);
12608 _this.renderInner = _this.renderInner.bind(_this);
12609
12610 if (true) {
12611 _this.warnInnerRef = once(function (displayName) {
12612 return (
12613 // eslint-disable-next-line no-console
12614 console.warn('The "innerRef" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use "ref" instead like a typical component. "innerRef" was detected on component "' + displayName + '".')
12615 );
12616 });
12617
12618 _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
12619 return (
12620 // eslint-disable-next-line no-console
12621 console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is "' + key + '" on component "' + displayName + '".', '\n ' + new Error().stack)
12622 );
12623 });
12624
12625 _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
12626 return (
12627 // eslint-disable-next-line no-console
12628 console.warn('It looks like you\'ve used a non styled-component as the value for the "' + key + '" prop in an object-form attrs constructor of "' + displayName + '".\n' + 'You should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\n' + "To continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\n" + ('For example, { ' + key + ': () => InnerComponent } instead of { ' + key + ': InnerComponent }'))
12629 );
12630 });
12631 }
12632 return _this;
12633 }
12634
12635 StyledComponent.prototype.render = function render() {
12636 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12637 StyleSheetConsumer,
12638 null,
12639 this.renderOuter
12640 );
12641 };
12642
12643 StyledComponent.prototype.renderOuter = function renderOuter() {
12644 var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
12645
12646 this.styleSheet = styleSheet;
12647
12648 // No need to subscribe a static component to theme changes, it won't change anything
12649 if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
12650
12651 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12652 ThemeConsumer,
12653 null,
12654 this.renderInner
12655 );
12656 };
12657
12658 StyledComponent.prototype.renderInner = function renderInner(theme) {
12659 var _props$forwardedCompo = this.props.forwardedComponent,
12660 componentStyle = _props$forwardedCompo.componentStyle,
12661 defaultProps = _props$forwardedCompo.defaultProps,
12662 displayName = _props$forwardedCompo.displayName,
12663 foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
12664 styledComponentId = _props$forwardedCompo.styledComponentId,
12665 target = _props$forwardedCompo.target;
12666
12667
12668 var generatedClassName = void 0;
12669 if (componentStyle.isStatic) {
12670 generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
12671 } else {
12672 generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);
12673 }
12674
12675 var elementToBeCreated = this.props.as || this.attrs.as || target;
12676 var isTargetTag = isTag(elementToBeCreated);
12677
12678 var propsForElement = {};
12679 var computedProps = _extends({}, this.props, this.attrs);
12680
12681 var key = void 0;
12682 // eslint-disable-next-line guard-for-in
12683 for (key in computedProps) {
12684 if ( true && key === 'innerRef' && isTargetTag) {
12685 this.warnInnerRef(displayName);
12686 }
12687
12688 if (key === 'forwardedComponent' || key === 'as') {
12689 continue;
12690 } else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];else if (key === 'forwardedAs') propsForElement.as = computedProps[key];else if (!isTargetTag || (0,_emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__["default"])(key)) {
12691 // Don't pass through non HTML tags through to HTML elements
12692 propsForElement[key] = computedProps[key];
12693 }
12694 }
12695
12696 if (this.props.style && this.attrs.style) {
12697 propsForElement.style = _extends({}, this.attrs.style, this.props.style);
12698 }
12699
12700 propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');
12701
12702 return (0,react__WEBPACK_IMPORTED_MODULE_2__.createElement)(elementToBeCreated, propsForElement);
12703 };
12704
12705 StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
12706 var _this2 = this;
12707
12708 var context = _extends({}, props, { theme: theme });
12709
12710 if (!attrs.length) return context;
12711
12712 this.attrs = {};
12713
12714 attrs.forEach(function (attrDef) {
12715 var resolvedAttrDef = attrDef;
12716 var attrDefWasFn = false;
12717 var attr = void 0;
12718 var key = void 0;
12719
12720 if (isFunction(resolvedAttrDef)) {
12721 // $FlowFixMe
12722 resolvedAttrDef = resolvedAttrDef(context);
12723 attrDefWasFn = true;
12724 }
12725
12726 /* eslint-disable guard-for-in */
12727 // $FlowFixMe
12728 for (key in resolvedAttrDef) {
12729 attr = resolvedAttrDef[key];
12730
12731 if (!attrDefWasFn) {
12732 if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
12733 if (true) {
12734 _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
12735 }
12736
12737 attr = attr(context);
12738
12739 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(attr)) {
12740 _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
12741 }
12742 }
12743 }
12744
12745 _this2.attrs[key] = attr;
12746 context[key] = attr;
12747 }
12748 /* eslint-enable */
12749 });
12750
12751 return context;
12752 };
12753
12754 StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
12755 var _props$forwardedCompo2 = props.forwardedComponent,
12756 attrs = _props$forwardedCompo2.attrs,
12757 componentStyle = _props$forwardedCompo2.componentStyle,
12758 warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
12759
12760 // statically styled-components don't need to build an execution context object,
12761 // and shouldn't be increasing the number of class names
12762
12763 if (componentStyle.isStatic && !attrs.length) {
12764 return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
12765 }
12766
12767 var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
12768
12769 if ( true && warnTooManyClasses) warnTooManyClasses(className);
12770
12771 return className;
12772 };
12773
12774 return StyledComponent;
12775 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12776
12777 function createStyledComponent(target, options, rules) {
12778 var isTargetStyledComp = isStyledComponent(target);
12779 var isClass = !isTag(target);
12780
12781 var _options$displayName = options.displayName,
12782 displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
12783 _options$componentId = options.componentId,
12784 componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
12785 _options$ParentCompon = options.ParentComponent,
12786 ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
12787 _options$attrs = options.attrs,
12788 attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
12789
12790
12791 var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
12792
12793 // fold the underlying StyledComponent attrs up (implicit extend)
12794 var finalAttrs =
12795 // $FlowFixMe
12796 isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
12797
12798 var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
12799 // $FlowFixMe
12800 target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
12801
12802 /**
12803 * forwardRef creates a new interim component, which we'll take advantage of
12804 * instead of extending ParentComponent to create _another_ interim class
12805 */
12806 var WrappedStyledComponent = void 0;
12807 var forwardRef = function forwardRef(props, ref) {
12808 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
12809 };
12810 forwardRef.displayName = displayName;
12811 WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(forwardRef);
12812 WrappedStyledComponent.displayName = displayName;
12813
12814 // $FlowFixMe
12815 WrappedStyledComponent.attrs = finalAttrs;
12816 // $FlowFixMe
12817 WrappedStyledComponent.componentStyle = componentStyle;
12818
12819 // $FlowFixMe
12820 WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
12821 Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
12822
12823 // $FlowFixMe
12824 WrappedStyledComponent.styledComponentId = styledComponentId;
12825
12826 // fold the underlying StyledComponent target up since we folded the styles
12827 // $FlowFixMe
12828 WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
12829
12830 // $FlowFixMe
12831 WrappedStyledComponent.withComponent = function withComponent(tag) {
12832 var previousComponentId = options.componentId,
12833 optionsToCopy = objectWithoutProperties(options, ['componentId']);
12834
12835
12836 var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
12837
12838 var newOptions = _extends({}, optionsToCopy, {
12839 attrs: finalAttrs,
12840 componentId: newComponentId,
12841 ParentComponent: ParentComponent
12842 });
12843
12844 return createStyledComponent(tag, newOptions, rules);
12845 };
12846
12847 // $FlowFixMe
12848 Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
12849 get: function get$$1() {
12850 return this._foldedDefaultProps;
12851 },
12852 set: function set$$1(obj) {
12853 // $FlowFixMe
12854 this._foldedDefaultProps = isTargetStyledComp ? (0,merge_anything__WEBPACK_IMPORTED_MODULE_6__["default"])(target.defaultProps, obj) : obj;
12855 }
12856 });
12857
12858 if (true) {
12859 // $FlowFixMe
12860 WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
12861 }
12862
12863 // $FlowFixMe
12864 WrappedStyledComponent.toString = function () {
12865 return '.' + WrappedStyledComponent.styledComponentId;
12866 };
12867
12868 if (isClass) {
12869 hoistNonReactStatics(WrappedStyledComponent, target, {
12870 // all SC-specific things should not be hoisted
12871 attrs: true,
12872 componentStyle: true,
12873 displayName: true,
12874 foldedComponentIds: true,
12875 styledComponentId: true,
12876 target: true,
12877 withComponent: true
12878 });
12879 }
12880
12881 return WrappedStyledComponent;
12882 }
12883
12884 //
12885 // Thanks to ReactDOMFactories for this handy list!
12886
12887 var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
12888
12889 // SVG
12890 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
12891
12892 //
12893
12894 var styled = function styled(tag) {
12895 return constructWithOptions(createStyledComponent, tag);
12896 };
12897
12898 // Shorthands for all valid HTML Elements
12899 domElements.forEach(function (domElement) {
12900 styled[domElement] = styled(domElement);
12901 });
12902
12903 //
12904
12905 var GlobalStyle = function () {
12906 function GlobalStyle(rules, componentId) {
12907 classCallCheck(this, GlobalStyle);
12908
12909 this.rules = rules;
12910 this.componentId = componentId;
12911 this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
12912
12913 if (!StyleSheet.master.hasId(componentId)) {
12914 StyleSheet.master.deferredInject(componentId, []);
12915 }
12916 }
12917
12918 GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
12919 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12920 var css = stringifyRules(flatCSS, '');
12921
12922 styleSheet.inject(this.componentId, css);
12923 };
12924
12925 GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
12926 var componentId = this.componentId;
12927
12928 if (styleSheet.hasId(componentId)) {
12929 styleSheet.remove(componentId);
12930 }
12931 };
12932
12933 // TODO: overwrite in-place instead of remove+create?
12934
12935
12936 GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
12937 this.removeStyles(styleSheet);
12938 this.createStyles(executionContext, styleSheet);
12939 };
12940
12941 return GlobalStyle;
12942 }();
12943
12944 //
12945
12946 // place our cache into shared context so it'll persist between HMRs
12947 if (IS_BROWSER) {
12948 window.scCGSHMRCache = {};
12949 }
12950
12951 function createGlobalStyle(strings) {
12952 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12953 interpolations[_key - 1] = arguments[_key];
12954 }
12955
12956 var rules = css.apply(undefined, [strings].concat(interpolations));
12957 var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
12958 var style = new GlobalStyle(rules, id);
12959
12960 var GlobalStyleComponent = function (_React$Component) {
12961 inherits(GlobalStyleComponent, _React$Component);
12962
12963 function GlobalStyleComponent(props) {
12964 classCallCheck(this, GlobalStyleComponent);
12965
12966 var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
12967
12968 var _this$constructor = _this.constructor,
12969 globalStyle = _this$constructor.globalStyle,
12970 styledComponentId = _this$constructor.styledComponentId;
12971
12972
12973 if (IS_BROWSER) {
12974 window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
12975 }
12976
12977 /**
12978 * This fixes HMR compatibility. Don't ask me why, but this combination of
12979 * caching the closure variables via statics and then persisting the statics in
12980 * state works across HMR where no other combination did. ¯\_(ツ)_/¯
12981 */
12982 _this.state = {
12983 globalStyle: globalStyle,
12984 styledComponentId: styledComponentId
12985 };
12986 return _this;
12987 }
12988
12989 GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
12990 if (window.scCGSHMRCache[this.state.styledComponentId]) {
12991 window.scCGSHMRCache[this.state.styledComponentId] -= 1;
12992 }
12993 /**
12994 * Depending on the order "render" is called this can cause the styles to be lost
12995 * until the next render pass of the remaining instance, which may
12996 * not be immediate.
12997 */
12998 if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
12999 this.state.globalStyle.removeStyles(this.styleSheet);
13000 }
13001 };
13002
13003 GlobalStyleComponent.prototype.render = function render() {
13004 var _this2 = this;
13005
13006 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(this.props.children)) {
13007 // eslint-disable-next-line no-console
13008 console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
13009 }
13010
13011 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13012 StyleSheetConsumer,
13013 null,
13014 function (styleSheet) {
13015 _this2.styleSheet = styleSheet || StyleSheet.master;
13016
13017 var globalStyle = _this2.state.globalStyle;
13018
13019
13020 if (globalStyle.isStatic) {
13021 globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
13022
13023 return null;
13024 } else {
13025 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13026 ThemeConsumer,
13027 null,
13028 function (theme) {
13029 // $FlowFixMe
13030 var defaultProps = _this2.constructor.defaultProps;
13031
13032
13033 var context = _extends({}, _this2.props);
13034
13035 if (typeof theme !== 'undefined') {
13036 context.theme = determineTheme(_this2.props, theme, defaultProps);
13037 }
13038
13039 globalStyle.renderStyles(context, _this2.styleSheet);
13040
13041 return null;
13042 }
13043 );
13044 }
13045 }
13046 );
13047 };
13048
13049 return GlobalStyleComponent;
13050 }((react__WEBPACK_IMPORTED_MODULE_2___default().Component));
13051
13052 GlobalStyleComponent.globalStyle = style;
13053 GlobalStyleComponent.styledComponentId = id;
13054
13055
13056 return GlobalStyleComponent;
13057 }
13058
13059 //
13060
13061 var replaceWhitespace = function replaceWhitespace(str) {
13062 return str.replace(/\s|\\n/g, '');
13063 };
13064
13065 function keyframes(strings) {
13066 /* Warning if you've used keyframes on React Native */
13067 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13068 // eslint-disable-next-line no-console
13069 console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
13070 }
13071
13072 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13073 interpolations[_key - 1] = arguments[_key];
13074 }
13075
13076 var rules = css.apply(undefined, [strings].concat(interpolations));
13077
13078 var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
13079
13080 return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
13081 }
13082
13083 //
13084
13085 var withTheme = (function (Component$$1) {
13086 var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function (props, ref) {
13087 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13088 ThemeConsumer,
13089 null,
13090 function (theme) {
13091 // $FlowFixMe
13092 var defaultProps = Component$$1.defaultProps;
13093
13094 var themeProp = determineTheme(props, theme, defaultProps);
13095
13096 if ( true && themeProp === undefined) {
13097 // eslint-disable-next-line no-console
13098 console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "' + getComponentName(Component$$1) + '"');
13099 }
13100
13101 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
13102 }
13103 );
13104 });
13105
13106 hoistNonReactStatics(WithTheme, Component$$1);
13107
13108 WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
13109
13110 return WithTheme;
13111 });
13112
13113 //
13114
13115 /* eslint-disable */
13116 var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
13117 StyleSheet: StyleSheet
13118 };
13119
13120 //
13121
13122 /* Warning if you've imported this file on React Native */
13123 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13124 // eslint-disable-next-line no-console
13125 console.warn("It looks like you've imported 'styled-components' on React Native.\n" + "Perhaps you're looking to import 'styled-components/native'?\n" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
13126 }
13127
13128 /* Warning if there are several instances of styled-components */
13129 if ( true && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
13130 window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
13131
13132 if (window['__styled-components-init__'] === 1) {
13133 // eslint-disable-next-line no-console
13134 console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\n\n' + 'See https://s-c.sh/2BAXzed for more info.');
13135 }
13136
13137 window['__styled-components-init__'] += 1;
13138 }
13139
13140 //
13141
13142 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (styled);
13143
13144 //# sourceMappingURL=styled-components.browser.esm.js.map
13145
13146
13147 /***/ }),
13148
13149 /***/ "./node_modules/stylis-rule-sheet/index.js":
13150 /*!*************************************************!*\
13151 !*** ./node_modules/stylis-rule-sheet/index.js ***!
13152 \*************************************************/
13153 /***/ ((module) => {
13154
13155 (function (factory) {
13156 true ? (module['exports'] = factory()) :
13157 0
13158 }(function () {
13159
13160 'use strict'
13161
13162 return function (insertRule) {
13163 var delimiter = '/*|*/'
13164 var needle = delimiter+'}'
13165
13166 function toSheet (block) {
13167 if (block)
13168 try {
13169 insertRule(block + '}')
13170 } catch (e) {}
13171 }
13172
13173 return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
13174 switch (context) {
13175 // property
13176 case 1:
13177 // @import
13178 if (depth === 0 && content.charCodeAt(0) === 64)
13179 return insertRule(content+';'), ''
13180 break
13181 // selector
13182 case 2:
13183 if (ns === 0)
13184 return content + delimiter
13185 break
13186 // at-rule
13187 case 3:
13188 switch (ns) {
13189 // @font-face, @page
13190 case 102:
13191 case 112:
13192 return insertRule(selectors[0]+content), ''
13193 default:
13194 return content + (at === 0 ? delimiter : '')
13195 }
13196 case -2:
13197 content.split(needle).forEach(toSheet)
13198 }
13199 }
13200 }
13201 }))
13202
13203
13204 /***/ }),
13205
13206 /***/ "./node_modules/stylis/stylis.min.js":
13207 /*!*******************************************!*\
13208 !*** ./node_modules/stylis/stylis.min.js ***!
13209 \*******************************************/
13210 /***/ ((module) => {
13211
13212 !function(e){ true?module.exports=e(null):0}(function e(a){"use strict";var r=/^\0+/g,c=/[\0\r\f]/g,s=/: */g,t=/zoo|gra/,i=/([,: ])(transform)/g,f=/,+\s*(?![^(]*[)])/g,n=/ +\s*(?![^(]*[)])/g,l=/ *[\0] */g,o=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,u=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,b=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,k=/:(read-only)/g,g=/\s+(?=[{\];=:>])/g,A=/([[}=:>])\s+/g,C=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,v=/([^\(])(:+) */g,m=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,y=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,j=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,N="-webkit-",S="-moz-",F="-ms-",W=59,q=125,B=123,D=40,E=41,G=91,H=93,I=10,J=13,K=9,L=64,M=32,P=38,Q=45,R=95,T=42,U=44,V=58,X=39,Y=34,Z=47,_=62,ee=43,ae=126,re=0,ce=12,se=11,te=107,ie=109,fe=115,ne=112,le=111,oe=105,he=99,ue=100,de=112,be=1,pe=1,ke=0,ge=1,Ae=1,Ce=1,we=0,ve=0,me=0,xe=[],$e=[],ye=0,Oe=null,je=-2,ze=-1,Ne=0,Se=1,Fe=2,We=3,qe=0,Be=1,De="",Ee="",Ge="";function He(e,a,s,t,i){for(var f,n,o=0,h=0,u=0,d=0,g=0,A=0,C=0,w=0,m=0,$=0,y=0,O=0,j=0,z=0,R=0,we=0,$e=0,Oe=0,je=0,ze=s.length,Je=ze-1,Re="",Te="",Ue="",Ve="",Xe="",Ye="";R<ze;){if(C=s.charCodeAt(R),R===Je)if(h+d+u+o!==0){if(0!==h)C=h===Z?I:Z;d=u=o=0,ze++,Je++}if(h+d+u+o===0){if(R===Je){if(we>0)Te=Te.replace(c,"");if(Te.trim().length>0){switch(C){case M:case K:case W:case J:case I:break;default:Te+=s.charAt(R)}C=W}}if(1===$e)switch(C){case B:case q:case W:case Y:case X:case D:case E:case U:$e=0;case K:case J:case I:case M:break;default:for($e=0,je=R,g=C,R--,C=W;je<ze;)switch(s.charCodeAt(je++)){case I:case J:case W:++R,C=g,je=ze;break;case V:if(we>0)++R,C=g;case B:je=ze}}switch(C){case B:for(g=(Te=Te.trim()).charCodeAt(0),y=1,je=++R;R<ze;){switch(C=s.charCodeAt(R)){case B:y++;break;case q:y--;break;case Z:switch(A=s.charCodeAt(R+1)){case T:case Z:R=Qe(A,R,Je,s)}break;case G:C++;case D:C++;case Y:case X:for(;R++<Je&&s.charCodeAt(R)!==C;);}if(0===y)break;R++}if(Ue=s.substring(je,R),g===re)g=(Te=Te.replace(r,"").trim()).charCodeAt(0);switch(g){case L:if(we>0)Te=Te.replace(c,"");switch(A=Te.charCodeAt(1)){case ue:case ie:case fe:case Q:f=a;break;default:f=xe}if(je=(Ue=He(a,f,Ue,A,i+1)).length,me>0&&0===je)je=Te.length;if(ye>0)if(f=Ie(xe,Te,Oe),n=Pe(We,Ue,f,a,pe,be,je,A,i,t),Te=f.join(""),void 0!==n)if(0===(je=(Ue=n.trim()).length))A=0,Ue="";if(je>0)switch(A){case fe:Te=Te.replace(x,Me);case ue:case ie:case Q:Ue=Te+"{"+Ue+"}";break;case te:if(Ue=(Te=Te.replace(b,"$1 $2"+(Be>0?De:"")))+"{"+Ue+"}",1===Ae||2===Ae&&Le("@"+Ue,3))Ue="@"+N+Ue+"@"+Ue;else Ue="@"+Ue;break;default:if(Ue=Te+Ue,t===de)Ve+=Ue,Ue=""}else Ue="";break;default:Ue=He(a,Ie(a,Te,Oe),Ue,t,i+1)}Xe+=Ue,O=0,$e=0,z=0,we=0,Oe=0,j=0,Te="",Ue="",C=s.charCodeAt(++R);break;case q:case W:if((je=(Te=(we>0?Te.replace(c,""):Te).trim()).length)>1){if(0===z)if((g=Te.charCodeAt(0))===Q||g>96&&g<123)je=(Te=Te.replace(" ",":")).length;if(ye>0)if(void 0!==(n=Pe(Se,Te,a,e,pe,be,Ve.length,t,i,t)))if(0===(je=(Te=n.trim()).length))Te="\0\0";switch(g=Te.charCodeAt(0),A=Te.charCodeAt(1),g){case re:break;case L:if(A===oe||A===he){Ye+=Te+s.charAt(R);break}default:if(Te.charCodeAt(je-1)===V)break;Ve+=Ke(Te,g,A,Te.charCodeAt(2))}}O=0,$e=0,z=0,we=0,Oe=0,Te="",C=s.charCodeAt(++R)}}switch(C){case J:case I:if(h+d+u+o+ve===0)switch($){case E:case X:case Y:case L:case ae:case _:case T:case ee:case Z:case Q:case V:case U:case W:case B:case q:break;default:if(z>0)$e=1}if(h===Z)h=0;else if(ge+O===0&&t!==te&&Te.length>0)we=1,Te+="\0";if(ye*qe>0)Pe(Ne,Te,a,e,pe,be,Ve.length,t,i,t);be=1,pe++;break;case W:case q:if(h+d+u+o===0){be++;break}default:switch(be++,Re=s.charAt(R),C){case K:case M:if(d+o+h===0)switch(w){case U:case V:case K:case M:Re="";break;default:if(C!==M)Re=" "}break;case re:Re="\\0";break;case ce:Re="\\f";break;case se:Re="\\v";break;case P:if(d+h+o===0&&ge>0)Oe=1,we=1,Re="\f"+Re;break;case 108:if(d+h+o+ke===0&&z>0)switch(R-z){case 2:if(w===ne&&s.charCodeAt(R-3)===V)ke=w;case 8:if(m===le)ke=m}break;case V:if(d+h+o===0)z=R;break;case U:if(h+u+d+o===0)we=1,Re+="\r";break;case Y:case X:if(0===h)d=d===C?0:0===d?C:d;break;case G:if(d+h+u===0)o++;break;case H:if(d+h+u===0)o--;break;case E:if(d+h+o===0)u--;break;case D:if(d+h+o===0){if(0===O)switch(2*w+3*m){case 533:break;default:y=0,O=1}u++}break;case L:if(h+u+d+o+z+j===0)j=1;break;case T:case Z:if(d+o+u>0)break;switch(h){case 0:switch(2*C+3*s.charCodeAt(R+1)){case 235:h=Z;break;case 220:je=R,h=T}break;case T:if(C===Z&&w===T&&je+2!==R){if(33===s.charCodeAt(je+2))Ve+=s.substring(je,R+1);Re="",h=0}}}if(0===h){if(ge+d+o+j===0&&t!==te&&C!==W)switch(C){case U:case ae:case _:case ee:case E:case D:if(0===O){switch(w){case K:case M:case I:case J:Re+="\0";break;default:Re="\0"+Re+(C===U?"":"\0")}we=1}else switch(C){case D:if(z+7===R&&108===w)z=0;O=++y;break;case E:if(0==(O=--y))we=1,Re+="\0"}break;case K:case M:switch(w){case re:case B:case q:case W:case U:case ce:case K:case M:case I:case J:break;default:if(0===O)we=1,Re+="\0"}}if(Te+=Re,C!==M&&C!==K)$=C}}m=w,w=C,R++}if(je=Ve.length,me>0)if(0===je&&0===Xe.length&&0===a[0].length==false)if(t!==ie||1===a.length&&(ge>0?Ee:Ge)===a[0])je=a.join(",").length+2;if(je>0){if(f=0===ge&&t!==te?function(e){for(var a,r,s=0,t=e.length,i=Array(t);s<t;++s){for(var f=e[s].split(l),n="",o=0,h=0,u=0,d=0,b=f.length;o<b;++o){if(0===(h=(r=f[o]).length)&&b>1)continue;if(u=n.charCodeAt(n.length-1),d=r.charCodeAt(0),a="",0!==o)switch(u){case T:case ae:case _:case ee:case M:case D:break;default:a=" "}switch(d){case P:r=a+Ee;case ae:case _:case ee:case M:case E:case D:break;case G:r=a+r+Ee;break;case V:switch(2*r.charCodeAt(1)+3*r.charCodeAt(2)){case 530:if(Ce>0){r=a+r.substring(8,h-1);break}default:if(o<1||f[o-1].length<1)r=a+Ee+r}break;case U:a="";default:if(h>1&&r.indexOf(":")>0)r=a+r.replace(v,"$1"+Ee+"$2");else r=a+r+Ee}n+=r}i[s]=n.replace(c,"").trim()}return i}(a):a,ye>0)if(void 0!==(n=Pe(Fe,Ve,f,e,pe,be,je,t,i,t))&&0===(Ve=n).length)return Ye+Ve+Xe;if(Ve=f.join(",")+"{"+Ve+"}",Ae*ke!=0){if(2===Ae&&!Le(Ve,2))ke=0;switch(ke){case le:Ve=Ve.replace(k,":"+S+"$1")+Ve;break;case ne:Ve=Ve.replace(p,"::"+N+"input-$1")+Ve.replace(p,"::"+S+"$1")+Ve.replace(p,":"+F+"input-$1")+Ve}ke=0}}return Ye+Ve+Xe}function Ie(e,a,r){var c=a.trim().split(o),s=c,t=c.length,i=e.length;switch(i){case 0:case 1:for(var f=0,n=0===i?"":e[0]+" ";f<t;++f)s[f]=Je(n,s[f],r,i).trim();break;default:f=0;var l=0;for(s=[];f<t;++f)for(var h=0;h<i;++h)s[l++]=Je(e[h]+" ",c[f],r,i).trim()}return s}function Je(e,a,r,c){var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);switch(t){case P:switch(ge+c){case 0:case 1:if(0===e.trim().length)break;default:return s.replace(h,"$1"+e.trim())}break;case V:switch(s.charCodeAt(1)){case 103:if(Ce>0&&ge>0)return s.replace(u,"$1").replace(h,"$1"+Ge);break;default:return e.trim()+s.replace(h,"$1"+e.trim())}default:if(r*ge>0&&s.indexOf("\f")>0)return s.replace(h,(e.charCodeAt(0)===V?"":"$1")+e.trim())}return e+s}function Ke(e,a,r,c){var l,o=0,h=e+";",u=2*a+3*r+4*c;if(944===u)return function(e){var a=e.length,r=e.indexOf(":",9)+1,c=e.substring(0,r).trim(),s=e.substring(r,a-1).trim();switch(e.charCodeAt(9)*Be){case 0:break;case Q:if(110!==e.charCodeAt(10))break;default:for(var t=s.split((s="",f)),i=0,r=0,a=t.length;i<a;r=0,++i){for(var l=t[i],o=l.split(n);l=o[r];){var h=l.charCodeAt(0);if(1===Be&&(h>L&&h<90||h>96&&h<123||h===R||h===Q&&l.charCodeAt(1)!==Q))switch(isNaN(parseFloat(l))+(-1!==l.indexOf("("))){case 1:switch(l){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:l+=De}}o[r++]=l}s+=(0===i?"":",")+o.join(" ")}}if(s=c+s+";",1===Ae||2===Ae&&Le(s,1))return N+s+s;return s}(h);else if(0===Ae||2===Ae&&!Le(h,1))return h;switch(u){case 1015:return 97===h.charCodeAt(10)?N+h+h:h;case 951:return 116===h.charCodeAt(3)?N+h+h:h;case 963:return 110===h.charCodeAt(5)?N+h+h:h;case 1009:if(100!==h.charCodeAt(4))break;case 969:case 942:return N+h+h;case 978:return N+h+S+h+h;case 1019:case 983:return N+h+S+h+F+h+h;case 883:if(h.charCodeAt(8)===Q)return N+h+h;if(h.indexOf("image-set(",11)>0)return h.replace(z,"$1"+N+"$2")+h;return h;case 932:if(h.charCodeAt(4)===Q)switch(h.charCodeAt(5)){case 103:return N+"box-"+h.replace("-grow","")+N+h+F+h.replace("grow","positive")+h;case 115:return N+h+F+h.replace("shrink","negative")+h;case 98:return N+h+F+h.replace("basis","preferred-size")+h}return N+h+F+h+h;case 964:return N+h+F+"flex-"+h+h;case 1023:if(99!==h.charCodeAt(8))break;return l=h.substring(h.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),N+"box-pack"+l+N+h+F+"flex-pack"+l+h;case 1005:return t.test(h)?h.replace(s,":"+N)+h.replace(s,":"+S)+h:h;case 1e3:switch(o=(l=h.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(o)){case 226:l=h.replace(m,"tb");break;case 232:l=h.replace(m,"tb-rl");break;case 220:l=h.replace(m,"lr");break;default:return h}return N+h+F+l+h;case 1017:if(-1===h.indexOf("sticky",9))return h;case 975:switch(o=(h=e).length-10,u=(l=(33===h.charCodeAt(o)?h.substring(0,o):h).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(l.charCodeAt(8)<111)break;case 115:h=h.replace(l,N+l)+";"+h;break;case 207:case 102:h=h.replace(l,N+(u>102?"inline-":"")+"box")+";"+h.replace(l,N+l)+";"+h.replace(l,F+l+"box")+";"+h}return h+";";case 938:if(h.charCodeAt(5)===Q)switch(h.charCodeAt(6)){case 105:return l=h.replace("-items",""),N+h+N+"box-"+l+F+"flex-"+l+h;case 115:return N+h+F+"flex-item-"+h.replace(y,"")+h;default:return N+h+F+"flex-line-pack"+h.replace("align-content","").replace(y,"")+h}break;case 973:case 989:if(h.charCodeAt(3)!==Q||122===h.charCodeAt(4))break;case 931:case 953:if(true===j.test(e))if(115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0))return Ke(e.replace("stretch","fill-available"),a,r,c).replace(":fill-available",":stretch");else return h.replace(l,N+l)+h.replace(l,S+l.replace("fill-",""))+h;break;case 962:if(h=N+h+(102===h.charCodeAt(5)?F+h:"")+h,r+c===211&&105===h.charCodeAt(13)&&h.indexOf("transform",10)>0)return h.substring(0,h.indexOf(";",27)+1).replace(i,"$1"+N+"$2")+h}return h}function Le(e,a){var r=e.indexOf(1===a?":":"{"),c=e.substring(0,3!==a?r:10),s=e.substring(r+1,e.length-1);return Oe(2!==a?c:c.replace(O,"$1"),s,a)}function Me(e,a){var r=Ke(a,a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2));return r!==a+";"?r.replace($," or ($1)").substring(4):"("+a+")"}function Pe(e,a,r,c,s,t,i,f,n,l){for(var o,h=0,u=a;h<ye;++h)switch(o=$e[h].call(Te,e,u,r,c,s,t,i,f,n,l)){case void 0:case false:case true:case null:break;default:u=o}if(u!==a)return u}function Qe(e,a,r,c){for(var s=a+1;s<r;++s)switch(c.charCodeAt(s)){case Z:if(e===T)if(c.charCodeAt(s-1)===T&&a+2!==s)return s+1;break;case I:if(e===Z)return s+1}return s}function Re(e){for(var a in e){var r=e[a];switch(a){case"keyframe":Be=0|r;break;case"global":Ce=0|r;break;case"cascade":ge=0|r;break;case"compress":we=0|r;break;case"semicolon":ve=0|r;break;case"preserve":me=0|r;break;case"prefix":if(Oe=null,!r)Ae=0;else if("function"!=typeof r)Ae=1;else Ae=2,Oe=r}}return Re}function Te(a,r){if(void 0!==this&&this.constructor===Te)return e(a);var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);if(Be>0)De=s.replace(d,t===G?"":"-");if(t=1,1===ge)Ge=s;else Ee=s;var i,f=[Ge];if(ye>0)if(void 0!==(i=Pe(ze,r,f,f,pe,be,0,0,0,0))&&"string"==typeof i)r=i;var n=He(xe,f,r,0,0);if(ye>0)if(void 0!==(i=Pe(je,n,f,f,pe,be,n.length,0,0,0))&&"string"!=typeof(n=i))t=0;return De="",Ge="",Ee="",ke=0,pe=1,be=1,we*t==0?n:n.replace(c,"").replace(g,"").replace(A,"$1").replace(C,"$1").replace(w," ")}if(Te.use=function e(a){switch(a){case void 0:case null:ye=$e.length=0;break;default:if("function"==typeof a)$e[ye++]=a;else if("object"==typeof a)for(var r=0,c=a.length;r<c;++r)e(a[r]);else qe=0|!!a}return e},Te.set=Re,void 0!==a)Re(a);return Te});
13213 //# sourceMappingURL=stylis.min.js.map
13214
13215 /***/ }),
13216
13217 /***/ "react":
13218 /*!************************!*\
13219 !*** external "React" ***!
13220 \************************/
13221 /***/ ((module) => {
13222
13223 "use strict";
13224 module.exports = window["React"];
13225
13226 /***/ }),
13227
13228 /***/ "jquery":
13229 /*!*************************!*\
13230 !*** external "jQuery" ***!
13231 \*************************/
13232 /***/ ((module) => {
13233
13234 "use strict";
13235 module.exports = window["jQuery"];
13236
13237 /***/ }),
13238
13239 /***/ "@wordpress/block-editor":
13240 /*!*************************************!*\
13241 !*** external ["wp","blockEditor"] ***!
13242 \*************************************/
13243 /***/ ((module) => {
13244
13245 "use strict";
13246 module.exports = window["wp"]["blockEditor"];
13247
13248 /***/ }),
13249
13250 /***/ "@wordpress/blocks":
13251 /*!********************************!*\
13252 !*** external ["wp","blocks"] ***!
13253 \********************************/
13254 /***/ ((module) => {
13255
13256 "use strict";
13257 module.exports = window["wp"]["blocks"];
13258
13259 /***/ }),
13260
13261 /***/ "@wordpress/components":
13262 /*!************************************!*\
13263 !*** external ["wp","components"] ***!
13264 \************************************/
13265 /***/ ((module) => {
13266
13267 "use strict";
13268 module.exports = window["wp"]["components"];
13269
13270 /***/ }),
13271
13272 /***/ "@wordpress/compose":
13273 /*!*********************************!*\
13274 !*** external ["wp","compose"] ***!
13275 \*********************************/
13276 /***/ ((module) => {
13277
13278 "use strict";
13279 module.exports = window["wp"]["compose"];
13280
13281 /***/ }),
13282
13283 /***/ "@wordpress/data":
13284 /*!******************************!*\
13285 !*** external ["wp","data"] ***!
13286 \******************************/
13287 /***/ ((module) => {
13288
13289 "use strict";
13290 module.exports = window["wp"]["data"];
13291
13292 /***/ }),
13293
13294 /***/ "@wordpress/edit-post":
13295 /*!**********************************!*\
13296 !*** external ["wp","editPost"] ***!
13297 \**********************************/
13298 /***/ ((module) => {
13299
13300 "use strict";
13301 module.exports = window["wp"]["editPost"];
13302
13303 /***/ }),
13304
13305 /***/ "@wordpress/element":
13306 /*!*********************************!*\
13307 !*** external ["wp","element"] ***!
13308 \*********************************/
13309 /***/ ((module) => {
13310
13311 "use strict";
13312 module.exports = window["wp"]["element"];
13313
13314 /***/ }),
13315
13316 /***/ "@wordpress/i18n":
13317 /*!******************************!*\
13318 !*** external ["wp","i18n"] ***!
13319 \******************************/
13320 /***/ ((module) => {
13321
13322 "use strict";
13323 module.exports = window["wp"]["i18n"];
13324
13325 /***/ }),
13326
13327 /***/ "@wordpress/plugins":
13328 /*!*********************************!*\
13329 !*** external ["wp","plugins"] ***!
13330 \*********************************/
13331 /***/ ((module) => {
13332
13333 "use strict";
13334 module.exports = window["wp"]["plugins"];
13335
13336 /***/ }),
13337
13338 /***/ "./node_modules/@linaria/react/dist/index.mjs":
13339 /*!****************************************************!*\
13340 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
13341 \****************************************************/
13342 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13343
13344 "use strict";
13345 __webpack_require__.r(__webpack_exports__);
13346 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13347 /* harmony export */ "styled": () => (/* binding */ styled_default)
13348 /* harmony export */ });
13349 /* 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");
13350 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
13351 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
13352 // src/styled.ts
13353
13354
13355
13356 var isCapital = (ch) => ch.toUpperCase() === ch;
13357 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
13358 var omit = (obj, keys) => {
13359 const res = {};
13360 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
13361 res[key] = obj[key];
13362 });
13363 return res;
13364 };
13365 function filterProps(asIs, props, omitKeys) {
13366 const filteredProps = omit(props, omitKeys);
13367 if (!asIs) {
13368 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"];
13369 Object.keys(filteredProps).forEach((key) => {
13370 if (!interopValidAttr.default(key)) {
13371 delete filteredProps[key];
13372 }
13373 });
13374 }
13375 return filteredProps;
13376 }
13377 var warnIfInvalid = (value, componentName) => {
13378 if (true) {
13379 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
13380 return;
13381 }
13382 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
13383 console.warn(
13384 `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.`
13385 );
13386 }
13387 };
13388 var idx = 0;
13389 function styled(tag) {
13390 var _a;
13391 let mockedClass = "";
13392 if (false) {}
13393 return (options) => {
13394 if (true) {
13395 if (Array.isArray(options)) {
13396 throw new Error(
13397 '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'
13398 );
13399 }
13400 }
13401 const render = (props, ref) => {
13402 const { as: component = tag, class: className = mockedClass } = props;
13403 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
13404 const filteredProps = filterProps(shouldKeepProps, props, [
13405 "as",
13406 "class"
13407 ]);
13408 filteredProps.ref = ref;
13409 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);
13410 const { vars } = options;
13411 if (vars) {
13412 const style = {};
13413 for (const name in vars) {
13414 const variable = vars[name];
13415 const result = variable[0];
13416 const unit = variable[1] || "";
13417 const value = typeof result === "function" ? result(props) : result;
13418 warnIfInvalid(value, options.name);
13419 style[`--${name}`] = `${value}${unit}`;
13420 }
13421 const ownStyle = filteredProps.style || {};
13422 const keys = Object.keys(ownStyle);
13423 if (keys.length > 0) {
13424 keys.forEach((key) => {
13425 style[key] = ownStyle[key];
13426 });
13427 }
13428 filteredProps.style = style;
13429 }
13430 if (tag.__linaria && tag !== component) {
13431 filteredProps.as = component;
13432 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
13433 }
13434 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
13435 };
13436 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
13437 const rest = omit(props, ["innerRef"]);
13438 return render(rest, props.innerRef);
13439 };
13440 Result.displayName = options.name;
13441 Result.__linaria = {
13442 className: options.class || mockedClass,
13443 extends: tag
13444 };
13445 return Result;
13446 };
13447 }
13448 var styled_default = true ? new Proxy(styled, {
13449 get(o, prop) {
13450 return o(prop);
13451 }
13452 }) : 0;
13453
13454 //# sourceMappingURL=index.mjs.map
13455
13456 /***/ }),
13457
13458 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
13459 /*!*******************************************************************************!*\
13460 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
13461 \*******************************************************************************/
13462 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13463
13464 "use strict";
13465 __webpack_require__.r(__webpack_exports__);
13466 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13467 /* harmony export */ "css": () => (/* binding */ css_default),
13468 /* harmony export */ "cx": () => (/* binding */ cx_default)
13469 /* harmony export */ });
13470 // src/css.ts
13471 var idx = 0;
13472 var css = () => {
13473 if (false) {}
13474 throw new Error(
13475 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
13476 );
13477 };
13478 var css_default = css;
13479
13480 // src/cx.ts
13481 var cx = function cx2() {
13482 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
13483 const atomicClasses = {};
13484 const nonAtomicClasses = [];
13485 presentClassNames.forEach((arg) => {
13486 const individualClassNames = arg ? arg.split(" ") : [];
13487 individualClassNames.forEach((className) => {
13488 if (className.startsWith("atm_")) {
13489 const [, keyHash] = className.split("_");
13490 atomicClasses[keyHash] = className;
13491 } else {
13492 nonAtomicClasses.push(className);
13493 }
13494 });
13495 });
13496 const result = [];
13497 for (const keyHash in atomicClasses) {
13498 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
13499 result.push(atomicClasses[keyHash]);
13500 }
13501 }
13502 result.push(...nonAtomicClasses);
13503 return result.join(" ");
13504 };
13505 var cx_default = cx;
13506
13507 //# sourceMappingURL=index.mjs.map
13508
13509 /***/ })
13510
13511 /******/ });
13512 /************************************************************************/
13513 /******/ // The module cache
13514 /******/ var __webpack_module_cache__ = {};
13515 /******/
13516 /******/ // The require function
13517 /******/ function __webpack_require__(moduleId) {
13518 /******/ // Check if module is in cache
13519 /******/ var cachedModule = __webpack_module_cache__[moduleId];
13520 /******/ if (cachedModule !== undefined) {
13521 /******/ return cachedModule.exports;
13522 /******/ }
13523 /******/ // Create a new module (and put it into the cache)
13524 /******/ var module = __webpack_module_cache__[moduleId] = {
13525 /******/ // no module.id needed
13526 /******/ // no module.loaded needed
13527 /******/ exports: {}
13528 /******/ };
13529 /******/
13530 /******/ // Execute the module function
13531 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
13532 /******/
13533 /******/ // Return the exports of the module
13534 /******/ return module.exports;
13535 /******/ }
13536 /******/
13537 /************************************************************************/
13538 /******/ /* webpack/runtime/compat get default export */
13539 /******/ (() => {
13540 /******/ // getDefaultExport function for compatibility with non-harmony modules
13541 /******/ __webpack_require__.n = (module) => {
13542 /******/ var getter = module && module.__esModule ?
13543 /******/ () => (module['default']) :
13544 /******/ () => (module);
13545 /******/ __webpack_require__.d(getter, { a: getter });
13546 /******/ return getter;
13547 /******/ };
13548 /******/ })();
13549 /******/
13550 /******/ /* webpack/runtime/define property getters */
13551 /******/ (() => {
13552 /******/ // define getter functions for harmony exports
13553 /******/ __webpack_require__.d = (exports, definition) => {
13554 /******/ for(var key in definition) {
13555 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13556 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
13557 /******/ }
13558 /******/ }
13559 /******/ };
13560 /******/ })();
13561 /******/
13562 /******/ /* webpack/runtime/global */
13563 /******/ (() => {
13564 /******/ __webpack_require__.g = (function() {
13565 /******/ if (typeof globalThis === 'object') return globalThis;
13566 /******/ try {
13567 /******/ return this || new Function('return this')();
13568 /******/ } catch (e) {
13569 /******/ if (typeof window === 'object') return window;
13570 /******/ }
13571 /******/ })();
13572 /******/ })();
13573 /******/
13574 /******/ /* webpack/runtime/hasOwnProperty shorthand */
13575 /******/ (() => {
13576 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13577 /******/ })();
13578 /******/
13579 /******/ /* webpack/runtime/make namespace object */
13580 /******/ (() => {
13581 /******/ // define __esModule on exports
13582 /******/ __webpack_require__.r = (exports) => {
13583 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
13584 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13585 /******/ }
13586 /******/ Object.defineProperty(exports, '__esModule', { value: true });
13587 /******/ };
13588 /******/ })();
13589 /******/
13590 /******/ /* webpack/runtime/nonce */
13591 /******/ (() => {
13592 /******/ __webpack_require__.nc = undefined;
13593 /******/ })();
13594 /******/
13595 /************************************************************************/
13596 var __webpack_exports__ = {};
13597 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
13598 (() => {
13599 "use strict";
13600 /*!**************************************!*\
13601 !*** ./scripts/entries/gutenberg.ts ***!
13602 \**************************************/
13603 __webpack_require__.r(__webpack_exports__);
13604 /* harmony import */ var _gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../gutenberg/FormBlock/registerFormBlock */ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx");
13605 /* harmony import */ var _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../gutenberg/Sidebar/contentType */ "./scripts/gutenberg/Sidebar/contentType.tsx");
13606 /* harmony import */ var _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gutenberg/MeetingsBlock/registerMeetingBlock */ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx");
13607 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
13608
13609
13610
13611
13612 (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__.initBackgroundApp)([_gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__["default"], _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__.registerHubspotSidebar]);
13613 })();
13614
13615 /******/ })()
13616 ;
13617 //# sourceMappingURL=gutenberg.js.map