PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.75
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.75
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.75, at build/gutenberg.js

13,842 lines 552.9 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/EmbedderContainer.tsx":
1720 /*!*****************************************************!*\
1721 !*** ./scripts/shared/Common/EmbedderContainer.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 */ EmbedderContainer)
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 _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1732 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
1733 /* harmony import */ var _LoadingBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1734
1735
1736
1737
1738 function EmbedderContainer(_ref) {
1739 var children = _ref.children;
1740 var _useGetEmbedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_2__.useGetEmbedder)(),
1741 embedder = _useGetEmbedder.embedder,
1742 errorElement = _useGetEmbedder.errorElement,
1743 isLoading = _useGetEmbedder.isLoading;
1744 if (errorElement) {
1745 return errorElement;
1746 }
1747 if (isLoading) {
1748 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_LoadingBlock__WEBPACK_IMPORTED_MODULE_3__["default"], {});
1749 }
1750 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.BackgroudAppContext.Provider, {
1751 value: embedder,
1752 children: children
1753 });
1754 }
1755
1756 /***/ }),
1757
1758 /***/ "./scripts/shared/Common/ErrorHandler.tsx":
1759 /*!************************************************!*\
1760 !*** ./scripts/shared/Common/ErrorHandler.tsx ***!
1761 \************************************************/
1762 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1763
1764 "use strict";
1765 __webpack_require__.r(__webpack_exports__);
1766 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1767 /* harmony export */ "default": () => (/* binding */ ErrorHandler)
1768 /* harmony export */ });
1769 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1770 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
1771 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1772 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1773 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1774 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1775 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
1776
1777
1778
1779
1780
1781
1782
1783 function redirectToPlugin() {
1784 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);
1785 }
1786 function ErrorHandler(_ref) {
1787 var status = _ref.status,
1788 resetErrorState = _ref.resetErrorState,
1789 _ref$errorInfo = _ref.errorInfo,
1790 errorInfo = _ref$errorInfo === void 0 ? {
1791 header: '',
1792 message: '',
1793 action: ''
1794 } : _ref$errorInfo;
1795 var isUnauthorized = status === 401 || status === 403;
1796 var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header;
1797 var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools', 'leadin') : errorInfo.message;
1798 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
1799 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath,
1800 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], {
1801 textAlign: "center",
1802 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1803 children: errorHeader
1804 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1805 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1806 children: errorMessage
1807 })
1808 }), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1809 "data-test-id": "authorize-button",
1810 onClick: redirectToPlugin,
1811 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin')
1812 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1813 "data-test-id": "retry-button",
1814 onClick: resetErrorState,
1815 children: errorInfo.action
1816 })]
1817 })
1818 });
1819 }
1820
1821 /***/ }),
1822
1823 /***/ "./scripts/shared/Common/HubspotWrapper.ts":
1824 /*!*************************************************!*\
1825 !*** ./scripts/shared/Common/HubspotWrapper.ts ***!
1826 \*************************************************/
1827 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1828
1829 "use strict";
1830 __webpack_require__.r(__webpack_exports__);
1831 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1832 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1833 /* harmony export */ });
1834 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1835
1836 var _exp = /*#__PURE__*/function _exp() {
1837 return function (props) {
1838 return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)");
1839 };
1840 };
1841 var _exp2 = /*#__PURE__*/function _exp2() {
1842 return function (props) {
1843 return props.padding || '90px 20% 25px';
1844 };
1845 };
1846 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
1847 name: "HubspotWrapper0",
1848 "class": "h1q5v5ee",
1849 propsAsIs: false,
1850 vars: {
1851 "h1q5v5ee-0": [_exp()],
1852 "h1q5v5ee-1": [_exp2()]
1853 }
1854 }));
1855 __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");
1856
1857 /***/ }),
1858
1859 /***/ "./scripts/shared/Common/LoadingBlock.tsx":
1860 /*!************************************************!*\
1861 !*** ./scripts/shared/Common/LoadingBlock.tsx ***!
1862 \************************************************/
1863 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1864
1865 "use strict";
1866 __webpack_require__.r(__webpack_exports__);
1867 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1868 /* harmony export */ "default": () => (/* binding */ LoadingBlock)
1869 /* harmony export */ });
1870 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1871 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1872 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1873 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1874
1875
1876
1877
1878 function LoadingBlock() {
1879 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1880 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1881 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
1882 size: 50
1883 })
1884 });
1885 }
1886
1887 /***/ }),
1888
1889 /***/ "./scripts/shared/Common/PreviewDisabled.tsx":
1890 /*!***************************************************!*\
1891 !*** ./scripts/shared/Common/PreviewDisabled.tsx ***!
1892 \***************************************************/
1893 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1894
1895 "use strict";
1896 __webpack_require__.r(__webpack_exports__);
1897 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1898 /* harmony export */ "default": () => (/* binding */ PreviewDisabled)
1899 /* harmony export */ });
1900 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1901 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1902 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1903 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1904 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1905 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
1906
1907
1908
1909
1910
1911 function PreviewDisabled() {
1912 var errorHeader = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Preview Unavailable', 'leadin');
1913 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'));
1914 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
1915 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1916 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__["default"], {
1917 textAlign: "center",
1918 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1919 children: errorHeader
1920 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1921 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1922 children: errorMessage
1923 })
1924 })]
1925 })
1926 });
1927 }
1928
1929 /***/ }),
1930
1931 /***/ "./scripts/shared/Form/FormEdit.tsx":
1932 /*!******************************************!*\
1933 !*** ./scripts/shared/Form/FormEdit.tsx ***!
1934 \******************************************/
1935 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1936
1937 "use strict";
1938 __webpack_require__.r(__webpack_exports__);
1939 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1940 /* harmony export */ "default": () => (/* binding */ FormEditContainer)
1941 /* harmony export */ });
1942 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1943 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1944 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1945 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1946 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
1947 /* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx");
1948 /* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx");
1949 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1950 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1951 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1952 /* harmony import */ var _Common_EmbedderContainer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Common/EmbedderContainer */ "./scripts/shared/Common/EmbedderContainer.tsx");
1953 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); }
1954 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; }
1955 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; }
1956 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; }
1957 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1958 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); }
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969 function FormEdit(_ref) {
1970 var attributes = _ref.attributes,
1971 isSelected = _ref.isSelected,
1972 setAttributes = _ref.setAttributes,
1973 _ref$preview = _ref.preview,
1974 preview = _ref$preview === void 0 ? true : _ref$preview,
1975 _ref$origin = _ref.origin,
1976 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
1977 fullSiteEditor = _ref.fullSiteEditor;
1978 var formId = attributes.formId,
1979 formName = attributes.formName,
1980 embedVersion = attributes.embedVersion;
1981 var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId;
1982 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)();
1983 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)();
1984 var handleChange = function handleChange(selectedForm) {
1985 setAttributes({
1986 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1987 formId: selectedForm.value,
1988 formName: selectedForm.label,
1989 embedVersion: selectedForm.embedVersion
1990 });
1991 };
1992 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1993 monitorFormPreviewRender({
1994 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender,
1995 payload: {
1996 origin: origin
1997 }
1998 });
1999 }, [origin]);
2000 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, {
2001 children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], {
2002 formId: formId,
2003 formName: formName,
2004 handleChange: handleChange,
2005 origin: origin,
2006 embedVersion: embedVersion
2007 }), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2008 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"], {
2009 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
2010 formId: formId,
2011 fullSiteEditor: fullSiteEditor,
2012 embedVersion: embedVersion
2013 })]
2014 })]
2015 });
2016 }
2017 function FormEditContainer(props) {
2018 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_EmbedderContainer__WEBPACK_IMPORTED_MODULE_9__["default"], {
2019 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props))
2020 });
2021 }
2022
2023 /***/ }),
2024
2025 /***/ "./scripts/shared/Form/FormSelect.tsx":
2026 /*!********************************************!*\
2027 !*** ./scripts/shared/Form/FormSelect.tsx ***!
2028 \********************************************/
2029 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2030
2031 "use strict";
2032 __webpack_require__.r(__webpack_exports__);
2033 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2034 /* harmony export */ "default": () => (/* binding */ FormSelect)
2035 /* harmony export */ });
2036 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2037 /* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx");
2038 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2039 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2040 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
2041 /* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts");
2042 /* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts");
2043 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
2044 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2045
2046
2047
2048
2049
2050
2051
2052
2053 function FormSelect(_ref) {
2054 var formId = _ref.formId,
2055 formName = _ref.formName,
2056 handleChange = _ref.handleChange,
2057 _ref$origin = _ref.origin,
2058 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
2059 embedVersion = _ref.embedVersion;
2060 var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2061 search = _useForms.search,
2062 formApiError = _useForms.formApiError,
2063 reset = _useForms.reset;
2064 var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin),
2065 createFormByTemplate = _useCreateFormFromTem.createFormByTemplate,
2066 createReset = _useCreateFormFromTem.reset,
2067 isCreating = _useCreateFormFromTem.isCreating,
2068 hasError = _useCreateFormFromTem.hasError,
2069 createApiError = _useCreateFormFromTem.formApiError;
2070 var value = formId && formName ? {
2071 label: formName,
2072 value: formId,
2073 embedVersion: embedVersion
2074 } : null;
2075 var handleLocalChange = function handleLocalChange(option) {
2076 if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) {
2077 createFormByTemplate(option.value).then(function (_ref2) {
2078 var guid = _ref2.guid,
2079 name = _ref2.name;
2080 handleChange({
2081 value: guid,
2082 label: name,
2083 embedVersion: 'v4'
2084 });
2085 });
2086 } else {
2087 handleChange(option);
2088 }
2089 };
2090 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"], {
2091 status: formApiError ? formApiError.status : createApiError.status,
2092 resetErrorState: function resetErrorState() {
2093 if (hasError) {
2094 createReset();
2095 } else {
2096 reset();
2097 }
2098 },
2099 errorInfo: {
2100 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'),
2101 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes', 'leadin'),
2102 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin')
2103 }
2104 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], {
2105 loadOptions: search,
2106 onChange: function onChange(option) {
2107 return handleLocalChange(option);
2108 },
2109 value: value
2110 });
2111 }
2112
2113 /***/ }),
2114
2115 /***/ "./scripts/shared/Form/FormSelector.tsx":
2116 /*!**********************************************!*\
2117 !*** ./scripts/shared/Form/FormSelector.tsx ***!
2118 \**********************************************/
2119 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2120
2121 "use strict";
2122 __webpack_require__.r(__webpack_exports__);
2123 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2124 /* harmony export */ "default": () => (/* binding */ FormSelector)
2125 /* harmony export */ });
2126 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2127 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2128 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2129 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2130 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2131 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2132
2133
2134
2135
2136
2137 function FormSelector(_ref) {
2138 var loadOptions = _ref.loadOptions,
2139 onChange = _ref.onChange,
2140 value = _ref.value;
2141 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
2142 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath,
2143 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
2144 "data-test-id": "leadin-form-select",
2145 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2146 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin')
2147 })
2148 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], {
2149 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'),
2150 value: value,
2151 loadOptions: loadOptions,
2152 onChange: onChange
2153 })]
2154 });
2155 }
2156
2157 /***/ }),
2158
2159 /***/ "./scripts/shared/Form/PreviewForm.tsx":
2160 /*!*********************************************!*\
2161 !*** ./scripts/shared/Form/PreviewForm.tsx ***!
2162 \*********************************************/
2163 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2164
2165 "use strict";
2166 __webpack_require__.r(__webpack_exports__);
2167 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2168 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2169 /* harmony export */ });
2170 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2171 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2172 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2173 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2174 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2175 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2176 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); }
2177 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; }
2178 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; }
2179 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; }
2180 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2181 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); }
2182
2183
2184
2185
2186
2187 function PreviewForm(_ref) {
2188 var portalId = _ref.portalId,
2189 formId = _ref.formId,
2190 fullSiteEditor = _ref.fullSiteEditor,
2191 embedVersion = _ref.embedVersion;
2192 var isFormV4 = embedVersion === 'v4';
2193 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2194 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2195 if (inputEl.current) {
2196 //@ts-expect-error Hubspot global
2197 var hbspt = window.parent.hbspt || window.hbspt;
2198 inputEl.current.innerHTML = '';
2199 var isQa = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScriptPayload.includes('qa');
2200 if (isFormV4) {
2201 // WP 6.3+ renders the block-editor canvas inside an iframe
2202 // (iframe[name="editor-canvas"]). The block's DOM lives in that iframe,
2203 // but our React runs in the top window's JS realm, so the global
2204 // `document` here is the TOP frame's document, not the iframe's. The v4
2205 // forms embed script scans its executing context's local `document`
2206 // (getElementsByClassName('hs-form-frame') + MutationObserver on
2207 // document.body) and has no programmatic create() API. So both the
2208 // placeholder and the embed script must live in the IFRAME's document
2209 // for hydration to happen. Route everything through the placeholder's
2210 // ownerDocument to target the correct realm.
2211 var doc = inputEl.current.ownerDocument;
2212 var container = doc.createElement('div');
2213 container.classList.add('hs-form-frame');
2214 container.dataset.region = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet;
2215 container.dataset.formId = formId;
2216 container.dataset.portalId = portalId.toString();
2217 container.dataset.env = isQa ? 'qa' : '';
2218 inputEl.current.appendChild(container);
2219 // Derive the portal-specific embed URL from the v2 script URL: take its
2220 // host (origin) so we follow whatever host a PHP filter applies to the
2221 // v2 URL, and append the v4 embed path. Inject it into the iframe's
2222 // document so it executes in the iframe window and scans the iframe
2223 // document where the placeholder is. Running post-mount means doc.body
2224 // exists, so the script's MutationObserver initializes without the
2225 // "not a Node" crash seen when it's loaded too early in the iframe
2226 // head. One copy per iframe window is enough — its MutationObserver
2227 // hydrates any later placeholders too.
2228 var v4EmbedUrl = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScript ? "".concat(new URL(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScript).origin, "/forms/embed/").concat(portalId, ".js") : '';
2229 var v4AlreadyPresent = !v4EmbedUrl || !!doc.querySelector("script[src=\"".concat(v4EmbedUrl, "\"]"));
2230 if (v4EmbedUrl && !v4AlreadyPresent) {
2231 var embedScript = doc.createElement('script');
2232 embedScript.src = v4EmbedUrl;
2233 embedScript.defer = true;
2234 doc.body.appendChild(embedScript);
2235 }
2236 } else {
2237 var additionalParams = isQa ? {
2238 env: 'qa'
2239 } : {};
2240 hbspt.forms.create(_objectSpread({
2241 portalId: portalId,
2242 formId: formId,
2243 region: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet,
2244 target: "#".concat(inputEl.current.id)
2245 }, additionalParams));
2246 }
2247 }
2248 }, [formId, portalId, inputEl, isFormV4]);
2249 if (fullSiteEditor) {
2250 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__["default"], {});
2251 }
2252 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2253 ref: inputEl,
2254 id: "hbspt-previewform-".concat(formId)
2255 });
2256 }
2257
2258 /***/ }),
2259
2260 /***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts":
2261 /*!****************************************************************!*\
2262 !*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***!
2263 \****************************************************************/
2264 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2265
2266 "use strict";
2267 __webpack_require__.r(__webpack_exports__);
2268 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2269 /* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate)
2270 /* harmony export */ });
2271 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2272 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2273 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2274 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2275 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2276 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2277 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."); }
2278 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; } }
2279 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; }
2280 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; } }
2281 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2282
2283
2284
2285
2286 function useCreateFormFromTemplate() {
2287 var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg';
2288 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2289 var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)();
2290 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle),
2291 _useState2 = _slicedToArray(_useState, 2),
2292 loadState = _useState2[0],
2293 setLoadState = _useState2[1];
2294 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2295 _useState4 = _slicedToArray(_useState3, 2),
2296 formApiError = _useState4[0],
2297 setFormApiError = _useState4[1];
2298 var createFormByTemplate = function createFormByTemplate(type) {
2299 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2300 track({
2301 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate,
2302 payload: {
2303 type: type,
2304 origin: origin
2305 }
2306 });
2307 return proxy({
2308 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate,
2309 payload: {
2310 type: type,
2311 embedVersion: 'v4'
2312 }
2313 }).then(function (form) {
2314 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2315 return form;
2316 })["catch"](function (err) {
2317 setFormApiError(err);
2318 track({
2319 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed,
2320 payload: {
2321 origin: origin
2322 }
2323 });
2324 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2325 });
2326 };
2327 return {
2328 isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading,
2329 hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed,
2330 formApiError: formApiError,
2331 createFormByTemplate: createFormByTemplate,
2332 reset: function reset() {
2333 return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2334 }
2335 };
2336 }
2337
2338 /***/ }),
2339
2340 /***/ "./scripts/shared/Form/hooks/useForms.ts":
2341 /*!***********************************************!*\
2342 !*** ./scripts/shared/Form/hooks/useForms.ts ***!
2343 \***********************************************/
2344 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2345
2346 "use strict";
2347 __webpack_require__.r(__webpack_exports__);
2348 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2349 /* harmony export */ "default": () => (/* binding */ useForms)
2350 /* harmony export */ });
2351 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2352 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2353 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
2354 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
2355 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2356 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2357 /* harmony import */ var _useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useGetTemplateAvailability */ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts");
2358 function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2359 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."); }
2360 function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
2361 function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2362 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2363 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."); }
2364 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; } }
2365 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; }
2366 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; } }
2367 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2368
2369
2370
2371
2372
2373 function useForms() {
2374 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2375 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2376 _useState2 = _slicedToArray(_useState, 2),
2377 formApiError = _useState2[0],
2378 setFormApiError = _useState2[1];
2379 var _useGetTemplateAvaila = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2380 availabilityPromise = _useGetTemplateAvaila.availabilityPromise;
2381 var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) {
2382 return Promise.all([availabilityPromise, proxy({
2383 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchForms,
2384 payload: {
2385 search: search
2386 }
2387 })]).then(function (_ref) {
2388 var _ref2 = _slicedToArray(_ref, 2),
2389 templateAvailabilityResponse = _ref2[0],
2390 forms = _ref2[1];
2391 var TEMPLATE_OPTIONS = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__.getTemplateOptions)(templateAvailabilityResponse.templateAvailability);
2392 callback([].concat(_toConsumableArray(forms.map(function (form) {
2393 return {
2394 label: form.name,
2395 value: form.guid,
2396 embedVersion: form.embedVersion
2397 };
2398 })), [TEMPLATE_OPTIONS]));
2399 })["catch"](function (error) {
2400 setFormApiError(error);
2401 });
2402 }, 300, {
2403 trailing: true
2404 });
2405 return {
2406 search: search,
2407 formApiError: formApiError,
2408 reset: function reset() {
2409 return setFormApiError(null);
2410 }
2411 };
2412 }
2413
2414 /***/ }),
2415
2416 /***/ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts":
2417 /*!*****************************************************************!*\
2418 !*** ./scripts/shared/Form/hooks/useGetTemplateAvailability.ts ***!
2419 \*****************************************************************/
2420 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2421
2422 "use strict";
2423 __webpack_require__.r(__webpack_exports__);
2424 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2425 /* harmony export */ "default": () => (/* binding */ useGetTemplateAvailability),
2426 /* harmony export */ "getTemplateOptions": () => (/* binding */ getTemplateOptions),
2427 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
2428 /* harmony export */ });
2429 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2430 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2431 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2432 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2433 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2434 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2435 /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../types */ "./scripts/shared/types.ts");
2436 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2437 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."); }
2438 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; } }
2439 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; }
2440 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; } }
2441 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2442
2443
2444
2445
2446
2447 function useGetTemplateAvailability() {
2448 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2449 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2450 _useState2 = _slicedToArray(_useState, 2),
2451 templateAvailability = _useState2[0],
2452 setTemplateAvailability = _useState2[1];
2453 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function () {
2454 return new Promise(function (resolve) {
2455 proxy({
2456 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.GetTemplateAvailability,
2457 payload: {}
2458 }).then(function (data) {
2459 setTemplateAvailability(data.templateAvailability);
2460 resolve(data);
2461 });
2462 });
2463 }),
2464 _useState4 = _slicedToArray(_useState3, 1),
2465 availabilityPromise = _useState4[0];
2466 return {
2467 templateAvailability: templateAvailability,
2468 availabilityPromise: availabilityPromise
2469 };
2470 }
2471 var getTemplateOptions = function getTemplateOptions(templateAvailability) {
2472 if (!templateAvailability) {
2473 return {};
2474 }
2475 return {
2476 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Templates', 'leadin'),
2477 options: Object.keys(templateAvailability).filter(function (templateId) {
2478 var hubspotFormTemplateAvailability = templateAvailability[templateId];
2479 return (hubspotFormTemplateAvailability.canCreateWithMissingScopes || !hubspotFormTemplateAvailability.missingScopes.length) && !Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.ExcludedTemplateAvailabilityKeys).includes(templateId);
2480 }).map(function (templateId) {
2481 return {
2482 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateLabels[templateId], 'leadin'),
2483 value: _types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues[templateId]
2484 };
2485 })
2486 };
2487 };
2488 function isDefaultForm(value) {
2489 return Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues).includes(value);
2490 }
2491
2492 /***/ }),
2493
2494 /***/ "./scripts/shared/Meeting/MeetingController.tsx":
2495 /*!******************************************************!*\
2496 !*** ./scripts/shared/Meeting/MeetingController.tsx ***!
2497 \******************************************************/
2498 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2499
2500 "use strict";
2501 __webpack_require__.r(__webpack_exports__);
2502 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2503 /* harmony export */ "default": () => (/* binding */ MeetingController)
2504 /* harmony export */ });
2505 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2506 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2507 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2508 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2509 /* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx");
2510 /* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx");
2511 /* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts");
2512 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2513 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2514 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2515 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2516 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
2517 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
2518 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__);
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530 function MeetingController(_ref) {
2531 var handleChange = _ref.handleChange,
2532 url = _ref.url;
2533 var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(),
2534 meetings = _useMeetings.mappedMeetings,
2535 loading = _useMeetings.loading,
2536 error = _useMeetings.error,
2537 reload = _useMeetings.reload,
2538 connectCalendar = _useMeetings.connectCalendar;
2539 var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url);
2540 var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url);
2541 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2542 if (!url && meetings.length > 0) {
2543 handleChange(meetings[0].value);
2544 }
2545 }, [meetings, url, handleChange]);
2546 var handleLocalChange = function handleLocalChange(option) {
2547 handleChange(option.value);
2548 };
2549 var handleConnectCalendar = function handleConnectCalendar() {
2550 return connectCalendar().then(function () {
2551 reload();
2552 })["catch"](function (error) {
2553 raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', {
2554 extra: {
2555 error: error
2556 }
2557 });
2558 });
2559 };
2560 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2561 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"], {
2562 status: error && error.status || error,
2563 resetErrorState: function resetErrorState() {
2564 return reload();
2565 },
2566 errorInfo: {
2567 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'),
2568 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes', 'leadin'),
2569 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin')
2570 }
2571 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
2572 padding: "90px 32px 24px",
2573 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath,
2574 children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], {
2575 status: selectedMeetingCalendar,
2576 onConnectCalendar: handleConnectCalendar
2577 }), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], {
2578 onChange: handleLocalChange,
2579 options: meetings,
2580 value: selectedMeetingOption
2581 })]
2582 })
2583 });
2584 }
2585
2586 /***/ }),
2587
2588 /***/ "./scripts/shared/Meeting/MeetingEdit.tsx":
2589 /*!************************************************!*\
2590 !*** ./scripts/shared/Meeting/MeetingEdit.tsx ***!
2591 \************************************************/
2592 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2593
2594 "use strict";
2595 __webpack_require__.r(__webpack_exports__);
2596 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2597 /* harmony export */ "default": () => (/* binding */ MeetingsEditContainer)
2598 /* harmony export */ });
2599 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2600 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2601 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2602 /* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx");
2603 /* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx");
2604 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2605 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2606 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2607 /* harmony import */ var _Common_EmbedderContainer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/EmbedderContainer */ "./scripts/shared/Common/EmbedderContainer.tsx");
2608 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); }
2609 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; }
2610 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; }
2611 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; }
2612 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2613 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); }
2614
2615
2616
2617
2618
2619
2620
2621
2622 function MeetingEdit(_ref) {
2623 var url = _ref.attributes.url,
2624 isSelected = _ref.isSelected,
2625 setAttributes = _ref.setAttributes,
2626 _ref$preview = _ref.preview,
2627 preview = _ref$preview === void 0 ? true : _ref$preview,
2628 _ref$origin = _ref.origin,
2629 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
2630 fullSiteEditor = _ref.fullSiteEditor;
2631 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)();
2632 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)();
2633 var handleChange = function handleChange(newUrl) {
2634 setAttributes({
2635 url: newUrl
2636 });
2637 };
2638 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2639 monitorFormPreviewRender({
2640 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__.ProxyMessages.TrackMeetingPreviewRender,
2641 payload: {
2642 origin: origin
2643 }
2644 });
2645 }, [origin]);
2646 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, {
2647 children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], {
2648 url: url,
2649 handleChange: handleChange
2650 }), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], {
2651 url: url,
2652 fullSiteEditor: fullSiteEditor
2653 })]
2654 });
2655 }
2656 function MeetingsEditContainer(props) {
2657 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_EmbedderContainer__WEBPACK_IMPORTED_MODULE_7__["default"], {
2658 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props))
2659 });
2660 }
2661
2662 /***/ }),
2663
2664 /***/ "./scripts/shared/Meeting/MeetingSelector.tsx":
2665 /*!****************************************************!*\
2666 !*** ./scripts/shared/Meeting/MeetingSelector.tsx ***!
2667 \****************************************************/
2668 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2669
2670 "use strict";
2671 __webpack_require__.r(__webpack_exports__);
2672 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2673 /* harmony export */ "default": () => (/* binding */ MeetingSelector)
2674 /* harmony export */ });
2675 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2676 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2677 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2678 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2679 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
2680 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2681 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2682
2683
2684
2685
2686
2687 function MeetingSelector(_ref) {
2688 var options = _ref.options,
2689 onChange = _ref.onChange,
2690 value = _ref.value;
2691 var optionsWrapper = [{
2692 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'),
2693 options: options
2694 }];
2695 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2696 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", {
2697 "data-test-id": "leadin-meeting-select",
2698 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2699 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin')
2700 })
2701 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
2702 defaultOptions: optionsWrapper,
2703 onChange: onChange,
2704 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'),
2705 value: value
2706 })]
2707 });
2708 }
2709
2710 /***/ }),
2711
2712 /***/ "./scripts/shared/Meeting/MeetingWarning.tsx":
2713 /*!***************************************************!*\
2714 !*** ./scripts/shared/Meeting/MeetingWarning.tsx ***!
2715 \***************************************************/
2716 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2717
2718 "use strict";
2719 __webpack_require__.r(__webpack_exports__);
2720 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2721 /* harmony export */ "default": () => (/* binding */ MeetingWarning)
2722 /* harmony export */ });
2723 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2724 /* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx");
2725 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
2726 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts");
2727 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2728 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2729
2730
2731
2732
2733
2734 function MeetingWarning(_ref) {
2735 var status = _ref.status,
2736 onConnectCalendar = _ref.onConnectCalendar;
2737 var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING;
2738 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');
2739 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');
2740 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], {
2741 titleText: titleText,
2742 titleMessage: titleMessage,
2743 children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
2744 use: "tertiary",
2745 id: "meetings-connect-calendar",
2746 onClick: onConnectCalendar,
2747 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin')
2748 })
2749 });
2750 }
2751
2752 /***/ }),
2753
2754 /***/ "./scripts/shared/Meeting/PreviewMeeting.tsx":
2755 /*!***************************************************!*\
2756 !*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***!
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 */ "default": () => (/* binding */ PreviewForm)
2764 /* harmony export */ });
2765 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2766 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2767 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2768 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2769 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2770 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2771
2772
2773
2774
2775
2776 function getHbspt(win) {
2777 if (!win) {
2778 return undefined;
2779 }
2780 return win.hbspt;
2781 }
2782 function PreviewForm(_ref) {
2783 var url = _ref.url,
2784 fullSiteEditor = _ref.fullSiteEditor;
2785 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2786 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2787 var el = inputEl.current;
2788 if (!el) {
2789 return;
2790 }
2791 // WP 6.3+ renders the block-editor canvas inside an iframe
2792 // (iframe[name="editor-canvas"]). The `.meetings-iframe-container` lives in
2793 // that iframe's document, but `hbspt.meetings.create(selector)` resolves the
2794 // selector against the document of the realm `hbspt` belongs to. The
2795 // top-frame hbspt therefore scans the top document and never finds the
2796 // container, so the preview stays blank. Run the embed in the container's
2797 // own realm: reuse that realm's hbspt if it is already present, otherwise
2798 // inject MeetingsEmbedCode into that document and create once it loads.
2799 // (Mirrors the v4 form block fix.)
2800 var doc = el.ownerDocument;
2801 var win = doc.defaultView;
2802 var create = function create() {
2803 var hbspt = getHbspt(win) || getHbspt(window.parent) || getHbspt(window);
2804 if (hbspt && hbspt.meetings) {
2805 hbspt.meetings.create('.meetings-iframe-container');
2806 }
2807 };
2808 var realmHbspt = getHbspt(win);
2809 if (realmHbspt && realmHbspt.meetings) {
2810 create();
2811 return;
2812 }
2813 var existing = doc.querySelector("script[src=\"".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.meetingsScript, "\"]"));
2814 if (existing) {
2815 existing.addEventListener('load', create);
2816 return;
2817 }
2818 var script = doc.createElement('script');
2819 script.src = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.meetingsScript;
2820 script.defer = true;
2821 script.addEventListener('load', create);
2822 doc.body.appendChild(script);
2823 }, [url]);
2824 if (fullSiteEditor) {
2825 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__["default"], {});
2826 }
2827 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2828 children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2829 ref: inputEl,
2830 className: "meetings-iframe-container",
2831 "data-src": "".concat(url, "?embed=true")
2832 })
2833 });
2834 }
2835
2836 /***/ }),
2837
2838 /***/ "./scripts/shared/Meeting/constants.ts":
2839 /*!*********************************************!*\
2840 !*** ./scripts/shared/Meeting/constants.ts ***!
2841 \*********************************************/
2842 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2843
2844 "use strict";
2845 __webpack_require__.r(__webpack_exports__);
2846 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2847 /* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING),
2848 /* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING)
2849 /* harmony export */ });
2850 var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING';
2851 var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING';
2852
2853 /***/ }),
2854
2855 /***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts":
2856 /*!*************************************************************!*\
2857 !*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***!
2858 \*************************************************************/
2859 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2860
2861 "use strict";
2862 __webpack_require__.r(__webpack_exports__);
2863 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2864 /* harmony export */ "default": () => (/* binding */ useCurrentUserFetch)
2865 /* harmony export */ });
2866 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2867 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2868 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2869 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2870 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2871 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2872 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."); }
2873 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; } }
2874 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; }
2875 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; } }
2876 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2877
2878
2879
2880
2881 var user = null;
2882 function useCurrentUserFetch() {
2883 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2884 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2885 _useState2 = _slicedToArray(_useState, 2),
2886 loadState = _useState2[0],
2887 setLoadState = _useState2[1];
2888 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2889 _useState4 = _slicedToArray(_useState3, 2),
2890 error = _useState4[0],
2891 setError = _useState4[1];
2892 var createUser = function createUser() {
2893 if (!user) {
2894 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2895 }
2896 };
2897 var reload = function reload() {
2898 user = null;
2899 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2900 setError(null);
2901 };
2902 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2903 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) {
2904 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2905 proxy({
2906 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser
2907 }).then(function (data) {
2908 user = data;
2909 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2910 })["catch"](function (err) {
2911 setError(err);
2912 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2913 });
2914 }
2915 }, [loadState]);
2916 return {
2917 user: user,
2918 loadUserState: loadState,
2919 error: error,
2920 createUser: createUser,
2921 reload: reload
2922 };
2923 }
2924
2925 /***/ }),
2926
2927 /***/ "./scripts/shared/Meeting/hooks/useMeetings.ts":
2928 /*!*****************************************************!*\
2929 !*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***!
2930 \*****************************************************/
2931 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2932
2933 "use strict";
2934 __webpack_require__.r(__webpack_exports__);
2935 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2936 /* harmony export */ "default": () => (/* binding */ useMeetings),
2937 /* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting),
2938 /* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar)
2939 /* harmony export */ });
2940 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2941 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2942 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2943 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2944 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts");
2945 /* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts");
2946 /* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts");
2947 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2948 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2949 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2950 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); }
2951 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; }
2952 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; }
2953 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; }
2954 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2955 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); }
2956 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2957 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."); }
2958 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; } }
2959 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; }
2960 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; } }
2961 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2962
2963
2964
2965
2966
2967
2968
2969
2970 function getDefaultMeetingName(meeting, currentUser, meetingUsers) {
2971 var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1),
2972 meetingOwnerId = _meeting$meetingsUser[0];
2973 var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin');
2974 if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) {
2975 var user = meetingUsers[meetingOwnerId];
2976 result += " (".concat(user.userProfile.fullName, ")");
2977 }
2978 return result;
2979 }
2980 function hasCalendarObject(user) {
2981 return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email;
2982 }
2983 function useMeetings() {
2984 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)();
2985 var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(),
2986 meetings = _useMeetingsFetch.meetings,
2987 meetingUsers = _useMeetingsFetch.meetingUsers,
2988 meetingsError = _useMeetingsFetch.error,
2989 loadMeetingsState = _useMeetingsFetch.loadMeetingsState,
2990 reloadMeetings = _useMeetingsFetch.reload;
2991 var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2992 currentUser = _useCurrentUserFetch.user,
2993 userError = _useCurrentUserFetch.error,
2994 loadUserState = _useCurrentUserFetch.loadUserState,
2995 reloadUser = _useCurrentUserFetch.reload;
2996 var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
2997 reloadUser();
2998 reloadMeetings();
2999 }, [reloadUser, reloadMeetings]);
3000 var connectCalendar = function connectCalendar() {
3001 return proxy({
3002 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar
3003 });
3004 };
3005 return {
3006 mappedMeetings: meetings.map(function (meet) {
3007 return {
3008 label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers),
3009 value: meet.link
3010 };
3011 }),
3012 meetings: meetings,
3013 meetingUsers: meetingUsers,
3014 currentUser: currentUser,
3015 error: meetingsError || userError,
3016 loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading,
3017 reload: reload,
3018 connectCalendar: connectCalendar
3019 };
3020 }
3021 function useSelectedMeeting(url) {
3022 var _useMeetings = useMeetings(),
3023 meetings = _useMeetings.mappedMeetings;
3024 var option = meetings.find(function (_ref) {
3025 var value = _ref.value;
3026 return value === url;
3027 });
3028 return option;
3029 }
3030 function useSelectedMeetingCalendar(url) {
3031 var _useMeetings2 = useMeetings(),
3032 meetings = _useMeetings2.meetings,
3033 meetingUsers = _useMeetings2.meetingUsers,
3034 currentUser = _useMeetings2.currentUser;
3035 var meeting = meetings.find(function (meet) {
3036 return meet.link === url;
3037 });
3038 var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) {
3039 return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
3040 }, {});
3041 if (!meeting) {
3042 return null;
3043 } else {
3044 var meetingsUserIds = meeting.meetingsUserIds;
3045 if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) {
3046 return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING;
3047 } else if (meetingsUserIds.map(function (id) {
3048 return mappedMeetingUsersId[id];
3049 }).some(function (user) {
3050 return !hasCalendarObject(user);
3051 })) {
3052 return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING;
3053 } else {
3054 return null;
3055 }
3056 }
3057 }
3058
3059 /***/ }),
3060
3061 /***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts":
3062 /*!**********************************************************!*\
3063 !*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***!
3064 \**********************************************************/
3065 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3066
3067 "use strict";
3068 __webpack_require__.r(__webpack_exports__);
3069 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3070 /* harmony export */ "default": () => (/* binding */ useMeetingsFetch)
3071 /* harmony export */ });
3072 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3073 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
3074 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
3075 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
3076 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
3077 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3078 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."); }
3079 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; } }
3080 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; }
3081 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; } }
3082 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
3083
3084
3085
3086
3087 var meetings = [];
3088 var meetingUsers = [];
3089 function useMeetingsFetch() {
3090 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
3091 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
3092 _useState2 = _slicedToArray(_useState, 2),
3093 loadState = _useState2[0],
3094 setLoadState = _useState2[1];
3095 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3096 _useState4 = _slicedToArray(_useState3, 2),
3097 error = _useState4[0],
3098 setError = _useState4[1];
3099 var reload = function reload() {
3100 meetings = [];
3101 setError(null);
3102 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
3103 };
3104 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
3105 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) {
3106 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
3107 proxy({
3108 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers
3109 }).then(function (data) {
3110 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded);
3111 meetings = data && data.meetingLinks;
3112 meetingUsers = data && data.meetingUsers;
3113 })["catch"](function (e) {
3114 setError(e);
3115 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
3116 });
3117 }
3118 }, [loadState]);
3119 return {
3120 meetings: meetings,
3121 meetingUsers: meetingUsers,
3122 loadMeetingsState: loadState,
3123 error: error,
3124 reload: reload
3125 };
3126 }
3127
3128 /***/ }),
3129
3130 /***/ "./scripts/shared/UIComponents/UIAlert.tsx":
3131 /*!*************************************************!*\
3132 !*** ./scripts/shared/UIComponents/UIAlert.tsx ***!
3133 \*************************************************/
3134 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3135
3136 "use strict";
3137 __webpack_require__.r(__webpack_exports__);
3138 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3139 /* harmony export */ "default": () => (/* binding */ UIAlert)
3140 /* harmony export */ });
3141 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3142 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3143
3144
3145 var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3146 name: "AlertContainer",
3147 "class": "a1h8m4fo",
3148 propsAsIs: false
3149 });
3150 var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3151 name: "Title",
3152 "class": "tyndzxk",
3153 propsAsIs: false
3154 });
3155 var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3156 name: "Message",
3157 "class": "m1m9sbk4",
3158 propsAsIs: false
3159 });
3160 var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3161 name: "MessageContainer",
3162 "class": "mg5o421",
3163 propsAsIs: false
3164 });
3165 function UIAlert(_ref) {
3166 var titleText = _ref.titleText,
3167 titleMessage = _ref.titleMessage,
3168 children = _ref.children;
3169 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, {
3170 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, {
3171 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, {
3172 children: titleText
3173 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, {
3174 children: titleMessage
3175 })]
3176 }), children]
3177 });
3178 }
3179 __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");
3180
3181 /***/ }),
3182
3183 /***/ "./scripts/shared/UIComponents/UIButton.ts":
3184 /*!*************************************************!*\
3185 !*** ./scripts/shared/UIComponents/UIButton.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_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3195 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3196
3197
3198 var _exp2 = /*#__PURE__*/function _exp2() {
3199 return function (props) {
3200 return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX;
3201 };
3202 };
3203 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({
3204 name: "UIButton0",
3205 "class": "ug152ch",
3206 propsAsIs: false,
3207 vars: {
3208 "ug152ch-0": [_exp2()]
3209 }
3210 }));
3211 __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");
3212
3213 /***/ }),
3214
3215 /***/ "./scripts/shared/UIComponents/UIContainer.ts":
3216 /*!****************************************************!*\
3217 !*** ./scripts/shared/UIComponents/UIContainer.ts ***!
3218 \****************************************************/
3219 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3220
3221 "use strict";
3222 __webpack_require__.r(__webpack_exports__);
3223 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3224 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3225 /* harmony export */ });
3226 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3227
3228 var _exp = /*#__PURE__*/function _exp() {
3229 return function (props) {
3230 return props.textAlign ? props.textAlign : 'inherit';
3231 };
3232 };
3233 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3234 name: "UIContainer0",
3235 "class": "ua13n1c",
3236 propsAsIs: false,
3237 vars: {
3238 "ua13n1c-0": [_exp()]
3239 }
3240 }));
3241 __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");
3242
3243 /***/ }),
3244
3245 /***/ "./scripts/shared/UIComponents/UIOverlay.ts":
3246 /*!**************************************************!*\
3247 !*** ./scripts/shared/UIComponents/UIOverlay.ts ***!
3248 \**************************************************/
3249 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3250
3251 "use strict";
3252 __webpack_require__.r(__webpack_exports__);
3253 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3254 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3255 /* harmony export */ });
3256 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3257
3258 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3259 name: "UIOverlay0",
3260 "class": "u1q7a48k",
3261 propsAsIs: false
3262 }));
3263 __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");
3264
3265 /***/ }),
3266
3267 /***/ "./scripts/shared/UIComponents/UISpacer.ts":
3268 /*!*************************************************!*\
3269 !*** ./scripts/shared/UIComponents/UISpacer.ts ***!
3270 \*************************************************/
3271 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3272
3273 "use strict";
3274 __webpack_require__.r(__webpack_exports__);
3275 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3276 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3277 /* harmony export */ });
3278 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3279
3280 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3281 name: "UISpacer0",
3282 "class": "u3qxofx",
3283 propsAsIs: false
3284 }));
3285 __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");
3286
3287 /***/ }),
3288
3289 /***/ "./scripts/shared/UIComponents/UISpinner.tsx":
3290 /*!***************************************************!*\
3291 !*** ./scripts/shared/UIComponents/UISpinner.tsx ***!
3292 \***************************************************/
3293 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3294
3295 "use strict";
3296 __webpack_require__.r(__webpack_exports__);
3297 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3298 /* harmony export */ "default": () => (/* binding */ UISpinner)
3299 /* harmony export */ });
3300 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3301 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3302 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3303
3304
3305
3306 var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3307 name: "SpinnerOuter",
3308 "class": "sxa9zrc",
3309 propsAsIs: false
3310 });
3311 var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3312 name: "SpinnerInner",
3313 "class": "s14430wa",
3314 propsAsIs: false
3315 });
3316 var _exp = /*#__PURE__*/function _exp() {
3317 return function (props) {
3318 return props.color;
3319 };
3320 };
3321 var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3322 name: "Circle",
3323 "class": "ct87ghk",
3324 propsAsIs: true,
3325 vars: {
3326 "ct87ghk-0": [_exp()]
3327 }
3328 });
3329 var _exp2 = /*#__PURE__*/function _exp2() {
3330 return function (props) {
3331 return props.color;
3332 };
3333 };
3334 var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3335 name: "AnimatedCircle",
3336 "class": "avili0h",
3337 propsAsIs: true,
3338 vars: {
3339 "avili0h-0": [_exp2()]
3340 }
3341 });
3342 function UISpinner(_ref) {
3343 var _ref$size = _ref.size,
3344 size = _ref$size === void 0 ? 20 : _ref$size;
3345 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, {
3346 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, {
3347 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
3348 height: size,
3349 width: size,
3350 viewBox: "0 0 50 50",
3351 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, {
3352 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM,
3353 cx: "25",
3354 cy: "25",
3355 r: "22.5"
3356 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, {
3357 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO,
3358 cx: "25",
3359 cy: "25",
3360 r: "22.5"
3361 })]
3362 })
3363 })
3364 });
3365 }
3366 __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");
3367
3368 /***/ }),
3369
3370 /***/ "./scripts/shared/UIComponents/colors.ts":
3371 /*!***********************************************!*\
3372 !*** ./scripts/shared/UIComponents/colors.ts ***!
3373 \***********************************************/
3374 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3375
3376 "use strict";
3377 __webpack_require__.r(__webpack_exports__);
3378 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3379 /* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO),
3380 /* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT),
3381 /* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM),
3382 /* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP),
3383 /* harmony export */ "LORAX": () => (/* binding */ LORAX),
3384 /* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT),
3385 /* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM),
3386 /* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN),
3387 /* harmony export */ "OLAF": () => (/* binding */ OLAF)
3388 /* harmony export */ });
3389 var CALYPSO = '#00a4bd';
3390 var CALYPSO_MEDIUM = '#7fd1de';
3391 var CALYPSO_LIGHT = '#e5f5f8';
3392 var LORAX = '#ff7a59';
3393 var OLAF = '#ffffff';
3394 var HEFFALUMP = '#425b76';
3395 var MARIGOLD_LIGHT = '#fef8f0';
3396 var MARIGOLD_MEDIUM = '#fae0b5';
3397 var OBSIDIAN = '#33475b';
3398
3399 /***/ }),
3400
3401 /***/ "./scripts/shared/enums/connectionStatus.ts":
3402 /*!**************************************************!*\
3403 !*** ./scripts/shared/enums/connectionStatus.ts ***!
3404 \**************************************************/
3405 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3406
3407 "use strict";
3408 __webpack_require__.r(__webpack_exports__);
3409 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3410 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3411 /* harmony export */ });
3412 var ConnectionStatus = {
3413 Connected: 'Connected',
3414 NotConnected: 'NotConnected'
3415 };
3416 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus);
3417
3418 /***/ }),
3419
3420 /***/ "./scripts/shared/enums/loadState.ts":
3421 /*!*******************************************!*\
3422 !*** ./scripts/shared/enums/loadState.ts ***!
3423 \*******************************************/
3424 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3425
3426 "use strict";
3427 __webpack_require__.r(__webpack_exports__);
3428 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3429 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3430 /* harmony export */ });
3431 var LoadState = {
3432 NotLoaded: 'NotLoaded',
3433 Loading: 'Loading',
3434 Loaded: 'Loaded',
3435 Idle: 'Idle',
3436 Failed: 'Failed'
3437 };
3438 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState);
3439
3440 /***/ }),
3441
3442 /***/ "./scripts/shared/types.ts":
3443 /*!*********************************!*\
3444 !*** ./scripts/shared/types.ts ***!
3445 \*********************************/
3446 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3447
3448 "use strict";
3449 __webpack_require__.r(__webpack_exports__);
3450 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3451 /* harmony export */ "ExcludedTemplateAvailabilityKeys": () => (/* binding */ ExcludedTemplateAvailabilityKeys),
3452 /* harmony export */ "HubSpotFormTemplateAvailabilityKeys": () => (/* binding */ HubSpotFormTemplateAvailabilityKeys),
3453 /* harmony export */ "TemplateLabels": () => (/* binding */ TemplateLabels),
3454 /* harmony export */ "TemplateValues": () => (/* binding */ TemplateValues)
3455 /* harmony export */ });
3456 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); }
3457 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; }
3458 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3459 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); }
3460 var HubSpotFormTemplateAvailabilityKeys;
3461 (function (HubSpotFormTemplateAvailabilityKeys) {
3462 HubSpotFormTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3463 HubSpotFormTemplateAvailabilityKeys["BLANK"] = "blank";
3464 HubSpotFormTemplateAvailabilityKeys["NEWSLETTER"] = "newsletter";
3465 HubSpotFormTemplateAvailabilityKeys["CONTACT_US"] = "contact-us";
3466 HubSpotFormTemplateAvailabilityKeys["EVENT_REGISTRATION"] = "event-registration";
3467 HubSpotFormTemplateAvailabilityKeys["TALK_TO_AN_EXPERT"] = "talk-to-an-expert";
3468 HubSpotFormTemplateAvailabilityKeys["BOOK_A_MEETING"] = "book-a-meeting";
3469 HubSpotFormTemplateAvailabilityKeys["GATED_CONTENT"] = "gated-content";
3470 HubSpotFormTemplateAvailabilityKeys["SUPPORT"] = "support";
3471 })(HubSpotFormTemplateAvailabilityKeys || (HubSpotFormTemplateAvailabilityKeys = {}));
3472 var ExcludedTemplateAvailabilityKeys;
3473 (function (ExcludedTemplateAvailabilityKeys) {
3474 ExcludedTemplateAvailabilityKeys["SUPPORT"] = "support";
3475 ExcludedTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3476 })(ExcludedTemplateAvailabilityKeys || (ExcludedTemplateAvailabilityKeys = {}));
3477 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');
3478 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');
3479
3480 /***/ }),
3481
3482 /***/ "./scripts/utils/appUtils.ts":
3483 /*!***********************************!*\
3484 !*** ./scripts/utils/appUtils.ts ***!
3485 \***********************************/
3486 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3487
3488 "use strict";
3489 __webpack_require__.r(__webpack_exports__);
3490 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3491 /* harmony export */ "initApp": () => (/* binding */ initApp),
3492 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
3493 /* harmony export */ });
3494 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
3495 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
3496 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3497
3498
3499 function initApp(initFn) {
3500 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
3501 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
3502 }
3503 function initAppOnReady(initFn) {
3504 function main() {
3505 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
3506 }
3507 initApp(main);
3508 }
3509
3510 /***/ }),
3511
3512 /***/ "./scripts/utils/backgroundAppUtils.ts":
3513 /*!*********************************************!*\
3514 !*** ./scripts/utils/backgroundAppUtils.ts ***!
3515 \*********************************************/
3516 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3517
3518 "use strict";
3519 __webpack_require__.r(__webpack_exports__);
3520 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3521 /* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp),
3522 /* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp)
3523 /* harmony export */ });
3524 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3525 /* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts");
3526 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
3527 /* harmony import */ var _embedderReady__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./embedderReady */ "./scripts/utils/embedderReady.ts");
3528
3529
3530
3531
3532 function initBackgroundApp(initFn) {
3533 function main() {
3534 if (Array.isArray(initFn)) {
3535 initFn.forEach(function (callback) {
3536 return callback();
3537 });
3538 } else {
3539 initFn();
3540 }
3541 }
3542 (0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main);
3543 }
3544 var getLeadinConfig = function getLeadinConfig() {
3545 return {
3546 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.leadinPluginVersion
3547 };
3548 };
3549 var getOrCreateBackgroundApp = function getOrCreateBackgroundApp() {
3550 var accessToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3551 var expiresIn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3552 if (window.LeadinBackgroundApp) {
3553 return window.LeadinBackgroundApp;
3554 }
3555 if (!(0,_embedderReady__WEBPACK_IMPORTED_MODULE_3__.isEmbedderReady)()) {
3556 return null;
3557 }
3558 var _window = window,
3559 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3560 IntegratedAppOptions = _window.IntegratedAppOptions;
3561 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);
3562 var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options);
3563 embedder.attachTo(document.body, false);
3564 embedder.setTokenRenewalCallback(_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__.fetchAccessToken);
3565 embedder.postStartAppMessage(); // lets the app know all data has been passed to it
3566 window.LeadinBackgroundApp = embedder;
3567 return window.LeadinBackgroundApp;
3568 };
3569
3570 /***/ }),
3571
3572 /***/ "./scripts/utils/embedderReady.ts":
3573 /*!****************************************!*\
3574 !*** ./scripts/utils/embedderReady.ts ***!
3575 \****************************************/
3576 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3577
3578 "use strict";
3579 __webpack_require__.r(__webpack_exports__);
3580 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3581 /* harmony export */ "isEmbedderReady": () => (/* binding */ isEmbedderReady),
3582 /* harmony export */ "reportEmbedderUnavailable": () => (/* binding */ reportEmbedderUnavailable),
3583 /* harmony export */ "whenEmbedderReady": () => (/* binding */ whenEmbedderReady)
3584 /* harmony export */ });
3585 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3586 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; }
3587 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; }
3588 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; }
3589 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3590 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); }
3591 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); }
3592
3593 var POLL_INTERVAL_MS = 250;
3594 var DEFAULT_TIMEOUT_MS = 15000;
3595 var EMBEDDER_SCRIPT_SELECTOR = 'script[src*="/integrated-app-embedder/"]';
3596 function isEmbedderReady() {
3597 var _window = window,
3598 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3599 IntegratedAppOptions = _window.IntegratedAppOptions;
3600 return !!IntegratedAppEmbedder && typeof IntegratedAppOptions === 'function';
3601 }
3602 function getEmbedderDiagnostics() {
3603 var scriptTag = document.querySelector(EMBEDDER_SCRIPT_SELECTOR);
3604 return {
3605 hasScriptTag: !!scriptTag,
3606 scriptSrc: scriptTag ? scriptTag.src : null,
3607 readyState: document.readyState,
3608 hasEmbedder: !!window.IntegratedAppEmbedder,
3609 typeofOptions: _typeof(window.IntegratedAppOptions)
3610 };
3611 }
3612 /**
3613 * The embedder script is a cross-origin script from js.hubspot.com, and nothing
3614 * makes the widgets wait for it: they read its globals off `window` the moment a
3615 * control renders. On sites where an asset pipeline defers it, or where the
3616 * editor is simply slow, the widget can lose that race and fail permanently even
3617 * though the script arrives seconds later.
3618 *
3619 * Resolves true as soon as the globals appear, or false once the wait is up.
3620 */
3621 function whenEmbedderReady() {
3622 var timeoutMs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_TIMEOUT_MS;
3623 var intervalId;
3624 var cancel = function cancel() {
3625 if (intervalId !== undefined) {
3626 window.clearInterval(intervalId);
3627 intervalId = undefined;
3628 }
3629 };
3630 var promise = new Promise(function (resolve) {
3631 if (isEmbedderReady()) {
3632 console.info('HubSpot plugin - embedder ready immediately');
3633 resolve(true);
3634 return;
3635 }
3636 var startedAt = Date.now();
3637 console.info("HubSpot plugin - waiting up to ".concat(timeoutMs, "ms for embedder script"), getEmbedderDiagnostics());
3638 intervalId = window.setInterval(function () {
3639 var waitedMs = Date.now() - startedAt;
3640 if (isEmbedderReady()) {
3641 cancel();
3642 console.info("HubSpot plugin - embedder ready after ".concat(waitedMs, "ms"));
3643 resolve(true);
3644 } else if (waitedMs >= timeoutMs) {
3645 cancel();
3646 resolve(false);
3647 }
3648 }, POLL_INTERVAL_MS);
3649 });
3650 return {
3651 promise: promise,
3652 cancel: cancel
3653 };
3654 }
3655 /**
3656 * Reports a give-up so these failures stop being invisible. Until now the widget
3657 * rendered its error box without telling anyone, so the only signal we had for
3658 * this whole class of problem came from unrelated admin pages.
3659 *
3660 * Uses captureException rather than captureMessage on purpose: Raven is
3661 * configured with a shouldSendCallback that drops any event whose culprit does
3662 * not match plugins/leadin/, and captureMessage does not attach a stack trace,
3663 * so it has no culprit to match on.
3664 */
3665 function reportEmbedderUnavailable(waitedMs) {
3666 var diagnostics = getEmbedderDiagnostics();
3667 console.error("HubSpot plugin - embedder unavailable after ".concat(waitedMs, "ms"), diagnostics);
3668 _lib_Raven__WEBPACK_IMPORTED_MODULE_0__["default"].captureException(new Error('Leadin embedder unavailable'), {
3669 fingerprint: ['EMBEDDER_UNAVAILABLE'],
3670 extra: _objectSpread({
3671 waitedMs: waitedMs
3672 }, diagnostics)
3673 });
3674 }
3675
3676 /***/ }),
3677
3678 /***/ "./scripts/utils/isRefreshTokenAvailable.ts":
3679 /*!**************************************************!*\
3680 !*** ./scripts/utils/isRefreshTokenAvailable.ts ***!
3681 \**************************************************/
3682 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3683
3684 "use strict";
3685 __webpack_require__.r(__webpack_exports__);
3686 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3687 /* harmony export */ "isRefreshTokenAvailable": () => (/* binding */ isRefreshTokenAvailable)
3688 /* harmony export */ });
3689 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3690
3691 function isRefreshTokenAvailable() {
3692 return _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.connectionStatus === 'Connected';
3693 }
3694
3695 /***/ }),
3696
3697 /***/ "./scripts/utils/queryParams.ts":
3698 /*!**************************************!*\
3699 !*** ./scripts/utils/queryParams.ts ***!
3700 \**************************************/
3701 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3702
3703 "use strict";
3704 __webpack_require__.r(__webpack_exports__);
3705 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3706 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
3707 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
3708 /* harmony export */ });
3709 function addQueryObjectToUrl(urlObject, queryParams) {
3710 Object.keys(queryParams).forEach(function (key) {
3711 urlObject.searchParams.append(key, queryParams[key]);
3712 });
3713 }
3714 function removeQueryParamFromLocation(key) {
3715 var location = new URL(window.location.href);
3716 location.searchParams["delete"](key);
3717 window.history.replaceState(null, '', location.href);
3718 }
3719
3720 /***/ }),
3721
3722 /***/ "./scripts/utils/useGetEmbedder.ts":
3723 /*!*****************************************!*\
3724 !*** ./scripts/utils/useGetEmbedder.ts ***!
3725 \*****************************************/
3726 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3727
3728 "use strict";
3729 __webpack_require__.r(__webpack_exports__);
3730 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3731 /* harmony export */ "useGetEmbedder": () => (/* binding */ useGetEmbedder)
3732 /* harmony export */ });
3733 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3734 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
3735 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
3736 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
3737 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
3738 /* harmony import */ var _backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
3739 /* harmony import */ var _isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRefreshTokenAvailable */ "./scripts/utils/isRefreshTokenAvailable.ts");
3740 /* harmony import */ var _embedderReady__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./embedderReady */ "./scripts/utils/embedderReady.ts");
3741 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
3742 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3743 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."); }
3744 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; } }
3745 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; }
3746 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; } }
3747 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
3748
3749
3750
3751
3752
3753
3754
3755
3756 function useGetEmbedder() {
3757 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3758 _useState2 = _slicedToArray(_useState, 2),
3759 embedder = _useState2[0],
3760 setEmbedder = _useState2[1];
3761 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3762 _useState4 = _slicedToArray(_useState3, 2),
3763 errorStatus = _useState4[0],
3764 setErrorStatus = _useState4[1];
3765 var cancelWaitRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
3766 var mountedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(true);
3767 var loadEmbedder = function loadEmbedder() {
3768 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_2__.fetchAccessToken)().then(function (_ref) {
3769 var accessToken = _ref.accessToken,
3770 expiresIn = _ref.expiresIn;
3771 if (!mountedRef.current) return;
3772 var startedAt = Date.now();
3773 var _whenEmbedderReady = (0,_embedderReady__WEBPACK_IMPORTED_MODULE_5__.whenEmbedderReady)(),
3774 promise = _whenEmbedderReady.promise,
3775 cancel = _whenEmbedderReady.cancel;
3776 cancelWaitRef.current = cancel;
3777 return promise.then(function (isReady) {
3778 cancelWaitRef.current = null;
3779 if (!mountedRef.current) return;
3780 var app = isReady ? (0,_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__.getOrCreateBackgroundApp)(accessToken, expiresIn) : null;
3781 if (app) {
3782 console.info('HubSpot plugin - embedder ready, rendering widget');
3783 setEmbedder(app);
3784 } else {
3785 (0,_embedderReady__WEBPACK_IMPORTED_MODULE_5__.reportEmbedderUnavailable)(Date.now() - startedAt);
3786 setErrorStatus(500);
3787 }
3788 });
3789 })["catch"](function (err) {
3790 if (!mountedRef.current) return;
3791 console.error('HubSpot plugin - access token request failed', err && err.status || 'no status');
3792 setErrorStatus(err && err.status || 500);
3793 });
3794 };
3795 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
3796 if ((0,_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__.isRefreshTokenAvailable)()) {
3797 loadEmbedder();
3798 }
3799 return function () {
3800 mountedRef.current = false;
3801 if (cancelWaitRef.current) {
3802 cancelWaitRef.current();
3803 cancelWaitRef.current = null;
3804 }
3805 };
3806 }, []);
3807 var errorElement = errorStatus !== null ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__["default"], {
3808 status: errorStatus,
3809 resetErrorState: function resetErrorState() {
3810 setErrorStatus(null);
3811 loadEmbedder();
3812 },
3813 errorInfo: {
3814 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Unable to load HubSpot', 'leadin'),
3815 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('There was a problem connecting to HubSpot. Please try again.', 'leadin'),
3816 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'leadin')
3817 }
3818 }) : null;
3819 return {
3820 embedder: embedder,
3821 errorElement: errorElement,
3822 isLoading: (0,_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_4__.isRefreshTokenAvailable)() && embedder === null && errorStatus === null
3823 };
3824 }
3825
3826 /***/ }),
3827
3828 /***/ "./scripts/utils/withMetaData.ts":
3829 /*!***************************************!*\
3830 !*** ./scripts/utils/withMetaData.ts ***!
3831 \***************************************/
3832 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3833
3834 "use strict";
3835 __webpack_require__.r(__webpack_exports__);
3836 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3837 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
3838 /* harmony export */ "isFullSiteEditor": () => (/* binding */ isFullSiteEditor)
3839 /* harmony export */ });
3840 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3841 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3842 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); }
3843 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; }
3844 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3845 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); }
3846
3847 // from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599
3848 var isFullSiteEditor = function isFullSiteEditor() {
3849 return _wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select && !!(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/edit-site');
3850 };
3851 var applyWithSelect = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)(function (select, props) {
3852 return {
3853 metaValue: select('core/editor').getEditedPostAttribute('meta')[props.metaKey]
3854 };
3855 });
3856 var applyWithDispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch)(function (dispatch, props) {
3857 return {
3858 setMetaValue: function setMetaValue(value) {
3859 dispatch('core/editor').editPost({
3860 meta: _defineProperty({}, props.metaKey, value)
3861 });
3862 }
3863 };
3864 });
3865 function apply(el) {
3866 return applyWithSelect(applyWithDispatch(el));
3867 }
3868 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);
3869
3870 /***/ }),
3871
3872 /***/ "./node_modules/is-what/dist/index.esm.js":
3873 /*!************************************************!*\
3874 !*** ./node_modules/is-what/dist/index.esm.js ***!
3875 \************************************************/
3876 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3877
3878 "use strict";
3879 __webpack_require__.r(__webpack_exports__);
3880 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3881 /* harmony export */ "getType": () => (/* binding */ getType),
3882 /* harmony export */ "isAnyObject": () => (/* binding */ isAnyObject),
3883 /* harmony export */ "isArray": () => (/* binding */ isArray),
3884 /* harmony export */ "isBlob": () => (/* binding */ isBlob),
3885 /* harmony export */ "isBoolean": () => (/* binding */ isBoolean),
3886 /* harmony export */ "isDate": () => (/* binding */ isDate),
3887 /* harmony export */ "isEmptyArray": () => (/* binding */ isEmptyArray),
3888 /* harmony export */ "isEmptyObject": () => (/* binding */ isEmptyObject),
3889 /* harmony export */ "isEmptyString": () => (/* binding */ isEmptyString),
3890 /* harmony export */ "isError": () => (/* binding */ isError),
3891 /* harmony export */ "isFile": () => (/* binding */ isFile),
3892 /* harmony export */ "isFullArray": () => (/* binding */ isFullArray),
3893 /* harmony export */ "isFullObject": () => (/* binding */ isFullObject),
3894 /* harmony export */ "isFullString": () => (/* binding */ isFullString),
3895 /* harmony export */ "isFunction": () => (/* binding */ isFunction),
3896 /* harmony export */ "isMap": () => (/* binding */ isMap),
3897 /* harmony export */ "isNaNValue": () => (/* binding */ isNaNValue),
3898 /* harmony export */ "isNull": () => (/* binding */ isNull),
3899 /* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined),
3900 /* harmony export */ "isNumber": () => (/* binding */ isNumber),
3901 /* harmony export */ "isObject": () => (/* binding */ isObject),
3902 /* harmony export */ "isObjectLike": () => (/* binding */ isObjectLike),
3903 /* harmony export */ "isOneOf": () => (/* binding */ isOneOf),
3904 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
3905 /* harmony export */ "isPrimitive": () => (/* binding */ isPrimitive),
3906 /* harmony export */ "isPromise": () => (/* binding */ isPromise),
3907 /* harmony export */ "isRegExp": () => (/* binding */ isRegExp),
3908 /* harmony export */ "isSet": () => (/* binding */ isSet),
3909 /* harmony export */ "isString": () => (/* binding */ isString),
3910 /* harmony export */ "isSymbol": () => (/* binding */ isSymbol),
3911 /* harmony export */ "isType": () => (/* binding */ isType),
3912 /* harmony export */ "isUndefined": () => (/* binding */ isUndefined),
3913 /* harmony export */ "isWeakMap": () => (/* binding */ isWeakMap),
3914 /* harmony export */ "isWeakSet": () => (/* binding */ isWeakSet)
3915 /* harmony export */ });
3916 /**
3917 * Returns the object type of the given payload
3918 *
3919 * @param {*} payload
3920 * @returns {string}
3921 */
3922 function getType(payload) {
3923 return Object.prototype.toString.call(payload).slice(8, -1);
3924 }
3925 /**
3926 * Returns whether the payload is undefined
3927 *
3928 * @param {*} payload
3929 * @returns {payload is undefined}
3930 */
3931 function isUndefined(payload) {
3932 return getType(payload) === 'Undefined';
3933 }
3934 /**
3935 * Returns whether the payload is null
3936 *
3937 * @param {*} payload
3938 * @returns {payload is null}
3939 */
3940 function isNull(payload) {
3941 return getType(payload) === 'Null';
3942 }
3943 /**
3944 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3945 *
3946 * @param {*} payload
3947 * @returns {payload is PlainObject}
3948 */
3949 function isPlainObject(payload) {
3950 if (getType(payload) !== 'Object')
3951 return false;
3952 return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
3953 }
3954 /**
3955 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3956 *
3957 * @param {*} payload
3958 * @returns {payload is PlainObject}
3959 */
3960 function isObject(payload) {
3961 return isPlainObject(payload);
3962 }
3963 /**
3964 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3965 *
3966 * @param {*} payload
3967 * @returns {payload is { [K in any]: never }}
3968 */
3969 function isEmptyObject(payload) {
3970 return isPlainObject(payload) && Object.keys(payload).length === 0;
3971 }
3972 /**
3973 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3974 *
3975 * @param {*} payload
3976 * @returns {payload is PlainObject}
3977 */
3978 function isFullObject(payload) {
3979 return isPlainObject(payload) && Object.keys(payload).length > 0;
3980 }
3981 /**
3982 * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
3983 *
3984 * @param {*} payload
3985 * @returns {payload is PlainObject}
3986 */
3987 function isAnyObject(payload) {
3988 return getType(payload) === 'Object';
3989 }
3990 /**
3991 * Returns whether the payload is an object like a type passed in < >
3992 *
3993 * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
3994 *
3995 * @template T this must be passed in < >
3996 * @param {*} payload
3997 * @returns {payload is T}
3998 */
3999 function isObjectLike(payload) {
4000 return isAnyObject(payload);
4001 }
4002 /**
4003 * Returns whether the payload is a function (regular or async)
4004 *
4005 * @param {*} payload
4006 * @returns {payload is AnyFunction}
4007 */
4008 function isFunction(payload) {
4009 return typeof payload === 'function';
4010 }
4011 /**
4012 * Returns whether the payload is an array
4013 *
4014 * @param {any} payload
4015 * @returns {payload is any[]}
4016 */
4017 function isArray(payload) {
4018 return getType(payload) === 'Array';
4019 }
4020 /**
4021 * Returns whether the payload is a an array with at least 1 item
4022 *
4023 * @param {*} payload
4024 * @returns {payload is any[]}
4025 */
4026 function isFullArray(payload) {
4027 return isArray(payload) && payload.length > 0;
4028 }
4029 /**
4030 * Returns whether the payload is a an empty array
4031 *
4032 * @param {*} payload
4033 * @returns {payload is []}
4034 */
4035 function isEmptyArray(payload) {
4036 return isArray(payload) && payload.length === 0;
4037 }
4038 /**
4039 * Returns whether the payload is a string
4040 *
4041 * @param {*} payload
4042 * @returns {payload is string}
4043 */
4044 function isString(payload) {
4045 return getType(payload) === 'String';
4046 }
4047 /**
4048 * Returns whether the payload is a string, BUT returns false for ''
4049 *
4050 * @param {*} payload
4051 * @returns {payload is string}
4052 */
4053 function isFullString(payload) {
4054 return isString(payload) && payload !== '';
4055 }
4056 /**
4057 * Returns whether the payload is ''
4058 *
4059 * @param {*} payload
4060 * @returns {payload is string}
4061 */
4062 function isEmptyString(payload) {
4063 return payload === '';
4064 }
4065 /**
4066 * Returns whether the payload is a number (but not NaN)
4067 *
4068 * This will return `false` for `NaN`!!
4069 *
4070 * @param {*} payload
4071 * @returns {payload is number}
4072 */
4073 function isNumber(payload) {
4074 return getType(payload) === 'Number' && !isNaN(payload);
4075 }
4076 /**
4077 * Returns whether the payload is a boolean
4078 *
4079 * @param {*} payload
4080 * @returns {payload is boolean}
4081 */
4082 function isBoolean(payload) {
4083 return getType(payload) === 'Boolean';
4084 }
4085 /**
4086 * Returns whether the payload is a regular expression (RegExp)
4087 *
4088 * @param {*} payload
4089 * @returns {payload is RegExp}
4090 */
4091 function isRegExp(payload) {
4092 return getType(payload) === 'RegExp';
4093 }
4094 /**
4095 * Returns whether the payload is a Map
4096 *
4097 * @param {*} payload
4098 * @returns {payload is Map<any, any>}
4099 */
4100 function isMap(payload) {
4101 return getType(payload) === 'Map';
4102 }
4103 /**
4104 * Returns whether the payload is a WeakMap
4105 *
4106 * @param {*} payload
4107 * @returns {payload is WeakMap<any, any>}
4108 */
4109 function isWeakMap(payload) {
4110 return getType(payload) === 'WeakMap';
4111 }
4112 /**
4113 * Returns whether the payload is a Set
4114 *
4115 * @param {*} payload
4116 * @returns {payload is Set<any>}
4117 */
4118 function isSet(payload) {
4119 return getType(payload) === 'Set';
4120 }
4121 /**
4122 * Returns whether the payload is a WeakSet
4123 *
4124 * @param {*} payload
4125 * @returns {payload is WeakSet<any>}
4126 */
4127 function isWeakSet(payload) {
4128 return getType(payload) === 'WeakSet';
4129 }
4130 /**
4131 * Returns whether the payload is a Symbol
4132 *
4133 * @param {*} payload
4134 * @returns {payload is symbol}
4135 */
4136 function isSymbol(payload) {
4137 return getType(payload) === 'Symbol';
4138 }
4139 /**
4140 * Returns whether the payload is a Date, and that the date is valid
4141 *
4142 * @param {*} payload
4143 * @returns {payload is Date}
4144 */
4145 function isDate(payload) {
4146 return getType(payload) === 'Date' && !isNaN(payload);
4147 }
4148 /**
4149 * Returns whether the payload is a Blob
4150 *
4151 * @param {*} payload
4152 * @returns {payload is Blob}
4153 */
4154 function isBlob(payload) {
4155 return getType(payload) === 'Blob';
4156 }
4157 /**
4158 * Returns whether the payload is a File
4159 *
4160 * @param {*} payload
4161 * @returns {payload is File}
4162 */
4163 function isFile(payload) {
4164 return getType(payload) === 'File';
4165 }
4166 /**
4167 * Returns whether the payload is a Promise
4168 *
4169 * @param {*} payload
4170 * @returns {payload is Promise<any>}
4171 */
4172 function isPromise(payload) {
4173 return getType(payload) === 'Promise';
4174 }
4175 /**
4176 * Returns whether the payload is an Error
4177 *
4178 * @param {*} payload
4179 * @returns {payload is Error}
4180 */
4181 function isError(payload) {
4182 return getType(payload) === 'Error';
4183 }
4184 /**
4185 * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
4186 *
4187 * @param {*} payload
4188 * @returns {payload is typeof NaN}
4189 */
4190 function isNaNValue(payload) {
4191 return getType(payload) === 'Number' && isNaN(payload);
4192 }
4193 /**
4194 * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
4195 *
4196 * @param {*} payload
4197 * @returns {(payload is boolean | null | undefined | number | string | symbol)}
4198 */
4199 function isPrimitive(payload) {
4200 return (isBoolean(payload) ||
4201 isNull(payload) ||
4202 isUndefined(payload) ||
4203 isNumber(payload) ||
4204 isString(payload) ||
4205 isSymbol(payload));
4206 }
4207 /**
4208 * Returns true whether the payload is null or undefined
4209 *
4210 * @param {*} payload
4211 * @returns {(payload is null | undefined)}
4212 */
4213 var isNullOrUndefined = isOneOf(isNull, isUndefined);
4214 function isOneOf(a, b, c, d, e) {
4215 return function (value) {
4216 return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));
4217 };
4218 }
4219 /**
4220 * Does a generic check to check that the given payload is of a given type.
4221 * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
4222 * It will, however, differentiate between object and null
4223 *
4224 * @template T
4225 * @param {*} payload
4226 * @param {T} type
4227 * @throws {TypeError} Will throw type error if type is an invalid type
4228 * @returns {payload is T}
4229 */
4230 function isType(payload, type) {
4231 if (!(type instanceof Function)) {
4232 throw new TypeError('Type must be a function');
4233 }
4234 if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
4235 throw new TypeError('Type is not a class');
4236 }
4237 // Classes usually have names (as functions usually have names)
4238 var name = type.name;
4239 return getType(payload) === name || Boolean(payload && payload.constructor === type);
4240 }
4241
4242
4243
4244
4245 /***/ }),
4246
4247 /***/ "./node_modules/lodash/_Symbol.js":
4248 /*!****************************************!*\
4249 !*** ./node_modules/lodash/_Symbol.js ***!
4250 \****************************************/
4251 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4252
4253 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4254
4255 /** Built-in value references. */
4256 var Symbol = root.Symbol;
4257
4258 module.exports = Symbol;
4259
4260
4261 /***/ }),
4262
4263 /***/ "./node_modules/lodash/_baseGetTag.js":
4264 /*!********************************************!*\
4265 !*** ./node_modules/lodash/_baseGetTag.js ***!
4266 \********************************************/
4267 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4268
4269 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
4270 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
4271 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
4272
4273 /** `Object#toString` result references. */
4274 var nullTag = '[object Null]',
4275 undefinedTag = '[object Undefined]';
4276
4277 /** Built-in value references. */
4278 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4279
4280 /**
4281 * The base implementation of `getTag` without fallbacks for buggy environments.
4282 *
4283 * @private
4284 * @param {*} value The value to query.
4285 * @returns {string} Returns the `toStringTag`.
4286 */
4287 function baseGetTag(value) {
4288 if (value == null) {
4289 return value === undefined ? undefinedTag : nullTag;
4290 }
4291 return (symToStringTag && symToStringTag in Object(value))
4292 ? getRawTag(value)
4293 : objectToString(value);
4294 }
4295
4296 module.exports = baseGetTag;
4297
4298
4299 /***/ }),
4300
4301 /***/ "./node_modules/lodash/_baseTrim.js":
4302 /*!******************************************!*\
4303 !*** ./node_modules/lodash/_baseTrim.js ***!
4304 \******************************************/
4305 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4306
4307 var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
4308
4309 /** Used to match leading whitespace. */
4310 var reTrimStart = /^\s+/;
4311
4312 /**
4313 * The base implementation of `_.trim`.
4314 *
4315 * @private
4316 * @param {string} string The string to trim.
4317 * @returns {string} Returns the trimmed string.
4318 */
4319 function baseTrim(string) {
4320 return string
4321 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
4322 : string;
4323 }
4324
4325 module.exports = baseTrim;
4326
4327
4328 /***/ }),
4329
4330 /***/ "./node_modules/lodash/_freeGlobal.js":
4331 /*!********************************************!*\
4332 !*** ./node_modules/lodash/_freeGlobal.js ***!
4333 \********************************************/
4334 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4335
4336 /** Detect free variable `global` from Node.js. */
4337 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
4338
4339 module.exports = freeGlobal;
4340
4341
4342 /***/ }),
4343
4344 /***/ "./node_modules/lodash/_getRawTag.js":
4345 /*!*******************************************!*\
4346 !*** ./node_modules/lodash/_getRawTag.js ***!
4347 \*******************************************/
4348 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4349
4350 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
4351
4352 /** Used for built-in method references. */
4353 var objectProto = Object.prototype;
4354
4355 /** Used to check objects for own properties. */
4356 var hasOwnProperty = objectProto.hasOwnProperty;
4357
4358 /**
4359 * Used to resolve the
4360 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4361 * of values.
4362 */
4363 var nativeObjectToString = objectProto.toString;
4364
4365 /** Built-in value references. */
4366 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4367
4368 /**
4369 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
4370 *
4371 * @private
4372 * @param {*} value The value to query.
4373 * @returns {string} Returns the raw `toStringTag`.
4374 */
4375 function getRawTag(value) {
4376 var isOwn = hasOwnProperty.call(value, symToStringTag),
4377 tag = value[symToStringTag];
4378
4379 try {
4380 value[symToStringTag] = undefined;
4381 var unmasked = true;
4382 } catch (e) {}
4383
4384 var result = nativeObjectToString.call(value);
4385 if (unmasked) {
4386 if (isOwn) {
4387 value[symToStringTag] = tag;
4388 } else {
4389 delete value[symToStringTag];
4390 }
4391 }
4392 return result;
4393 }
4394
4395 module.exports = getRawTag;
4396
4397
4398 /***/ }),
4399
4400 /***/ "./node_modules/lodash/_objectToString.js":
4401 /*!************************************************!*\
4402 !*** ./node_modules/lodash/_objectToString.js ***!
4403 \************************************************/
4404 /***/ ((module) => {
4405
4406 /** Used for built-in method references. */
4407 var objectProto = Object.prototype;
4408
4409 /**
4410 * Used to resolve the
4411 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4412 * of values.
4413 */
4414 var nativeObjectToString = objectProto.toString;
4415
4416 /**
4417 * Converts `value` to a string using `Object.prototype.toString`.
4418 *
4419 * @private
4420 * @param {*} value The value to convert.
4421 * @returns {string} Returns the converted string.
4422 */
4423 function objectToString(value) {
4424 return nativeObjectToString.call(value);
4425 }
4426
4427 module.exports = objectToString;
4428
4429
4430 /***/ }),
4431
4432 /***/ "./node_modules/lodash/_root.js":
4433 /*!**************************************!*\
4434 !*** ./node_modules/lodash/_root.js ***!
4435 \**************************************/
4436 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4437
4438 var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
4439
4440 /** Detect free variable `self`. */
4441 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4442
4443 /** Used as a reference to the global object. */
4444 var root = freeGlobal || freeSelf || Function('return this')();
4445
4446 module.exports = root;
4447
4448
4449 /***/ }),
4450
4451 /***/ "./node_modules/lodash/_trimmedEndIndex.js":
4452 /*!*************************************************!*\
4453 !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
4454 \*************************************************/
4455 /***/ ((module) => {
4456
4457 /** Used to match a single whitespace character. */
4458 var reWhitespace = /\s/;
4459
4460 /**
4461 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
4462 * character of `string`.
4463 *
4464 * @private
4465 * @param {string} string The string to inspect.
4466 * @returns {number} Returns the index of the last non-whitespace character.
4467 */
4468 function trimmedEndIndex(string) {
4469 var index = string.length;
4470
4471 while (index-- && reWhitespace.test(string.charAt(index))) {}
4472 return index;
4473 }
4474
4475 module.exports = trimmedEndIndex;
4476
4477
4478 /***/ }),
4479
4480 /***/ "./node_modules/lodash/debounce.js":
4481 /*!*****************************************!*\
4482 !*** ./node_modules/lodash/debounce.js ***!
4483 \*****************************************/
4484 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4485
4486 var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4487 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
4488 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
4489
4490 /** Error message constants. */
4491 var FUNC_ERROR_TEXT = 'Expected a function';
4492
4493 /* Built-in method references for those with the same name as other `lodash` methods. */
4494 var nativeMax = Math.max,
4495 nativeMin = Math.min;
4496
4497 /**
4498 * Creates a debounced function that delays invoking `func` until after `wait`
4499 * milliseconds have elapsed since the last time the debounced function was
4500 * invoked. The debounced function comes with a `cancel` method to cancel
4501 * delayed `func` invocations and a `flush` method to immediately invoke them.
4502 * Provide `options` to indicate whether `func` should be invoked on the
4503 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
4504 * with the last arguments provided to the debounced function. Subsequent
4505 * calls to the debounced function return the result of the last `func`
4506 * invocation.
4507 *
4508 * **Note:** If `leading` and `trailing` options are `true`, `func` is
4509 * invoked on the trailing edge of the timeout only if the debounced function
4510 * is invoked more than once during the `wait` timeout.
4511 *
4512 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
4513 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
4514 *
4515 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
4516 * for details over the differences between `_.debounce` and `_.throttle`.
4517 *
4518 * @static
4519 * @memberOf _
4520 * @since 0.1.0
4521 * @category Function
4522 * @param {Function} func The function to debounce.
4523 * @param {number} [wait=0] The number of milliseconds to delay.
4524 * @param {Object} [options={}] The options object.
4525 * @param {boolean} [options.leading=false]
4526 * Specify invoking on the leading edge of the timeout.
4527 * @param {number} [options.maxWait]
4528 * The maximum time `func` is allowed to be delayed before it's invoked.
4529 * @param {boolean} [options.trailing=true]
4530 * Specify invoking on the trailing edge of the timeout.
4531 * @returns {Function} Returns the new debounced function.
4532 * @example
4533 *
4534 * // Avoid costly calculations while the window size is in flux.
4535 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
4536 *
4537 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
4538 * jQuery(element).on('click', _.debounce(sendMail, 300, {
4539 * 'leading': true,
4540 * 'trailing': false
4541 * }));
4542 *
4543 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
4544 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
4545 * var source = new EventSource('/stream');
4546 * jQuery(source).on('message', debounced);
4547 *
4548 * // Cancel the trailing debounced invocation.
4549 * jQuery(window).on('popstate', debounced.cancel);
4550 */
4551 function debounce(func, wait, options) {
4552 var lastArgs,
4553 lastThis,
4554 maxWait,
4555 result,
4556 timerId,
4557 lastCallTime,
4558 lastInvokeTime = 0,
4559 leading = false,
4560 maxing = false,
4561 trailing = true;
4562
4563 if (typeof func != 'function') {
4564 throw new TypeError(FUNC_ERROR_TEXT);
4565 }
4566 wait = toNumber(wait) || 0;
4567 if (isObject(options)) {
4568 leading = !!options.leading;
4569 maxing = 'maxWait' in options;
4570 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
4571 trailing = 'trailing' in options ? !!options.trailing : trailing;
4572 }
4573
4574 function invokeFunc(time) {
4575 var args = lastArgs,
4576 thisArg = lastThis;
4577
4578 lastArgs = lastThis = undefined;
4579 lastInvokeTime = time;
4580 result = func.apply(thisArg, args);
4581 return result;
4582 }
4583
4584 function leadingEdge(time) {
4585 // Reset any `maxWait` timer.
4586 lastInvokeTime = time;
4587 // Start the timer for the trailing edge.
4588 timerId = setTimeout(timerExpired, wait);
4589 // Invoke the leading edge.
4590 return leading ? invokeFunc(time) : result;
4591 }
4592
4593 function remainingWait(time) {
4594 var timeSinceLastCall = time - lastCallTime,
4595 timeSinceLastInvoke = time - lastInvokeTime,
4596 timeWaiting = wait - timeSinceLastCall;
4597
4598 return maxing
4599 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
4600 : timeWaiting;
4601 }
4602
4603 function shouldInvoke(time) {
4604 var timeSinceLastCall = time - lastCallTime,
4605 timeSinceLastInvoke = time - lastInvokeTime;
4606
4607 // Either this is the first call, activity has stopped and we're at the
4608 // trailing edge, the system time has gone backwards and we're treating
4609 // it as the trailing edge, or we've hit the `maxWait` limit.
4610 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
4611 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
4612 }
4613
4614 function timerExpired() {
4615 var time = now();
4616 if (shouldInvoke(time)) {
4617 return trailingEdge(time);
4618 }
4619 // Restart the timer.
4620 timerId = setTimeout(timerExpired, remainingWait(time));
4621 }
4622
4623 function trailingEdge(time) {
4624 timerId = undefined;
4625
4626 // Only invoke if we have `lastArgs` which means `func` has been
4627 // debounced at least once.
4628 if (trailing && lastArgs) {
4629 return invokeFunc(time);
4630 }
4631 lastArgs = lastThis = undefined;
4632 return result;
4633 }
4634
4635 function cancel() {
4636 if (timerId !== undefined) {
4637 clearTimeout(timerId);
4638 }
4639 lastInvokeTime = 0;
4640 lastArgs = lastCallTime = lastThis = timerId = undefined;
4641 }
4642
4643 function flush() {
4644 return timerId === undefined ? result : trailingEdge(now());
4645 }
4646
4647 function debounced() {
4648 var time = now(),
4649 isInvoking = shouldInvoke(time);
4650
4651 lastArgs = arguments;
4652 lastThis = this;
4653 lastCallTime = time;
4654
4655 if (isInvoking) {
4656 if (timerId === undefined) {
4657 return leadingEdge(lastCallTime);
4658 }
4659 if (maxing) {
4660 // Handle invocations in a tight loop.
4661 clearTimeout(timerId);
4662 timerId = setTimeout(timerExpired, wait);
4663 return invokeFunc(lastCallTime);
4664 }
4665 }
4666 if (timerId === undefined) {
4667 timerId = setTimeout(timerExpired, wait);
4668 }
4669 return result;
4670 }
4671 debounced.cancel = cancel;
4672 debounced.flush = flush;
4673 return debounced;
4674 }
4675
4676 module.exports = debounce;
4677
4678
4679 /***/ }),
4680
4681 /***/ "./node_modules/lodash/isObject.js":
4682 /*!*****************************************!*\
4683 !*** ./node_modules/lodash/isObject.js ***!
4684 \*****************************************/
4685 /***/ ((module) => {
4686
4687 /**
4688 * Checks if `value` is the
4689 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4690 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4691 *
4692 * @static
4693 * @memberOf _
4694 * @since 0.1.0
4695 * @category Lang
4696 * @param {*} value The value to check.
4697 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4698 * @example
4699 *
4700 * _.isObject({});
4701 * // => true
4702 *
4703 * _.isObject([1, 2, 3]);
4704 * // => true
4705 *
4706 * _.isObject(_.noop);
4707 * // => true
4708 *
4709 * _.isObject(null);
4710 * // => false
4711 */
4712 function isObject(value) {
4713 var type = typeof value;
4714 return value != null && (type == 'object' || type == 'function');
4715 }
4716
4717 module.exports = isObject;
4718
4719
4720 /***/ }),
4721
4722 /***/ "./node_modules/lodash/isObjectLike.js":
4723 /*!*********************************************!*\
4724 !*** ./node_modules/lodash/isObjectLike.js ***!
4725 \*********************************************/
4726 /***/ ((module) => {
4727
4728 /**
4729 * Checks if `value` is object-like. A value is object-like if it's not `null`
4730 * and has a `typeof` result of "object".
4731 *
4732 * @static
4733 * @memberOf _
4734 * @since 4.0.0
4735 * @category Lang
4736 * @param {*} value The value to check.
4737 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4738 * @example
4739 *
4740 * _.isObjectLike({});
4741 * // => true
4742 *
4743 * _.isObjectLike([1, 2, 3]);
4744 * // => true
4745 *
4746 * _.isObjectLike(_.noop);
4747 * // => false
4748 *
4749 * _.isObjectLike(null);
4750 * // => false
4751 */
4752 function isObjectLike(value) {
4753 return value != null && typeof value == 'object';
4754 }
4755
4756 module.exports = isObjectLike;
4757
4758
4759 /***/ }),
4760
4761 /***/ "./node_modules/lodash/isSymbol.js":
4762 /*!*****************************************!*\
4763 !*** ./node_modules/lodash/isSymbol.js ***!
4764 \*****************************************/
4765 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4766
4767 var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
4768 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
4769
4770 /** `Object#toString` result references. */
4771 var symbolTag = '[object Symbol]';
4772
4773 /**
4774 * Checks if `value` is classified as a `Symbol` primitive or object.
4775 *
4776 * @static
4777 * @memberOf _
4778 * @since 4.0.0
4779 * @category Lang
4780 * @param {*} value The value to check.
4781 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4782 * @example
4783 *
4784 * _.isSymbol(Symbol.iterator);
4785 * // => true
4786 *
4787 * _.isSymbol('abc');
4788 * // => false
4789 */
4790 function isSymbol(value) {
4791 return typeof value == 'symbol' ||
4792 (isObjectLike(value) && baseGetTag(value) == symbolTag);
4793 }
4794
4795 module.exports = isSymbol;
4796
4797
4798 /***/ }),
4799
4800 /***/ "./node_modules/lodash/now.js":
4801 /*!************************************!*\
4802 !*** ./node_modules/lodash/now.js ***!
4803 \************************************/
4804 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4805
4806 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4807
4808 /**
4809 * Gets the timestamp of the number of milliseconds that have elapsed since
4810 * the Unix epoch (1 January 1970 00:00:00 UTC).
4811 *
4812 * @static
4813 * @memberOf _
4814 * @since 2.4.0
4815 * @category Date
4816 * @returns {number} Returns the timestamp.
4817 * @example
4818 *
4819 * _.defer(function(stamp) {
4820 * console.log(_.now() - stamp);
4821 * }, _.now());
4822 * // => Logs the number of milliseconds it took for the deferred invocation.
4823 */
4824 var now = function() {
4825 return root.Date.now();
4826 };
4827
4828 module.exports = now;
4829
4830
4831 /***/ }),
4832
4833 /***/ "./node_modules/lodash/toNumber.js":
4834 /*!*****************************************!*\
4835 !*** ./node_modules/lodash/toNumber.js ***!
4836 \*****************************************/
4837 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4838
4839 var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
4840 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4841 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
4842
4843 /** Used as references for various `Number` constants. */
4844 var NAN = 0 / 0;
4845
4846 /** Used to detect bad signed hexadecimal string values. */
4847 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
4848
4849 /** Used to detect binary string values. */
4850 var reIsBinary = /^0b[01]+$/i;
4851
4852 /** Used to detect octal string values. */
4853 var reIsOctal = /^0o[0-7]+$/i;
4854
4855 /** Built-in method references without a dependency on `root`. */
4856 var freeParseInt = parseInt;
4857
4858 /**
4859 * Converts `value` to a number.
4860 *
4861 * @static
4862 * @memberOf _
4863 * @since 4.0.0
4864 * @category Lang
4865 * @param {*} value The value to process.
4866 * @returns {number} Returns the number.
4867 * @example
4868 *
4869 * _.toNumber(3.2);
4870 * // => 3.2
4871 *
4872 * _.toNumber(Number.MIN_VALUE);
4873 * // => 5e-324
4874 *
4875 * _.toNumber(Infinity);
4876 * // => Infinity
4877 *
4878 * _.toNumber('3.2');
4879 * // => 3.2
4880 */
4881 function toNumber(value) {
4882 if (typeof value == 'number') {
4883 return value;
4884 }
4885 if (isSymbol(value)) {
4886 return NAN;
4887 }
4888 if (isObject(value)) {
4889 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
4890 value = isObject(other) ? (other + '') : other;
4891 }
4892 if (typeof value != 'string') {
4893 return value === 0 ? value : +value;
4894 }
4895 value = baseTrim(value);
4896 var isBinary = reIsBinary.test(value);
4897 return (isBinary || reIsOctal.test(value))
4898 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
4899 : (reIsBadHex.test(value) ? NAN : +value);
4900 }
4901
4902 module.exports = toNumber;
4903
4904
4905 /***/ }),
4906
4907 /***/ "./node_modules/memoize-one/dist/memoize-one.esm.js":
4908 /*!**********************************************************!*\
4909 !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***!
4910 \**********************************************************/
4911 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4912
4913 "use strict";
4914 __webpack_require__.r(__webpack_exports__);
4915 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4916 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4917 /* harmony export */ });
4918 var safeIsNaN = Number.isNaN ||
4919 function ponyfill(value) {
4920 return typeof value === 'number' && value !== value;
4921 };
4922 function isEqual(first, second) {
4923 if (first === second) {
4924 return true;
4925 }
4926 if (safeIsNaN(first) && safeIsNaN(second)) {
4927 return true;
4928 }
4929 return false;
4930 }
4931 function areInputsEqual(newInputs, lastInputs) {
4932 if (newInputs.length !== lastInputs.length) {
4933 return false;
4934 }
4935 for (var i = 0; i < newInputs.length; i++) {
4936 if (!isEqual(newInputs[i], lastInputs[i])) {
4937 return false;
4938 }
4939 }
4940 return true;
4941 }
4942
4943 function memoizeOne(resultFn, isEqual) {
4944 if (isEqual === void 0) { isEqual = areInputsEqual; }
4945 var lastThis;
4946 var lastArgs = [];
4947 var lastResult;
4948 var calledOnce = false;
4949 function memoized() {
4950 var newArgs = [];
4951 for (var _i = 0; _i < arguments.length; _i++) {
4952 newArgs[_i] = arguments[_i];
4953 }
4954 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
4955 return lastResult;
4956 }
4957 lastResult = resultFn.apply(this, newArgs);
4958 calledOnce = true;
4959 lastThis = this;
4960 lastArgs = newArgs;
4961 return lastResult;
4962 }
4963 return memoized;
4964 }
4965
4966 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeOne);
4967
4968
4969 /***/ }),
4970
4971 /***/ "./node_modules/merge-anything/dist/index.esm.js":
4972 /*!*******************************************************!*\
4973 !*** ./node_modules/merge-anything/dist/index.esm.js ***!
4974 \*******************************************************/
4975 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4976
4977 "use strict";
4978 __webpack_require__.r(__webpack_exports__);
4979 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4980 /* harmony export */ "concatArrays": () => (/* binding */ concatArrays),
4981 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4982 /* harmony export */ "merge": () => (/* binding */ merge)
4983 /* harmony export */ });
4984 /* harmony import */ var is_what__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-what */ "./node_modules/is-what/dist/index.esm.js");
4985
4986
4987 /*! *****************************************************************************
4988 Copyright (c) Microsoft Corporation. All rights reserved.
4989 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4990 this file except in compliance with the License. You may obtain a copy of the
4991 License at http://www.apache.org/licenses/LICENSE-2.0
4992
4993 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4994 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
4995 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
4996 MERCHANTABLITY OR NON-INFRINGEMENT.
4997
4998 See the Apache Version 2.0 License for specific language governing permissions
4999 and limitations under the License.
5000 ***************************************************************************** */
5001
5002 function __spreadArrays() {
5003 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
5004 for (var r = Array(s), k = 0, i = 0; i < il; i++)
5005 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5006 r[k] = a[j];
5007 return r;
5008 }
5009
5010 function assignProp(carry, key, newVal, originalObject) {
5011 var propType = originalObject.propertyIsEnumerable(key)
5012 ? 'enumerable'
5013 : 'nonenumerable';
5014 if (propType === 'enumerable')
5015 carry[key] = newVal;
5016 if (propType === 'nonenumerable') {
5017 Object.defineProperty(carry, key, {
5018 value: newVal,
5019 enumerable: false,
5020 writable: true,
5021 configurable: true
5022 });
5023 }
5024 }
5025 function mergeRecursively(origin, newComer, extensions) {
5026 // work directly on newComer if its not an object
5027 if (!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newComer)) {
5028 // extend merge rules
5029 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
5030 extensions.forEach(function (extend) {
5031 newComer = extend(origin, newComer);
5032 });
5033 }
5034 return newComer;
5035 }
5036 // define newObject to merge all values upon
5037 var newObject = {};
5038 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin)) {
5039 var props_1 = Object.getOwnPropertyNames(origin);
5040 var symbols_1 = Object.getOwnPropertySymbols(origin);
5041 newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {
5042 // @ts-ignore
5043 var targetVal = origin[key];
5044 if ((!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||
5045 ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {
5046 assignProp(carry, key, targetVal, origin);
5047 }
5048 return carry;
5049 }, {});
5050 }
5051 var props = Object.getOwnPropertyNames(newComer);
5052 var symbols = Object.getOwnPropertySymbols(newComer);
5053 var result = __spreadArrays(props, symbols).reduce(function (carry, key) {
5054 // re-define the origin and newComer as targetVal and newVal
5055 var newVal = newComer[key];
5056 var targetVal = ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin))
5057 // @ts-ignore
5058 ? origin[key]
5059 : undefined;
5060 // extend merge rules
5061 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
5062 extensions.forEach(function (extend) {
5063 newVal = extend(targetVal, newVal);
5064 });
5065 }
5066 // When newVal is an object do the merge recursively
5067 if (targetVal !== undefined && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newVal)) {
5068 newVal = mergeRecursively(targetVal, newVal, extensions);
5069 }
5070 assignProp(carry, key, newVal, newComer);
5071 return carry;
5072 }, newObject);
5073 return result;
5074 }
5075 /**
5076 * Merge anything recursively.
5077 * Objects get merged, special objects (classes etc.) are re-assigned "as is".
5078 * Basic types overwrite objects or other basic types.
5079 *
5080 * @param {(IConfig | any)} origin
5081 * @param {...any[]} newComers
5082 * @returns the result
5083 */
5084 function merge(origin) {
5085 var newComers = [];
5086 for (var _i = 1; _i < arguments.length; _i++) {
5087 newComers[_i - 1] = arguments[_i];
5088 }
5089 var extensions = null;
5090 var base = origin;
5091 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin) && origin.extensions && Object.keys(origin).length === 1) {
5092 base = {};
5093 extensions = origin.extensions;
5094 }
5095 return newComers.reduce(function (result, newComer) {
5096 return mergeRecursively(result, newComer, extensions);
5097 }, base);
5098 }
5099
5100 function concatArrays(originVal, newVal) {
5101 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(originVal) && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(newVal)) {
5102 // concat logic
5103 return originVal.concat(newVal);
5104 }
5105 return newVal; // always return newVal as fallback!!
5106 }
5107
5108 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);
5109
5110
5111
5112 /***/ }),
5113
5114 /***/ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts":
5115 /*!****************************************************************************************************************************************************************************************!*\
5116 !*** ./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts ***!
5117 \****************************************************************************************************************************************************************************************/
5118 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5119
5120 "use strict";
5121 __webpack_require__.r(__webpack_exports__);
5122 // extracted by mini-css-extract-plugin
5123
5124
5125 /***/ }),
5126
5127 /***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx":
5128 /*!*******************************************************************************************************************************************************************************!*\
5129 !*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***!
5130 \*******************************************************************************************************************************************************************************/
5131 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5132
5133 "use strict";
5134 __webpack_require__.r(__webpack_exports__);
5135 // extracted by mini-css-extract-plugin
5136
5137
5138 /***/ }),
5139
5140 /***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts":
5141 /*!************************************************************************************************************************************************************************************!*\
5142 !*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***!
5143 \************************************************************************************************************************************************************************************/
5144 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5145
5146 "use strict";
5147 __webpack_require__.r(__webpack_exports__);
5148 // extracted by mini-css-extract-plugin
5149
5150
5151 /***/ }),
5152
5153 /***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx":
5154 /*!***********************************************************************************************************************************************************************************!*\
5155 !*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***!
5156 \***********************************************************************************************************************************************************************************/
5157 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5158
5159 "use strict";
5160 __webpack_require__.r(__webpack_exports__);
5161 // extracted by mini-css-extract-plugin
5162
5163
5164 /***/ }),
5165
5166 /***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts":
5167 /*!************************************************************************************************************************************************************************************!*\
5168 !*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***!
5169 \************************************************************************************************************************************************************************************/
5170 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5171
5172 "use strict";
5173 __webpack_require__.r(__webpack_exports__);
5174 // extracted by mini-css-extract-plugin
5175
5176
5177 /***/ }),
5178
5179 /***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts":
5180 /*!******************************************************************************************************************************************************************************************!*\
5181 !*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***!
5182 \******************************************************************************************************************************************************************************************/
5183 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5184
5185 "use strict";
5186 __webpack_require__.r(__webpack_exports__);
5187 // extracted by mini-css-extract-plugin
5188
5189
5190 /***/ }),
5191
5192 /***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts":
5193 /*!**************************************************************************************************************************************************************************************!*\
5194 !*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***!
5195 \**************************************************************************************************************************************************************************************/
5196 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5197
5198 "use strict";
5199 __webpack_require__.r(__webpack_exports__);
5200 // extracted by mini-css-extract-plugin
5201
5202
5203 /***/ }),
5204
5205 /***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts":
5206 /*!************************************************************************************************************************************************************************************!*\
5207 !*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***!
5208 \************************************************************************************************************************************************************************************/
5209 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5210
5211 "use strict";
5212 __webpack_require__.r(__webpack_exports__);
5213 // extracted by mini-css-extract-plugin
5214
5215
5216 /***/ }),
5217
5218 /***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx":
5219 /*!***************************************************************************************************************************************************************************************!*\
5220 !*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***!
5221 \***************************************************************************************************************************************************************************************/
5222 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5223
5224 "use strict";
5225 __webpack_require__.r(__webpack_exports__);
5226 // extracted by mini-css-extract-plugin
5227
5228
5229 /***/ }),
5230
5231 /***/ "./node_modules/object-assign/index.js":
5232 /*!*********************************************!*\
5233 !*** ./node_modules/object-assign/index.js ***!
5234 \*********************************************/
5235 /***/ ((module) => {
5236
5237 "use strict";
5238 /*
5239 object-assign
5240 (c) Sindre Sorhus
5241 @license MIT
5242 */
5243
5244
5245 /* eslint-disable no-unused-vars */
5246 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5247 var hasOwnProperty = Object.prototype.hasOwnProperty;
5248 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
5249
5250 function toObject(val) {
5251 if (val === null || val === undefined) {
5252 throw new TypeError('Object.assign cannot be called with null or undefined');
5253 }
5254
5255 return Object(val);
5256 }
5257
5258 function shouldUseNative() {
5259 try {
5260 if (!Object.assign) {
5261 return false;
5262 }
5263
5264 // Detect buggy property enumeration order in older V8 versions.
5265
5266 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
5267 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
5268 test1[5] = 'de';
5269 if (Object.getOwnPropertyNames(test1)[0] === '5') {
5270 return false;
5271 }
5272
5273 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5274 var test2 = {};
5275 for (var i = 0; i < 10; i++) {
5276 test2['_' + String.fromCharCode(i)] = i;
5277 }
5278 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
5279 return test2[n];
5280 });
5281 if (order2.join('') !== '0123456789') {
5282 return false;
5283 }
5284
5285 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5286 var test3 = {};
5287 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
5288 test3[letter] = letter;
5289 });
5290 if (Object.keys(Object.assign({}, test3)).join('') !==
5291 'abcdefghijklmnopqrst') {
5292 return false;
5293 }
5294
5295 return true;
5296 } catch (err) {
5297 // We don't expect any of the above to throw, but better to be safe.
5298 return false;
5299 }
5300 }
5301
5302 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
5303 var from;
5304 var to = toObject(target);
5305 var symbols;
5306
5307 for (var s = 1; s < arguments.length; s++) {
5308 from = Object(arguments[s]);
5309
5310 for (var key in from) {
5311 if (hasOwnProperty.call(from, key)) {
5312 to[key] = from[key];
5313 }
5314 }
5315
5316 if (getOwnPropertySymbols) {
5317 symbols = getOwnPropertySymbols(from);
5318 for (var i = 0; i < symbols.length; i++) {
5319 if (propIsEnumerable.call(from, symbols[i])) {
5320 to[symbols[i]] = from[symbols[i]];
5321 }
5322 }
5323 }
5324 }
5325
5326 return to;
5327 };
5328
5329
5330 /***/ }),
5331
5332 /***/ "./node_modules/prop-types/checkPropTypes.js":
5333 /*!***************************************************!*\
5334 !*** ./node_modules/prop-types/checkPropTypes.js ***!
5335 \***************************************************/
5336 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5337
5338 "use strict";
5339 /**
5340 * Copyright (c) 2013-present, Facebook, Inc.
5341 *
5342 * This source code is licensed under the MIT license found in the
5343 * LICENSE file in the root directory of this source tree.
5344 */
5345
5346
5347
5348 var printWarning = function() {};
5349
5350 if (true) {
5351 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5352 var loggedTypeFailures = {};
5353 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5354
5355 printWarning = function(text) {
5356 var message = 'Warning: ' + text;
5357 if (typeof console !== 'undefined') {
5358 console.error(message);
5359 }
5360 try {
5361 // --- Welcome to debugging React ---
5362 // This error was thrown as a convenience so that you can use this stack
5363 // to find the callsite that caused this warning to fire.
5364 throw new Error(message);
5365 } catch (x) { /**/ }
5366 };
5367 }
5368
5369 /**
5370 * Assert that the values match with the type specs.
5371 * Error messages are memorized and will only be shown once.
5372 *
5373 * @param {object} typeSpecs Map of name to a ReactPropType
5374 * @param {object} values Runtime values that need to be type-checked
5375 * @param {string} location e.g. "prop", "context", "child context"
5376 * @param {string} componentName Name of the component for error messages.
5377 * @param {?Function} getStack Returns the component stack.
5378 * @private
5379 */
5380 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
5381 if (true) {
5382 for (var typeSpecName in typeSpecs) {
5383 if (has(typeSpecs, typeSpecName)) {
5384 var error;
5385 // Prop type validation may throw. In case they do, we don't want to
5386 // fail the render phase where it didn't fail before. So we log it.
5387 // After these have been cleaned up, we'll let them throw.
5388 try {
5389 // This is intentionally an invariant that gets caught. It's the same
5390 // behavior as without this statement except with a better message.
5391 if (typeof typeSpecs[typeSpecName] !== 'function') {
5392 var err = Error(
5393 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
5394 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
5395 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
5396 );
5397 err.name = 'Invariant Violation';
5398 throw err;
5399 }
5400 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
5401 } catch (ex) {
5402 error = ex;
5403 }
5404 if (error && !(error instanceof Error)) {
5405 printWarning(
5406 (componentName || 'React class') + ': type specification of ' +
5407 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
5408 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
5409 'You may have forgotten to pass an argument to the type checker ' +
5410 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
5411 'shape all require an argument).'
5412 );
5413 }
5414 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
5415 // Only monitor this failure once because there tends to be a lot of the
5416 // same error.
5417 loggedTypeFailures[error.message] = true;
5418
5419 var stack = getStack ? getStack() : '';
5420
5421 printWarning(
5422 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
5423 );
5424 }
5425 }
5426 }
5427 }
5428 }
5429
5430 /**
5431 * Resets warning cache when testing.
5432 *
5433 * @private
5434 */
5435 checkPropTypes.resetWarningCache = function() {
5436 if (true) {
5437 loggedTypeFailures = {};
5438 }
5439 }
5440
5441 module.exports = checkPropTypes;
5442
5443
5444 /***/ }),
5445
5446 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
5447 /*!************************************************************!*\
5448 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
5449 \************************************************************/
5450 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5451
5452 "use strict";
5453 /**
5454 * Copyright (c) 2013-present, Facebook, Inc.
5455 *
5456 * This source code is licensed under the MIT license found in the
5457 * LICENSE file in the root directory of this source tree.
5458 */
5459
5460
5461
5462 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5463 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
5464
5465 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5466 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5467 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
5468
5469 var printWarning = function() {};
5470
5471 if (true) {
5472 printWarning = function(text) {
5473 var message = 'Warning: ' + text;
5474 if (typeof console !== 'undefined') {
5475 console.error(message);
5476 }
5477 try {
5478 // --- Welcome to debugging React ---
5479 // This error was thrown as a convenience so that you can use this stack
5480 // to find the callsite that caused this warning to fire.
5481 throw new Error(message);
5482 } catch (x) {}
5483 };
5484 }
5485
5486 function emptyFunctionThatReturnsNull() {
5487 return null;
5488 }
5489
5490 module.exports = function(isValidElement, throwOnDirectAccess) {
5491 /* global Symbol */
5492 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
5493 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
5494
5495 /**
5496 * Returns the iterator method function contained on the iterable object.
5497 *
5498 * Be sure to invoke the function with the iterable as context:
5499 *
5500 * var iteratorFn = getIteratorFn(myIterable);
5501 * if (iteratorFn) {
5502 * var iterator = iteratorFn.call(myIterable);
5503 * ...
5504 * }
5505 *
5506 * @param {?object} maybeIterable
5507 * @return {?function}
5508 */
5509 function getIteratorFn(maybeIterable) {
5510 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
5511 if (typeof iteratorFn === 'function') {
5512 return iteratorFn;
5513 }
5514 }
5515
5516 /**
5517 * Collection of methods that allow declaration and validation of props that are
5518 * supplied to React components. Example usage:
5519 *
5520 * var Props = require('ReactPropTypes');
5521 * var MyArticle = React.createClass({
5522 * propTypes: {
5523 * // An optional string prop named "description".
5524 * description: Props.string,
5525 *
5526 * // A required enum prop named "category".
5527 * category: Props.oneOf(['News','Photos']).isRequired,
5528 *
5529 * // A prop named "dialog" that requires an instance of Dialog.
5530 * dialog: Props.instanceOf(Dialog).isRequired
5531 * },
5532 * render: function() { ... }
5533 * });
5534 *
5535 * A more formal specification of how these methods are used:
5536 *
5537 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
5538 * decl := ReactPropTypes.{type}(.isRequired)?
5539 *
5540 * Each and every declaration produces a function with the same signature. This
5541 * allows the creation of custom validation functions. For example:
5542 *
5543 * var MyLink = React.createClass({
5544 * propTypes: {
5545 * // An optional string or URI prop named "href".
5546 * href: function(props, propName, componentName) {
5547 * var propValue = props[propName];
5548 * if (propValue != null && typeof propValue !== 'string' &&
5549 * !(propValue instanceof URI)) {
5550 * return new Error(
5551 * 'Expected a string or an URI for ' + propName + ' in ' +
5552 * componentName
5553 * );
5554 * }
5555 * }
5556 * },
5557 * render: function() {...}
5558 * });
5559 *
5560 * @internal
5561 */
5562
5563 var ANONYMOUS = '<<anonymous>>';
5564
5565 // Important!
5566 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
5567 var ReactPropTypes = {
5568 array: createPrimitiveTypeChecker('array'),
5569 bigint: createPrimitiveTypeChecker('bigint'),
5570 bool: createPrimitiveTypeChecker('boolean'),
5571 func: createPrimitiveTypeChecker('function'),
5572 number: createPrimitiveTypeChecker('number'),
5573 object: createPrimitiveTypeChecker('object'),
5574 string: createPrimitiveTypeChecker('string'),
5575 symbol: createPrimitiveTypeChecker('symbol'),
5576
5577 any: createAnyTypeChecker(),
5578 arrayOf: createArrayOfTypeChecker,
5579 element: createElementTypeChecker(),
5580 elementType: createElementTypeTypeChecker(),
5581 instanceOf: createInstanceTypeChecker,
5582 node: createNodeChecker(),
5583 objectOf: createObjectOfTypeChecker,
5584 oneOf: createEnumTypeChecker,
5585 oneOfType: createUnionTypeChecker,
5586 shape: createShapeTypeChecker,
5587 exact: createStrictShapeTypeChecker,
5588 };
5589
5590 /**
5591 * inlined Object.is polyfill to avoid requiring consumers ship their own
5592 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5593 */
5594 /*eslint-disable no-self-compare*/
5595 function is(x, y) {
5596 // SameValue algorithm
5597 if (x === y) {
5598 // Steps 1-5, 7-10
5599 // Steps 6.b-6.e: +0 != -0
5600 return x !== 0 || 1 / x === 1 / y;
5601 } else {
5602 // Step 6.a: NaN == NaN
5603 return x !== x && y !== y;
5604 }
5605 }
5606 /*eslint-enable no-self-compare*/
5607
5608 /**
5609 * We use an Error-like object for backward compatibility as people may call
5610 * PropTypes directly and inspect their output. However, we don't use real
5611 * Errors anymore. We don't inspect their stack anyway, and creating them
5612 * is prohibitively expensive if they are created too often, such as what
5613 * happens in oneOfType() for any type before the one that matched.
5614 */
5615 function PropTypeError(message, data) {
5616 this.message = message;
5617 this.data = data && typeof data === 'object' ? data: {};
5618 this.stack = '';
5619 }
5620 // Make `instanceof Error` still work for returned errors.
5621 PropTypeError.prototype = Error.prototype;
5622
5623 function createChainableTypeChecker(validate) {
5624 if (true) {
5625 var manualPropTypeCallCache = {};
5626 var manualPropTypeWarningCount = 0;
5627 }
5628 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5629 componentName = componentName || ANONYMOUS;
5630 propFullName = propFullName || propName;
5631
5632 if (secret !== ReactPropTypesSecret) {
5633 if (throwOnDirectAccess) {
5634 // New behavior only for users of `prop-types` package
5635 var err = new Error(
5636 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
5637 'Use `PropTypes.checkPropTypes()` to call them. ' +
5638 'Read more at http://fb.me/use-check-prop-types'
5639 );
5640 err.name = 'Invariant Violation';
5641 throw err;
5642 } else if ( true && typeof console !== 'undefined') {
5643 // Old behavior for people using React.PropTypes
5644 var cacheKey = componentName + ':' + propName;
5645 if (
5646 !manualPropTypeCallCache[cacheKey] &&
5647 // Avoid spamming the console because they are often not actionable except for lib authors
5648 manualPropTypeWarningCount < 3
5649 ) {
5650 printWarning(
5651 'You are manually calling a React.PropTypes validation ' +
5652 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
5653 'and will throw in the standalone `prop-types` package. ' +
5654 'You may be seeing this warning due to a third-party PropTypes ' +
5655 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
5656 );
5657 manualPropTypeCallCache[cacheKey] = true;
5658 manualPropTypeWarningCount++;
5659 }
5660 }
5661 }
5662 if (props[propName] == null) {
5663 if (isRequired) {
5664 if (props[propName] === null) {
5665 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5666 }
5667 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5668 }
5669 return null;
5670 } else {
5671 return validate(props, propName, componentName, location, propFullName);
5672 }
5673 }
5674
5675 var chainedCheckType = checkType.bind(null, false);
5676 chainedCheckType.isRequired = checkType.bind(null, true);
5677
5678 return chainedCheckType;
5679 }
5680
5681 function createPrimitiveTypeChecker(expectedType) {
5682 function validate(props, propName, componentName, location, propFullName, secret) {
5683 var propValue = props[propName];
5684 var propType = getPropType(propValue);
5685 if (propType !== expectedType) {
5686 // `propValue` being instance of, say, date/regexp, pass the 'object'
5687 // check, but we can offer a more precise error message here rather than
5688 // 'of type `object`'.
5689 var preciseType = getPreciseType(propValue);
5690
5691 return new PropTypeError(
5692 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
5693 {expectedType: expectedType}
5694 );
5695 }
5696 return null;
5697 }
5698 return createChainableTypeChecker(validate);
5699 }
5700
5701 function createAnyTypeChecker() {
5702 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5703 }
5704
5705 function createArrayOfTypeChecker(typeChecker) {
5706 function validate(props, propName, componentName, location, propFullName) {
5707 if (typeof typeChecker !== 'function') {
5708 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5709 }
5710 var propValue = props[propName];
5711 if (!Array.isArray(propValue)) {
5712 var propType = getPropType(propValue);
5713 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5714 }
5715 for (var i = 0; i < propValue.length; i++) {
5716 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5717 if (error instanceof Error) {
5718 return error;
5719 }
5720 }
5721 return null;
5722 }
5723 return createChainableTypeChecker(validate);
5724 }
5725
5726 function createElementTypeChecker() {
5727 function validate(props, propName, componentName, location, propFullName) {
5728 var propValue = props[propName];
5729 if (!isValidElement(propValue)) {
5730 var propType = getPropType(propValue);
5731 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5732 }
5733 return null;
5734 }
5735 return createChainableTypeChecker(validate);
5736 }
5737
5738 function createElementTypeTypeChecker() {
5739 function validate(props, propName, componentName, location, propFullName) {
5740 var propValue = props[propName];
5741 if (!ReactIs.isValidElementType(propValue)) {
5742 var propType = getPropType(propValue);
5743 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5744 }
5745 return null;
5746 }
5747 return createChainableTypeChecker(validate);
5748 }
5749
5750 function createInstanceTypeChecker(expectedClass) {
5751 function validate(props, propName, componentName, location, propFullName) {
5752 if (!(props[propName] instanceof expectedClass)) {
5753 var expectedClassName = expectedClass.name || ANONYMOUS;
5754 var actualClassName = getClassName(props[propName]);
5755 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5756 }
5757 return null;
5758 }
5759 return createChainableTypeChecker(validate);
5760 }
5761
5762 function createEnumTypeChecker(expectedValues) {
5763 if (!Array.isArray(expectedValues)) {
5764 if (true) {
5765 if (arguments.length > 1) {
5766 printWarning(
5767 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
5768 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
5769 );
5770 } else {
5771 printWarning('Invalid argument supplied to oneOf, expected an array.');
5772 }
5773 }
5774 return emptyFunctionThatReturnsNull;
5775 }
5776
5777 function validate(props, propName, componentName, location, propFullName) {
5778 var propValue = props[propName];
5779 for (var i = 0; i < expectedValues.length; i++) {
5780 if (is(propValue, expectedValues[i])) {
5781 return null;
5782 }
5783 }
5784
5785 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5786 var type = getPreciseType(value);
5787 if (type === 'symbol') {
5788 return String(value);
5789 }
5790 return value;
5791 });
5792 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5793 }
5794 return createChainableTypeChecker(validate);
5795 }
5796
5797 function createObjectOfTypeChecker(typeChecker) {
5798 function validate(props, propName, componentName, location, propFullName) {
5799 if (typeof typeChecker !== 'function') {
5800 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5801 }
5802 var propValue = props[propName];
5803 var propType = getPropType(propValue);
5804 if (propType !== 'object') {
5805 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5806 }
5807 for (var key in propValue) {
5808 if (has(propValue, key)) {
5809 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5810 if (error instanceof Error) {
5811 return error;
5812 }
5813 }
5814 }
5815 return null;
5816 }
5817 return createChainableTypeChecker(validate);
5818 }
5819
5820 function createUnionTypeChecker(arrayOfTypeCheckers) {
5821 if (!Array.isArray(arrayOfTypeCheckers)) {
5822 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
5823 return emptyFunctionThatReturnsNull;
5824 }
5825
5826 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5827 var checker = arrayOfTypeCheckers[i];
5828 if (typeof checker !== 'function') {
5829 printWarning(
5830 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
5831 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
5832 );
5833 return emptyFunctionThatReturnsNull;
5834 }
5835 }
5836
5837 function validate(props, propName, componentName, location, propFullName) {
5838 var expectedTypes = [];
5839 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5840 var checker = arrayOfTypeCheckers[i];
5841 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5842 if (checkerResult == null) {
5843 return null;
5844 }
5845 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5846 expectedTypes.push(checkerResult.data.expectedType);
5847 }
5848 }
5849 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
5850 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5851 }
5852 return createChainableTypeChecker(validate);
5853 }
5854
5855 function createNodeChecker() {
5856 function validate(props, propName, componentName, location, propFullName) {
5857 if (!isNode(props[propName])) {
5858 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5859 }
5860 return null;
5861 }
5862 return createChainableTypeChecker(validate);
5863 }
5864
5865 function invalidValidatorError(componentName, location, propFullName, key, type) {
5866 return new PropTypeError(
5867 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
5868 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
5869 );
5870 }
5871
5872 function createShapeTypeChecker(shapeTypes) {
5873 function validate(props, propName, componentName, location, propFullName) {
5874 var propValue = props[propName];
5875 var propType = getPropType(propValue);
5876 if (propType !== 'object') {
5877 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5878 }
5879 for (var key in shapeTypes) {
5880 var checker = shapeTypes[key];
5881 if (typeof checker !== 'function') {
5882 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5883 }
5884 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5885 if (error) {
5886 return error;
5887 }
5888 }
5889 return null;
5890 }
5891 return createChainableTypeChecker(validate);
5892 }
5893
5894 function createStrictShapeTypeChecker(shapeTypes) {
5895 function validate(props, propName, componentName, location, propFullName) {
5896 var propValue = props[propName];
5897 var propType = getPropType(propValue);
5898 if (propType !== 'object') {
5899 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5900 }
5901 // We need to check all keys in case some are required but missing from props.
5902 var allKeys = assign({}, props[propName], shapeTypes);
5903 for (var key in allKeys) {
5904 var checker = shapeTypes[key];
5905 if (has(shapeTypes, key) && typeof checker !== 'function') {
5906 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5907 }
5908 if (!checker) {
5909 return new PropTypeError(
5910 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
5911 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
5912 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
5913 );
5914 }
5915 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5916 if (error) {
5917 return error;
5918 }
5919 }
5920 return null;
5921 }
5922
5923 return createChainableTypeChecker(validate);
5924 }
5925
5926 function isNode(propValue) {
5927 switch (typeof propValue) {
5928 case 'number':
5929 case 'string':
5930 case 'undefined':
5931 return true;
5932 case 'boolean':
5933 return !propValue;
5934 case 'object':
5935 if (Array.isArray(propValue)) {
5936 return propValue.every(isNode);
5937 }
5938 if (propValue === null || isValidElement(propValue)) {
5939 return true;
5940 }
5941
5942 var iteratorFn = getIteratorFn(propValue);
5943 if (iteratorFn) {
5944 var iterator = iteratorFn.call(propValue);
5945 var step;
5946 if (iteratorFn !== propValue.entries) {
5947 while (!(step = iterator.next()).done) {
5948 if (!isNode(step.value)) {
5949 return false;
5950 }
5951 }
5952 } else {
5953 // Iterator will provide entry [k,v] tuples rather than values.
5954 while (!(step = iterator.next()).done) {
5955 var entry = step.value;
5956 if (entry) {
5957 if (!isNode(entry[1])) {
5958 return false;
5959 }
5960 }
5961 }
5962 }
5963 } else {
5964 return false;
5965 }
5966
5967 return true;
5968 default:
5969 return false;
5970 }
5971 }
5972
5973 function isSymbol(propType, propValue) {
5974 // Native Symbol.
5975 if (propType === 'symbol') {
5976 return true;
5977 }
5978
5979 // falsy value can't be a Symbol
5980 if (!propValue) {
5981 return false;
5982 }
5983
5984 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5985 if (propValue['@@toStringTag'] === 'Symbol') {
5986 return true;
5987 }
5988
5989 // Fallback for non-spec compliant Symbols which are polyfilled.
5990 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
5991 return true;
5992 }
5993
5994 return false;
5995 }
5996
5997 // Equivalent of `typeof` but with special handling for array and regexp.
5998 function getPropType(propValue) {
5999 var propType = typeof propValue;
6000 if (Array.isArray(propValue)) {
6001 return 'array';
6002 }
6003 if (propValue instanceof RegExp) {
6004 // Old webkits (at least until Android 4.0) return 'function' rather than
6005 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
6006 // passes PropTypes.object.
6007 return 'object';
6008 }
6009 if (isSymbol(propType, propValue)) {
6010 return 'symbol';
6011 }
6012 return propType;
6013 }
6014
6015 // This handles more types than `getPropType`. Only used for error messages.
6016 // See `createPrimitiveTypeChecker`.
6017 function getPreciseType(propValue) {
6018 if (typeof propValue === 'undefined' || propValue === null) {
6019 return '' + propValue;
6020 }
6021 var propType = getPropType(propValue);
6022 if (propType === 'object') {
6023 if (propValue instanceof Date) {
6024 return 'date';
6025 } else if (propValue instanceof RegExp) {
6026 return 'regexp';
6027 }
6028 }
6029 return propType;
6030 }
6031
6032 // Returns a string that is postfixed to a warning about an invalid type.
6033 // For example, "undefined" or "of type array"
6034 function getPostfixForTypeWarning(value) {
6035 var type = getPreciseType(value);
6036 switch (type) {
6037 case 'array':
6038 case 'object':
6039 return 'an ' + type;
6040 case 'boolean':
6041 case 'date':
6042 case 'regexp':
6043 return 'a ' + type;
6044 default:
6045 return type;
6046 }
6047 }
6048
6049 // Returns class name of the object, if any.
6050 function getClassName(propValue) {
6051 if (!propValue.constructor || !propValue.constructor.name) {
6052 return ANONYMOUS;
6053 }
6054 return propValue.constructor.name;
6055 }
6056
6057 ReactPropTypes.checkPropTypes = checkPropTypes;
6058 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
6059 ReactPropTypes.PropTypes = ReactPropTypes;
6060
6061 return ReactPropTypes;
6062 };
6063
6064
6065 /***/ }),
6066
6067 /***/ "./node_modules/prop-types/index.js":
6068 /*!******************************************!*\
6069 !*** ./node_modules/prop-types/index.js ***!
6070 \******************************************/
6071 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6072
6073 /**
6074 * Copyright (c) 2013-present, Facebook, Inc.
6075 *
6076 * This source code is licensed under the MIT license found in the
6077 * LICENSE file in the root directory of this source tree.
6078 */
6079
6080 if (true) {
6081 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
6082
6083 // By explicitly using `prop-types` you are opting into new development behavior.
6084 // http://fb.me/prop-types-in-prod
6085 var throwOnDirectAccess = true;
6086 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
6087 } else {}
6088
6089
6090 /***/ }),
6091
6092 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
6093 /*!*************************************************************!*\
6094 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
6095 \*************************************************************/
6096 /***/ ((module) => {
6097
6098 "use strict";
6099 /**
6100 * Copyright (c) 2013-present, Facebook, Inc.
6101 *
6102 * This source code is licensed under the MIT license found in the
6103 * LICENSE file in the root directory of this source tree.
6104 */
6105
6106
6107
6108 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
6109
6110 module.exports = ReactPropTypesSecret;
6111
6112
6113 /***/ }),
6114
6115 /***/ "./node_modules/prop-types/lib/has.js":
6116 /*!********************************************!*\
6117 !*** ./node_modules/prop-types/lib/has.js ***!
6118 \********************************************/
6119 /***/ ((module) => {
6120
6121 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
6122
6123
6124 /***/ }),
6125
6126 /***/ "./node_modules/raven-js/src/configError.js":
6127 /*!**************************************************!*\
6128 !*** ./node_modules/raven-js/src/configError.js ***!
6129 \**************************************************/
6130 /***/ ((module) => {
6131
6132 function RavenConfigError(message) {
6133 this.name = 'RavenConfigError';
6134 this.message = message;
6135 }
6136 RavenConfigError.prototype = new Error();
6137 RavenConfigError.prototype.constructor = RavenConfigError;
6138
6139 module.exports = RavenConfigError;
6140
6141
6142 /***/ }),
6143
6144 /***/ "./node_modules/raven-js/src/console.js":
6145 /*!**********************************************!*\
6146 !*** ./node_modules/raven-js/src/console.js ***!
6147 \**********************************************/
6148 /***/ ((module) => {
6149
6150 var wrapMethod = function(console, level, callback) {
6151 var originalConsoleLevel = console[level];
6152 var originalConsole = console;
6153
6154 if (!(level in console)) {
6155 return;
6156 }
6157
6158 var sentryLevel = level === 'warn' ? 'warning' : level;
6159
6160 console[level] = function() {
6161 var args = [].slice.call(arguments);
6162
6163 var msg = '' + args.join(' ');
6164 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
6165
6166 if (level === 'assert') {
6167 if (args[0] === false) {
6168 // Default browsers message
6169 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
6170 data.extra.arguments = args.slice(1);
6171 callback && callback(msg, data);
6172 }
6173 } else {
6174 callback && callback(msg, data);
6175 }
6176
6177 // this fails for some browsers. :(
6178 if (originalConsoleLevel) {
6179 // IE9 doesn't allow calling apply on console functions directly
6180 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
6181 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
6182 }
6183 };
6184 };
6185
6186 module.exports = {
6187 wrapMethod: wrapMethod
6188 };
6189
6190
6191 /***/ }),
6192
6193 /***/ "./node_modules/raven-js/src/raven.js":
6194 /*!********************************************!*\
6195 !*** ./node_modules/raven-js/src/raven.js ***!
6196 \********************************************/
6197 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6198
6199 /*global XDomainRequest:false */
6200
6201 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
6202 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
6203 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
6204
6205 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
6206 var isError = utils.isError;
6207 var isObject = utils.isObject;
6208 var isObject = utils.isObject;
6209 var isErrorEvent = utils.isErrorEvent;
6210 var isUndefined = utils.isUndefined;
6211 var isFunction = utils.isFunction;
6212 var isString = utils.isString;
6213 var isEmptyObject = utils.isEmptyObject;
6214 var each = utils.each;
6215 var objectMerge = utils.objectMerge;
6216 var truncate = utils.truncate;
6217 var objectFrozen = utils.objectFrozen;
6218 var hasKey = utils.hasKey;
6219 var joinRegExp = utils.joinRegExp;
6220 var urlencode = utils.urlencode;
6221 var uuid4 = utils.uuid4;
6222 var htmlTreeAsString = utils.htmlTreeAsString;
6223 var isSameException = utils.isSameException;
6224 var isSameStacktrace = utils.isSameStacktrace;
6225 var parseUrl = utils.parseUrl;
6226 var fill = utils.fill;
6227
6228 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
6229
6230 var dsnKeys = 'source protocol user pass host port path'.split(' '),
6231 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
6232
6233 function now() {
6234 return +new Date();
6235 }
6236
6237 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
6238 var _window =
6239 typeof window !== 'undefined'
6240 ? window
6241 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
6242 var _document = _window.document;
6243 var _navigator = _window.navigator;
6244
6245 function keepOriginalCallback(original, callback) {
6246 return isFunction(callback)
6247 ? function(data) {
6248 return callback(data, original);
6249 }
6250 : callback;
6251 }
6252
6253 // First, check for JSON support
6254 // If there is no JSON, we no-op the core features of Raven
6255 // since JSON is required to encode the payload
6256 function Raven() {
6257 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
6258 // Raven can run in contexts where there's no document (react-native)
6259 this._hasDocument = !isUndefined(_document);
6260 this._hasNavigator = !isUndefined(_navigator);
6261 this._lastCapturedException = null;
6262 this._lastData = null;
6263 this._lastEventId = null;
6264 this._globalServer = null;
6265 this._globalKey = null;
6266 this._globalProject = null;
6267 this._globalContext = {};
6268 this._globalOptions = {
6269 logger: 'javascript',
6270 ignoreErrors: [],
6271 ignoreUrls: [],
6272 whitelistUrls: [],
6273 includePaths: [],
6274 collectWindowErrors: true,
6275 maxMessageLength: 0,
6276
6277 // By default, truncates URL values to 250 chars
6278 maxUrlLength: 250,
6279 stackTraceLimit: 50,
6280 autoBreadcrumbs: true,
6281 instrument: true,
6282 sampleRate: 1
6283 };
6284 this._ignoreOnError = 0;
6285 this._isRavenInstalled = false;
6286 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
6287 // capture references to window.console *and* all its methods first
6288 // before the console plugin has a chance to monkey patch
6289 this._originalConsole = _window.console || {};
6290 this._originalConsoleMethods = {};
6291 this._plugins = [];
6292 this._startTime = now();
6293 this._wrappedBuiltIns = [];
6294 this._breadcrumbs = [];
6295 this._lastCapturedEvent = null;
6296 this._keypressTimeout;
6297 this._location = _window.location;
6298 this._lastHref = this._location && this._location.href;
6299 this._resetBackoff();
6300
6301 // eslint-disable-next-line guard-for-in
6302 for (var method in this._originalConsole) {
6303 this._originalConsoleMethods[method] = this._originalConsole[method];
6304 }
6305 }
6306
6307 /*
6308 * The core Raven singleton
6309 *
6310 * @this {Raven}
6311 */
6312
6313 Raven.prototype = {
6314 // Hardcode version string so that raven source can be loaded directly via
6315 // webpack (using a build step causes webpack #1617). Grunt verifies that
6316 // this value matches package.json during build.
6317 // See: https://github.com/getsentry/raven-js/issues/465
6318 VERSION: '3.19.1',
6319
6320 debug: false,
6321
6322 TraceKit: TraceKit, // alias to TraceKit
6323
6324 /*
6325 * Configure Raven with a DSN and extra options
6326 *
6327 * @param {string} dsn The public Sentry DSN
6328 * @param {object} options Set of global options [optional]
6329 * @return {Raven}
6330 */
6331 config: function(dsn, options) {
6332 var self = this;
6333
6334 if (self._globalServer) {
6335 this._logDebug('error', 'Error: Raven has already been configured');
6336 return self;
6337 }
6338 if (!dsn) return self;
6339
6340 var globalOptions = self._globalOptions;
6341
6342 // merge in options
6343 if (options) {
6344 each(options, function(key, value) {
6345 // tags and extra are special and need to be put into context
6346 if (key === 'tags' || key === 'extra' || key === 'user') {
6347 self._globalContext[key] = value;
6348 } else {
6349 globalOptions[key] = value;
6350 }
6351 });
6352 }
6353
6354 self.setDSN(dsn);
6355
6356 // "Script error." is hard coded into browsers for errors that it can't read.
6357 // this is the result of a script being pulled in from an external domain and CORS.
6358 globalOptions.ignoreErrors.push(/^Script error\.?$/);
6359 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
6360
6361 // join regexp rules into one big rule
6362 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
6363 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
6364 ? joinRegExp(globalOptions.ignoreUrls)
6365 : false;
6366 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
6367 ? joinRegExp(globalOptions.whitelistUrls)
6368 : false;
6369 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
6370 globalOptions.maxBreadcrumbs = Math.max(
6371 0,
6372 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
6373 ); // default and hard limit is 100
6374
6375 var autoBreadcrumbDefaults = {
6376 xhr: true,
6377 console: true,
6378 dom: true,
6379 location: true
6380 };
6381
6382 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
6383 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
6384 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
6385 } else if (autoBreadcrumbs !== false) {
6386 autoBreadcrumbs = autoBreadcrumbDefaults;
6387 }
6388 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
6389
6390 var instrumentDefaults = {
6391 tryCatch: true
6392 };
6393
6394 var instrument = globalOptions.instrument;
6395 if ({}.toString.call(instrument) === '[object Object]') {
6396 instrument = objectMerge(instrumentDefaults, instrument);
6397 } else if (instrument !== false) {
6398 instrument = instrumentDefaults;
6399 }
6400 globalOptions.instrument = instrument;
6401
6402 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
6403
6404 // return for chaining
6405 return self;
6406 },
6407
6408 /*
6409 * Installs a global window.onerror error handler
6410 * to capture and report uncaught exceptions.
6411 * At this point, install() is required to be called due
6412 * to the way TraceKit is set up.
6413 *
6414 * @return {Raven}
6415 */
6416 install: function() {
6417 var self = this;
6418 if (self.isSetup() && !self._isRavenInstalled) {
6419 TraceKit.report.subscribe(function() {
6420 self._handleOnErrorStackInfo.apply(self, arguments);
6421 });
6422 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
6423 self._instrumentTryCatch();
6424 }
6425
6426 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
6427
6428 // Install all of the plugins
6429 self._drainPlugins();
6430
6431 self._isRavenInstalled = true;
6432 }
6433
6434 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
6435 return this;
6436 },
6437
6438 /*
6439 * Set the DSN (can be called multiple time unlike config)
6440 *
6441 * @param {string} dsn The public Sentry DSN
6442 */
6443 setDSN: function(dsn) {
6444 var self = this,
6445 uri = self._parseDSN(dsn),
6446 lastSlash = uri.path.lastIndexOf('/'),
6447 path = uri.path.substr(1, lastSlash);
6448
6449 self._dsn = dsn;
6450 self._globalKey = uri.user;
6451 self._globalSecret = uri.pass && uri.pass.substr(1);
6452 self._globalProject = uri.path.substr(lastSlash + 1);
6453
6454 self._globalServer = self._getGlobalServer(uri);
6455
6456 self._globalEndpoint =
6457 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
6458
6459 // Reset backoff state since we may be pointing at a
6460 // new project/server
6461 this._resetBackoff();
6462 },
6463
6464 /*
6465 * Wrap code within a context so Raven can capture errors
6466 * reliably across domains that is executed immediately.
6467 *
6468 * @param {object} options A specific set of options for this context [optional]
6469 * @param {function} func The callback to be immediately executed within the context
6470 * @param {array} args An array of arguments to be called with the callback [optional]
6471 */
6472 context: function(options, func, args) {
6473 if (isFunction(options)) {
6474 args = func || [];
6475 func = options;
6476 options = undefined;
6477 }
6478
6479 return this.wrap(options, func).apply(this, args);
6480 },
6481
6482 /*
6483 * Wrap code within a context and returns back a new function to be executed
6484 *
6485 * @param {object} options A specific set of options for this context [optional]
6486 * @param {function} func The function to be wrapped in a new context
6487 * @param {function} func A function to call before the try/catch wrapper [optional, private]
6488 * @return {function} The newly wrapped functions with a context
6489 */
6490 wrap: function(options, func, _before) {
6491 var self = this;
6492 // 1 argument has been passed, and it's not a function
6493 // so just return it
6494 if (isUndefined(func) && !isFunction(options)) {
6495 return options;
6496 }
6497
6498 // options is optional
6499 if (isFunction(options)) {
6500 func = options;
6501 options = undefined;
6502 }
6503
6504 // At this point, we've passed along 2 arguments, and the second one
6505 // is not a function either, so we'll just return the second argument.
6506 if (!isFunction(func)) {
6507 return func;
6508 }
6509
6510 // We don't wanna wrap it twice!
6511 try {
6512 if (func.__raven__) {
6513 return func;
6514 }
6515
6516 // If this has already been wrapped in the past, return that
6517 if (func.__raven_wrapper__) {
6518 return func.__raven_wrapper__;
6519 }
6520 } catch (e) {
6521 // Just accessing custom props in some Selenium environments
6522 // can cause a "Permission denied" exception (see raven-js#495).
6523 // Bail on wrapping and return the function as-is (defers to window.onerror).
6524 return func;
6525 }
6526
6527 function wrapped() {
6528 var args = [],
6529 i = arguments.length,
6530 deep = !options || (options && options.deep !== false);
6531
6532 if (_before && isFunction(_before)) {
6533 _before.apply(this, arguments);
6534 }
6535
6536 // Recursively wrap all of a function's arguments that are
6537 // functions themselves.
6538 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
6539
6540 try {
6541 // Attempt to invoke user-land function
6542 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
6543 // means Raven caught an error invoking your application code. This is
6544 // expected behavior and NOT indicative of a bug with Raven.js.
6545 return func.apply(this, args);
6546 } catch (e) {
6547 self._ignoreNextOnError();
6548 self.captureException(e, options);
6549 throw e;
6550 }
6551 }
6552
6553 // copy over properties of the old function
6554 for (var property in func) {
6555 if (hasKey(func, property)) {
6556 wrapped[property] = func[property];
6557 }
6558 }
6559 wrapped.prototype = func.prototype;
6560
6561 func.__raven_wrapper__ = wrapped;
6562 // Signal that this function has been wrapped already
6563 // for both debugging and to prevent it to being wrapped twice
6564 wrapped.__raven__ = true;
6565 wrapped.__inner__ = func;
6566
6567 return wrapped;
6568 },
6569
6570 /*
6571 * Uninstalls the global error handler.
6572 *
6573 * @return {Raven}
6574 */
6575 uninstall: function() {
6576 TraceKit.report.uninstall();
6577
6578 this._restoreBuiltIns();
6579
6580 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
6581 this._isRavenInstalled = false;
6582
6583 return this;
6584 },
6585
6586 /*
6587 * Manually capture an exception and send it over to Sentry
6588 *
6589 * @param {error} ex An exception to be logged
6590 * @param {object} options A specific set of options for this error [optional]
6591 * @return {Raven}
6592 */
6593 captureException: function(ex, options) {
6594 // Cases for sending ex as a message, rather than an exception
6595 var isNotError = !isError(ex);
6596 var isNotErrorEvent = !isErrorEvent(ex);
6597 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
6598
6599 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
6600 return this.captureMessage(
6601 ex,
6602 objectMerge(
6603 {
6604 trimHeadFrames: 1,
6605 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
6606 },
6607 options
6608 )
6609 );
6610 }
6611
6612 // Get actual Error from ErrorEvent
6613 if (isErrorEvent(ex)) ex = ex.error;
6614
6615 // Store the raw exception object for potential debugging and introspection
6616 this._lastCapturedException = ex;
6617
6618 // TraceKit.report will re-raise any exception passed to it,
6619 // which means you have to wrap it in try/catch. Instead, we
6620 // can wrap it here and only re-raise if TraceKit.report
6621 // raises an exception different from the one we asked to
6622 // report on.
6623 try {
6624 var stack = TraceKit.computeStackTrace(ex);
6625 this._handleStackInfo(stack, options);
6626 } catch (ex1) {
6627 if (ex !== ex1) {
6628 throw ex1;
6629 }
6630 }
6631
6632 return this;
6633 },
6634
6635 /*
6636 * Manually send a message to Sentry
6637 *
6638 * @param {string} msg A plain message to be captured in Sentry
6639 * @param {object} options A specific set of options for this message [optional]
6640 * @return {Raven}
6641 */
6642 captureMessage: function(msg, options) {
6643 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
6644 // early call; we'll error on the side of logging anything called before configuration since it's
6645 // probably something you should see:
6646 if (
6647 !!this._globalOptions.ignoreErrors.test &&
6648 this._globalOptions.ignoreErrors.test(msg)
6649 ) {
6650 return;
6651 }
6652
6653 options = options || {};
6654
6655 var data = objectMerge(
6656 {
6657 message: msg + '' // Make sure it's actually a string
6658 },
6659 options
6660 );
6661
6662 var ex;
6663 // Generate a "synthetic" stack trace from this point.
6664 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
6665 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
6666 // or if it catches a thrown object without a "stack" property.
6667 try {
6668 throw new Error(msg);
6669 } catch (ex1) {
6670 ex = ex1;
6671 }
6672
6673 // null exception name so `Error` isn't prefixed to msg
6674 ex.name = null;
6675 var stack = TraceKit.computeStackTrace(ex);
6676
6677 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
6678 var initialCall = stack.stack[1];
6679
6680 var fileurl = (initialCall && initialCall.url) || '';
6681
6682 if (
6683 !!this._globalOptions.ignoreUrls.test &&
6684 this._globalOptions.ignoreUrls.test(fileurl)
6685 ) {
6686 return;
6687 }
6688
6689 if (
6690 !!this._globalOptions.whitelistUrls.test &&
6691 !this._globalOptions.whitelistUrls.test(fileurl)
6692 ) {
6693 return;
6694 }
6695
6696 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
6697 options = objectMerge(
6698 {
6699 // fingerprint on msg, not stack trace (legacy behavior, could be
6700 // revisited)
6701 fingerprint: msg,
6702 // since we know this is a synthetic trace, the top N-most frames
6703 // MUST be from Raven.js, so mark them as in_app later by setting
6704 // trimHeadFrames
6705 trimHeadFrames: (options.trimHeadFrames || 0) + 1
6706 },
6707 options
6708 );
6709
6710 var frames = this._prepareFrames(stack, options);
6711 data.stacktrace = {
6712 // Sentry expects frames oldest to newest
6713 frames: frames.reverse()
6714 };
6715 }
6716
6717 // Fire away!
6718 this._send(data);
6719
6720 return this;
6721 },
6722
6723 captureBreadcrumb: function(obj) {
6724 var crumb = objectMerge(
6725 {
6726 timestamp: now() / 1000
6727 },
6728 obj
6729 );
6730
6731 if (isFunction(this._globalOptions.breadcrumbCallback)) {
6732 var result = this._globalOptions.breadcrumbCallback(crumb);
6733
6734 if (isObject(result) && !isEmptyObject(result)) {
6735 crumb = result;
6736 } else if (result === false) {
6737 return this;
6738 }
6739 }
6740
6741 this._breadcrumbs.push(crumb);
6742 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
6743 this._breadcrumbs.shift();
6744 }
6745 return this;
6746 },
6747
6748 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
6749 var pluginArgs = [].slice.call(arguments, 1);
6750
6751 this._plugins.push([plugin, pluginArgs]);
6752 if (this._isRavenInstalled) {
6753 this._drainPlugins();
6754 }
6755
6756 return this;
6757 },
6758
6759 /*
6760 * Set/clear a user to be sent along with the payload.
6761 *
6762 * @param {object} user An object representing user data [optional]
6763 * @return {Raven}
6764 */
6765 setUserContext: function(user) {
6766 // Intentionally do not merge here since that's an unexpected behavior.
6767 this._globalContext.user = user;
6768
6769 return this;
6770 },
6771
6772 /*
6773 * Merge extra attributes to be sent along with the payload.
6774 *
6775 * @param {object} extra An object representing extra data [optional]
6776 * @return {Raven}
6777 */
6778 setExtraContext: function(extra) {
6779 this._mergeContext('extra', extra);
6780
6781 return this;
6782 },
6783
6784 /*
6785 * Merge tags to be sent along with the payload.
6786 *
6787 * @param {object} tags An object representing tags [optional]
6788 * @return {Raven}
6789 */
6790 setTagsContext: function(tags) {
6791 this._mergeContext('tags', tags);
6792
6793 return this;
6794 },
6795
6796 /*
6797 * Clear all of the context.
6798 *
6799 * @return {Raven}
6800 */
6801 clearContext: function() {
6802 this._globalContext = {};
6803
6804 return this;
6805 },
6806
6807 /*
6808 * Get a copy of the current context. This cannot be mutated.
6809 *
6810 * @return {object} copy of context
6811 */
6812 getContext: function() {
6813 // lol javascript
6814 return JSON.parse(stringify(this._globalContext));
6815 },
6816
6817 /*
6818 * Set environment of application
6819 *
6820 * @param {string} environment Typically something like 'production'.
6821 * @return {Raven}
6822 */
6823 setEnvironment: function(environment) {
6824 this._globalOptions.environment = environment;
6825
6826 return this;
6827 },
6828
6829 /*
6830 * Set release version of application
6831 *
6832 * @param {string} release Typically something like a git SHA to identify version
6833 * @return {Raven}
6834 */
6835 setRelease: function(release) {
6836 this._globalOptions.release = release;
6837
6838 return this;
6839 },
6840
6841 /*
6842 * Set the dataCallback option
6843 *
6844 * @param {function} callback The callback to run which allows the
6845 * data blob to be mutated before sending
6846 * @return {Raven}
6847 */
6848 setDataCallback: function(callback) {
6849 var original = this._globalOptions.dataCallback;
6850 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
6851 return this;
6852 },
6853
6854 /*
6855 * Set the breadcrumbCallback option
6856 *
6857 * @param {function} callback The callback to run which allows filtering
6858 * or mutating breadcrumbs
6859 * @return {Raven}
6860 */
6861 setBreadcrumbCallback: function(callback) {
6862 var original = this._globalOptions.breadcrumbCallback;
6863 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
6864 return this;
6865 },
6866
6867 /*
6868 * Set the shouldSendCallback option
6869 *
6870 * @param {function} callback The callback to run which allows
6871 * introspecting the blob before sending
6872 * @return {Raven}
6873 */
6874 setShouldSendCallback: function(callback) {
6875 var original = this._globalOptions.shouldSendCallback;
6876 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
6877 return this;
6878 },
6879
6880 /**
6881 * Override the default HTTP transport mechanism that transmits data
6882 * to the Sentry server.
6883 *
6884 * @param {function} transport Function invoked instead of the default
6885 * `makeRequest` handler.
6886 *
6887 * @return {Raven}
6888 */
6889 setTransport: function(transport) {
6890 this._globalOptions.transport = transport;
6891
6892 return this;
6893 },
6894
6895 /*
6896 * Get the latest raw exception that was captured by Raven.
6897 *
6898 * @return {error}
6899 */
6900 lastException: function() {
6901 return this._lastCapturedException;
6902 },
6903
6904 /*
6905 * Get the last event id
6906 *
6907 * @return {string}
6908 */
6909 lastEventId: function() {
6910 return this._lastEventId;
6911 },
6912
6913 /*
6914 * Determine if Raven is setup and ready to go.
6915 *
6916 * @return {boolean}
6917 */
6918 isSetup: function() {
6919 if (!this._hasJSON) return false; // needs JSON support
6920 if (!this._globalServer) {
6921 if (!this.ravenNotConfiguredError) {
6922 this.ravenNotConfiguredError = true;
6923 this._logDebug('error', 'Error: Raven has not been configured.');
6924 }
6925 return false;
6926 }
6927 return true;
6928 },
6929
6930 afterLoad: function() {
6931 // TODO: remove window dependence?
6932
6933 // Attempt to initialize Raven on load
6934 var RavenConfig = _window.RavenConfig;
6935 if (RavenConfig) {
6936 this.config(RavenConfig.dsn, RavenConfig.config).install();
6937 }
6938 },
6939
6940 showReportDialog: function(options) {
6941 if (
6942 !_document // doesn't work without a document (React native)
6943 )
6944 return;
6945
6946 options = options || {};
6947
6948 var lastEventId = options.eventId || this.lastEventId();
6949 if (!lastEventId) {
6950 throw new RavenConfigError('Missing eventId');
6951 }
6952
6953 var dsn = options.dsn || this._dsn;
6954 if (!dsn) {
6955 throw new RavenConfigError('Missing DSN');
6956 }
6957
6958 var encode = encodeURIComponent;
6959 var qs = '';
6960 qs += '?eventId=' + encode(lastEventId);
6961 qs += '&dsn=' + encode(dsn);
6962
6963 var user = options.user || this._globalContext.user;
6964 if (user) {
6965 if (user.name) qs += '&name=' + encode(user.name);
6966 if (user.email) qs += '&email=' + encode(user.email);
6967 }
6968
6969 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
6970
6971 var script = _document.createElement('script');
6972 script.async = true;
6973 script.src = globalServer + '/api/embed/error-page/' + qs;
6974 (_document.head || _document.body).appendChild(script);
6975 },
6976
6977 /**** Private functions ****/
6978 _ignoreNextOnError: function() {
6979 var self = this;
6980 this._ignoreOnError += 1;
6981 setTimeout(function() {
6982 // onerror should trigger before setTimeout
6983 self._ignoreOnError -= 1;
6984 });
6985 },
6986
6987 _triggerEvent: function(eventType, options) {
6988 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
6989 var evt, key;
6990
6991 if (!this._hasDocument) return;
6992
6993 options = options || {};
6994
6995 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
6996
6997 if (_document.createEvent) {
6998 evt = _document.createEvent('HTMLEvents');
6999 evt.initEvent(eventType, true, true);
7000 } else {
7001 evt = _document.createEventObject();
7002 evt.eventType = eventType;
7003 }
7004
7005 for (key in options)
7006 if (hasKey(options, key)) {
7007 evt[key] = options[key];
7008 }
7009
7010 if (_document.createEvent) {
7011 // IE9 if standards
7012 _document.dispatchEvent(evt);
7013 } else {
7014 // IE8 regardless of Quirks or Standards
7015 // IE9 if quirks
7016 try {
7017 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
7018 } catch (e) {
7019 // Do nothing
7020 }
7021 }
7022 },
7023
7024 /**
7025 * Wraps addEventListener to capture UI breadcrumbs
7026 * @param evtName the event name (e.g. "click")
7027 * @returns {Function}
7028 * @private
7029 */
7030 _breadcrumbEventHandler: function(evtName) {
7031 var self = this;
7032 return function(evt) {
7033 // reset keypress timeout; e.g. triggering a 'click' after
7034 // a 'keypress' will reset the keypress debounce so that a new
7035 // set of keypresses can be recorded
7036 self._keypressTimeout = null;
7037
7038 // It's possible this handler might trigger multiple times for the same
7039 // event (e.g. event propagation through node ancestors). Ignore if we've
7040 // already captured the event.
7041 if (self._lastCapturedEvent === evt) return;
7042
7043 self._lastCapturedEvent = evt;
7044
7045 // try/catch both:
7046 // - accessing evt.target (see getsentry/raven-js#838, #768)
7047 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
7048 // can throw an exception in some circumstances.
7049 var target;
7050 try {
7051 target = htmlTreeAsString(evt.target);
7052 } catch (e) {
7053 target = '<unknown>';
7054 }
7055
7056 self.captureBreadcrumb({
7057 category: 'ui.' + evtName, // e.g. ui.click, ui.input
7058 message: target
7059 });
7060 };
7061 },
7062
7063 /**
7064 * Wraps addEventListener to capture keypress UI events
7065 * @returns {Function}
7066 * @private
7067 */
7068 _keypressEventHandler: function() {
7069 var self = this,
7070 debounceDuration = 1000; // milliseconds
7071
7072 // TODO: if somehow user switches keypress target before
7073 // debounce timeout is triggered, we will only capture
7074 // a single breadcrumb from the FIRST target (acceptable?)
7075 return function(evt) {
7076 var target;
7077 try {
7078 target = evt.target;
7079 } catch (e) {
7080 // just accessing event properties can throw an exception in some rare circumstances
7081 // see: https://github.com/getsentry/raven-js/issues/838
7082 return;
7083 }
7084 var tagName = target && target.tagName;
7085
7086 // only consider keypress events on actual input elements
7087 // this will disregard keypresses targeting body (e.g. tabbing
7088 // through elements, hotkeys, etc)
7089 if (
7090 !tagName ||
7091 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
7092 )
7093 return;
7094
7095 // record first keypress in a series, but ignore subsequent
7096 // keypresses until debounce clears
7097 var timeout = self._keypressTimeout;
7098 if (!timeout) {
7099 self._breadcrumbEventHandler('input')(evt);
7100 }
7101 clearTimeout(timeout);
7102 self._keypressTimeout = setTimeout(function() {
7103 self._keypressTimeout = null;
7104 }, debounceDuration);
7105 };
7106 },
7107
7108 /**
7109 * Captures a breadcrumb of type "navigation", normalizing input URLs
7110 * @param to the originating URL
7111 * @param from the target URL
7112 * @private
7113 */
7114 _captureUrlChange: function(from, to) {
7115 var parsedLoc = parseUrl(this._location.href);
7116 var parsedTo = parseUrl(to);
7117 var parsedFrom = parseUrl(from);
7118
7119 // because onpopstate only tells you the "new" (to) value of location.href, and
7120 // not the previous (from) value, we need to track the value of the current URL
7121 // state ourselves
7122 this._lastHref = to;
7123
7124 // Use only the path component of the URL if the URL matches the current
7125 // document (almost all the time when using pushState)
7126 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
7127 to = parsedTo.relative;
7128 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
7129 from = parsedFrom.relative;
7130
7131 this.captureBreadcrumb({
7132 category: 'navigation',
7133 data: {
7134 to: to,
7135 from: from
7136 }
7137 });
7138 },
7139
7140 /**
7141 * Wrap timer functions and event targets to catch errors and provide
7142 * better metadata.
7143 */
7144 _instrumentTryCatch: function() {
7145 var self = this;
7146
7147 var wrappedBuiltIns = self._wrappedBuiltIns;
7148
7149 function wrapTimeFn(orig) {
7150 return function(fn, t) {
7151 // preserve arity
7152 // Make a copy of the arguments to prevent deoptimization
7153 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
7154 var args = new Array(arguments.length);
7155 for (var i = 0; i < args.length; ++i) {
7156 args[i] = arguments[i];
7157 }
7158 var originalCallback = args[0];
7159 if (isFunction(originalCallback)) {
7160 args[0] = self.wrap(originalCallback);
7161 }
7162
7163 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
7164 // also supports only two arguments and doesn't care what this is, so we
7165 // can just call the original function directly.
7166 if (orig.apply) {
7167 return orig.apply(this, args);
7168 } else {
7169 return orig(args[0], args[1]);
7170 }
7171 };
7172 }
7173
7174 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
7175
7176 function wrapEventTarget(global) {
7177 var proto = _window[global] && _window[global].prototype;
7178 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
7179 fill(
7180 proto,
7181 'addEventListener',
7182 function(orig) {
7183 return function(evtName, fn, capture, secure) {
7184 // preserve arity
7185 try {
7186 if (fn && fn.handleEvent) {
7187 fn.handleEvent = self.wrap(fn.handleEvent);
7188 }
7189 } catch (err) {
7190 // can sometimes get 'Permission denied to access property "handle Event'
7191 }
7192
7193 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
7194 // so that we don't have more than one wrapper function
7195 var before, clickHandler, keypressHandler;
7196
7197 if (
7198 autoBreadcrumbs &&
7199 autoBreadcrumbs.dom &&
7200 (global === 'EventTarget' || global === 'Node')
7201 ) {
7202 // NOTE: generating multiple handlers per addEventListener invocation, should
7203 // revisit and verify we can just use one (almost certainly)
7204 clickHandler = self._breadcrumbEventHandler('click');
7205 keypressHandler = self._keypressEventHandler();
7206 before = function(evt) {
7207 // need to intercept every DOM event in `before` argument, in case that
7208 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
7209 // see #724
7210 if (!evt) return;
7211
7212 var eventType;
7213 try {
7214 eventType = evt.type;
7215 } catch (e) {
7216 // just accessing event properties can throw an exception in some rare circumstances
7217 // see: https://github.com/getsentry/raven-js/issues/838
7218 return;
7219 }
7220 if (eventType === 'click') return clickHandler(evt);
7221 else if (eventType === 'keypress') return keypressHandler(evt);
7222 };
7223 }
7224 return orig.call(
7225 this,
7226 evtName,
7227 self.wrap(fn, undefined, before),
7228 capture,
7229 secure
7230 );
7231 };
7232 },
7233 wrappedBuiltIns
7234 );
7235 fill(
7236 proto,
7237 'removeEventListener',
7238 function(orig) {
7239 return function(evt, fn, capture, secure) {
7240 try {
7241 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
7242 } catch (e) {
7243 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
7244 }
7245 return orig.call(this, evt, fn, capture, secure);
7246 };
7247 },
7248 wrappedBuiltIns
7249 );
7250 }
7251 }
7252
7253 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
7254 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
7255 if (_window.requestAnimationFrame) {
7256 fill(
7257 _window,
7258 'requestAnimationFrame',
7259 function(orig) {
7260 return function(cb) {
7261 return orig(self.wrap(cb));
7262 };
7263 },
7264 wrappedBuiltIns
7265 );
7266 }
7267
7268 // event targets borrowed from bugsnag-js:
7269 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
7270 var eventTargets = [
7271 'EventTarget',
7272 'Window',
7273 'Node',
7274 'ApplicationCache',
7275 'AudioTrackList',
7276 'ChannelMergerNode',
7277 'CryptoOperation',
7278 'EventSource',
7279 'FileReader',
7280 'HTMLUnknownElement',
7281 'IDBDatabase',
7282 'IDBRequest',
7283 'IDBTransaction',
7284 'KeyOperation',
7285 'MediaController',
7286 'MessagePort',
7287 'ModalWindow',
7288 'Notification',
7289 'SVGElementInstance',
7290 'Screen',
7291 'TextTrack',
7292 'TextTrackCue',
7293 'TextTrackList',
7294 'WebSocket',
7295 'WebSocketWorker',
7296 'Worker',
7297 'XMLHttpRequest',
7298 'XMLHttpRequestEventTarget',
7299 'XMLHttpRequestUpload'
7300 ];
7301 for (var i = 0; i < eventTargets.length; i++) {
7302 wrapEventTarget(eventTargets[i]);
7303 }
7304 },
7305
7306 /**
7307 * Instrument browser built-ins w/ breadcrumb capturing
7308 * - XMLHttpRequests
7309 * - DOM interactions (click/typing)
7310 * - window.location changes
7311 * - console
7312 *
7313 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
7314 */
7315 _instrumentBreadcrumbs: function() {
7316 var self = this;
7317 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
7318
7319 var wrappedBuiltIns = self._wrappedBuiltIns;
7320
7321 function wrapProp(prop, xhr) {
7322 if (prop in xhr && isFunction(xhr[prop])) {
7323 fill(xhr, prop, function(orig) {
7324 return self.wrap(orig);
7325 }); // intentionally don't track filled methods on XHR instances
7326 }
7327 }
7328
7329 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
7330 var xhrproto = XMLHttpRequest.prototype;
7331 fill(
7332 xhrproto,
7333 'open',
7334 function(origOpen) {
7335 return function(method, url) {
7336 // preserve arity
7337
7338 // if Sentry key appears in URL, don't capture
7339 if (isString(url) && url.indexOf(self._globalKey) === -1) {
7340 this.__raven_xhr = {
7341 method: method,
7342 url: url,
7343 status_code: null
7344 };
7345 }
7346
7347 return origOpen.apply(this, arguments);
7348 };
7349 },
7350 wrappedBuiltIns
7351 );
7352
7353 fill(
7354 xhrproto,
7355 'send',
7356 function(origSend) {
7357 return function(data) {
7358 // preserve arity
7359 var xhr = this;
7360
7361 function onreadystatechangeHandler() {
7362 if (xhr.__raven_xhr && xhr.readyState === 4) {
7363 try {
7364 // touching statusCode in some platforms throws
7365 // an exception
7366 xhr.__raven_xhr.status_code = xhr.status;
7367 } catch (e) {
7368 /* do nothing */
7369 }
7370
7371 self.captureBreadcrumb({
7372 type: 'http',
7373 category: 'xhr',
7374 data: xhr.__raven_xhr
7375 });
7376 }
7377 }
7378
7379 var props = ['onload', 'onerror', 'onprogress'];
7380 for (var j = 0; j < props.length; j++) {
7381 wrapProp(props[j], xhr);
7382 }
7383
7384 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
7385 fill(
7386 xhr,
7387 'onreadystatechange',
7388 function(orig) {
7389 return self.wrap(orig, undefined, onreadystatechangeHandler);
7390 } /* intentionally don't track this instrumentation */
7391 );
7392 } else {
7393 // if onreadystatechange wasn't actually set by the page on this xhr, we
7394 // are free to set our own and capture the breadcrumb
7395 xhr.onreadystatechange = onreadystatechangeHandler;
7396 }
7397
7398 return origSend.apply(this, arguments);
7399 };
7400 },
7401 wrappedBuiltIns
7402 );
7403 }
7404
7405 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
7406 fill(
7407 _window,
7408 'fetch',
7409 function(origFetch) {
7410 return function(fn, t) {
7411 // preserve arity
7412 // Make a copy of the arguments to prevent deoptimization
7413 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
7414 var args = new Array(arguments.length);
7415 for (var i = 0; i < args.length; ++i) {
7416 args[i] = arguments[i];
7417 }
7418
7419 var fetchInput = args[0];
7420 var method = 'GET';
7421 var url;
7422
7423 if (typeof fetchInput === 'string') {
7424 url = fetchInput;
7425 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
7426 url = fetchInput.url;
7427 if (fetchInput.method) {
7428 method = fetchInput.method;
7429 }
7430 } else {
7431 url = '' + fetchInput;
7432 }
7433
7434 if (args[1] && args[1].method) {
7435 method = args[1].method;
7436 }
7437
7438 var fetchData = {
7439 method: method,
7440 url: url,
7441 status_code: null
7442 };
7443
7444 self.captureBreadcrumb({
7445 type: 'http',
7446 category: 'fetch',
7447 data: fetchData
7448 });
7449
7450 return origFetch.apply(this, args).then(function(response) {
7451 fetchData.status_code = response.status;
7452
7453 return response;
7454 });
7455 };
7456 },
7457 wrappedBuiltIns
7458 );
7459 }
7460
7461 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
7462 // to the document. Do this before we instrument addEventListener.
7463 if (autoBreadcrumbs.dom && this._hasDocument) {
7464 if (_document.addEventListener) {
7465 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
7466 _document.addEventListener('keypress', self._keypressEventHandler(), false);
7467 } else {
7468 // IE8 Compatibility
7469 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
7470 _document.attachEvent('onkeypress', self._keypressEventHandler());
7471 }
7472 }
7473
7474 // record navigation (URL) changes
7475 // NOTE: in Chrome App environment, touching history.pushState, *even inside
7476 // a try/catch block*, will cause Chrome to output an error to console.error
7477 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
7478 var chrome = _window.chrome;
7479 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
7480 var hasPushAndReplaceState =
7481 !isChromePackagedApp &&
7482 _window.history &&
7483 history.pushState &&
7484 history.replaceState;
7485 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
7486 // TODO: remove onpopstate handler on uninstall()
7487 var oldOnPopState = _window.onpopstate;
7488 _window.onpopstate = function() {
7489 var currentHref = self._location.href;
7490 self._captureUrlChange(self._lastHref, currentHref);
7491
7492 if (oldOnPopState) {
7493 return oldOnPopState.apply(this, arguments);
7494 }
7495 };
7496
7497 var historyReplacementFunction = function(origHistFunction) {
7498 // note history.pushState.length is 0; intentionally not declaring
7499 // params to preserve 0 arity
7500 return function(/* state, title, url */) {
7501 var url = arguments.length > 2 ? arguments[2] : undefined;
7502
7503 // url argument is optional
7504 if (url) {
7505 // coerce to string (this is what pushState does)
7506 self._captureUrlChange(self._lastHref, url + '');
7507 }
7508
7509 return origHistFunction.apply(this, arguments);
7510 };
7511 };
7512
7513 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
7514 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
7515 }
7516
7517 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
7518 // console
7519 var consoleMethodCallback = function(msg, data) {
7520 self.captureBreadcrumb({
7521 message: msg,
7522 level: data.level,
7523 category: 'console'
7524 });
7525 };
7526
7527 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
7528 wrapConsoleMethod(console, level, consoleMethodCallback);
7529 });
7530 }
7531 },
7532
7533 _restoreBuiltIns: function() {
7534 // restore any wrapped builtins
7535 var builtin;
7536 while (this._wrappedBuiltIns.length) {
7537 builtin = this._wrappedBuiltIns.shift();
7538
7539 var obj = builtin[0],
7540 name = builtin[1],
7541 orig = builtin[2];
7542
7543 obj[name] = orig;
7544 }
7545 },
7546
7547 _drainPlugins: function() {
7548 var self = this;
7549
7550 // FIX ME TODO
7551 each(this._plugins, function(_, plugin) {
7552 var installer = plugin[0];
7553 var args = plugin[1];
7554 installer.apply(self, [self].concat(args));
7555 });
7556 },
7557
7558 _parseDSN: function(str) {
7559 var m = dsnPattern.exec(str),
7560 dsn = {},
7561 i = 7;
7562
7563 try {
7564 while (i--) dsn[dsnKeys[i]] = m[i] || '';
7565 } catch (e) {
7566 throw new RavenConfigError('Invalid DSN: ' + str);
7567 }
7568
7569 if (dsn.pass && !this._globalOptions.allowSecretKey) {
7570 throw new RavenConfigError(
7571 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
7572 );
7573 }
7574
7575 return dsn;
7576 },
7577
7578 _getGlobalServer: function(uri) {
7579 // assemble the endpoint from the uri pieces
7580 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
7581
7582 if (uri.protocol) {
7583 globalServer = uri.protocol + ':' + globalServer;
7584 }
7585 return globalServer;
7586 },
7587
7588 _handleOnErrorStackInfo: function() {
7589 // if we are intentionally ignoring errors via onerror, bail out
7590 if (!this._ignoreOnError) {
7591 this._handleStackInfo.apply(this, arguments);
7592 }
7593 },
7594
7595 _handleStackInfo: function(stackInfo, options) {
7596 var frames = this._prepareFrames(stackInfo, options);
7597
7598 this._triggerEvent('handle', {
7599 stackInfo: stackInfo,
7600 options: options
7601 });
7602
7603 this._processException(
7604 stackInfo.name,
7605 stackInfo.message,
7606 stackInfo.url,
7607 stackInfo.lineno,
7608 frames,
7609 options
7610 );
7611 },
7612
7613 _prepareFrames: function(stackInfo, options) {
7614 var self = this;
7615 var frames = [];
7616 if (stackInfo.stack && stackInfo.stack.length) {
7617 each(stackInfo.stack, function(i, stack) {
7618 var frame = self._normalizeFrame(stack, stackInfo.url);
7619 if (frame) {
7620 frames.push(frame);
7621 }
7622 });
7623
7624 // e.g. frames captured via captureMessage throw
7625 if (options && options.trimHeadFrames) {
7626 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
7627 frames[j].in_app = false;
7628 }
7629 }
7630 }
7631 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
7632 return frames;
7633 },
7634
7635 _normalizeFrame: function(frame, stackInfoUrl) {
7636 // normalize the frames data
7637 var normalized = {
7638 filename: frame.url,
7639 lineno: frame.line,
7640 colno: frame.column,
7641 function: frame.func || '?'
7642 };
7643
7644 // Case when we don't have any information about the error
7645 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
7646 // Generating synthetic error doesn't add any value here
7647 //
7648 // We should probably somehow let a user know that they should fix their code
7649 if (!frame.url) {
7650 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
7651 }
7652
7653 normalized.in_app = !// determine if an exception came from outside of our app
7654 // first we check the global includePaths list.
7655 (
7656 (!!this._globalOptions.includePaths.test &&
7657 !this._globalOptions.includePaths.test(normalized.filename)) ||
7658 // Now we check for fun, if the function name is Raven or TraceKit
7659 /(Raven|TraceKit)\./.test(normalized['function']) ||
7660 // finally, we do a last ditch effort and check for raven.min.js
7661 /raven\.(min\.)?js$/.test(normalized.filename)
7662 );
7663
7664 return normalized;
7665 },
7666
7667 _processException: function(type, message, fileurl, lineno, frames, options) {
7668 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
7669 if (
7670 !!this._globalOptions.ignoreErrors.test &&
7671 (this._globalOptions.ignoreErrors.test(message) ||
7672 this._globalOptions.ignoreErrors.test(prefixedMessage))
7673 ) {
7674 return;
7675 }
7676
7677 var stacktrace;
7678
7679 if (frames && frames.length) {
7680 fileurl = frames[0].filename || fileurl;
7681 // Sentry expects frames oldest to newest
7682 // and JS sends them as newest to oldest
7683 frames.reverse();
7684 stacktrace = {frames: frames};
7685 } else if (fileurl) {
7686 stacktrace = {
7687 frames: [
7688 {
7689 filename: fileurl,
7690 lineno: lineno,
7691 in_app: true
7692 }
7693 ]
7694 };
7695 }
7696
7697 if (
7698 !!this._globalOptions.ignoreUrls.test &&
7699 this._globalOptions.ignoreUrls.test(fileurl)
7700 ) {
7701 return;
7702 }
7703
7704 if (
7705 !!this._globalOptions.whitelistUrls.test &&
7706 !this._globalOptions.whitelistUrls.test(fileurl)
7707 ) {
7708 return;
7709 }
7710
7711 var data = objectMerge(
7712 {
7713 // sentry.interfaces.Exception
7714 exception: {
7715 values: [
7716 {
7717 type: type,
7718 value: message,
7719 stacktrace: stacktrace
7720 }
7721 ]
7722 },
7723 culprit: fileurl
7724 },
7725 options
7726 );
7727
7728 // Fire away!
7729 this._send(data);
7730 },
7731
7732 _trimPacket: function(data) {
7733 // For now, we only want to truncate the two different messages
7734 // but this could/should be expanded to just trim everything
7735 var max = this._globalOptions.maxMessageLength;
7736 if (data.message) {
7737 data.message = truncate(data.message, max);
7738 }
7739 if (data.exception) {
7740 var exception = data.exception.values[0];
7741 exception.value = truncate(exception.value, max);
7742 }
7743
7744 var request = data.request;
7745 if (request) {
7746 if (request.url) {
7747 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
7748 }
7749 if (request.Referer) {
7750 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
7751 }
7752 }
7753
7754 if (data.breadcrumbs && data.breadcrumbs.values)
7755 this._trimBreadcrumbs(data.breadcrumbs);
7756
7757 return data;
7758 },
7759
7760 /**
7761 * Truncate breadcrumb values (right now just URLs)
7762 */
7763 _trimBreadcrumbs: function(breadcrumbs) {
7764 // known breadcrumb properties with urls
7765 // TODO: also consider arbitrary prop values that start with (https?)?://
7766 var urlProps = ['to', 'from', 'url'],
7767 urlProp,
7768 crumb,
7769 data;
7770
7771 for (var i = 0; i < breadcrumbs.values.length; ++i) {
7772 crumb = breadcrumbs.values[i];
7773 if (
7774 !crumb.hasOwnProperty('data') ||
7775 !isObject(crumb.data) ||
7776 objectFrozen(crumb.data)
7777 )
7778 continue;
7779
7780 data = objectMerge({}, crumb.data);
7781 for (var j = 0; j < urlProps.length; ++j) {
7782 urlProp = urlProps[j];
7783 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
7784 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
7785 }
7786 }
7787 breadcrumbs.values[i].data = data;
7788 }
7789 },
7790
7791 _getHttpData: function() {
7792 if (!this._hasNavigator && !this._hasDocument) return;
7793 var httpData = {};
7794
7795 if (this._hasNavigator && _navigator.userAgent) {
7796 httpData.headers = {
7797 'User-Agent': navigator.userAgent
7798 };
7799 }
7800
7801 if (this._hasDocument) {
7802 if (_document.location && _document.location.href) {
7803 httpData.url = _document.location.href;
7804 }
7805 if (_document.referrer) {
7806 if (!httpData.headers) httpData.headers = {};
7807 httpData.headers.Referer = _document.referrer;
7808 }
7809 }
7810
7811 return httpData;
7812 },
7813
7814 _resetBackoff: function() {
7815 this._backoffDuration = 0;
7816 this._backoffStart = null;
7817 },
7818
7819 _shouldBackoff: function() {
7820 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
7821 },
7822
7823 /**
7824 * Returns true if the in-process data payload matches the signature
7825 * of the previously-sent data
7826 *
7827 * NOTE: This has to be done at this level because TraceKit can generate
7828 * data from window.onerror WITHOUT an exception object (IE8, IE9,
7829 * other old browsers). This can take the form of an "exception"
7830 * data object with a single frame (derived from the onerror args).
7831 */
7832 _isRepeatData: function(current) {
7833 var last = this._lastData;
7834
7835 if (
7836 !last ||
7837 current.message !== last.message || // defined for captureMessage
7838 current.culprit !== last.culprit // defined for captureException/onerror
7839 )
7840 return false;
7841
7842 // Stacktrace interface (i.e. from captureMessage)
7843 if (current.stacktrace || last.stacktrace) {
7844 return isSameStacktrace(current.stacktrace, last.stacktrace);
7845 } else if (current.exception || last.exception) {
7846 // Exception interface (i.e. from captureException/onerror)
7847 return isSameException(current.exception, last.exception);
7848 }
7849
7850 return true;
7851 },
7852
7853 _setBackoffState: function(request) {
7854 // If we are already in a backoff state, don't change anything
7855 if (this._shouldBackoff()) {
7856 return;
7857 }
7858
7859 var status = request.status;
7860
7861 // 400 - project_id doesn't exist or some other fatal
7862 // 401 - invalid/revoked dsn
7863 // 429 - too many requests
7864 if (!(status === 400 || status === 401 || status === 429)) return;
7865
7866 var retry;
7867 try {
7868 // If Retry-After is not in Access-Control-Expose-Headers, most
7869 // browsers will throw an exception trying to access it
7870 retry = request.getResponseHeader('Retry-After');
7871 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
7872 } catch (e) {
7873 /* eslint no-empty:0 */
7874 }
7875
7876 this._backoffDuration = retry
7877 ? // If Sentry server returned a Retry-After value, use it
7878 retry
7879 : // Otherwise, double the last backoff duration (starts at 1 sec)
7880 this._backoffDuration * 2 || 1000;
7881
7882 this._backoffStart = now();
7883 },
7884
7885 _send: function(data) {
7886 var globalOptions = this._globalOptions;
7887
7888 var baseData = {
7889 project: this._globalProject,
7890 logger: globalOptions.logger,
7891 platform: 'javascript'
7892 },
7893 httpData = this._getHttpData();
7894
7895 if (httpData) {
7896 baseData.request = httpData;
7897 }
7898
7899 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
7900 if (data.trimHeadFrames) delete data.trimHeadFrames;
7901
7902 data = objectMerge(baseData, data);
7903
7904 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
7905 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
7906 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
7907
7908 // Send along our own collected metadata with extra
7909 data.extra['session:duration'] = now() - this._startTime;
7910
7911 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
7912 // intentionally make shallow copy so that additions
7913 // to breadcrumbs aren't accidentally sent in this request
7914 data.breadcrumbs = {
7915 values: [].slice.call(this._breadcrumbs, 0)
7916 };
7917 }
7918
7919 // If there are no tags/extra, strip the key from the payload alltogther.
7920 if (isEmptyObject(data.tags)) delete data.tags;
7921
7922 if (this._globalContext.user) {
7923 // sentry.interfaces.User
7924 data.user = this._globalContext.user;
7925 }
7926
7927 // Include the environment if it's defined in globalOptions
7928 if (globalOptions.environment) data.environment = globalOptions.environment;
7929
7930 // Include the release if it's defined in globalOptions
7931 if (globalOptions.release) data.release = globalOptions.release;
7932
7933 // Include server_name if it's defined in globalOptions
7934 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
7935
7936 if (isFunction(globalOptions.dataCallback)) {
7937 data = globalOptions.dataCallback(data) || data;
7938 }
7939
7940 // Why??????????
7941 if (!data || isEmptyObject(data)) {
7942 return;
7943 }
7944
7945 // Check if the request should be filtered or not
7946 if (
7947 isFunction(globalOptions.shouldSendCallback) &&
7948 !globalOptions.shouldSendCallback(data)
7949 ) {
7950 return;
7951 }
7952
7953 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
7954 // so drop requests until "cool-off" period has elapsed.
7955 if (this._shouldBackoff()) {
7956 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
7957 return;
7958 }
7959
7960 if (typeof globalOptions.sampleRate === 'number') {
7961 if (Math.random() < globalOptions.sampleRate) {
7962 this._sendProcessedPayload(data);
7963 }
7964 } else {
7965 this._sendProcessedPayload(data);
7966 }
7967 },
7968
7969 _getUuid: function() {
7970 return uuid4();
7971 },
7972
7973 _sendProcessedPayload: function(data, callback) {
7974 var self = this;
7975 var globalOptions = this._globalOptions;
7976
7977 if (!this.isSetup()) return;
7978
7979 // Try and clean up the packet before sending by truncating long values
7980 data = this._trimPacket(data);
7981
7982 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
7983 // but this would require copying an un-truncated copy of the data packet, which can be
7984 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
7985 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
7986 this._logDebug('warn', 'Raven dropped repeat event: ', data);
7987 return;
7988 }
7989
7990 // Send along an event_id if not explicitly passed.
7991 // This event_id can be used to reference the error within Sentry itself.
7992 // Set lastEventId after we know the error should actually be sent
7993 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
7994
7995 // Store outbound payload after trim
7996 this._lastData = data;
7997
7998 this._logDebug('debug', 'Raven about to send:', data);
7999
8000 var auth = {
8001 sentry_version: '7',
8002 sentry_client: 'raven-js/' + this.VERSION,
8003 sentry_key: this._globalKey
8004 };
8005
8006 if (this._globalSecret) {
8007 auth.sentry_secret = this._globalSecret;
8008 }
8009
8010 var exception = data.exception && data.exception.values[0];
8011 this.captureBreadcrumb({
8012 category: 'sentry',
8013 message: exception
8014 ? (exception.type ? exception.type + ': ' : '') + exception.value
8015 : data.message,
8016 event_id: data.event_id,
8017 level: data.level || 'error' // presume error unless specified
8018 });
8019
8020 var url = this._globalEndpoint;
8021 (globalOptions.transport || this._makeRequest).call(this, {
8022 url: url,
8023 auth: auth,
8024 data: data,
8025 options: globalOptions,
8026 onSuccess: function success() {
8027 self._resetBackoff();
8028
8029 self._triggerEvent('success', {
8030 data: data,
8031 src: url
8032 });
8033 callback && callback();
8034 },
8035 onError: function failure(error) {
8036 self._logDebug('error', 'Raven transport failed to send: ', error);
8037
8038 if (error.request) {
8039 self._setBackoffState(error.request);
8040 }
8041
8042 self._triggerEvent('failure', {
8043 data: data,
8044 src: url
8045 });
8046 error = error || new Error('Raven send failed (no additional details provided)');
8047 callback && callback(error);
8048 }
8049 });
8050 },
8051
8052 _makeRequest: function(opts) {
8053 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
8054 if (!request) return;
8055
8056 // if browser doesn't support CORS (e.g. IE7), we are out of luck
8057 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
8058
8059 if (!hasCORS) return;
8060
8061 var url = opts.url;
8062
8063 if ('withCredentials' in request) {
8064 request.onreadystatechange = function() {
8065 if (request.readyState !== 4) {
8066 return;
8067 } else if (request.status === 200) {
8068 opts.onSuccess && opts.onSuccess();
8069 } else if (opts.onError) {
8070 var err = new Error('Sentry error code: ' + request.status);
8071 err.request = request;
8072 opts.onError(err);
8073 }
8074 };
8075 } else {
8076 request = new XDomainRequest();
8077 // xdomainrequest cannot go http -> https (or vice versa),
8078 // so always use protocol relative
8079 url = url.replace(/^https?:/, '');
8080
8081 // onreadystatechange not supported by XDomainRequest
8082 if (opts.onSuccess) {
8083 request.onload = opts.onSuccess;
8084 }
8085 if (opts.onError) {
8086 request.onerror = function() {
8087 var err = new Error('Sentry error code: XDomainRequest');
8088 err.request = request;
8089 opts.onError(err);
8090 };
8091 }
8092 }
8093
8094 // NOTE: auth is intentionally sent as part of query string (NOT as custom
8095 // HTTP header) so as to avoid preflight CORS requests
8096 request.open('POST', url + '?' + urlencode(opts.auth));
8097 request.send(stringify(opts.data));
8098 },
8099
8100 _logDebug: function(level) {
8101 if (this._originalConsoleMethods[level] && this.debug) {
8102 // In IE<10 console methods do not have their own 'apply' method
8103 Function.prototype.apply.call(
8104 this._originalConsoleMethods[level],
8105 this._originalConsole,
8106 [].slice.call(arguments, 1)
8107 );
8108 }
8109 },
8110
8111 _mergeContext: function(key, context) {
8112 if (isUndefined(context)) {
8113 delete this._globalContext[key];
8114 } else {
8115 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
8116 }
8117 }
8118 };
8119
8120 // Deprecations
8121 Raven.prototype.setUser = Raven.prototype.setUserContext;
8122 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
8123
8124 module.exports = Raven;
8125
8126
8127 /***/ }),
8128
8129 /***/ "./node_modules/raven-js/src/singleton.js":
8130 /*!************************************************!*\
8131 !*** ./node_modules/raven-js/src/singleton.js ***!
8132 \************************************************/
8133 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8134
8135 /**
8136 * Enforces a single instance of the Raven client, and the
8137 * main entry point for Raven. If you are a consumer of the
8138 * Raven library, you SHOULD load this file (vs raven.js).
8139 **/
8140
8141 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
8142
8143 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
8144 var _window =
8145 typeof window !== 'undefined'
8146 ? window
8147 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
8148 var _Raven = _window.Raven;
8149
8150 var Raven = new RavenConstructor();
8151
8152 /*
8153 * Allow multiple versions of Raven to be installed.
8154 * Strip Raven from the global context and returns the instance.
8155 *
8156 * @return {Raven}
8157 */
8158 Raven.noConflict = function() {
8159 _window.Raven = _Raven;
8160 return Raven;
8161 };
8162
8163 Raven.afterLoad();
8164
8165 module.exports = Raven;
8166
8167
8168 /***/ }),
8169
8170 /***/ "./node_modules/raven-js/src/utils.js":
8171 /*!********************************************!*\
8172 !*** ./node_modules/raven-js/src/utils.js ***!
8173 \********************************************/
8174 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8175
8176 var _window =
8177 typeof window !== 'undefined'
8178 ? window
8179 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
8180
8181 function isObject(what) {
8182 return typeof what === 'object' && what !== null;
8183 }
8184
8185 // Yanked from https://git.io/vS8DV re-used under CC0
8186 // with some tiny modifications
8187 function isError(value) {
8188 switch ({}.toString.call(value)) {
8189 case '[object Error]':
8190 return true;
8191 case '[object Exception]':
8192 return true;
8193 case '[object DOMException]':
8194 return true;
8195 default:
8196 return value instanceof Error;
8197 }
8198 }
8199
8200 function isErrorEvent(value) {
8201 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
8202 }
8203
8204 function isUndefined(what) {
8205 return what === void 0;
8206 }
8207
8208 function isFunction(what) {
8209 return typeof what === 'function';
8210 }
8211
8212 function isString(what) {
8213 return Object.prototype.toString.call(what) === '[object String]';
8214 }
8215
8216 function isEmptyObject(what) {
8217 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
8218 return true;
8219 }
8220
8221 function supportsErrorEvent() {
8222 try {
8223 new ErrorEvent(''); // eslint-disable-line no-new
8224 return true;
8225 } catch (e) {
8226 return false;
8227 }
8228 }
8229
8230 function wrappedCallback(callback) {
8231 function dataCallback(data, original) {
8232 var normalizedData = callback(data) || data;
8233 if (original) {
8234 return original(normalizedData) || normalizedData;
8235 }
8236 return normalizedData;
8237 }
8238
8239 return dataCallback;
8240 }
8241
8242 function each(obj, callback) {
8243 var i, j;
8244
8245 if (isUndefined(obj.length)) {
8246 for (i in obj) {
8247 if (hasKey(obj, i)) {
8248 callback.call(null, i, obj[i]);
8249 }
8250 }
8251 } else {
8252 j = obj.length;
8253 if (j) {
8254 for (i = 0; i < j; i++) {
8255 callback.call(null, i, obj[i]);
8256 }
8257 }
8258 }
8259 }
8260
8261 function objectMerge(obj1, obj2) {
8262 if (!obj2) {
8263 return obj1;
8264 }
8265 each(obj2, function(key, value) {
8266 obj1[key] = value;
8267 });
8268 return obj1;
8269 }
8270
8271 /**
8272 * This function is only used for react-native.
8273 * react-native freezes object that have already been sent over the
8274 * js bridge. We need this function in order to check if the object is frozen.
8275 * So it's ok that objectFrozen returns false if Object.isFrozen is not
8276 * supported because it's not relevant for other "platforms". See related issue:
8277 * https://github.com/getsentry/react-native-sentry/issues/57
8278 */
8279 function objectFrozen(obj) {
8280 if (!Object.isFrozen) {
8281 return false;
8282 }
8283 return Object.isFrozen(obj);
8284 }
8285
8286 function truncate(str, max) {
8287 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
8288 }
8289
8290 /**
8291 * hasKey, a better form of hasOwnProperty
8292 * Example: hasKey(MainHostObject, property) === true/false
8293 *
8294 * @param {Object} host object to check property
8295 * @param {string} key to check
8296 */
8297 function hasKey(object, key) {
8298 return Object.prototype.hasOwnProperty.call(object, key);
8299 }
8300
8301 function joinRegExp(patterns) {
8302 // Combine an array of regular expressions and strings into one large regexp
8303 // Be mad.
8304 var sources = [],
8305 i = 0,
8306 len = patterns.length,
8307 pattern;
8308
8309 for (; i < len; i++) {
8310 pattern = patterns[i];
8311 if (isString(pattern)) {
8312 // If it's a string, we need to escape it
8313 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
8314 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
8315 } else if (pattern && pattern.source) {
8316 // If it's a regexp already, we want to extract the source
8317 sources.push(pattern.source);
8318 }
8319 // Intentionally skip other cases
8320 }
8321 return new RegExp(sources.join('|'), 'i');
8322 }
8323
8324 function urlencode(o) {
8325 var pairs = [];
8326 each(o, function(key, value) {
8327 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
8328 });
8329 return pairs.join('&');
8330 }
8331
8332 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
8333 // intentionally using regex and not <a/> href parsing trick because React Native and other
8334 // environments where DOM might not be available
8335 function parseUrl(url) {
8336 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
8337 if (!match) return {};
8338
8339 // coerce to undefined values to empty string so we don't get 'undefined'
8340 var query = match[6] || '';
8341 var fragment = match[8] || '';
8342 return {
8343 protocol: match[2],
8344 host: match[4],
8345 path: match[5],
8346 relative: match[5] + query + fragment // everything minus origin
8347 };
8348 }
8349 function uuid4() {
8350 var crypto = _window.crypto || _window.msCrypto;
8351
8352 if (!isUndefined(crypto) && crypto.getRandomValues) {
8353 // Use window.crypto API if available
8354 // eslint-disable-next-line no-undef
8355 var arr = new Uint16Array(8);
8356 crypto.getRandomValues(arr);
8357
8358 // set 4 in byte 7
8359 arr[3] = (arr[3] & 0xfff) | 0x4000;
8360 // set 2 most significant bits of byte 9 to '10'
8361 arr[4] = (arr[4] & 0x3fff) | 0x8000;
8362
8363 var pad = function(num) {
8364 var v = num.toString(16);
8365 while (v.length < 4) {
8366 v = '0' + v;
8367 }
8368 return v;
8369 };
8370
8371 return (
8372 pad(arr[0]) +
8373 pad(arr[1]) +
8374 pad(arr[2]) +
8375 pad(arr[3]) +
8376 pad(arr[4]) +
8377 pad(arr[5]) +
8378 pad(arr[6]) +
8379 pad(arr[7])
8380 );
8381 } else {
8382 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
8383 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
8384 var r = (Math.random() * 16) | 0,
8385 v = c === 'x' ? r : (r & 0x3) | 0x8;
8386 return v.toString(16);
8387 });
8388 }
8389 }
8390
8391 /**
8392 * Given a child DOM element, returns a query-selector statement describing that
8393 * and its ancestors
8394 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
8395 * @param elem
8396 * @returns {string}
8397 */
8398 function htmlTreeAsString(elem) {
8399 /* eslint no-extra-parens:0*/
8400 var MAX_TRAVERSE_HEIGHT = 5,
8401 MAX_OUTPUT_LEN = 80,
8402 out = [],
8403 height = 0,
8404 len = 0,
8405 separator = ' > ',
8406 sepLength = separator.length,
8407 nextStr;
8408
8409 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
8410 nextStr = htmlElementAsString(elem);
8411 // bail out if
8412 // - nextStr is the 'html' element
8413 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
8414 // (ignore this limit if we are on the first iteration)
8415 if (
8416 nextStr === 'html' ||
8417 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
8418 ) {
8419 break;
8420 }
8421
8422 out.push(nextStr);
8423
8424 len += nextStr.length;
8425 elem = elem.parentNode;
8426 }
8427
8428 return out.reverse().join(separator);
8429 }
8430
8431 /**
8432 * Returns a simple, query-selector representation of a DOM element
8433 * e.g. [HTMLElement] => input#foo.btn[name=baz]
8434 * @param HTMLElement
8435 * @returns {string}
8436 */
8437 function htmlElementAsString(elem) {
8438 var out = [],
8439 className,
8440 classes,
8441 key,
8442 attr,
8443 i;
8444
8445 if (!elem || !elem.tagName) {
8446 return '';
8447 }
8448
8449 out.push(elem.tagName.toLowerCase());
8450 if (elem.id) {
8451 out.push('#' + elem.id);
8452 }
8453
8454 className = elem.className;
8455 if (className && isString(className)) {
8456 classes = className.split(/\s+/);
8457 for (i = 0; i < classes.length; i++) {
8458 out.push('.' + classes[i]);
8459 }
8460 }
8461 var attrWhitelist = ['type', 'name', 'title', 'alt'];
8462 for (i = 0; i < attrWhitelist.length; i++) {
8463 key = attrWhitelist[i];
8464 attr = elem.getAttribute(key);
8465 if (attr) {
8466 out.push('[' + key + '="' + attr + '"]');
8467 }
8468 }
8469 return out.join('');
8470 }
8471
8472 /**
8473 * Returns true if either a OR b is truthy, but not both
8474 */
8475 function isOnlyOneTruthy(a, b) {
8476 return !!(!!a ^ !!b);
8477 }
8478
8479 /**
8480 * Returns true if the two input exception interfaces have the same content
8481 */
8482 function isSameException(ex1, ex2) {
8483 if (isOnlyOneTruthy(ex1, ex2)) return false;
8484
8485 ex1 = ex1.values[0];
8486 ex2 = ex2.values[0];
8487
8488 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
8489
8490 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
8491 }
8492
8493 /**
8494 * Returns true if the two input stack trace interfaces have the same content
8495 */
8496 function isSameStacktrace(stack1, stack2) {
8497 if (isOnlyOneTruthy(stack1, stack2)) return false;
8498
8499 var frames1 = stack1.frames;
8500 var frames2 = stack2.frames;
8501
8502 // Exit early if frame count differs
8503 if (frames1.length !== frames2.length) return false;
8504
8505 // Iterate through every frame; bail out if anything differs
8506 var a, b;
8507 for (var i = 0; i < frames1.length; i++) {
8508 a = frames1[i];
8509 b = frames2[i];
8510 if (
8511 a.filename !== b.filename ||
8512 a.lineno !== b.lineno ||
8513 a.colno !== b.colno ||
8514 a['function'] !== b['function']
8515 )
8516 return false;
8517 }
8518 return true;
8519 }
8520
8521 /**
8522 * Polyfill a method
8523 * @param obj object e.g. `document`
8524 * @param name method name present on object e.g. `addEventListener`
8525 * @param replacement replacement function
8526 * @param track {optional} record instrumentation to an array
8527 */
8528 function fill(obj, name, replacement, track) {
8529 var orig = obj[name];
8530 obj[name] = replacement(orig);
8531 if (track) {
8532 track.push([obj, name, orig]);
8533 }
8534 }
8535
8536 module.exports = {
8537 isObject: isObject,
8538 isError: isError,
8539 isErrorEvent: isErrorEvent,
8540 isUndefined: isUndefined,
8541 isFunction: isFunction,
8542 isString: isString,
8543 isEmptyObject: isEmptyObject,
8544 supportsErrorEvent: supportsErrorEvent,
8545 wrappedCallback: wrappedCallback,
8546 each: each,
8547 objectMerge: objectMerge,
8548 truncate: truncate,
8549 objectFrozen: objectFrozen,
8550 hasKey: hasKey,
8551 joinRegExp: joinRegExp,
8552 urlencode: urlencode,
8553 uuid4: uuid4,
8554 htmlTreeAsString: htmlTreeAsString,
8555 htmlElementAsString: htmlElementAsString,
8556 isSameException: isSameException,
8557 isSameStacktrace: isSameStacktrace,
8558 parseUrl: parseUrl,
8559 fill: fill
8560 };
8561
8562
8563 /***/ }),
8564
8565 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
8566 /*!***********************************************************!*\
8567 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
8568 \***********************************************************/
8569 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8570
8571 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
8572
8573 /*
8574 TraceKit - Cross brower stack traces
8575
8576 This was originally forked from github.com/occ/TraceKit, but has since been
8577 largely re-written and is now maintained as part of raven-js. Tests for
8578 this are in test/vendor.
8579
8580 MIT license
8581 */
8582
8583 var TraceKit = {
8584 collectWindowErrors: true,
8585 debug: false
8586 };
8587
8588 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
8589 var _window =
8590 typeof window !== 'undefined'
8591 ? window
8592 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
8593
8594 // global reference to slice
8595 var _slice = [].slice;
8596 var UNKNOWN_FUNCTION = '?';
8597
8598 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
8599 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
8600
8601 function getLocationHref() {
8602 if (typeof document === 'undefined' || document.location == null) return '';
8603
8604 return document.location.href;
8605 }
8606
8607 /**
8608 * TraceKit.report: cross-browser processing of unhandled exceptions
8609 *
8610 * Syntax:
8611 * TraceKit.report.subscribe(function(stackInfo) { ... })
8612 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
8613 * TraceKit.report(exception)
8614 * try { ...code... } catch(ex) { TraceKit.report(ex); }
8615 *
8616 * Supports:
8617 * - Firefox: full stack trace with line numbers, plus column number
8618 * on top frame; column number is not guaranteed
8619 * - Opera: full stack trace with line and column numbers
8620 * - Chrome: full stack trace with line and column numbers
8621 * - Safari: line and column number for the top frame only; some frames
8622 * may be missing, and column number is not guaranteed
8623 * - IE: line and column number for the top frame only; some frames
8624 * may be missing, and column number is not guaranteed
8625 *
8626 * In theory, TraceKit should work on all of the following versions:
8627 * - IE5.5+ (only 8.0 tested)
8628 * - Firefox 0.9+ (only 3.5+ tested)
8629 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
8630 * Exceptions Have Stacktrace to be enabled in opera:config)
8631 * - Safari 3+ (only 4+ tested)
8632 * - Chrome 1+ (only 5+ tested)
8633 * - Konqueror 3.5+ (untested)
8634 *
8635 * Requires TraceKit.computeStackTrace.
8636 *
8637 * Tries to catch all unhandled exceptions and report them to the
8638 * subscribed handlers. Please note that TraceKit.report will rethrow the
8639 * exception. This is REQUIRED in order to get a useful stack trace in IE.
8640 * If the exception does not reach the top of the browser, you will only
8641 * get a stack trace from the point where TraceKit.report was called.
8642 *
8643 * Handlers receive a stackInfo object as described in the
8644 * TraceKit.computeStackTrace docs.
8645 */
8646 TraceKit.report = (function reportModuleWrapper() {
8647 var handlers = [],
8648 lastArgs = null,
8649 lastException = null,
8650 lastExceptionStack = null;
8651
8652 /**
8653 * Add a crash handler.
8654 * @param {Function} handler
8655 */
8656 function subscribe(handler) {
8657 installGlobalHandler();
8658 handlers.push(handler);
8659 }
8660
8661 /**
8662 * Remove a crash handler.
8663 * @param {Function} handler
8664 */
8665 function unsubscribe(handler) {
8666 for (var i = handlers.length - 1; i >= 0; --i) {
8667 if (handlers[i] === handler) {
8668 handlers.splice(i, 1);
8669 }
8670 }
8671 }
8672
8673 /**
8674 * Remove all crash handlers.
8675 */
8676 function unsubscribeAll() {
8677 uninstallGlobalHandler();
8678 handlers = [];
8679 }
8680
8681 /**
8682 * Dispatch stack information to all handlers.
8683 * @param {Object.<string, *>} stack
8684 */
8685 function notifyHandlers(stack, isWindowError) {
8686 var exception = null;
8687 if (isWindowError && !TraceKit.collectWindowErrors) {
8688 return;
8689 }
8690 for (var i in handlers) {
8691 if (handlers.hasOwnProperty(i)) {
8692 try {
8693 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
8694 } catch (inner) {
8695 exception = inner;
8696 }
8697 }
8698 }
8699
8700 if (exception) {
8701 throw exception;
8702 }
8703 }
8704
8705 var _oldOnerrorHandler, _onErrorHandlerInstalled;
8706
8707 /**
8708 * Ensures all global unhandled exceptions are recorded.
8709 * Supported by Gecko and IE.
8710 * @param {string} message Error message.
8711 * @param {string} url URL of script that generated the exception.
8712 * @param {(number|string)} lineNo The line number at which the error
8713 * occurred.
8714 * @param {?(number|string)} colNo The column number at which the error
8715 * occurred.
8716 * @param {?Error} ex The actual Error object.
8717 */
8718 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
8719 var stack = null;
8720
8721 if (lastExceptionStack) {
8722 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
8723 lastExceptionStack,
8724 url,
8725 lineNo,
8726 message
8727 );
8728 processLastException();
8729 } else if (ex && utils.isError(ex)) {
8730 // non-string `ex` arg; attempt to extract stack trace
8731
8732 // New chrome and blink send along a real error object
8733 // Let's just report that like a normal error.
8734 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
8735 stack = TraceKit.computeStackTrace(ex);
8736 notifyHandlers(stack, true);
8737 } else {
8738 var location = {
8739 url: url,
8740 line: lineNo,
8741 column: colNo
8742 };
8743
8744 var name = undefined;
8745 var msg = message; // must be new var or will modify original `arguments`
8746 var groups;
8747 if ({}.toString.call(message) === '[object String]') {
8748 var groups = message.match(ERROR_TYPES_RE);
8749 if (groups) {
8750 name = groups[1];
8751 msg = groups[2];
8752 }
8753 }
8754
8755 location.func = UNKNOWN_FUNCTION;
8756
8757 stack = {
8758 name: name,
8759 message: msg,
8760 url: getLocationHref(),
8761 stack: [location]
8762 };
8763 notifyHandlers(stack, true);
8764 }
8765
8766 if (_oldOnerrorHandler) {
8767 return _oldOnerrorHandler.apply(this, arguments);
8768 }
8769
8770 return false;
8771 }
8772
8773 function installGlobalHandler() {
8774 if (_onErrorHandlerInstalled) {
8775 return;
8776 }
8777 _oldOnerrorHandler = _window.onerror;
8778 _window.onerror = traceKitWindowOnError;
8779 _onErrorHandlerInstalled = true;
8780 }
8781
8782 function uninstallGlobalHandler() {
8783 if (!_onErrorHandlerInstalled) {
8784 return;
8785 }
8786 _window.onerror = _oldOnerrorHandler;
8787 _onErrorHandlerInstalled = false;
8788 _oldOnerrorHandler = undefined;
8789 }
8790
8791 function processLastException() {
8792 var _lastExceptionStack = lastExceptionStack,
8793 _lastArgs = lastArgs;
8794 lastArgs = null;
8795 lastExceptionStack = null;
8796 lastException = null;
8797 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
8798 }
8799
8800 /**
8801 * Reports an unhandled Error to TraceKit.
8802 * @param {Error} ex
8803 * @param {?boolean} rethrow If false, do not re-throw the exception.
8804 * Only used for window.onerror to not cause an infinite loop of
8805 * rethrowing.
8806 */
8807 function report(ex, rethrow) {
8808 var args = _slice.call(arguments, 1);
8809 if (lastExceptionStack) {
8810 if (lastException === ex) {
8811 return; // already caught by an inner catch block, ignore
8812 } else {
8813 processLastException();
8814 }
8815 }
8816
8817 var stack = TraceKit.computeStackTrace(ex);
8818 lastExceptionStack = stack;
8819 lastException = ex;
8820 lastArgs = args;
8821
8822 // If the stack trace is incomplete, wait for 2 seconds for
8823 // slow slow IE to see if onerror occurs or not before reporting
8824 // this exception; otherwise, we will end up with an incomplete
8825 // stack trace
8826 setTimeout(function() {
8827 if (lastException === ex) {
8828 processLastException();
8829 }
8830 }, stack.incomplete ? 2000 : 0);
8831
8832 if (rethrow !== false) {
8833 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
8834 }
8835 }
8836
8837 report.subscribe = subscribe;
8838 report.unsubscribe = unsubscribe;
8839 report.uninstall = unsubscribeAll;
8840 return report;
8841 })();
8842
8843 /**
8844 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
8845 *
8846 * Syntax:
8847 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
8848 * Returns:
8849 * s.name - exception name
8850 * s.message - exception message
8851 * s.stack[i].url - JavaScript or HTML file URL
8852 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
8853 * s.stack[i].args - arguments passed to the function, if known
8854 * s.stack[i].line - line number, if known
8855 * s.stack[i].column - column number, if known
8856 *
8857 * Supports:
8858 * - Firefox: full stack trace with line numbers and unreliable column
8859 * number on top frame
8860 * - Opera 10: full stack trace with line and column numbers
8861 * - Opera 9-: full stack trace with line numbers
8862 * - Chrome: full stack trace with line and column numbers
8863 * - Safari: line and column number for the topmost stacktrace element
8864 * only
8865 * - IE: no line numbers whatsoever
8866 *
8867 * Tries to guess names of anonymous functions by looking for assignments
8868 * in the source code. In IE and Safari, we have to guess source file names
8869 * by searching for function bodies inside all page scripts. This will not
8870 * work for scripts that are loaded cross-domain.
8871 * Here be dragons: some function names may be guessed incorrectly, and
8872 * duplicate functions may be mismatched.
8873 *
8874 * TraceKit.computeStackTrace should only be used for tracing purposes.
8875 * Logging of unhandled exceptions should be done with TraceKit.report,
8876 * which builds on top of TraceKit.computeStackTrace and provides better
8877 * IE support by utilizing the window.onerror event to retrieve information
8878 * about the top of the stack.
8879 *
8880 * Note: In IE and Safari, no stack trace is recorded on the Error object,
8881 * so computeStackTrace instead walks its *own* chain of callers.
8882 * This means that:
8883 * * in Safari, some methods may be missing from the stack trace;
8884 * * in IE, the topmost function in the stack trace will always be the
8885 * caller of computeStackTrace.
8886 *
8887 * This is okay for tracing (because you are likely to be calling
8888 * computeStackTrace from the function you want to be the topmost element
8889 * of the stack trace anyway), but not okay for logging unhandled
8890 * exceptions (because your catch block will likely be far away from the
8891 * inner function that actually caused the exception).
8892 *
8893 */
8894 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
8895 // Contents of Exception in various browsers.
8896 //
8897 // SAFARI:
8898 // ex.message = Can't find variable: qq
8899 // ex.line = 59
8900 // ex.sourceId = 580238192
8901 // ex.sourceURL = http://...
8902 // ex.expressionBeginOffset = 96
8903 // ex.expressionCaretOffset = 98
8904 // ex.expressionEndOffset = 98
8905 // ex.name = ReferenceError
8906 //
8907 // FIREFOX:
8908 // ex.message = qq is not defined
8909 // ex.fileName = http://...
8910 // ex.lineNumber = 59
8911 // ex.columnNumber = 69
8912 // ex.stack = ...stack trace... (see the example below)
8913 // ex.name = ReferenceError
8914 //
8915 // CHROME:
8916 // ex.message = qq is not defined
8917 // ex.name = ReferenceError
8918 // ex.type = not_defined
8919 // ex.arguments = ['aa']
8920 // ex.stack = ...stack trace...
8921 //
8922 // INTERNET EXPLORER:
8923 // ex.message = ...
8924 // ex.name = ReferenceError
8925 //
8926 // OPERA:
8927 // ex.message = ...message... (see the example below)
8928 // ex.name = ReferenceError
8929 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
8930 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
8931
8932 /**
8933 * Computes stack trace information from the stack property.
8934 * Chrome and Gecko use this property.
8935 * @param {Error} ex
8936 * @return {?Object.<string, *>} Stack trace information.
8937 */
8938 function computeStackTraceFromStackProp(ex) {
8939 if (typeof ex.stack === 'undefined' || !ex.stack) return;
8940
8941 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
8942 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
8943 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
8944 // Used to additionally parse URL/line/column from eval frames
8945 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
8946 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
8947 lines = ex.stack.split('\n'),
8948 stack = [],
8949 submatch,
8950 parts,
8951 element,
8952 reference = /^(.*) is undefined$/.exec(ex.message);
8953
8954 for (var i = 0, j = lines.length; i < j; ++i) {
8955 if ((parts = chrome.exec(lines[i]))) {
8956 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
8957 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
8958 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
8959 // throw out eval line/column and use top-most line/column number
8960 parts[2] = submatch[1]; // url
8961 parts[3] = submatch[2]; // line
8962 parts[4] = submatch[3]; // column
8963 }
8964 element = {
8965 url: !isNative ? parts[2] : null,
8966 func: parts[1] || UNKNOWN_FUNCTION,
8967 args: isNative ? [parts[2]] : [],
8968 line: parts[3] ? +parts[3] : null,
8969 column: parts[4] ? +parts[4] : null
8970 };
8971 } else if ((parts = winjs.exec(lines[i]))) {
8972 element = {
8973 url: parts[2],
8974 func: parts[1] || UNKNOWN_FUNCTION,
8975 args: [],
8976 line: +parts[3],
8977 column: parts[4] ? +parts[4] : null
8978 };
8979 } else if ((parts = gecko.exec(lines[i]))) {
8980 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
8981 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
8982 // throw out eval line/column and use top-most line number
8983 parts[3] = submatch[1];
8984 parts[4] = submatch[2];
8985 parts[5] = null; // no column when eval
8986 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
8987 // FireFox uses this awesome columnNumber property for its top frame
8988 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
8989 // so adding 1
8990 // NOTE: this hack doesn't work if top-most frame is eval
8991 stack[0].column = ex.columnNumber + 1;
8992 }
8993 element = {
8994 url: parts[3],
8995 func: parts[1] || UNKNOWN_FUNCTION,
8996 args: parts[2] ? parts[2].split(',') : [],
8997 line: parts[4] ? +parts[4] : null,
8998 column: parts[5] ? +parts[5] : null
8999 };
9000 } else {
9001 continue;
9002 }
9003
9004 if (!element.func && element.line) {
9005 element.func = UNKNOWN_FUNCTION;
9006 }
9007
9008 stack.push(element);
9009 }
9010
9011 if (!stack.length) {
9012 return null;
9013 }
9014
9015 return {
9016 name: ex.name,
9017 message: ex.message,
9018 url: getLocationHref(),
9019 stack: stack
9020 };
9021 }
9022
9023 /**
9024 * Adds information about the first frame to incomplete stack traces.
9025 * Safari and IE require this to get complete data on the first frame.
9026 * @param {Object.<string, *>} stackInfo Stack trace information from
9027 * one of the compute* methods.
9028 * @param {string} url The URL of the script that caused an error.
9029 * @param {(number|string)} lineNo The line number of the script that
9030 * caused an error.
9031 * @param {string=} message The error generated by the browser, which
9032 * hopefully contains the name of the object that caused the error.
9033 * @return {boolean} Whether or not the stack information was
9034 * augmented.
9035 */
9036 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
9037 var initial = {
9038 url: url,
9039 line: lineNo
9040 };
9041
9042 if (initial.url && initial.line) {
9043 stackInfo.incomplete = false;
9044
9045 if (!initial.func) {
9046 initial.func = UNKNOWN_FUNCTION;
9047 }
9048
9049 if (stackInfo.stack.length > 0) {
9050 if (stackInfo.stack[0].url === initial.url) {
9051 if (stackInfo.stack[0].line === initial.line) {
9052 return false; // already in stack trace
9053 } else if (
9054 !stackInfo.stack[0].line &&
9055 stackInfo.stack[0].func === initial.func
9056 ) {
9057 stackInfo.stack[0].line = initial.line;
9058 return false;
9059 }
9060 }
9061 }
9062
9063 stackInfo.stack.unshift(initial);
9064 stackInfo.partial = true;
9065 return true;
9066 } else {
9067 stackInfo.incomplete = true;
9068 }
9069
9070 return false;
9071 }
9072
9073 /**
9074 * Computes stack trace information by walking the arguments.caller
9075 * chain at the time the exception occurred. This will cause earlier
9076 * frames to be missed but is the only way to get any stack trace in
9077 * Safari and IE. The top frame is restored by
9078 * {@link augmentStackTraceWithInitialElement}.
9079 * @param {Error} ex
9080 * @return {?Object.<string, *>} Stack trace information.
9081 */
9082 function computeStackTraceByWalkingCallerChain(ex, depth) {
9083 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
9084 stack = [],
9085 funcs = {},
9086 recursion = false,
9087 parts,
9088 item,
9089 source;
9090
9091 for (
9092 var curr = computeStackTraceByWalkingCallerChain.caller;
9093 curr && !recursion;
9094 curr = curr.caller
9095 ) {
9096 if (curr === computeStackTrace || curr === TraceKit.report) {
9097 // console.log('skipping internal function');
9098 continue;
9099 }
9100
9101 item = {
9102 url: null,
9103 func: UNKNOWN_FUNCTION,
9104 line: null,
9105 column: null
9106 };
9107
9108 if (curr.name) {
9109 item.func = curr.name;
9110 } else if ((parts = functionName.exec(curr.toString()))) {
9111 item.func = parts[1];
9112 }
9113
9114 if (typeof item.func === 'undefined') {
9115 try {
9116 item.func = parts.input.substring(0, parts.input.indexOf('{'));
9117 } catch (e) {}
9118 }
9119
9120 if (funcs['' + curr]) {
9121 recursion = true;
9122 } else {
9123 funcs['' + curr] = true;
9124 }
9125
9126 stack.push(item);
9127 }
9128
9129 if (depth) {
9130 // console.log('depth is ' + depth);
9131 // console.log('stack is ' + stack.length);
9132 stack.splice(0, depth);
9133 }
9134
9135 var result = {
9136 name: ex.name,
9137 message: ex.message,
9138 url: getLocationHref(),
9139 stack: stack
9140 };
9141 augmentStackTraceWithInitialElement(
9142 result,
9143 ex.sourceURL || ex.fileName,
9144 ex.line || ex.lineNumber,
9145 ex.message || ex.description
9146 );
9147 return result;
9148 }
9149
9150 /**
9151 * Computes a stack trace for an exception.
9152 * @param {Error} ex
9153 * @param {(string|number)=} depth
9154 */
9155 function computeStackTrace(ex, depth) {
9156 var stack = null;
9157 depth = depth == null ? 0 : +depth;
9158
9159 try {
9160 stack = computeStackTraceFromStackProp(ex);
9161 if (stack) {
9162 return stack;
9163 }
9164 } catch (e) {
9165 if (TraceKit.debug) {
9166 throw e;
9167 }
9168 }
9169
9170 try {
9171 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
9172 if (stack) {
9173 return stack;
9174 }
9175 } catch (e) {
9176 if (TraceKit.debug) {
9177 throw e;
9178 }
9179 }
9180 return {
9181 name: ex.name,
9182 message: ex.message,
9183 url: getLocationHref()
9184 };
9185 }
9186
9187 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
9188 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
9189
9190 return computeStackTrace;
9191 })();
9192
9193 module.exports = TraceKit;
9194
9195
9196 /***/ }),
9197
9198 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
9199 /*!***********************************************************************!*\
9200 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
9201 \***********************************************************************/
9202 /***/ ((module, exports) => {
9203
9204 /*
9205 json-stringify-safe
9206 Like JSON.stringify, but doesn't throw on circular references.
9207
9208 Originally forked from https://github.com/isaacs/json-stringify-safe
9209 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
9210 and IE8 compatibility. Tests for this are in test/vendor.
9211
9212 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
9213 */
9214
9215 exports = module.exports = stringify;
9216 exports.getSerialize = serializer;
9217
9218 function indexOf(haystack, needle) {
9219 for (var i = 0; i < haystack.length; ++i) {
9220 if (haystack[i] === needle) return i;
9221 }
9222 return -1;
9223 }
9224
9225 function stringify(obj, replacer, spaces, cycleReplacer) {
9226 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
9227 }
9228
9229 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
9230 function stringifyError(value) {
9231 var err = {
9232 // These properties are implemented as magical getters and don't show up in for in
9233 stack: value.stack,
9234 message: value.message,
9235 name: value.name
9236 };
9237
9238 for (var i in value) {
9239 if (Object.prototype.hasOwnProperty.call(value, i)) {
9240 err[i] = value[i];
9241 }
9242 }
9243
9244 return err;
9245 }
9246
9247 function serializer(replacer, cycleReplacer) {
9248 var stack = [];
9249 var keys = [];
9250
9251 if (cycleReplacer == null) {
9252 cycleReplacer = function(key, value) {
9253 if (stack[0] === value) {
9254 return '[Circular ~]';
9255 }
9256 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
9257 };
9258 }
9259
9260 return function(key, value) {
9261 if (stack.length > 0) {
9262 var thisPos = indexOf(stack, this);
9263 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
9264 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
9265
9266 if (~indexOf(stack, value)) {
9267 value = cycleReplacer.call(this, key, value);
9268 }
9269 } else {
9270 stack.push(value);
9271 }
9272
9273 return replacer == null
9274 ? value instanceof Error ? stringifyError(value) : value
9275 : replacer.call(this, key, value);
9276 };
9277 }
9278
9279
9280 /***/ }),
9281
9282 /***/ "./node_modules/react-is/cjs/react-is.development.js":
9283 /*!***********************************************************!*\
9284 !*** ./node_modules/react-is/cjs/react-is.development.js ***!
9285 \***********************************************************/
9286 /***/ ((__unused_webpack_module, exports) => {
9287
9288 "use strict";
9289 /** @license React v16.13.1
9290 * react-is.development.js
9291 *
9292 * Copyright (c) Facebook, Inc. and its affiliates.
9293 *
9294 * This source code is licensed under the MIT license found in the
9295 * LICENSE file in the root directory of this source tree.
9296 */
9297
9298
9299
9300
9301
9302 if (true) {
9303 (function() {
9304 'use strict';
9305
9306 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
9307 // nor polyfill, then a plain number is used for performance.
9308 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
9309 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
9310 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
9311 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
9312 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
9313 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
9314 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
9315 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
9316 // (unstable) APIs that have been removed. Can we remove the symbols?
9317
9318 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
9319 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
9320 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
9321 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
9322 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
9323 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
9324 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
9325 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
9326 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
9327 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
9328 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
9329
9330 function isValidElementType(type) {
9331 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
9332 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);
9333 }
9334
9335 function typeOf(object) {
9336 if (typeof object === 'object' && object !== null) {
9337 var $$typeof = object.$$typeof;
9338
9339 switch ($$typeof) {
9340 case REACT_ELEMENT_TYPE:
9341 var type = object.type;
9342
9343 switch (type) {
9344 case REACT_ASYNC_MODE_TYPE:
9345 case REACT_CONCURRENT_MODE_TYPE:
9346 case REACT_FRAGMENT_TYPE:
9347 case REACT_PROFILER_TYPE:
9348 case REACT_STRICT_MODE_TYPE:
9349 case REACT_SUSPENSE_TYPE:
9350 return type;
9351
9352 default:
9353 var $$typeofType = type && type.$$typeof;
9354
9355 switch ($$typeofType) {
9356 case REACT_CONTEXT_TYPE:
9357 case REACT_FORWARD_REF_TYPE:
9358 case REACT_LAZY_TYPE:
9359 case REACT_MEMO_TYPE:
9360 case REACT_PROVIDER_TYPE:
9361 return $$typeofType;
9362
9363 default:
9364 return $$typeof;
9365 }
9366
9367 }
9368
9369 case REACT_PORTAL_TYPE:
9370 return $$typeof;
9371 }
9372 }
9373
9374 return undefined;
9375 } // AsyncMode is deprecated along with isAsyncMode
9376
9377 var AsyncMode = REACT_ASYNC_MODE_TYPE;
9378 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
9379 var ContextConsumer = REACT_CONTEXT_TYPE;
9380 var ContextProvider = REACT_PROVIDER_TYPE;
9381 var Element = REACT_ELEMENT_TYPE;
9382 var ForwardRef = REACT_FORWARD_REF_TYPE;
9383 var Fragment = REACT_FRAGMENT_TYPE;
9384 var Lazy = REACT_LAZY_TYPE;
9385 var Memo = REACT_MEMO_TYPE;
9386 var Portal = REACT_PORTAL_TYPE;
9387 var Profiler = REACT_PROFILER_TYPE;
9388 var StrictMode = REACT_STRICT_MODE_TYPE;
9389 var Suspense = REACT_SUSPENSE_TYPE;
9390 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
9391
9392 function isAsyncMode(object) {
9393 {
9394 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
9395 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
9396
9397 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.');
9398 }
9399 }
9400
9401 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
9402 }
9403 function isConcurrentMode(object) {
9404 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
9405 }
9406 function isContextConsumer(object) {
9407 return typeOf(object) === REACT_CONTEXT_TYPE;
9408 }
9409 function isContextProvider(object) {
9410 return typeOf(object) === REACT_PROVIDER_TYPE;
9411 }
9412 function isElement(object) {
9413 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9414 }
9415 function isForwardRef(object) {
9416 return typeOf(object) === REACT_FORWARD_REF_TYPE;
9417 }
9418 function isFragment(object) {
9419 return typeOf(object) === REACT_FRAGMENT_TYPE;
9420 }
9421 function isLazy(object) {
9422 return typeOf(object) === REACT_LAZY_TYPE;
9423 }
9424 function isMemo(object) {
9425 return typeOf(object) === REACT_MEMO_TYPE;
9426 }
9427 function isPortal(object) {
9428 return typeOf(object) === REACT_PORTAL_TYPE;
9429 }
9430 function isProfiler(object) {
9431 return typeOf(object) === REACT_PROFILER_TYPE;
9432 }
9433 function isStrictMode(object) {
9434 return typeOf(object) === REACT_STRICT_MODE_TYPE;
9435 }
9436 function isSuspense(object) {
9437 return typeOf(object) === REACT_SUSPENSE_TYPE;
9438 }
9439
9440 exports.AsyncMode = AsyncMode;
9441 exports.ConcurrentMode = ConcurrentMode;
9442 exports.ContextConsumer = ContextConsumer;
9443 exports.ContextProvider = ContextProvider;
9444 exports.Element = Element;
9445 exports.ForwardRef = ForwardRef;
9446 exports.Fragment = Fragment;
9447 exports.Lazy = Lazy;
9448 exports.Memo = Memo;
9449 exports.Portal = Portal;
9450 exports.Profiler = Profiler;
9451 exports.StrictMode = StrictMode;
9452 exports.Suspense = Suspense;
9453 exports.isAsyncMode = isAsyncMode;
9454 exports.isConcurrentMode = isConcurrentMode;
9455 exports.isContextConsumer = isContextConsumer;
9456 exports.isContextProvider = isContextProvider;
9457 exports.isElement = isElement;
9458 exports.isForwardRef = isForwardRef;
9459 exports.isFragment = isFragment;
9460 exports.isLazy = isLazy;
9461 exports.isMemo = isMemo;
9462 exports.isPortal = isPortal;
9463 exports.isProfiler = isProfiler;
9464 exports.isStrictMode = isStrictMode;
9465 exports.isSuspense = isSuspense;
9466 exports.isValidElementType = isValidElementType;
9467 exports.typeOf = typeOf;
9468 })();
9469 }
9470
9471
9472 /***/ }),
9473
9474 /***/ "./node_modules/react-is/index.js":
9475 /*!****************************************!*\
9476 !*** ./node_modules/react-is/index.js ***!
9477 \****************************************/
9478 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9479
9480 "use strict";
9481
9482
9483 if (false) {} else {
9484 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
9485 }
9486
9487
9488 /***/ }),
9489
9490 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
9491 /*!*****************************************************************!*\
9492 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
9493 \*****************************************************************/
9494 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9495
9496 "use strict";
9497 /**
9498 * @license React
9499 * react-jsx-runtime.development.js
9500 *
9501 * Copyright (c) Facebook, Inc. and its affiliates.
9502 *
9503 * This source code is licensed under the MIT license found in the
9504 * LICENSE file in the root directory of this source tree.
9505 */
9506
9507
9508
9509 if (true) {
9510 (function() {
9511 'use strict';
9512
9513 var React = __webpack_require__(/*! react */ "react");
9514
9515 // ATTENTION
9516 // When adding new symbols to this file,
9517 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
9518 // The Symbol used to tag the ReactElement-like types.
9519 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
9520 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
9521 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
9522 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
9523 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
9524 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
9525 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
9526 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
9527 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
9528 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
9529 var REACT_MEMO_TYPE = Symbol.for('react.memo');
9530 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
9531 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
9532 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
9533 var FAUX_ITERATOR_SYMBOL = '@@iterator';
9534 function getIteratorFn(maybeIterable) {
9535 if (maybeIterable === null || typeof maybeIterable !== 'object') {
9536 return null;
9537 }
9538
9539 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
9540
9541 if (typeof maybeIterator === 'function') {
9542 return maybeIterator;
9543 }
9544
9545 return null;
9546 }
9547
9548 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
9549
9550 function error(format) {
9551 {
9552 {
9553 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
9554 args[_key2 - 1] = arguments[_key2];
9555 }
9556
9557 printWarning('error', format, args);
9558 }
9559 }
9560 }
9561
9562 function printWarning(level, format, args) {
9563 // When changing this logic, you might want to also
9564 // update consoleWithStackDev.www.js as well.
9565 {
9566 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9567 var stack = ReactDebugCurrentFrame.getStackAddendum();
9568
9569 if (stack !== '') {
9570 format += '%s';
9571 args = args.concat([stack]);
9572 } // eslint-disable-next-line react-internal/safe-string-coercion
9573
9574
9575 var argsWithFormat = args.map(function (item) {
9576 return String(item);
9577 }); // Careful: RN currently depends on this prefix
9578
9579 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
9580 // breaks IE9: https://github.com/facebook/react/issues/13610
9581 // eslint-disable-next-line react-internal/no-production-logging
9582
9583 Function.prototype.apply.call(console[level], console, argsWithFormat);
9584 }
9585 }
9586
9587 // -----------------------------------------------------------------------------
9588
9589 var enableScopeAPI = false; // Experimental Create Event Handle API.
9590 var enableCacheElement = false;
9591 var enableTransitionTracing = false; // No known bugs, but needs performance testing
9592
9593 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
9594 // stuff. Intended to enable React core members to more easily debug scheduling
9595 // issues in DEV builds.
9596
9597 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
9598
9599 var REACT_MODULE_REFERENCE;
9600
9601 {
9602 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
9603 }
9604
9605 function isValidElementType(type) {
9606 if (typeof type === 'string' || typeof type === 'function') {
9607 return true;
9608 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
9609
9610
9611 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 ) {
9612 return true;
9613 }
9614
9615 if (typeof type === 'object' && type !== null) {
9616 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
9617 // types supported by any Flight configuration anywhere since
9618 // we don't know which Flight build this will end up being used
9619 // with.
9620 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
9621 return true;
9622 }
9623 }
9624
9625 return false;
9626 }
9627
9628 function getWrappedName(outerType, innerType, wrapperName) {
9629 var displayName = outerType.displayName;
9630
9631 if (displayName) {
9632 return displayName;
9633 }
9634
9635 var functionName = innerType.displayName || innerType.name || '';
9636 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
9637 } // Keep in sync with react-reconciler/getComponentNameFromFiber
9638
9639
9640 function getContextName(type) {
9641 return type.displayName || 'Context';
9642 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
9643
9644
9645 function getComponentNameFromType(type) {
9646 if (type == null) {
9647 // Host root, text node or just invalid type.
9648 return null;
9649 }
9650
9651 {
9652 if (typeof type.tag === 'number') {
9653 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
9654 }
9655 }
9656
9657 if (typeof type === 'function') {
9658 return type.displayName || type.name || null;
9659 }
9660
9661 if (typeof type === 'string') {
9662 return type;
9663 }
9664
9665 switch (type) {
9666 case REACT_FRAGMENT_TYPE:
9667 return 'Fragment';
9668
9669 case REACT_PORTAL_TYPE:
9670 return 'Portal';
9671
9672 case REACT_PROFILER_TYPE:
9673 return 'Profiler';
9674
9675 case REACT_STRICT_MODE_TYPE:
9676 return 'StrictMode';
9677
9678 case REACT_SUSPENSE_TYPE:
9679 return 'Suspense';
9680
9681 case REACT_SUSPENSE_LIST_TYPE:
9682 return 'SuspenseList';
9683
9684 }
9685
9686 if (typeof type === 'object') {
9687 switch (type.$$typeof) {
9688 case REACT_CONTEXT_TYPE:
9689 var context = type;
9690 return getContextName(context) + '.Consumer';
9691
9692 case REACT_PROVIDER_TYPE:
9693 var provider = type;
9694 return getContextName(provider._context) + '.Provider';
9695
9696 case REACT_FORWARD_REF_TYPE:
9697 return getWrappedName(type, type.render, 'ForwardRef');
9698
9699 case REACT_MEMO_TYPE:
9700 var outerName = type.displayName || null;
9701
9702 if (outerName !== null) {
9703 return outerName;
9704 }
9705
9706 return getComponentNameFromType(type.type) || 'Memo';
9707
9708 case REACT_LAZY_TYPE:
9709 {
9710 var lazyComponent = type;
9711 var payload = lazyComponent._payload;
9712 var init = lazyComponent._init;
9713
9714 try {
9715 return getComponentNameFromType(init(payload));
9716 } catch (x) {
9717 return null;
9718 }
9719 }
9720
9721 // eslint-disable-next-line no-fallthrough
9722 }
9723 }
9724
9725 return null;
9726 }
9727
9728 var assign = Object.assign;
9729
9730 // Helpers to patch console.logs to avoid logging during side-effect free
9731 // replaying on render function. This currently only patches the object
9732 // lazily which won't cover if the log function was extracted eagerly.
9733 // We could also eagerly patch the method.
9734 var disabledDepth = 0;
9735 var prevLog;
9736 var prevInfo;
9737 var prevWarn;
9738 var prevError;
9739 var prevGroup;
9740 var prevGroupCollapsed;
9741 var prevGroupEnd;
9742
9743 function disabledLog() {}
9744
9745 disabledLog.__reactDisabledLog = true;
9746 function disableLogs() {
9747 {
9748 if (disabledDepth === 0) {
9749 /* eslint-disable react-internal/no-production-logging */
9750 prevLog = console.log;
9751 prevInfo = console.info;
9752 prevWarn = console.warn;
9753 prevError = console.error;
9754 prevGroup = console.group;
9755 prevGroupCollapsed = console.groupCollapsed;
9756 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
9757
9758 var props = {
9759 configurable: true,
9760 enumerable: true,
9761 value: disabledLog,
9762 writable: true
9763 }; // $FlowFixMe Flow thinks console is immutable.
9764
9765 Object.defineProperties(console, {
9766 info: props,
9767 log: props,
9768 warn: props,
9769 error: props,
9770 group: props,
9771 groupCollapsed: props,
9772 groupEnd: props
9773 });
9774 /* eslint-enable react-internal/no-production-logging */
9775 }
9776
9777 disabledDepth++;
9778 }
9779 }
9780 function reenableLogs() {
9781 {
9782 disabledDepth--;
9783
9784 if (disabledDepth === 0) {
9785 /* eslint-disable react-internal/no-production-logging */
9786 var props = {
9787 configurable: true,
9788 enumerable: true,
9789 writable: true
9790 }; // $FlowFixMe Flow thinks console is immutable.
9791
9792 Object.defineProperties(console, {
9793 log: assign({}, props, {
9794 value: prevLog
9795 }),
9796 info: assign({}, props, {
9797 value: prevInfo
9798 }),
9799 warn: assign({}, props, {
9800 value: prevWarn
9801 }),
9802 error: assign({}, props, {
9803 value: prevError
9804 }),
9805 group: assign({}, props, {
9806 value: prevGroup
9807 }),
9808 groupCollapsed: assign({}, props, {
9809 value: prevGroupCollapsed
9810 }),
9811 groupEnd: assign({}, props, {
9812 value: prevGroupEnd
9813 })
9814 });
9815 /* eslint-enable react-internal/no-production-logging */
9816 }
9817
9818 if (disabledDepth < 0) {
9819 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
9820 }
9821 }
9822 }
9823
9824 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9825 var prefix;
9826 function describeBuiltInComponentFrame(name, source, ownerFn) {
9827 {
9828 if (prefix === undefined) {
9829 // Extract the VM specific prefix used by each line.
9830 try {
9831 throw Error();
9832 } catch (x) {
9833 var match = x.stack.trim().match(/\n( *(at )?)/);
9834 prefix = match && match[1] || '';
9835 }
9836 } // We use the prefix to ensure our stacks line up with native stack frames.
9837
9838
9839 return '\n' + prefix + name;
9840 }
9841 }
9842 var reentry = false;
9843 var componentFrameCache;
9844
9845 {
9846 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
9847 componentFrameCache = new PossiblyWeakMap();
9848 }
9849
9850 function describeNativeComponentFrame(fn, construct) {
9851 // If something asked for a stack inside a fake render, it should get ignored.
9852 if ( !fn || reentry) {
9853 return '';
9854 }
9855
9856 {
9857 var frame = componentFrameCache.get(fn);
9858
9859 if (frame !== undefined) {
9860 return frame;
9861 }
9862 }
9863
9864 var control;
9865 reentry = true;
9866 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
9867
9868 Error.prepareStackTrace = undefined;
9869 var previousDispatcher;
9870
9871 {
9872 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
9873 // for warnings.
9874
9875 ReactCurrentDispatcher.current = null;
9876 disableLogs();
9877 }
9878
9879 try {
9880 // This should throw.
9881 if (construct) {
9882 // Something should be setting the props in the constructor.
9883 var Fake = function () {
9884 throw Error();
9885 }; // $FlowFixMe
9886
9887
9888 Object.defineProperty(Fake.prototype, 'props', {
9889 set: function () {
9890 // We use a throwing setter instead of frozen or non-writable props
9891 // because that won't throw in a non-strict mode function.
9892 throw Error();
9893 }
9894 });
9895
9896 if (typeof Reflect === 'object' && Reflect.construct) {
9897 // We construct a different control for this case to include any extra
9898 // frames added by the construct call.
9899 try {
9900 Reflect.construct(Fake, []);
9901 } catch (x) {
9902 control = x;
9903 }
9904
9905 Reflect.construct(fn, [], Fake);
9906 } else {
9907 try {
9908 Fake.call();
9909 } catch (x) {
9910 control = x;
9911 }
9912
9913 fn.call(Fake.prototype);
9914 }
9915 } else {
9916 try {
9917 throw Error();
9918 } catch (x) {
9919 control = x;
9920 }
9921
9922 fn();
9923 }
9924 } catch (sample) {
9925 // This is inlined manually because closure doesn't do it for us.
9926 if (sample && control && typeof sample.stack === 'string') {
9927 // This extracts the first frame from the sample that isn't also in the control.
9928 // Skipping one frame that we assume is the frame that calls the two.
9929 var sampleLines = sample.stack.split('\n');
9930 var controlLines = control.stack.split('\n');
9931 var s = sampleLines.length - 1;
9932 var c = controlLines.length - 1;
9933
9934 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
9935 // We expect at least one stack frame to be shared.
9936 // Typically this will be the root most one. However, stack frames may be
9937 // cut off due to maximum stack limits. In this case, one maybe cut off
9938 // earlier than the other. We assume that the sample is longer or the same
9939 // and there for cut off earlier. So we should find the root most frame in
9940 // the sample somewhere in the control.
9941 c--;
9942 }
9943
9944 for (; s >= 1 && c >= 0; s--, c--) {
9945 // Next we find the first one that isn't the same which should be the
9946 // frame that called our sample function and the control.
9947 if (sampleLines[s] !== controlLines[c]) {
9948 // In V8, the first line is describing the message but other VMs don't.
9949 // If we're about to return the first line, and the control is also on the same
9950 // line, that's a pretty good indicator that our sample threw at same line as
9951 // the control. I.e. before we entered the sample frame. So we ignore this result.
9952 // This can happen if you passed a class to function component, or non-function.
9953 if (s !== 1 || c !== 1) {
9954 do {
9955 s--;
9956 c--; // We may still have similar intermediate frames from the construct call.
9957 // The next one that isn't the same should be our match though.
9958
9959 if (c < 0 || sampleLines[s] !== controlLines[c]) {
9960 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
9961 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
9962 // but we have a user-provided "displayName"
9963 // splice it in to make the stack more readable.
9964
9965
9966 if (fn.displayName && _frame.includes('<anonymous>')) {
9967 _frame = _frame.replace('<anonymous>', fn.displayName);
9968 }
9969
9970 {
9971 if (typeof fn === 'function') {
9972 componentFrameCache.set(fn, _frame);
9973 }
9974 } // Return the line we found.
9975
9976
9977 return _frame;
9978 }
9979 } while (s >= 1 && c >= 0);
9980 }
9981
9982 break;
9983 }
9984 }
9985 }
9986 } finally {
9987 reentry = false;
9988
9989 {
9990 ReactCurrentDispatcher.current = previousDispatcher;
9991 reenableLogs();
9992 }
9993
9994 Error.prepareStackTrace = previousPrepareStackTrace;
9995 } // Fallback to just using the name if we couldn't make it throw.
9996
9997
9998 var name = fn ? fn.displayName || fn.name : '';
9999 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
10000
10001 {
10002 if (typeof fn === 'function') {
10003 componentFrameCache.set(fn, syntheticFrame);
10004 }
10005 }
10006
10007 return syntheticFrame;
10008 }
10009 function describeFunctionComponentFrame(fn, source, ownerFn) {
10010 {
10011 return describeNativeComponentFrame(fn, false);
10012 }
10013 }
10014
10015 function shouldConstruct(Component) {
10016 var prototype = Component.prototype;
10017 return !!(prototype && prototype.isReactComponent);
10018 }
10019
10020 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
10021
10022 if (type == null) {
10023 return '';
10024 }
10025
10026 if (typeof type === 'function') {
10027 {
10028 return describeNativeComponentFrame(type, shouldConstruct(type));
10029 }
10030 }
10031
10032 if (typeof type === 'string') {
10033 return describeBuiltInComponentFrame(type);
10034 }
10035
10036 switch (type) {
10037 case REACT_SUSPENSE_TYPE:
10038 return describeBuiltInComponentFrame('Suspense');
10039
10040 case REACT_SUSPENSE_LIST_TYPE:
10041 return describeBuiltInComponentFrame('SuspenseList');
10042 }
10043
10044 if (typeof type === 'object') {
10045 switch (type.$$typeof) {
10046 case REACT_FORWARD_REF_TYPE:
10047 return describeFunctionComponentFrame(type.render);
10048
10049 case REACT_MEMO_TYPE:
10050 // Memo may contain any component type so we recursively resolve it.
10051 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
10052
10053 case REACT_LAZY_TYPE:
10054 {
10055 var lazyComponent = type;
10056 var payload = lazyComponent._payload;
10057 var init = lazyComponent._init;
10058
10059 try {
10060 // Lazy may contain any component type so we recursively resolve it.
10061 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
10062 } catch (x) {}
10063 }
10064 }
10065 }
10066
10067 return '';
10068 }
10069
10070 var hasOwnProperty = Object.prototype.hasOwnProperty;
10071
10072 var loggedTypeFailures = {};
10073 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
10074
10075 function setCurrentlyValidatingElement(element) {
10076 {
10077 if (element) {
10078 var owner = element._owner;
10079 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
10080 ReactDebugCurrentFrame.setExtraStackFrame(stack);
10081 } else {
10082 ReactDebugCurrentFrame.setExtraStackFrame(null);
10083 }
10084 }
10085 }
10086
10087 function checkPropTypes(typeSpecs, values, location, componentName, element) {
10088 {
10089 // $FlowFixMe This is okay but Flow doesn't know it.
10090 var has = Function.call.bind(hasOwnProperty);
10091
10092 for (var typeSpecName in typeSpecs) {
10093 if (has(typeSpecs, typeSpecName)) {
10094 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
10095 // fail the render phase where it didn't fail before. So we log it.
10096 // After these have been cleaned up, we'll let them throw.
10097
10098 try {
10099 // This is intentionally an invariant that gets caught. It's the same
10100 // behavior as without this statement except with a better message.
10101 if (typeof typeSpecs[typeSpecName] !== 'function') {
10102 // eslint-disable-next-line react-internal/prod-error-codes
10103 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`.');
10104 err.name = 'Invariant Violation';
10105 throw err;
10106 }
10107
10108 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
10109 } catch (ex) {
10110 error$1 = ex;
10111 }
10112
10113 if (error$1 && !(error$1 instanceof Error)) {
10114 setCurrentlyValidatingElement(element);
10115
10116 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);
10117
10118 setCurrentlyValidatingElement(null);
10119 }
10120
10121 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
10122 // Only monitor this failure once because there tends to be a lot of the
10123 // same error.
10124 loggedTypeFailures[error$1.message] = true;
10125 setCurrentlyValidatingElement(element);
10126
10127 error('Failed %s type: %s', location, error$1.message);
10128
10129 setCurrentlyValidatingElement(null);
10130 }
10131 }
10132 }
10133 }
10134 }
10135
10136 var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
10137
10138 function isArray(a) {
10139 return isArrayImpl(a);
10140 }
10141
10142 /*
10143 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
10144 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
10145 *
10146 * The functions in this module will throw an easier-to-understand,
10147 * easier-to-debug exception with a clear errors message message explaining the
10148 * problem. (Instead of a confusing exception thrown inside the implementation
10149 * of the `value` object).
10150 */
10151 // $FlowFixMe only called in DEV, so void return is not possible.
10152 function typeName(value) {
10153 {
10154 // toStringTag is needed for namespaced types like Temporal.Instant
10155 var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
10156 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
10157 return type;
10158 }
10159 } // $FlowFixMe only called in DEV, so void return is not possible.
10160
10161
10162 function willCoercionThrow(value) {
10163 {
10164 try {
10165 testStringCoercion(value);
10166 return false;
10167 } catch (e) {
10168 return true;
10169 }
10170 }
10171 }
10172
10173 function testStringCoercion(value) {
10174 // If you ended up here by following an exception call stack, here's what's
10175 // happened: you supplied an object or symbol value to React (as a prop, key,
10176 // DOM attribute, CSS property, string ref, etc.) and when React tried to
10177 // coerce it to a string using `'' + value`, an exception was thrown.
10178 //
10179 // The most common types that will cause this exception are `Symbol` instances
10180 // and Temporal objects like `Temporal.Instant`. But any object that has a
10181 // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
10182 // exception. (Library authors do this to prevent users from using built-in
10183 // numeric operators like `+` or comparison operators like `>=` because custom
10184 // methods are needed to perform accurate arithmetic or comparison.)
10185 //
10186 // To fix the problem, coerce this object or symbol value to a string before
10187 // passing it to React. The most reliable way is usually `String(value)`.
10188 //
10189 // To find which value is throwing, check the browser or debugger console.
10190 // Before this exception was thrown, there should be `console.error` output
10191 // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
10192 // problem and how that type was used: key, atrribute, input value prop, etc.
10193 // In most cases, this console output also shows the component and its
10194 // ancestor components where the exception happened.
10195 //
10196 // eslint-disable-next-line react-internal/safe-string-coercion
10197 return '' + value;
10198 }
10199 function checkKeyStringCoercion(value) {
10200 {
10201 if (willCoercionThrow(value)) {
10202 error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
10203
10204 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
10205 }
10206 }
10207 }
10208
10209 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
10210 var RESERVED_PROPS = {
10211 key: true,
10212 ref: true,
10213 __self: true,
10214 __source: true
10215 };
10216 var specialPropKeyWarningShown;
10217 var specialPropRefWarningShown;
10218 var didWarnAboutStringRefs;
10219
10220 {
10221 didWarnAboutStringRefs = {};
10222 }
10223
10224 function hasValidRef(config) {
10225 {
10226 if (hasOwnProperty.call(config, 'ref')) {
10227 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
10228
10229 if (getter && getter.isReactWarning) {
10230 return false;
10231 }
10232 }
10233 }
10234
10235 return config.ref !== undefined;
10236 }
10237
10238 function hasValidKey(config) {
10239 {
10240 if (hasOwnProperty.call(config, 'key')) {
10241 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
10242
10243 if (getter && getter.isReactWarning) {
10244 return false;
10245 }
10246 }
10247 }
10248
10249 return config.key !== undefined;
10250 }
10251
10252 function warnIfStringRefCannotBeAutoConverted(config, self) {
10253 {
10254 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
10255 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
10256
10257 if (!didWarnAboutStringRefs[componentName]) {
10258 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);
10259
10260 didWarnAboutStringRefs[componentName] = true;
10261 }
10262 }
10263 }
10264 }
10265
10266 function defineKeyPropWarningGetter(props, displayName) {
10267 {
10268 var warnAboutAccessingKey = function () {
10269 if (!specialPropKeyWarningShown) {
10270 specialPropKeyWarningShown = true;
10271
10272 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);
10273 }
10274 };
10275
10276 warnAboutAccessingKey.isReactWarning = true;
10277 Object.defineProperty(props, 'key', {
10278 get: warnAboutAccessingKey,
10279 configurable: true
10280 });
10281 }
10282 }
10283
10284 function defineRefPropWarningGetter(props, displayName) {
10285 {
10286 var warnAboutAccessingRef = function () {
10287 if (!specialPropRefWarningShown) {
10288 specialPropRefWarningShown = true;
10289
10290 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);
10291 }
10292 };
10293
10294 warnAboutAccessingRef.isReactWarning = true;
10295 Object.defineProperty(props, 'ref', {
10296 get: warnAboutAccessingRef,
10297 configurable: true
10298 });
10299 }
10300 }
10301 /**
10302 * Factory method to create a new React element. This no longer adheres to
10303 * the class pattern, so do not use new to call it. Also, instanceof check
10304 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
10305 * if something is a React Element.
10306 *
10307 * @param {*} type
10308 * @param {*} props
10309 * @param {*} key
10310 * @param {string|object} ref
10311 * @param {*} owner
10312 * @param {*} self A *temporary* helper to detect places where `this` is
10313 * different from the `owner` when React.createElement is called, so that we
10314 * can warn. We want to get rid of owner and replace string `ref`s with arrow
10315 * functions, and as long as `this` and owner are the same, there will be no
10316 * change in behavior.
10317 * @param {*} source An annotation object (added by a transpiler or otherwise)
10318 * indicating filename, line number, and/or other information.
10319 * @internal
10320 */
10321
10322
10323 var ReactElement = function (type, key, ref, self, source, owner, props) {
10324 var element = {
10325 // This tag allows us to uniquely identify this as a React Element
10326 $$typeof: REACT_ELEMENT_TYPE,
10327 // Built-in properties that belong on the element
10328 type: type,
10329 key: key,
10330 ref: ref,
10331 props: props,
10332 // Record the component responsible for creating this element.
10333 _owner: owner
10334 };
10335
10336 {
10337 // The validation flag is currently mutative. We put it on
10338 // an external backing store so that we can freeze the whole object.
10339 // This can be replaced with a WeakMap once they are implemented in
10340 // commonly used development environments.
10341 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
10342 // the validation flag non-enumerable (where possible, which should
10343 // include every environment we run tests in), so the test framework
10344 // ignores it.
10345
10346 Object.defineProperty(element._store, 'validated', {
10347 configurable: false,
10348 enumerable: false,
10349 writable: true,
10350 value: false
10351 }); // self and source are DEV only properties.
10352
10353 Object.defineProperty(element, '_self', {
10354 configurable: false,
10355 enumerable: false,
10356 writable: false,
10357 value: self
10358 }); // Two elements created in two different places should be considered
10359 // equal for testing purposes and therefore we hide it from enumeration.
10360
10361 Object.defineProperty(element, '_source', {
10362 configurable: false,
10363 enumerable: false,
10364 writable: false,
10365 value: source
10366 });
10367
10368 if (Object.freeze) {
10369 Object.freeze(element.props);
10370 Object.freeze(element);
10371 }
10372 }
10373
10374 return element;
10375 };
10376 /**
10377 * https://github.com/reactjs/rfcs/pull/107
10378 * @param {*} type
10379 * @param {object} props
10380 * @param {string} key
10381 */
10382
10383 function jsxDEV(type, config, maybeKey, source, self) {
10384 {
10385 var propName; // Reserved names are extracted
10386
10387 var props = {};
10388 var key = null;
10389 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
10390 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
10391 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
10392 // but as an intermediary step, we will use jsxDEV for everything except
10393 // <div {...props} key="Hi" />, because we aren't currently able to tell if
10394 // key is explicitly declared to be undefined or not.
10395
10396 if (maybeKey !== undefined) {
10397 {
10398 checkKeyStringCoercion(maybeKey);
10399 }
10400
10401 key = '' + maybeKey;
10402 }
10403
10404 if (hasValidKey(config)) {
10405 {
10406 checkKeyStringCoercion(config.key);
10407 }
10408
10409 key = '' + config.key;
10410 }
10411
10412 if (hasValidRef(config)) {
10413 ref = config.ref;
10414 warnIfStringRefCannotBeAutoConverted(config, self);
10415 } // Remaining properties are added to a new props object
10416
10417
10418 for (propName in config) {
10419 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10420 props[propName] = config[propName];
10421 }
10422 } // Resolve default props
10423
10424
10425 if (type && type.defaultProps) {
10426 var defaultProps = type.defaultProps;
10427
10428 for (propName in defaultProps) {
10429 if (props[propName] === undefined) {
10430 props[propName] = defaultProps[propName];
10431 }
10432 }
10433 }
10434
10435 if (key || ref) {
10436 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
10437
10438 if (key) {
10439 defineKeyPropWarningGetter(props, displayName);
10440 }
10441
10442 if (ref) {
10443 defineRefPropWarningGetter(props, displayName);
10444 }
10445 }
10446
10447 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10448 }
10449 }
10450
10451 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
10452 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
10453
10454 function setCurrentlyValidatingElement$1(element) {
10455 {
10456 if (element) {
10457 var owner = element._owner;
10458 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
10459 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
10460 } else {
10461 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
10462 }
10463 }
10464 }
10465
10466 var propTypesMisspellWarningShown;
10467
10468 {
10469 propTypesMisspellWarningShown = false;
10470 }
10471 /**
10472 * Verifies the object is a ReactElement.
10473 * See https://reactjs.org/docs/react-api.html#isvalidelement
10474 * @param {?object} object
10475 * @return {boolean} True if `object` is a ReactElement.
10476 * @final
10477 */
10478
10479
10480 function isValidElement(object) {
10481 {
10482 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10483 }
10484 }
10485
10486 function getDeclarationErrorAddendum() {
10487 {
10488 if (ReactCurrentOwner$1.current) {
10489 var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
10490
10491 if (name) {
10492 return '\n\nCheck the render method of `' + name + '`.';
10493 }
10494 }
10495
10496 return '';
10497 }
10498 }
10499
10500 function getSourceInfoErrorAddendum(source) {
10501 {
10502 if (source !== undefined) {
10503 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
10504 var lineNumber = source.lineNumber;
10505 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
10506 }
10507
10508 return '';
10509 }
10510 }
10511 /**
10512 * Warn if there's no key explicitly set on dynamic arrays of children or
10513 * object keys are not valid. This allows us to keep track of children between
10514 * updates.
10515 */
10516
10517
10518 var ownerHasKeyUseWarning = {};
10519
10520 function getCurrentComponentErrorInfo(parentType) {
10521 {
10522 var info = getDeclarationErrorAddendum();
10523
10524 if (!info) {
10525 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10526
10527 if (parentName) {
10528 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
10529 }
10530 }
10531
10532 return info;
10533 }
10534 }
10535 /**
10536 * Warn if the element doesn't have an explicit key assigned to it.
10537 * This element is in an array. The array could grow and shrink or be
10538 * reordered. All children that haven't already been validated are required to
10539 * have a "key" property assigned to it. Error statuses are cached so a warning
10540 * will only be shown once.
10541 *
10542 * @internal
10543 * @param {ReactElement} element Element that requires a key.
10544 * @param {*} parentType element's parent's type.
10545 */
10546
10547
10548 function validateExplicitKey(element, parentType) {
10549 {
10550 if (!element._store || element._store.validated || element.key != null) {
10551 return;
10552 }
10553
10554 element._store.validated = true;
10555 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
10556
10557 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
10558 return;
10559 }
10560
10561 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
10562 // property, it may be the creator of the child that's responsible for
10563 // assigning it a key.
10564
10565 var childOwner = '';
10566
10567 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
10568 // Give the component that originally created this child.
10569 childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
10570 }
10571
10572 setCurrentlyValidatingElement$1(element);
10573
10574 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);
10575
10576 setCurrentlyValidatingElement$1(null);
10577 }
10578 }
10579 /**
10580 * Ensure that every element either is passed in a static location, in an
10581 * array with an explicit keys property defined, or in an object literal
10582 * with valid key property.
10583 *
10584 * @internal
10585 * @param {ReactNode} node Statically passed child of any type.
10586 * @param {*} parentType node's parent's type.
10587 */
10588
10589
10590 function validateChildKeys(node, parentType) {
10591 {
10592 if (typeof node !== 'object') {
10593 return;
10594 }
10595
10596 if (isArray(node)) {
10597 for (var i = 0; i < node.length; i++) {
10598 var child = node[i];
10599
10600 if (isValidElement(child)) {
10601 validateExplicitKey(child, parentType);
10602 }
10603 }
10604 } else if (isValidElement(node)) {
10605 // This element was passed in a valid location.
10606 if (node._store) {
10607 node._store.validated = true;
10608 }
10609 } else if (node) {
10610 var iteratorFn = getIteratorFn(node);
10611
10612 if (typeof iteratorFn === 'function') {
10613 // Entry iterators used to provide implicit keys,
10614 // but now we print a separate warning for them later.
10615 if (iteratorFn !== node.entries) {
10616 var iterator = iteratorFn.call(node);
10617 var step;
10618
10619 while (!(step = iterator.next()).done) {
10620 if (isValidElement(step.value)) {
10621 validateExplicitKey(step.value, parentType);
10622 }
10623 }
10624 }
10625 }
10626 }
10627 }
10628 }
10629 /**
10630 * Given an element, validate that its props follow the propTypes definition,
10631 * provided by the type.
10632 *
10633 * @param {ReactElement} element
10634 */
10635
10636
10637 function validatePropTypes(element) {
10638 {
10639 var type = element.type;
10640
10641 if (type === null || type === undefined || typeof type === 'string') {
10642 return;
10643 }
10644
10645 var propTypes;
10646
10647 if (typeof type === 'function') {
10648 propTypes = type.propTypes;
10649 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
10650 // Inner props are checked in the reconciler.
10651 type.$$typeof === REACT_MEMO_TYPE)) {
10652 propTypes = type.propTypes;
10653 } else {
10654 return;
10655 }
10656
10657 if (propTypes) {
10658 // Intentionally inside to avoid triggering lazy initializers:
10659 var name = getComponentNameFromType(type);
10660 checkPropTypes(propTypes, element.props, 'prop', name, element);
10661 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
10662 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
10663
10664 var _name = getComponentNameFromType(type);
10665
10666 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
10667 }
10668
10669 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
10670 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
10671 }
10672 }
10673 }
10674 /**
10675 * Given a fragment, validate that it can only be provided with fragment props
10676 * @param {ReactElement} fragment
10677 */
10678
10679
10680 function validateFragmentProps(fragment) {
10681 {
10682 var keys = Object.keys(fragment.props);
10683
10684 for (var i = 0; i < keys.length; i++) {
10685 var key = keys[i];
10686
10687 if (key !== 'children' && key !== 'key') {
10688 setCurrentlyValidatingElement$1(fragment);
10689
10690 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
10691
10692 setCurrentlyValidatingElement$1(null);
10693 break;
10694 }
10695 }
10696
10697 if (fragment.ref !== null) {
10698 setCurrentlyValidatingElement$1(fragment);
10699
10700 error('Invalid attribute `ref` supplied to `React.Fragment`.');
10701
10702 setCurrentlyValidatingElement$1(null);
10703 }
10704 }
10705 }
10706
10707 var didWarnAboutKeySpread = {};
10708 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
10709 {
10710 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
10711 // succeed and there will likely be errors in render.
10712
10713 if (!validType) {
10714 var info = '';
10715
10716 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
10717 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.";
10718 }
10719
10720 var sourceInfo = getSourceInfoErrorAddendum(source);
10721
10722 if (sourceInfo) {
10723 info += sourceInfo;
10724 } else {
10725 info += getDeclarationErrorAddendum();
10726 }
10727
10728 var typeString;
10729
10730 if (type === null) {
10731 typeString = 'null';
10732 } else if (isArray(type)) {
10733 typeString = 'array';
10734 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
10735 typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
10736 info = ' Did you accidentally export a JSX literal instead of a component?';
10737 } else {
10738 typeString = typeof type;
10739 }
10740
10741 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);
10742 }
10743
10744 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
10745 // TODO: Drop this when these are no longer allowed as the type argument.
10746
10747 if (element == null) {
10748 return element;
10749 } // Skip key warning if the type isn't valid since our key validation logic
10750 // doesn't expect a non-string/function type and can throw confusing errors.
10751 // We don't want exception behavior to differ between dev and prod.
10752 // (Rendering will throw with a helpful message and as soon as the type is
10753 // fixed, the key warnings will appear.)
10754
10755
10756 if (validType) {
10757 var children = props.children;
10758
10759 if (children !== undefined) {
10760 if (isStaticChildren) {
10761 if (isArray(children)) {
10762 for (var i = 0; i < children.length; i++) {
10763 validateChildKeys(children[i], type);
10764 }
10765
10766 if (Object.freeze) {
10767 Object.freeze(children);
10768 }
10769 } else {
10770 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.');
10771 }
10772 } else {
10773 validateChildKeys(children, type);
10774 }
10775 }
10776 }
10777
10778 {
10779 if (hasOwnProperty.call(props, 'key')) {
10780 var componentName = getComponentNameFromType(type);
10781 var keys = Object.keys(props).filter(function (k) {
10782 return k !== 'key';
10783 });
10784 var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
10785
10786 if (!didWarnAboutKeySpread[componentName + beforeExample]) {
10787 var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
10788
10789 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);
10790
10791 didWarnAboutKeySpread[componentName + beforeExample] = true;
10792 }
10793 }
10794 }
10795
10796 if (type === REACT_FRAGMENT_TYPE) {
10797 validateFragmentProps(element);
10798 } else {
10799 validatePropTypes(element);
10800 }
10801
10802 return element;
10803 }
10804 } // These two functions exist to still get child warnings in dev
10805 // even with the prod transform. This means that jsxDEV is purely
10806 // opt-in behavior for better messages but that we won't stop
10807 // giving you warnings if you use production apis.
10808
10809 function jsxWithValidationStatic(type, props, key) {
10810 {
10811 return jsxWithValidation(type, props, key, true);
10812 }
10813 }
10814 function jsxWithValidationDynamic(type, props, key) {
10815 {
10816 return jsxWithValidation(type, props, key, false);
10817 }
10818 }
10819
10820 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
10821 // for now we can ship identical prod functions
10822
10823 var jsxs = jsxWithValidationStatic ;
10824
10825 exports.Fragment = REACT_FRAGMENT_TYPE;
10826 exports.jsx = jsx;
10827 exports.jsxs = jsxs;
10828 })();
10829 }
10830
10831
10832 /***/ }),
10833
10834 /***/ "./node_modules/react/jsx-runtime.js":
10835 /*!*******************************************!*\
10836 !*** ./node_modules/react/jsx-runtime.js ***!
10837 \*******************************************/
10838 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10839
10840 "use strict";
10841
10842
10843 if (false) {} else {
10844 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
10845 }
10846
10847
10848 /***/ }),
10849
10850 /***/ "./node_modules/styled-components/dist/styled-components.browser.esm.js":
10851 /*!******************************************************************************!*\
10852 !*** ./node_modules/styled-components/dist/styled-components.browser.esm.js ***!
10853 \******************************************************************************/
10854 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10855
10856 "use strict";
10857 __webpack_require__.r(__webpack_exports__);
10858 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10859 /* harmony export */ "ServerStyleSheet": () => (/* binding */ ServerStyleSheet),
10860 /* harmony export */ "StyleSheetConsumer": () => (/* binding */ StyleSheetConsumer),
10861 /* harmony export */ "StyleSheetContext": () => (/* binding */ StyleSheetContext),
10862 /* harmony export */ "StyleSheetManager": () => (/* binding */ StyleSheetManager),
10863 /* harmony export */ "ThemeConsumer": () => (/* binding */ ThemeConsumer),
10864 /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
10865 /* harmony export */ "ThemeProvider": () => (/* binding */ ThemeProvider),
10866 /* 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),
10867 /* harmony export */ "createGlobalStyle": () => (/* binding */ createGlobalStyle),
10868 /* harmony export */ "css": () => (/* binding */ css),
10869 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10870 /* harmony export */ "isStyledComponent": () => (/* binding */ isStyledComponent),
10871 /* harmony export */ "keyframes": () => (/* binding */ keyframes),
10872 /* harmony export */ "withTheme": () => (/* binding */ withTheme)
10873 /* harmony export */ });
10874 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis/stylis.min */ "./node_modules/stylis/stylis.min.js");
10875 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__);
10876 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis-rule-sheet */ "./node_modules/stylis-rule-sheet/index.js");
10877 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__);
10878 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
10879 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
10880 /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
10881 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
10882 /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js");
10883 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
10884 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
10885 /* 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");
10886 /* harmony import */ var merge_anything__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! merge-anything */ "./node_modules/merge-anything/dist/index.esm.js");
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897 //
10898
10899 var interleave = (function (strings, interpolations) {
10900 var result = [strings[0]];
10901
10902 for (var i = 0, len = interpolations.length; i < len; i += 1) {
10903 result.push(interpolations[i], strings[i + 1]);
10904 }
10905
10906 return result;
10907 });
10908
10909 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
10910 return typeof obj;
10911 } : function (obj) {
10912 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
10913 };
10914
10915 var classCallCheck = function (instance, Constructor) {
10916 if (!(instance instanceof Constructor)) {
10917 throw new TypeError("Cannot call a class as a function");
10918 }
10919 };
10920
10921 var createClass = function () {
10922 function defineProperties(target, props) {
10923 for (var i = 0; i < props.length; i++) {
10924 var descriptor = props[i];
10925 descriptor.enumerable = descriptor.enumerable || false;
10926 descriptor.configurable = true;
10927 if ("value" in descriptor) descriptor.writable = true;
10928 Object.defineProperty(target, descriptor.key, descriptor);
10929 }
10930 }
10931
10932 return function (Constructor, protoProps, staticProps) {
10933 if (protoProps) defineProperties(Constructor.prototype, protoProps);
10934 if (staticProps) defineProperties(Constructor, staticProps);
10935 return Constructor;
10936 };
10937 }();
10938
10939 var _extends = Object.assign || function (target) {
10940 for (var i = 1; i < arguments.length; i++) {
10941 var source = arguments[i];
10942
10943 for (var key in source) {
10944 if (Object.prototype.hasOwnProperty.call(source, key)) {
10945 target[key] = source[key];
10946 }
10947 }
10948 }
10949
10950 return target;
10951 };
10952
10953 var inherits = function (subClass, superClass) {
10954 if (typeof superClass !== "function" && superClass !== null) {
10955 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
10956 }
10957
10958 subClass.prototype = Object.create(superClass && superClass.prototype, {
10959 constructor: {
10960 value: subClass,
10961 enumerable: false,
10962 writable: true,
10963 configurable: true
10964 }
10965 });
10966 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10967 };
10968
10969 var objectWithoutProperties = function (obj, keys) {
10970 var target = {};
10971
10972 for (var i in obj) {
10973 if (keys.indexOf(i) >= 0) continue;
10974 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
10975 target[i] = obj[i];
10976 }
10977
10978 return target;
10979 };
10980
10981 var possibleConstructorReturn = function (self, call) {
10982 if (!self) {
10983 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10984 }
10985
10986 return call && (typeof call === "object" || typeof call === "function") ? call : self;
10987 };
10988
10989 //
10990 var isPlainObject = (function (x) {
10991 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
10992 });
10993
10994 //
10995 var EMPTY_ARRAY = Object.freeze([]);
10996 var EMPTY_OBJECT = Object.freeze({});
10997
10998 //
10999 function isFunction(test) {
11000 return typeof test === 'function';
11001 }
11002
11003 //
11004
11005 function getComponentName(target) {
11006 return ( true ? typeof target === 'string' && target : 0) || target.displayName || target.name || 'Component';
11007 }
11008
11009 //
11010 function isStatelessFunction(test) {
11011 return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
11012 }
11013
11014 //
11015 function isStyledComponent(target) {
11016 return target && typeof target.styledComponentId === 'string';
11017 }
11018
11019 //
11020
11021 var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
11022
11023 var SC_VERSION_ATTR = 'data-styled-version';
11024
11025 var SC_STREAM_ATTR = 'data-styled-streamed';
11026
11027 var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
11028
11029 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';
11030
11031 // Shared empty execution context when generating static styles
11032 var STATIC_EXECUTION_CONTEXT = {};
11033
11034 //
11035
11036
11037 /**
11038 * Parse errors.md and turn it into a simple hash of code: message
11039 */
11040 var ERRORS = true ? {
11041 "1": "Cannot create styled-component for component: %s.\n\n",
11042 "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",
11043 "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
11044 "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",
11045 "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",
11046 "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",
11047 "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
11048 "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
11049 "9": "Missing document `<head>`\n\n",
11050 "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",
11051 "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",
11052 "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",
11053 "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"
11054 } : 0;
11055
11056 /**
11057 * super basic version of sprintf
11058 */
11059 function format() {
11060 var a = arguments.length <= 0 ? undefined : arguments[0];
11061 var b = [];
11062
11063 for (var c = 1, len = arguments.length; c < len; c += 1) {
11064 b.push(arguments.length <= c ? undefined : arguments[c]);
11065 }
11066
11067 b.forEach(function (d) {
11068 a = a.replace(/%[a-z]/, d);
11069 });
11070
11071 return a;
11072 }
11073
11074 /**
11075 * Create an error file out of errors.md for development and a simple web link to the full errors
11076 * in production mode.
11077 */
11078
11079 var StyledComponentsError = function (_Error) {
11080 inherits(StyledComponentsError, _Error);
11081
11082 function StyledComponentsError(code) {
11083 classCallCheck(this, StyledComponentsError);
11084
11085 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11086 interpolations[_key - 1] = arguments[_key];
11087 }
11088
11089 if (false) { var _this; } else {
11090 var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
11091 }
11092 return possibleConstructorReturn(_this);
11093 }
11094
11095 return StyledComponentsError;
11096 }(Error);
11097
11098 //
11099 var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
11100
11101 var extractComps = (function (maybeCSS) {
11102 var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
11103 var existingComponents = [];
11104 css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
11105 existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
11106 return match;
11107 });
11108 return existingComponents.map(function (_ref, i) {
11109 var componentId = _ref.componentId,
11110 matchIndex = _ref.matchIndex;
11111
11112 var nextComp = existingComponents[i + 1];
11113 var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
11114 return { componentId: componentId, cssFromDOM: cssFromDOM };
11115 });
11116 });
11117
11118 //
11119
11120 var COMMENT_REGEX = /^\s*\/\/.*$/gm;
11121
11122 // NOTE: This stylis instance is only used to split rules from SSR'd style tags
11123 var stylisSplitter = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
11124 global: false,
11125 cascade: true,
11126 keyframe: false,
11127 prefix: false,
11128 compress: false,
11129 semicolon: true
11130 });
11131
11132 var stylis = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
11133 global: false,
11134 cascade: true,
11135 keyframe: false,
11136 prefix: true,
11137 compress: false,
11138 semicolon: false // NOTE: This means "autocomplete missing semicolons"
11139 });
11140
11141 // Wrap `insertRulePlugin to build a list of rules,
11142 // and then make our own plugin to return the rules. This
11143 // makes it easier to hook into the existing SSR architecture
11144
11145 var parsingRules = [];
11146
11147 // eslint-disable-next-line consistent-return
11148 var returnRulesPlugin = function returnRulesPlugin(context) {
11149 if (context === -2) {
11150 var parsedRules = parsingRules;
11151 parsingRules = [];
11152 return parsedRules;
11153 }
11154 };
11155
11156 var parseRulesPlugin = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) {
11157 parsingRules.push(rule);
11158 });
11159
11160 var _componentId = void 0;
11161 var _selector = void 0;
11162 var _selectorRegexp = void 0;
11163
11164 var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
11165 if (
11166 // the first self-ref is always untouched
11167 offset > 0 &&
11168 // there should be at least two self-refs to do a replacement (.b > .b)
11169 string.slice(0, offset).indexOf(_selector) !== -1 &&
11170 // no consecutive self refs (.b.b); that is a precedence boost and treated differently
11171 string.slice(offset - _selector.length, offset) !== _selector) {
11172 return '.' + _componentId;
11173 }
11174
11175 return match;
11176 };
11177
11178 /**
11179 * When writing a style like
11180 *
11181 * & + & {
11182 * color: red;
11183 * }
11184 *
11185 * The second ampersand should be a reference to the static component class. stylis
11186 * has no knowledge of static class so we have to intelligently replace the base selector.
11187 */
11188 var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
11189 if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
11190 // eslint-disable-next-line no-param-reassign
11191 selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
11192 }
11193 };
11194
11195 stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
11196 stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
11197
11198 var splitByRules = function splitByRules(css) {
11199 return stylisSplitter('', css);
11200 };
11201
11202 function stringifyRules(rules, selector, prefix) {
11203 var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
11204
11205 var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
11206
11207 var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
11208
11209 // stylis has no concept of state to be passed to plugins
11210 // but since JS is single=threaded, we can rely on that to ensure
11211 // these properties stay in sync with the current stylis run
11212 _componentId = componentId;
11213 _selector = selector;
11214 _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
11215
11216 return stylis(prefix || !selector ? '' : selector, cssStr);
11217 }
11218
11219 //
11220 /* eslint-disable camelcase, no-undef */
11221
11222 var getNonce = (function () {
11223 return true ? __webpack_require__.nc : 0;
11224 });
11225
11226 //
11227 /* These are helpers for the StyleTags to keep track of the injected
11228 * rule names for each (component) ID that they're keeping track of.
11229 * They're crucial for detecting whether a name has already been
11230 * injected.
11231 * (This excludes rehydrated names) */
11232
11233 /* adds a new ID:name pairing to a names dictionary */
11234 var addNameForId = function addNameForId(names, id, name) {
11235 if (name) {
11236 // eslint-disable-next-line no-param-reassign
11237 var namesForId = names[id] || (names[id] = Object.create(null));
11238 namesForId[name] = true;
11239 }
11240 };
11241
11242 /* resets an ID entirely by overwriting it in the dictionary */
11243 var resetIdNames = function resetIdNames(names, id) {
11244 // eslint-disable-next-line no-param-reassign
11245 names[id] = Object.create(null);
11246 };
11247
11248 /* factory for a names dictionary checking the existance of an ID:name pairing */
11249 var hasNameForId = function hasNameForId(names) {
11250 return function (id, name) {
11251 return names[id] !== undefined && names[id][name];
11252 };
11253 };
11254
11255 /* stringifies names for the html/element output */
11256 var stringifyNames = function stringifyNames(names) {
11257 var str = '';
11258 // eslint-disable-next-line guard-for-in
11259 for (var id in names) {
11260 str += Object.keys(names[id]).join(' ') + ' ';
11261 }
11262 return str.trim();
11263 };
11264
11265 /* clones the nested names dictionary */
11266 var cloneNames = function cloneNames(names) {
11267 var clone = Object.create(null);
11268 // eslint-disable-next-line guard-for-in
11269 for (var id in names) {
11270 clone[id] = _extends({}, names[id]);
11271 }
11272 return clone;
11273 };
11274
11275 //
11276
11277 /* These are helpers that deal with the insertRule (aka speedy) API
11278 * They are used in the StyleTags and specifically the speedy tag
11279 */
11280
11281 /* retrieve a sheet for a given style tag */
11282 var sheetForTag = function sheetForTag(tag) {
11283 // $FlowFixMe
11284 if (tag.sheet) return tag.sheet;
11285
11286 /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
11287 var size = tag.ownerDocument.styleSheets.length;
11288 for (var i = 0; i < size; i += 1) {
11289 var sheet = tag.ownerDocument.styleSheets[i];
11290 // $FlowFixMe
11291 if (sheet.ownerNode === tag) return sheet;
11292 }
11293
11294 /* we should always be able to find a tag */
11295 throw new StyledComponentsError(10);
11296 };
11297
11298 /* insert a rule safely and return whether it was actually injected */
11299 var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
11300 /* abort early if cssRule string is falsy */
11301 if (!cssRule) return false;
11302
11303 var maxIndex = sheet.cssRules.length;
11304
11305 try {
11306 /* use insertRule and cap passed index with maxIndex (no of cssRules) */
11307 sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
11308 } catch (err) {
11309 /* any error indicates an invalid rule */
11310 return false;
11311 }
11312
11313 return true;
11314 };
11315
11316 /* deletes `size` rules starting from `removalIndex` */
11317 var deleteRules = function deleteRules(sheet, removalIndex, size) {
11318 var lowerBound = removalIndex - size;
11319 for (var i = removalIndex; i > lowerBound; i -= 1) {
11320 sheet.deleteRule(i);
11321 }
11322 };
11323
11324 //
11325
11326 /* this marker separates component styles and is important for rehydration */
11327 var makeTextMarker = function makeTextMarker(id) {
11328 return '\n/* sc-component-id: ' + id + ' */\n';
11329 };
11330
11331 /* add up all numbers in array up until and including the index */
11332 var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
11333 var totalUpToIndex = 0;
11334 for (var i = 0; i <= index; i += 1) {
11335 totalUpToIndex += sizes[i];
11336 }
11337
11338 return totalUpToIndex;
11339 };
11340
11341 /* create a new style tag after lastEl */
11342 var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
11343 var targetDocument = document;
11344 if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;
11345
11346 var el = targetDocument.createElement('style');
11347 el.setAttribute(SC_ATTR, '');
11348 el.setAttribute(SC_VERSION_ATTR, "4.4.1");
11349
11350 var nonce = getNonce();
11351 if (nonce) {
11352 el.setAttribute('nonce', nonce);
11353 }
11354
11355 /* Work around insertRule quirk in EdgeHTML */
11356 el.appendChild(targetDocument.createTextNode(''));
11357
11358 if (target && !tagEl) {
11359 /* Append to target when no previous element was passed */
11360 target.appendChild(el);
11361 } else {
11362 if (!tagEl || !target || !tagEl.parentNode) {
11363 throw new StyledComponentsError(6);
11364 }
11365
11366 /* Insert new style tag after the previous one */
11367 tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
11368 }
11369
11370 return el;
11371 };
11372
11373 /* takes a css factory function and outputs an html styled tag factory */
11374 var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
11375 return function (additionalAttrs) {
11376 var nonce = getNonce();
11377 var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.4.1" + '"', additionalAttrs];
11378
11379 var htmlAttr = attrs.filter(Boolean).join(' ');
11380 return '<style ' + htmlAttr + '>' + css() + '</style>';
11381 };
11382 };
11383
11384 /* takes a css factory function and outputs an element factory */
11385 var wrapAsElement = function wrapAsElement(css, names) {
11386 return function () {
11387 var _props;
11388
11389 var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.4.1", _props);
11390
11391 var nonce = getNonce();
11392 if (nonce) {
11393 // $FlowFixMe
11394 props.nonce = nonce;
11395 }
11396
11397 // eslint-disable-next-line react/no-danger
11398 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
11399 };
11400 };
11401
11402 var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
11403 return function () {
11404 return Object.keys(markers);
11405 };
11406 };
11407
11408 /* speedy tags utilise insertRule */
11409 var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
11410 var names = Object.create(null);
11411 var markers = Object.create(null);
11412 var sizes = [];
11413
11414 var extractImport = getImportRuleTag !== undefined;
11415 /* indicates whether getImportRuleTag was called */
11416 var usedImportRuleTag = false;
11417
11418 var insertMarker = function insertMarker(id) {
11419 var prev = markers[id];
11420 if (prev !== undefined) {
11421 return prev;
11422 }
11423
11424 markers[id] = sizes.length;
11425 sizes.push(0);
11426 resetIdNames(names, id);
11427
11428 return markers[id];
11429 };
11430
11431 var insertRules = function insertRules(id, cssRules, name) {
11432 var marker = insertMarker(id);
11433 var sheet = sheetForTag(el);
11434 var insertIndex = addUpUntilIndex(sizes, marker);
11435
11436 var injectedRules = 0;
11437 var importRules = [];
11438 var cssRulesSize = cssRules.length;
11439
11440 for (var i = 0; i < cssRulesSize; i += 1) {
11441 var cssRule = cssRules[i];
11442 var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
11443 if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
11444 importRules.push(cssRule);
11445 } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
11446 mayHaveImport = false;
11447 injectedRules += 1;
11448 }
11449 }
11450
11451 if (extractImport && importRules.length > 0) {
11452 usedImportRuleTag = true;
11453 // $FlowFixMe
11454 getImportRuleTag().insertRules(id + '-import', importRules);
11455 }
11456
11457 sizes[marker] += injectedRules; /* add up no of injected rules */
11458 addNameForId(names, id, name);
11459 };
11460
11461 var removeRules = function removeRules(id) {
11462 var marker = markers[id];
11463 if (marker === undefined) return;
11464 // $FlowFixMe
11465 if (el.isConnected === false) return;
11466
11467 var size = sizes[marker];
11468 var sheet = sheetForTag(el);
11469 var removalIndex = addUpUntilIndex(sizes, marker) - 1;
11470 deleteRules(sheet, removalIndex, size);
11471 sizes[marker] = 0;
11472 resetIdNames(names, id);
11473
11474 if (extractImport && usedImportRuleTag) {
11475 // $FlowFixMe
11476 getImportRuleTag().removeRules(id + '-import');
11477 }
11478 };
11479
11480 var css = function css() {
11481 var _sheetForTag = sheetForTag(el),
11482 cssRules = _sheetForTag.cssRules;
11483
11484 var str = '';
11485
11486 // eslint-disable-next-line guard-for-in
11487 for (var id in markers) {
11488 str += makeTextMarker(id);
11489 var marker = markers[id];
11490 var end = addUpUntilIndex(sizes, marker);
11491 var size = sizes[marker];
11492 for (var i = end - size; i < end; i += 1) {
11493 var rule = cssRules[i];
11494 if (rule !== undefined) {
11495 str += rule.cssText;
11496 }
11497 }
11498 }
11499
11500 return str;
11501 };
11502
11503 return {
11504 clone: function clone() {
11505 throw new StyledComponentsError(5);
11506 },
11507
11508 css: css,
11509 getIds: getIdsFromMarkersFactory(markers),
11510 hasNameForId: hasNameForId(names),
11511 insertMarker: insertMarker,
11512 insertRules: insertRules,
11513 removeRules: removeRules,
11514 sealed: false,
11515 styleTag: el,
11516 toElement: wrapAsElement(css, names),
11517 toHTML: wrapAsHtmlTag(css, names)
11518 };
11519 };
11520
11521 var makeTextNode = function makeTextNode(targetDocument, id) {
11522 return targetDocument.createTextNode(makeTextMarker(id));
11523 };
11524
11525 var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
11526 var names = Object.create(null);
11527 var markers = Object.create(null);
11528
11529 var extractImport = getImportRuleTag !== undefined;
11530
11531 /* indicates whether getImportRuleTag was called */
11532 var usedImportRuleTag = false;
11533
11534 var insertMarker = function insertMarker(id) {
11535 var prev = markers[id];
11536 if (prev !== undefined) {
11537 return prev;
11538 }
11539
11540 markers[id] = makeTextNode(el.ownerDocument, id);
11541 el.appendChild(markers[id]);
11542 names[id] = Object.create(null);
11543
11544 return markers[id];
11545 };
11546
11547 var insertRules = function insertRules(id, cssRules, name) {
11548 var marker = insertMarker(id);
11549 var importRules = [];
11550 var cssRulesSize = cssRules.length;
11551
11552 for (var i = 0; i < cssRulesSize; i += 1) {
11553 var rule = cssRules[i];
11554 var mayHaveImport = extractImport;
11555 if (mayHaveImport && rule.indexOf('@import') !== -1) {
11556 importRules.push(rule);
11557 } else {
11558 mayHaveImport = false;
11559 var separator = i === cssRulesSize - 1 ? '' : ' ';
11560 marker.appendData('' + rule + separator);
11561 }
11562 }
11563
11564 addNameForId(names, id, name);
11565
11566 if (extractImport && importRules.length > 0) {
11567 usedImportRuleTag = true;
11568 // $FlowFixMe
11569 getImportRuleTag().insertRules(id + '-import', importRules);
11570 }
11571 };
11572
11573 var removeRules = function removeRules(id) {
11574 var marker = markers[id];
11575 if (marker === undefined) return;
11576
11577 /* create new empty text node and replace the current one */
11578 var newMarker = makeTextNode(el.ownerDocument, id);
11579 el.replaceChild(newMarker, marker);
11580 markers[id] = newMarker;
11581 resetIdNames(names, id);
11582
11583 if (extractImport && usedImportRuleTag) {
11584 // $FlowFixMe
11585 getImportRuleTag().removeRules(id + '-import');
11586 }
11587 };
11588
11589 var css = function css() {
11590 var str = '';
11591
11592 // eslint-disable-next-line guard-for-in
11593 for (var id in markers) {
11594 str += markers[id].data;
11595 }
11596
11597 return str;
11598 };
11599
11600 return {
11601 clone: function clone() {
11602 throw new StyledComponentsError(5);
11603 },
11604
11605 css: css,
11606 getIds: getIdsFromMarkersFactory(markers),
11607 hasNameForId: hasNameForId(names),
11608 insertMarker: insertMarker,
11609 insertRules: insertRules,
11610 removeRules: removeRules,
11611 sealed: false,
11612 styleTag: el,
11613 toElement: wrapAsElement(css, names),
11614 toHTML: wrapAsHtmlTag(css, names)
11615 };
11616 };
11617
11618 var makeServerTag = function makeServerTag(namesArg, markersArg) {
11619 var names = namesArg === undefined ? Object.create(null) : namesArg;
11620 var markers = markersArg === undefined ? Object.create(null) : markersArg;
11621
11622 var insertMarker = function insertMarker(id) {
11623 var prev = markers[id];
11624 if (prev !== undefined) {
11625 return prev;
11626 }
11627
11628 return markers[id] = [''];
11629 };
11630
11631 var insertRules = function insertRules(id, cssRules, name) {
11632 var marker = insertMarker(id);
11633 marker[0] += cssRules.join(' ');
11634 addNameForId(names, id, name);
11635 };
11636
11637 var removeRules = function removeRules(id) {
11638 var marker = markers[id];
11639 if (marker === undefined) return;
11640 marker[0] = '';
11641 resetIdNames(names, id);
11642 };
11643
11644 var css = function css() {
11645 var str = '';
11646 // eslint-disable-next-line guard-for-in
11647 for (var id in markers) {
11648 var cssForId = markers[id][0];
11649 if (cssForId) {
11650 str += makeTextMarker(id) + cssForId;
11651 }
11652 }
11653 return str;
11654 };
11655
11656 var clone = function clone() {
11657 var namesClone = cloneNames(names);
11658 var markersClone = Object.create(null);
11659
11660 // eslint-disable-next-line guard-for-in
11661 for (var id in markers) {
11662 markersClone[id] = [markers[id][0]];
11663 }
11664
11665 return makeServerTag(namesClone, markersClone);
11666 };
11667
11668 var tag = {
11669 clone: clone,
11670 css: css,
11671 getIds: getIdsFromMarkersFactory(markers),
11672 hasNameForId: hasNameForId(names),
11673 insertMarker: insertMarker,
11674 insertRules: insertRules,
11675 removeRules: removeRules,
11676 sealed: false,
11677 styleTag: null,
11678 toElement: wrapAsElement(css, names),
11679 toHTML: wrapAsHtmlTag(css, names)
11680 };
11681
11682 return tag;
11683 };
11684
11685 var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
11686 if (IS_BROWSER && !forceServer) {
11687 var el = makeStyleTag(target, tagEl, insertBefore);
11688
11689 if (DISABLE_SPEEDY) {
11690 return makeBrowserTag(el, getImportRuleTag);
11691 } else {
11692 return makeSpeedyTag(el, getImportRuleTag);
11693 }
11694 }
11695
11696 return makeServerTag();
11697 };
11698
11699 var rehydrate = function rehydrate(tag, els, extracted) {
11700 /* add all extracted components to the new tag */
11701 for (var i = 0, len = extracted.length; i < len; i += 1) {
11702 var _extracted$i = extracted[i],
11703 componentId = _extracted$i.componentId,
11704 cssFromDOM = _extracted$i.cssFromDOM;
11705
11706 var cssRules = splitByRules(cssFromDOM);
11707 tag.insertRules(componentId, cssRules);
11708 }
11709
11710 /* remove old HTMLStyleElements, since they have been rehydrated */
11711 for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
11712 var el = els[_i];
11713 if (el.parentNode) {
11714 el.parentNode.removeChild(el);
11715 }
11716 }
11717 };
11718
11719 //
11720
11721 var SPLIT_REGEX = /\s+/;
11722
11723 /* determine the maximum number of components before tags are sharded */
11724 var MAX_SIZE = void 0;
11725 if (IS_BROWSER) {
11726 /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
11727 MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
11728 } else {
11729 /* for servers we do not need to shard at all */
11730 MAX_SIZE = -1;
11731 }
11732
11733 var sheetRunningId = 0;
11734 var master = void 0;
11735
11736 var StyleSheet = function () {
11737
11738 /* a map from ids to tags */
11739
11740 /* deferred rules for a given id */
11741
11742 /* this is used for not reinjecting rules via hasNameForId() */
11743
11744 /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
11745
11746 /* a list of tags belonging to this StyleSheet */
11747
11748 /* a tag for import rules */
11749
11750 /* current capacity until a new tag must be created */
11751
11752 /* children (aka clones) of this StyleSheet inheriting all and future injections */
11753
11754 function StyleSheet() {
11755 var _this = this;
11756
11757 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
11758 var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11759 classCallCheck(this, StyleSheet);
11760
11761 this.getImportRuleTag = function () {
11762 var importRuleTag = _this.importRuleTag;
11763
11764 if (importRuleTag !== undefined) {
11765 return importRuleTag;
11766 }
11767
11768 var firstTag = _this.tags[0];
11769 var insertBefore = true;
11770
11771 return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
11772 };
11773
11774 sheetRunningId += 1;
11775 this.id = sheetRunningId;
11776 this.forceServer = forceServer;
11777 this.target = forceServer ? null : target;
11778 this.tagMap = {};
11779 this.deferred = {};
11780 this.rehydratedNames = {};
11781 this.ignoreRehydratedNames = {};
11782 this.tags = [];
11783 this.capacity = 1;
11784 this.clones = [];
11785 }
11786
11787 /* rehydrate all SSR'd style tags */
11788
11789
11790 StyleSheet.prototype.rehydrate = function rehydrate$$1() {
11791 if (!IS_BROWSER || this.forceServer) return this;
11792
11793 var els = [];
11794 var extracted = [];
11795 var isStreamed = false;
11796
11797 /* retrieve all of our SSR style elements from the DOM */
11798 var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.4.1" + '"]');
11799
11800 var nodesSize = nodes.length;
11801
11802 /* abort rehydration if no previous style tags were found */
11803 if (!nodesSize) return this;
11804
11805 for (var i = 0; i < nodesSize; i += 1) {
11806 var el = nodes[i];
11807
11808 /* check if style tag is a streamed tag */
11809 if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
11810
11811 /* retrieve all component names */
11812 var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
11813 var elNamesSize = elNames.length;
11814 for (var j = 0, name; j < elNamesSize; j += 1) {
11815 name = elNames[j];
11816 /* add rehydrated name to sheet to avoid re-adding styles */
11817 this.rehydratedNames[name] = true;
11818 }
11819
11820 /* extract all components and their CSS */
11821 extracted.push.apply(extracted, extractComps(el.textContent));
11822
11823 /* store original HTMLStyleElement */
11824 els.push(el);
11825 }
11826
11827 /* abort rehydration if nothing was extracted */
11828 var extractedSize = extracted.length;
11829 if (!extractedSize) return this;
11830
11831 /* create a tag to be used for rehydration */
11832 var tag = this.makeTag(null);
11833
11834 rehydrate(tag, els, extracted);
11835
11836 /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
11837 this.capacity = Math.max(1, MAX_SIZE - extractedSize);
11838 this.tags.push(tag);
11839
11840 /* retrieve all component ids */
11841 for (var _j = 0; _j < extractedSize; _j += 1) {
11842 this.tagMap[extracted[_j].componentId] = tag;
11843 }
11844
11845 return this;
11846 };
11847
11848 /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
11849 * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
11850 * StyleSheetManager's context */
11851
11852
11853 /* reset the internal "master" instance */
11854 StyleSheet.reset = function reset() {
11855 var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
11856
11857 master = new StyleSheet(undefined, forceServer).rehydrate();
11858 };
11859
11860 /* adds "children" to the StyleSheet that inherit all of the parents' rules
11861 * while their own rules do not affect the parent */
11862
11863
11864 StyleSheet.prototype.clone = function clone() {
11865 var sheet = new StyleSheet(this.target, this.forceServer);
11866
11867 /* add to clone array */
11868 this.clones.push(sheet);
11869
11870 /* clone all tags */
11871 sheet.tags = this.tags.map(function (tag) {
11872 var ids = tag.getIds();
11873 var newTag = tag.clone();
11874
11875 /* reconstruct tagMap */
11876 for (var i = 0; i < ids.length; i += 1) {
11877 sheet.tagMap[ids[i]] = newTag;
11878 }
11879
11880 return newTag;
11881 });
11882
11883 /* clone other maps */
11884 sheet.rehydratedNames = _extends({}, this.rehydratedNames);
11885 sheet.deferred = _extends({}, this.deferred);
11886
11887 return sheet;
11888 };
11889
11890 /* force StyleSheet to create a new tag on the next injection */
11891
11892
11893 StyleSheet.prototype.sealAllTags = function sealAllTags() {
11894 this.capacity = 1;
11895
11896 this.tags.forEach(function (tag) {
11897 // eslint-disable-next-line no-param-reassign
11898 tag.sealed = true;
11899 });
11900 };
11901
11902 StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
11903 var lastEl = tag ? tag.styleTag : null;
11904 var insertBefore = false;
11905
11906 return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
11907 };
11908
11909 /* get a tag for a given componentId, assign the componentId to one, or shard */
11910 StyleSheet.prototype.getTagForId = function getTagForId(id) {
11911 /* simply return a tag, when the componentId was already assigned one */
11912 var prev = this.tagMap[id];
11913 if (prev !== undefined && !prev.sealed) {
11914 return prev;
11915 }
11916
11917 var tag = this.tags[this.tags.length - 1];
11918
11919 /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
11920 this.capacity -= 1;
11921
11922 if (this.capacity === 0) {
11923 this.capacity = MAX_SIZE;
11924 tag = this.makeTag(tag);
11925 this.tags.push(tag);
11926 }
11927
11928 return this.tagMap[id] = tag;
11929 };
11930
11931 /* mainly for createGlobalStyle to check for its id */
11932
11933
11934 StyleSheet.prototype.hasId = function hasId(id) {
11935 return this.tagMap[id] !== undefined;
11936 };
11937
11938 /* caching layer checking id+name to already have a corresponding tag and injected rules */
11939
11940
11941 StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
11942 /* exception for rehydrated names which are checked separately */
11943 if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
11944 return true;
11945 }
11946
11947 var tag = this.tagMap[id];
11948 return tag !== undefined && tag.hasNameForId(id, name);
11949 };
11950
11951 /* registers a componentId and registers it on its tag */
11952
11953
11954 StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
11955 /* don't inject when the id is already registered */
11956 if (this.tagMap[id] !== undefined) return;
11957
11958 var clones = this.clones;
11959
11960 for (var i = 0; i < clones.length; i += 1) {
11961 clones[i].deferredInject(id, cssRules);
11962 }
11963
11964 this.getTagForId(id).insertMarker(id);
11965 this.deferred[id] = cssRules;
11966 };
11967
11968 /* injects rules for a given id with a name that will need to be cached */
11969
11970
11971 StyleSheet.prototype.inject = function inject(id, cssRules, name) {
11972 var clones = this.clones;
11973
11974
11975 for (var i = 0; i < clones.length; i += 1) {
11976 clones[i].inject(id, cssRules, name);
11977 }
11978
11979 var tag = this.getTagForId(id);
11980
11981 /* add deferred rules for component */
11982 if (this.deferred[id] !== undefined) {
11983 // Combine passed cssRules with previously deferred CSS rules
11984 // NOTE: We cannot mutate the deferred array itself as all clones
11985 // do the same (see clones[i].inject)
11986 var rules = this.deferred[id].concat(cssRules);
11987 tag.insertRules(id, rules, name);
11988
11989 this.deferred[id] = undefined;
11990 } else {
11991 tag.insertRules(id, cssRules, name);
11992 }
11993 };
11994
11995 /* removes all rules for a given id, which doesn't remove its marker but resets it */
11996
11997
11998 StyleSheet.prototype.remove = function remove(id) {
11999 var tag = this.tagMap[id];
12000 if (tag === undefined) return;
12001
12002 var clones = this.clones;
12003
12004 for (var i = 0; i < clones.length; i += 1) {
12005 clones[i].remove(id);
12006 }
12007
12008 /* remove all rules from the tag */
12009 tag.removeRules(id);
12010
12011 /* ignore possible rehydrated names */
12012 this.ignoreRehydratedNames[id] = true;
12013
12014 /* delete possible deferred rules */
12015 this.deferred[id] = undefined;
12016 };
12017
12018 StyleSheet.prototype.toHTML = function toHTML() {
12019 return this.tags.map(function (tag) {
12020 return tag.toHTML();
12021 }).join('');
12022 };
12023
12024 StyleSheet.prototype.toReactElements = function toReactElements() {
12025 var id = this.id;
12026
12027
12028 return this.tags.map(function (tag, i) {
12029 var key = 'sc-' + id + '-' + i;
12030 return (0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(tag.toElement(), { key: key });
12031 });
12032 };
12033
12034 createClass(StyleSheet, null, [{
12035 key: 'master',
12036 get: function get$$1() {
12037 return master || (master = new StyleSheet().rehydrate());
12038 }
12039
12040 /* NOTE: This is just for backwards-compatibility with jest-styled-components */
12041
12042 }, {
12043 key: 'instance',
12044 get: function get$$1() {
12045 return StyleSheet.master;
12046 }
12047 }]);
12048 return StyleSheet;
12049 }();
12050
12051 //
12052
12053 var Keyframes = function () {
12054 function Keyframes(name, rules) {
12055 var _this = this;
12056
12057 classCallCheck(this, Keyframes);
12058
12059 this.inject = function (styleSheet) {
12060 if (!styleSheet.hasNameForId(_this.id, _this.name)) {
12061 styleSheet.inject(_this.id, _this.rules, _this.name);
12062 }
12063 };
12064
12065 this.toString = function () {
12066 throw new StyledComponentsError(12, String(_this.name));
12067 };
12068
12069 this.name = name;
12070 this.rules = rules;
12071
12072 this.id = 'sc-keyframes-' + name;
12073 }
12074
12075 Keyframes.prototype.getName = function getName() {
12076 return this.name;
12077 };
12078
12079 return Keyframes;
12080 }();
12081
12082 //
12083
12084 /**
12085 * inlined version of
12086 * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
12087 */
12088
12089 var uppercasePattern = /([A-Z])/g;
12090 var msPattern = /^ms-/;
12091
12092 /**
12093 * Hyphenates a camelcased CSS property name, for example:
12094 *
12095 * > hyphenateStyleName('backgroundColor')
12096 * < "background-color"
12097 * > hyphenateStyleName('MozTransition')
12098 * < "-moz-transition"
12099 * > hyphenateStyleName('msTransition')
12100 * < "-ms-transition"
12101 *
12102 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
12103 * is converted to `-ms-`.
12104 *
12105 * @param {string} string
12106 * @return {string}
12107 */
12108 function hyphenateStyleName(string) {
12109 return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
12110 }
12111
12112 //
12113
12114 // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
12115 function addUnitIfNeeded(name, value) {
12116 // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
12117 // $FlowFixMe
12118 if (value == null || typeof value === 'boolean' || value === '') {
12119 return '';
12120 }
12121
12122 if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__["default"])) {
12123 return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
12124 }
12125
12126 return String(value).trim();
12127 }
12128
12129 //
12130
12131 /**
12132 * It's falsish not falsy because 0 is allowed.
12133 */
12134 var isFalsish = function isFalsish(chunk) {
12135 return chunk === undefined || chunk === null || chunk === false || chunk === '';
12136 };
12137
12138 var objToCssArray = function objToCssArray(obj, prevKey) {
12139 var rules = [];
12140 var keys = Object.keys(obj);
12141
12142 keys.forEach(function (key) {
12143 if (!isFalsish(obj[key])) {
12144 if (isPlainObject(obj[key])) {
12145 rules.push.apply(rules, objToCssArray(obj[key], key));
12146
12147 return rules;
12148 } else if (isFunction(obj[key])) {
12149 rules.push(hyphenateStyleName(key) + ':', obj[key], ';');
12150
12151 return rules;
12152 }
12153 rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');
12154 }
12155 return rules;
12156 });
12157
12158 return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;
12159 };
12160
12161 function flatten(chunk, executionContext, styleSheet) {
12162 if (Array.isArray(chunk)) {
12163 var ruleSet = [];
12164
12165 for (var i = 0, len = chunk.length, result; i < len; i += 1) {
12166 result = flatten(chunk[i], executionContext, styleSheet);
12167
12168 if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
12169 }
12170
12171 return ruleSet;
12172 }
12173
12174 if (isFalsish(chunk)) {
12175 return null;
12176 }
12177
12178 /* Handle other components */
12179 if (isStyledComponent(chunk)) {
12180 return '.' + chunk.styledComponentId;
12181 }
12182
12183 /* Either execute or defer the function */
12184 if (isFunction(chunk)) {
12185 if (isStatelessFunction(chunk) && executionContext) {
12186 var _result = chunk(executionContext);
12187
12188 if ( true && (0,react_is__WEBPACK_IMPORTED_MODULE_4__.isElement)(_result)) {
12189 // eslint-disable-next-line no-console
12190 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.');
12191 }
12192
12193 return flatten(_result, executionContext, styleSheet);
12194 } else return chunk;
12195 }
12196
12197 if (chunk instanceof Keyframes) {
12198 if (styleSheet) {
12199 chunk.inject(styleSheet);
12200 return chunk.getName();
12201 } else return chunk;
12202 }
12203
12204 /* Handle objects */
12205 return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
12206 }
12207
12208 //
12209
12210 function css(styles) {
12211 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12212 interpolations[_key - 1] = arguments[_key];
12213 }
12214
12215 if (isFunction(styles) || isPlainObject(styles)) {
12216 // $FlowFixMe
12217 return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
12218 }
12219
12220 // $FlowFixMe
12221 return flatten(interleave(styles, interpolations));
12222 }
12223
12224 //
12225
12226 function constructWithOptions(componentConstructor, tag) {
12227 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
12228
12229 if (!(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(tag)) {
12230 throw new StyledComponentsError(1, String(tag));
12231 }
12232
12233 /* This is callable directly as a template function */
12234 // $FlowFixMe: Not typed to avoid destructuring arguments
12235 var templateFunction = function templateFunction() {
12236 return componentConstructor(tag, options, css.apply(undefined, arguments));
12237 };
12238
12239 /* If config methods are called, wrap up a new template function and merge options */
12240 templateFunction.withConfig = function (config) {
12241 return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
12242 };
12243
12244 /* Modify/inject new props at runtime */
12245 templateFunction.attrs = function (attrs) {
12246 return constructWithOptions(componentConstructor, tag, _extends({}, options, {
12247 attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
12248 }));
12249 };
12250
12251 return templateFunction;
12252 }
12253
12254 //
12255 // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
12256 function murmurhash(c) {
12257 for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
12258 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;
12259 }
12260 switch (e) {
12261 case 3:
12262 a ^= (c.charCodeAt(d + 2) & 255) << 16;
12263 case 2:
12264 a ^= (c.charCodeAt(d + 1) & 255) << 8;
12265 case 1:
12266 a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
12267 }
12268 a ^= a >>> 13;
12269 a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
12270 return (a ^ a >>> 15) >>> 0;
12271 }
12272
12273 //
12274 /* eslint-disable no-bitwise */
12275
12276 /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
12277 * counterparts */
12278 var charsLength = 52;
12279
12280 /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
12281 var getAlphabeticChar = function getAlphabeticChar(code) {
12282 return String.fromCharCode(code + (code > 25 ? 39 : 97));
12283 };
12284
12285 /* input a number, usually a hash and convert it to base-52 */
12286 function generateAlphabeticName(code) {
12287 var name = '';
12288 var x = void 0;
12289
12290 /* get a char and divide by alphabet-length */
12291 for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
12292 name = getAlphabeticChar(x % charsLength) + name;
12293 }
12294
12295 return getAlphabeticChar(x % charsLength) + name;
12296 }
12297
12298 //
12299
12300 function hasFunctionObjectKey(obj) {
12301 // eslint-disable-next-line guard-for-in, no-restricted-syntax
12302 for (var key in obj) {
12303 if (isFunction(obj[key])) {
12304 return true;
12305 }
12306 }
12307
12308 return false;
12309 }
12310
12311 function isStaticRules(rules, attrs) {
12312 for (var i = 0; i < rules.length; i += 1) {
12313 var rule = rules[i];
12314
12315 // recursive case
12316 if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
12317 return false;
12318 } else if (isFunction(rule) && !isStyledComponent(rule)) {
12319 // functions are allowed to be static if they're just being
12320 // used to get the classname of a nested styled component
12321 return false;
12322 }
12323 }
12324
12325 if (attrs.some(function (x) {
12326 return isFunction(x) || hasFunctionObjectKey(x);
12327 })) return false;
12328
12329 return true;
12330 }
12331
12332 //
12333
12334 /* combines hashStr (murmurhash) and nameGenerator for convenience */
12335 var hasher = function hasher(str) {
12336 return generateAlphabeticName(murmurhash(str));
12337 };
12338
12339 /*
12340 ComponentStyle is all the CSS-specific stuff, not
12341 the React-specific stuff.
12342 */
12343
12344 var ComponentStyle = function () {
12345 function ComponentStyle(rules, attrs, componentId) {
12346 classCallCheck(this, ComponentStyle);
12347
12348 this.rules = rules;
12349 this.isStatic = false && 0;
12350 this.componentId = componentId;
12351
12352 if (!StyleSheet.master.hasId(componentId)) {
12353 StyleSheet.master.deferredInject(componentId, []);
12354 }
12355 }
12356
12357 /*
12358 * Flattens a rule set into valid CSS
12359 * Hashes it, wraps the whole chunk in a .hash1234 {}
12360 * Returns the hash to be injected on render()
12361 * */
12362
12363
12364 ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
12365 var isStatic = this.isStatic,
12366 componentId = this.componentId,
12367 lastClassName = this.lastClassName;
12368
12369 if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
12370 return lastClassName;
12371 }
12372
12373 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12374 var name = hasher(this.componentId + flatCSS.join(''));
12375 if (!styleSheet.hasNameForId(componentId, name)) {
12376 styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
12377 }
12378
12379 this.lastClassName = name;
12380 return name;
12381 };
12382
12383 ComponentStyle.generateName = function generateName(str) {
12384 return hasher(str);
12385 };
12386
12387 return ComponentStyle;
12388 }();
12389
12390 //
12391
12392 var LIMIT = 200;
12393
12394 var createWarnTooManyClasses = (function (displayName) {
12395 var generatedClasses = {};
12396 var warningSeen = false;
12397
12398 return function (className) {
12399 if (!warningSeen) {
12400 generatedClasses[className] = true;
12401 if (Object.keys(generatedClasses).length >= LIMIT) {
12402 // Unable to find latestRule in test environment.
12403 /* eslint-disable no-console, prefer-template */
12404 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 />');
12405 warningSeen = true;
12406 generatedClasses = {};
12407 }
12408 }
12409 };
12410 });
12411
12412 //
12413
12414 var determineTheme = (function (props, fallbackTheme) {
12415 var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
12416
12417 // Props should take precedence over ThemeProvider, which should take precedence over
12418 // defaultProps, but React automatically puts defaultProps on props.
12419
12420 /* eslint-disable react/prop-types, flowtype-errors/show-errors */
12421 var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
12422 var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
12423 /* eslint-enable */
12424
12425 return theme;
12426 });
12427
12428 //
12429 var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
12430 var dashesAtEnds = /(^-|-$)/g;
12431
12432 /**
12433 * TODO: Explore using CSS.escape when it becomes more available
12434 * in evergreen browsers.
12435 */
12436 function escape(str) {
12437 return str
12438 // Replace all possible CSS selectors
12439 .replace(escapeRegex, '-')
12440
12441 // Remove extraneous hyphens at the start and end
12442 .replace(dashesAtEnds, '');
12443 }
12444
12445 //
12446
12447 function isTag(target) {
12448 return typeof target === 'string' && ( true ? target.charAt(0) === target.charAt(0).toLowerCase() : 0);
12449 }
12450
12451 //
12452
12453 function generateDisplayName(target) {
12454 // $FlowFixMe
12455 return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
12456 }
12457
12458 var _TYPE_STATICS;
12459
12460 var REACT_STATICS = {
12461 childContextTypes: true,
12462 contextTypes: true,
12463 defaultProps: true,
12464 displayName: true,
12465 getDerivedStateFromProps: true,
12466 propTypes: true,
12467 type: true
12468 };
12469
12470 var KNOWN_STATICS = {
12471 name: true,
12472 length: true,
12473 prototype: true,
12474 caller: true,
12475 callee: true,
12476 arguments: true,
12477 arity: true
12478 };
12479
12480 var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__.ForwardRef] = {
12481 $$typeof: true,
12482 render: true
12483 }, _TYPE_STATICS);
12484
12485 var defineProperty$1 = Object.defineProperty,
12486 getOwnPropertyNames = Object.getOwnPropertyNames,
12487 _Object$getOwnPropert = Object.getOwnPropertySymbols,
12488 getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
12489 return [];
12490 } : _Object$getOwnPropert,
12491 getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
12492 getPrototypeOf = Object.getPrototypeOf,
12493 objectPrototype = Object.prototype;
12494 var arrayPrototype = Array.prototype;
12495
12496
12497 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
12498 if (typeof sourceComponent !== 'string') {
12499 // don't hoist over string (html) components
12500
12501 var inheritedComponent = getPrototypeOf(sourceComponent);
12502
12503 if (inheritedComponent && inheritedComponent !== objectPrototype) {
12504 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
12505 }
12506
12507 var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
12508 // $FlowFixMe
12509 getOwnPropertySymbols(sourceComponent));
12510
12511 var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
12512
12513 var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
12514
12515 var i = keys.length;
12516 var descriptor = void 0;
12517 var key = void 0;
12518
12519 // eslint-disable-next-line no-plusplus
12520 while (i--) {
12521 key = keys[i];
12522
12523 if (
12524 // $FlowFixMe
12525 !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
12526 // $FlowFixMe
12527 !(targetStatics && targetStatics[key])) {
12528 descriptor = getOwnPropertyDescriptor(sourceComponent, key);
12529
12530 if (descriptor) {
12531 try {
12532 // Avoid failures from read-only properties
12533 defineProperty$1(targetComponent, key, descriptor);
12534 } catch (e) {
12535 /* fail silently */
12536 }
12537 }
12538 }
12539 }
12540
12541 return targetComponent;
12542 }
12543
12544 return targetComponent;
12545 }
12546
12547 //
12548 function isDerivedReactComponent(fn) {
12549 return !!(fn && fn.prototype && fn.prototype.isReactComponent);
12550 }
12551
12552 //
12553 // Helper to call a given function, only once
12554 var once = (function (cb) {
12555 var called = false;
12556
12557 return function () {
12558 if (!called) {
12559 called = true;
12560 cb.apply(undefined, arguments);
12561 }
12562 };
12563 });
12564
12565 //
12566
12567 var ThemeContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12568
12569 var ThemeConsumer = ThemeContext.Consumer;
12570
12571 /**
12572 * Provide a theme to an entire react component tree via context
12573 */
12574
12575 var ThemeProvider = function (_Component) {
12576 inherits(ThemeProvider, _Component);
12577
12578 function ThemeProvider(props) {
12579 classCallCheck(this, ThemeProvider);
12580
12581 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12582
12583 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext.bind(_this));
12584 _this.renderInner = _this.renderInner.bind(_this);
12585 return _this;
12586 }
12587
12588 ThemeProvider.prototype.render = function render() {
12589 if (!this.props.children) return null;
12590
12591 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12592 ThemeContext.Consumer,
12593 null,
12594 this.renderInner
12595 );
12596 };
12597
12598 ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
12599 var context = this.getContext(this.props.theme, outerTheme);
12600
12601 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12602 ThemeContext.Provider,
12603 { value: context },
12604 this.props.children
12605 );
12606 };
12607
12608 /**
12609 * Get the theme from the props, supporting both (outerTheme) => {}
12610 * as well as object notation
12611 */
12612
12613
12614 ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
12615 if (isFunction(theme)) {
12616 var mergedTheme = theme(outerTheme);
12617
12618 if ( true && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
12619 throw new StyledComponentsError(7);
12620 }
12621
12622 return mergedTheme;
12623 }
12624
12625 if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
12626 throw new StyledComponentsError(8);
12627 }
12628
12629 return _extends({}, outerTheme, theme);
12630 };
12631
12632 ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
12633 return this.getTheme(theme, outerTheme);
12634 };
12635
12636 return ThemeProvider;
12637 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12638
12639 //
12640
12641 var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
12642
12643 var ServerStyleSheet = function () {
12644 function ServerStyleSheet() {
12645 classCallCheck(this, ServerStyleSheet);
12646
12647 /* The master sheet might be reset, so keep a reference here */
12648 this.masterSheet = StyleSheet.master;
12649 this.instance = this.masterSheet.clone();
12650 this.sealed = false;
12651 }
12652
12653 /**
12654 * Mark the ServerStyleSheet as being fully emitted and manually GC it from the
12655 * StyleSheet singleton.
12656 */
12657
12658
12659 ServerStyleSheet.prototype.seal = function seal() {
12660 if (!this.sealed) {
12661 /* Remove sealed StyleSheets from the master sheet */
12662 var index = this.masterSheet.clones.indexOf(this.instance);
12663 this.masterSheet.clones.splice(index, 1);
12664 this.sealed = true;
12665 }
12666 };
12667
12668 ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
12669 if (this.sealed) {
12670 throw new StyledComponentsError(2);
12671 }
12672
12673 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12674 StyleSheetManager,
12675 { sheet: this.instance },
12676 children
12677 );
12678 };
12679
12680 ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
12681 this.seal();
12682 return this.instance.toHTML();
12683 };
12684
12685 ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
12686 this.seal();
12687 return this.instance.toReactElements();
12688 };
12689
12690 ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
12691 var _this = this;
12692
12693 {
12694 throw new StyledComponentsError(3);
12695 }
12696
12697 /* the tag index keeps track of which tags have already been emitted */
12698 var instance = this.instance;
12699
12700 var instanceTagIndex = 0;
12701
12702 var streamAttr = SC_STREAM_ATTR + '="true"';
12703
12704 var transformer = new stream.Transform({
12705 transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
12706 var tags = instance.tags;
12707
12708 var html = '';
12709
12710 /* retrieve html for each new style tag */
12711 for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
12712 var tag = tags[instanceTagIndex];
12713 html += tag.toHTML(streamAttr);
12714 }
12715
12716 /* force our StyleSheets to emit entirely new tags */
12717 instance.sealAllTags();
12718
12719 var renderedHtml = chunk.toString();
12720
12721 /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
12722 if (CLOSING_TAG_R.test(renderedHtml)) {
12723 var endOfClosingTag = renderedHtml.indexOf('>');
12724
12725 this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
12726 } else this.push(html + renderedHtml);
12727
12728 callback();
12729 }
12730 });
12731
12732 readableStream.on('end', function () {
12733 return _this.seal();
12734 });
12735
12736 readableStream.on('error', function (err) {
12737 _this.seal();
12738
12739 // forward the error to the transform stream
12740 transformer.emit('error', err);
12741 });
12742
12743 return readableStream.pipe(transformer);
12744 };
12745
12746 return ServerStyleSheet;
12747 }();
12748
12749 //
12750
12751 var StyleSheetContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12752 var StyleSheetConsumer = StyleSheetContext.Consumer;
12753
12754 var StyleSheetManager = function (_Component) {
12755 inherits(StyleSheetManager, _Component);
12756
12757 function StyleSheetManager(props) {
12758 classCallCheck(this, StyleSheetManager);
12759
12760 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12761
12762 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext);
12763 return _this;
12764 }
12765
12766 StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
12767 if (sheet) {
12768 return sheet;
12769 } else if (target) {
12770 return new StyleSheet(target);
12771 } else {
12772 throw new StyledComponentsError(4);
12773 }
12774 };
12775
12776 StyleSheetManager.prototype.render = function render() {
12777 var _props = this.props,
12778 children = _props.children,
12779 sheet = _props.sheet,
12780 target = _props.target;
12781
12782
12783 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12784 StyleSheetContext.Provider,
12785 { value: this.getContext(sheet, target) },
12786 true ? react__WEBPACK_IMPORTED_MODULE_2___default().Children.only(children) : 0
12787 );
12788 };
12789
12790 return StyleSheetManager;
12791 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12792 true ? StyleSheetManager.propTypes = {
12793 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)]),
12794
12795 target: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
12796 appendChild: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func.isRequired)
12797 })
12798 } : 0;
12799
12800 //
12801
12802 var identifiers = {};
12803
12804 /* We depend on components having unique IDs */
12805 function generateId(_ComponentStyle, _displayName, parentComponentId) {
12806 var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
12807
12808 /**
12809 * This ensures uniqueness if two components happen to share
12810 * the same displayName.
12811 */
12812 var nr = (identifiers[displayName] || 0) + 1;
12813 identifiers[displayName] = nr;
12814
12815 var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
12816
12817 return parentComponentId ? parentComponentId + '-' + componentId : componentId;
12818 }
12819
12820 // $FlowFixMe
12821
12822 var StyledComponent = function (_Component) {
12823 inherits(StyledComponent, _Component);
12824
12825 function StyledComponent() {
12826 classCallCheck(this, StyledComponent);
12827
12828 var _this = possibleConstructorReturn(this, _Component.call(this));
12829
12830 _this.attrs = {};
12831
12832 _this.renderOuter = _this.renderOuter.bind(_this);
12833 _this.renderInner = _this.renderInner.bind(_this);
12834
12835 if (true) {
12836 _this.warnInnerRef = once(function (displayName) {
12837 return (
12838 // eslint-disable-next-line no-console
12839 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 + '".')
12840 );
12841 });
12842
12843 _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
12844 return (
12845 // eslint-disable-next-line no-console
12846 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)
12847 );
12848 });
12849
12850 _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
12851 return (
12852 // eslint-disable-next-line no-console
12853 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 }'))
12854 );
12855 });
12856 }
12857 return _this;
12858 }
12859
12860 StyledComponent.prototype.render = function render() {
12861 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12862 StyleSheetConsumer,
12863 null,
12864 this.renderOuter
12865 );
12866 };
12867
12868 StyledComponent.prototype.renderOuter = function renderOuter() {
12869 var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
12870
12871 this.styleSheet = styleSheet;
12872
12873 // No need to subscribe a static component to theme changes, it won't change anything
12874 if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
12875
12876 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12877 ThemeConsumer,
12878 null,
12879 this.renderInner
12880 );
12881 };
12882
12883 StyledComponent.prototype.renderInner = function renderInner(theme) {
12884 var _props$forwardedCompo = this.props.forwardedComponent,
12885 componentStyle = _props$forwardedCompo.componentStyle,
12886 defaultProps = _props$forwardedCompo.defaultProps,
12887 displayName = _props$forwardedCompo.displayName,
12888 foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
12889 styledComponentId = _props$forwardedCompo.styledComponentId,
12890 target = _props$forwardedCompo.target;
12891
12892
12893 var generatedClassName = void 0;
12894 if (componentStyle.isStatic) {
12895 generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
12896 } else {
12897 generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);
12898 }
12899
12900 var elementToBeCreated = this.props.as || this.attrs.as || target;
12901 var isTargetTag = isTag(elementToBeCreated);
12902
12903 var propsForElement = {};
12904 var computedProps = _extends({}, this.props, this.attrs);
12905
12906 var key = void 0;
12907 // eslint-disable-next-line guard-for-in
12908 for (key in computedProps) {
12909 if ( true && key === 'innerRef' && isTargetTag) {
12910 this.warnInnerRef(displayName);
12911 }
12912
12913 if (key === 'forwardedComponent' || key === 'as') {
12914 continue;
12915 } 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)) {
12916 // Don't pass through non HTML tags through to HTML elements
12917 propsForElement[key] = computedProps[key];
12918 }
12919 }
12920
12921 if (this.props.style && this.attrs.style) {
12922 propsForElement.style = _extends({}, this.attrs.style, this.props.style);
12923 }
12924
12925 propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');
12926
12927 return (0,react__WEBPACK_IMPORTED_MODULE_2__.createElement)(elementToBeCreated, propsForElement);
12928 };
12929
12930 StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
12931 var _this2 = this;
12932
12933 var context = _extends({}, props, { theme: theme });
12934
12935 if (!attrs.length) return context;
12936
12937 this.attrs = {};
12938
12939 attrs.forEach(function (attrDef) {
12940 var resolvedAttrDef = attrDef;
12941 var attrDefWasFn = false;
12942 var attr = void 0;
12943 var key = void 0;
12944
12945 if (isFunction(resolvedAttrDef)) {
12946 // $FlowFixMe
12947 resolvedAttrDef = resolvedAttrDef(context);
12948 attrDefWasFn = true;
12949 }
12950
12951 /* eslint-disable guard-for-in */
12952 // $FlowFixMe
12953 for (key in resolvedAttrDef) {
12954 attr = resolvedAttrDef[key];
12955
12956 if (!attrDefWasFn) {
12957 if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
12958 if (true) {
12959 _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
12960 }
12961
12962 attr = attr(context);
12963
12964 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(attr)) {
12965 _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
12966 }
12967 }
12968 }
12969
12970 _this2.attrs[key] = attr;
12971 context[key] = attr;
12972 }
12973 /* eslint-enable */
12974 });
12975
12976 return context;
12977 };
12978
12979 StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
12980 var _props$forwardedCompo2 = props.forwardedComponent,
12981 attrs = _props$forwardedCompo2.attrs,
12982 componentStyle = _props$forwardedCompo2.componentStyle,
12983 warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
12984
12985 // statically styled-components don't need to build an execution context object,
12986 // and shouldn't be increasing the number of class names
12987
12988 if (componentStyle.isStatic && !attrs.length) {
12989 return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
12990 }
12991
12992 var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
12993
12994 if ( true && warnTooManyClasses) warnTooManyClasses(className);
12995
12996 return className;
12997 };
12998
12999 return StyledComponent;
13000 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
13001
13002 function createStyledComponent(target, options, rules) {
13003 var isTargetStyledComp = isStyledComponent(target);
13004 var isClass = !isTag(target);
13005
13006 var _options$displayName = options.displayName,
13007 displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
13008 _options$componentId = options.componentId,
13009 componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
13010 _options$ParentCompon = options.ParentComponent,
13011 ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
13012 _options$attrs = options.attrs,
13013 attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
13014
13015
13016 var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
13017
13018 // fold the underlying StyledComponent attrs up (implicit extend)
13019 var finalAttrs =
13020 // $FlowFixMe
13021 isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
13022
13023 var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
13024 // $FlowFixMe
13025 target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
13026
13027 /**
13028 * forwardRef creates a new interim component, which we'll take advantage of
13029 * instead of extending ParentComponent to create _another_ interim class
13030 */
13031 var WrappedStyledComponent = void 0;
13032 var forwardRef = function forwardRef(props, ref) {
13033 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
13034 };
13035 forwardRef.displayName = displayName;
13036 WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(forwardRef);
13037 WrappedStyledComponent.displayName = displayName;
13038
13039 // $FlowFixMe
13040 WrappedStyledComponent.attrs = finalAttrs;
13041 // $FlowFixMe
13042 WrappedStyledComponent.componentStyle = componentStyle;
13043
13044 // $FlowFixMe
13045 WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
13046 Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
13047
13048 // $FlowFixMe
13049 WrappedStyledComponent.styledComponentId = styledComponentId;
13050
13051 // fold the underlying StyledComponent target up since we folded the styles
13052 // $FlowFixMe
13053 WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
13054
13055 // $FlowFixMe
13056 WrappedStyledComponent.withComponent = function withComponent(tag) {
13057 var previousComponentId = options.componentId,
13058 optionsToCopy = objectWithoutProperties(options, ['componentId']);
13059
13060
13061 var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
13062
13063 var newOptions = _extends({}, optionsToCopy, {
13064 attrs: finalAttrs,
13065 componentId: newComponentId,
13066 ParentComponent: ParentComponent
13067 });
13068
13069 return createStyledComponent(tag, newOptions, rules);
13070 };
13071
13072 // $FlowFixMe
13073 Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
13074 get: function get$$1() {
13075 return this._foldedDefaultProps;
13076 },
13077 set: function set$$1(obj) {
13078 // $FlowFixMe
13079 this._foldedDefaultProps = isTargetStyledComp ? (0,merge_anything__WEBPACK_IMPORTED_MODULE_6__["default"])(target.defaultProps, obj) : obj;
13080 }
13081 });
13082
13083 if (true) {
13084 // $FlowFixMe
13085 WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
13086 }
13087
13088 // $FlowFixMe
13089 WrappedStyledComponent.toString = function () {
13090 return '.' + WrappedStyledComponent.styledComponentId;
13091 };
13092
13093 if (isClass) {
13094 hoistNonReactStatics(WrappedStyledComponent, target, {
13095 // all SC-specific things should not be hoisted
13096 attrs: true,
13097 componentStyle: true,
13098 displayName: true,
13099 foldedComponentIds: true,
13100 styledComponentId: true,
13101 target: true,
13102 withComponent: true
13103 });
13104 }
13105
13106 return WrappedStyledComponent;
13107 }
13108
13109 //
13110 // Thanks to ReactDOMFactories for this handy list!
13111
13112 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',
13113
13114 // SVG
13115 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
13116
13117 //
13118
13119 var styled = function styled(tag) {
13120 return constructWithOptions(createStyledComponent, tag);
13121 };
13122
13123 // Shorthands for all valid HTML Elements
13124 domElements.forEach(function (domElement) {
13125 styled[domElement] = styled(domElement);
13126 });
13127
13128 //
13129
13130 var GlobalStyle = function () {
13131 function GlobalStyle(rules, componentId) {
13132 classCallCheck(this, GlobalStyle);
13133
13134 this.rules = rules;
13135 this.componentId = componentId;
13136 this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
13137
13138 if (!StyleSheet.master.hasId(componentId)) {
13139 StyleSheet.master.deferredInject(componentId, []);
13140 }
13141 }
13142
13143 GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
13144 var flatCSS = flatten(this.rules, executionContext, styleSheet);
13145 var css = stringifyRules(flatCSS, '');
13146
13147 styleSheet.inject(this.componentId, css);
13148 };
13149
13150 GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
13151 var componentId = this.componentId;
13152
13153 if (styleSheet.hasId(componentId)) {
13154 styleSheet.remove(componentId);
13155 }
13156 };
13157
13158 // TODO: overwrite in-place instead of remove+create?
13159
13160
13161 GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
13162 this.removeStyles(styleSheet);
13163 this.createStyles(executionContext, styleSheet);
13164 };
13165
13166 return GlobalStyle;
13167 }();
13168
13169 //
13170
13171 // place our cache into shared context so it'll persist between HMRs
13172 if (IS_BROWSER) {
13173 window.scCGSHMRCache = {};
13174 }
13175
13176 function createGlobalStyle(strings) {
13177 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13178 interpolations[_key - 1] = arguments[_key];
13179 }
13180
13181 var rules = css.apply(undefined, [strings].concat(interpolations));
13182 var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
13183 var style = new GlobalStyle(rules, id);
13184
13185 var GlobalStyleComponent = function (_React$Component) {
13186 inherits(GlobalStyleComponent, _React$Component);
13187
13188 function GlobalStyleComponent(props) {
13189 classCallCheck(this, GlobalStyleComponent);
13190
13191 var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
13192
13193 var _this$constructor = _this.constructor,
13194 globalStyle = _this$constructor.globalStyle,
13195 styledComponentId = _this$constructor.styledComponentId;
13196
13197
13198 if (IS_BROWSER) {
13199 window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
13200 }
13201
13202 /**
13203 * This fixes HMR compatibility. Don't ask me why, but this combination of
13204 * caching the closure variables via statics and then persisting the statics in
13205 * state works across HMR where no other combination did. ¯\_(ツ)_/¯
13206 */
13207 _this.state = {
13208 globalStyle: globalStyle,
13209 styledComponentId: styledComponentId
13210 };
13211 return _this;
13212 }
13213
13214 GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
13215 if (window.scCGSHMRCache[this.state.styledComponentId]) {
13216 window.scCGSHMRCache[this.state.styledComponentId] -= 1;
13217 }
13218 /**
13219 * Depending on the order "render" is called this can cause the styles to be lost
13220 * until the next render pass of the remaining instance, which may
13221 * not be immediate.
13222 */
13223 if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
13224 this.state.globalStyle.removeStyles(this.styleSheet);
13225 }
13226 };
13227
13228 GlobalStyleComponent.prototype.render = function render() {
13229 var _this2 = this;
13230
13231 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(this.props.children)) {
13232 // eslint-disable-next-line no-console
13233 console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
13234 }
13235
13236 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13237 StyleSheetConsumer,
13238 null,
13239 function (styleSheet) {
13240 _this2.styleSheet = styleSheet || StyleSheet.master;
13241
13242 var globalStyle = _this2.state.globalStyle;
13243
13244
13245 if (globalStyle.isStatic) {
13246 globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
13247
13248 return null;
13249 } else {
13250 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13251 ThemeConsumer,
13252 null,
13253 function (theme) {
13254 // $FlowFixMe
13255 var defaultProps = _this2.constructor.defaultProps;
13256
13257
13258 var context = _extends({}, _this2.props);
13259
13260 if (typeof theme !== 'undefined') {
13261 context.theme = determineTheme(_this2.props, theme, defaultProps);
13262 }
13263
13264 globalStyle.renderStyles(context, _this2.styleSheet);
13265
13266 return null;
13267 }
13268 );
13269 }
13270 }
13271 );
13272 };
13273
13274 return GlobalStyleComponent;
13275 }((react__WEBPACK_IMPORTED_MODULE_2___default().Component));
13276
13277 GlobalStyleComponent.globalStyle = style;
13278 GlobalStyleComponent.styledComponentId = id;
13279
13280
13281 return GlobalStyleComponent;
13282 }
13283
13284 //
13285
13286 var replaceWhitespace = function replaceWhitespace(str) {
13287 return str.replace(/\s|\\n/g, '');
13288 };
13289
13290 function keyframes(strings) {
13291 /* Warning if you've used keyframes on React Native */
13292 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13293 // eslint-disable-next-line no-console
13294 console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
13295 }
13296
13297 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13298 interpolations[_key - 1] = arguments[_key];
13299 }
13300
13301 var rules = css.apply(undefined, [strings].concat(interpolations));
13302
13303 var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
13304
13305 return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
13306 }
13307
13308 //
13309
13310 var withTheme = (function (Component$$1) {
13311 var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function (props, ref) {
13312 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
13313 ThemeConsumer,
13314 null,
13315 function (theme) {
13316 // $FlowFixMe
13317 var defaultProps = Component$$1.defaultProps;
13318
13319 var themeProp = determineTheme(props, theme, defaultProps);
13320
13321 if ( true && themeProp === undefined) {
13322 // eslint-disable-next-line no-console
13323 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) + '"');
13324 }
13325
13326 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
13327 }
13328 );
13329 });
13330
13331 hoistNonReactStatics(WithTheme, Component$$1);
13332
13333 WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
13334
13335 return WithTheme;
13336 });
13337
13338 //
13339
13340 /* eslint-disable */
13341 var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
13342 StyleSheet: StyleSheet
13343 };
13344
13345 //
13346
13347 /* Warning if you've imported this file on React Native */
13348 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13349 // eslint-disable-next-line no-console
13350 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');
13351 }
13352
13353 /* Warning if there are several instances of styled-components */
13354 if ( true && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
13355 window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
13356
13357 if (window['__styled-components-init__'] === 1) {
13358 // eslint-disable-next-line no-console
13359 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.');
13360 }
13361
13362 window['__styled-components-init__'] += 1;
13363 }
13364
13365 //
13366
13367 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (styled);
13368
13369 //# sourceMappingURL=styled-components.browser.esm.js.map
13370
13371
13372 /***/ }),
13373
13374 /***/ "./node_modules/stylis-rule-sheet/index.js":
13375 /*!*************************************************!*\
13376 !*** ./node_modules/stylis-rule-sheet/index.js ***!
13377 \*************************************************/
13378 /***/ ((module) => {
13379
13380 (function (factory) {
13381 true ? (module['exports'] = factory()) :
13382 0
13383 }(function () {
13384
13385 'use strict'
13386
13387 return function (insertRule) {
13388 var delimiter = '/*|*/'
13389 var needle = delimiter+'}'
13390
13391 function toSheet (block) {
13392 if (block)
13393 try {
13394 insertRule(block + '}')
13395 } catch (e) {}
13396 }
13397
13398 return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
13399 switch (context) {
13400 // property
13401 case 1:
13402 // @import
13403 if (depth === 0 && content.charCodeAt(0) === 64)
13404 return insertRule(content+';'), ''
13405 break
13406 // selector
13407 case 2:
13408 if (ns === 0)
13409 return content + delimiter
13410 break
13411 // at-rule
13412 case 3:
13413 switch (ns) {
13414 // @font-face, @page
13415 case 102:
13416 case 112:
13417 return insertRule(selectors[0]+content), ''
13418 default:
13419 return content + (at === 0 ? delimiter : '')
13420 }
13421 case -2:
13422 content.split(needle).forEach(toSheet)
13423 }
13424 }
13425 }
13426 }))
13427
13428
13429 /***/ }),
13430
13431 /***/ "./node_modules/stylis/stylis.min.js":
13432 /*!*******************************************!*\
13433 !*** ./node_modules/stylis/stylis.min.js ***!
13434 \*******************************************/
13435 /***/ ((module) => {
13436
13437 !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});
13438 //# sourceMappingURL=stylis.min.js.map
13439
13440 /***/ }),
13441
13442 /***/ "react":
13443 /*!************************!*\
13444 !*** external "React" ***!
13445 \************************/
13446 /***/ ((module) => {
13447
13448 "use strict";
13449 module.exports = window["React"];
13450
13451 /***/ }),
13452
13453 /***/ "jquery":
13454 /*!*************************!*\
13455 !*** external "jQuery" ***!
13456 \*************************/
13457 /***/ ((module) => {
13458
13459 "use strict";
13460 module.exports = window["jQuery"];
13461
13462 /***/ }),
13463
13464 /***/ "@wordpress/block-editor":
13465 /*!*************************************!*\
13466 !*** external ["wp","blockEditor"] ***!
13467 \*************************************/
13468 /***/ ((module) => {
13469
13470 "use strict";
13471 module.exports = window["wp"]["blockEditor"];
13472
13473 /***/ }),
13474
13475 /***/ "@wordpress/blocks":
13476 /*!********************************!*\
13477 !*** external ["wp","blocks"] ***!
13478 \********************************/
13479 /***/ ((module) => {
13480
13481 "use strict";
13482 module.exports = window["wp"]["blocks"];
13483
13484 /***/ }),
13485
13486 /***/ "@wordpress/components":
13487 /*!************************************!*\
13488 !*** external ["wp","components"] ***!
13489 \************************************/
13490 /***/ ((module) => {
13491
13492 "use strict";
13493 module.exports = window["wp"]["components"];
13494
13495 /***/ }),
13496
13497 /***/ "@wordpress/compose":
13498 /*!*********************************!*\
13499 !*** external ["wp","compose"] ***!
13500 \*********************************/
13501 /***/ ((module) => {
13502
13503 "use strict";
13504 module.exports = window["wp"]["compose"];
13505
13506 /***/ }),
13507
13508 /***/ "@wordpress/data":
13509 /*!******************************!*\
13510 !*** external ["wp","data"] ***!
13511 \******************************/
13512 /***/ ((module) => {
13513
13514 "use strict";
13515 module.exports = window["wp"]["data"];
13516
13517 /***/ }),
13518
13519 /***/ "@wordpress/edit-post":
13520 /*!**********************************!*\
13521 !*** external ["wp","editPost"] ***!
13522 \**********************************/
13523 /***/ ((module) => {
13524
13525 "use strict";
13526 module.exports = window["wp"]["editPost"];
13527
13528 /***/ }),
13529
13530 /***/ "@wordpress/element":
13531 /*!*********************************!*\
13532 !*** external ["wp","element"] ***!
13533 \*********************************/
13534 /***/ ((module) => {
13535
13536 "use strict";
13537 module.exports = window["wp"]["element"];
13538
13539 /***/ }),
13540
13541 /***/ "@wordpress/i18n":
13542 /*!******************************!*\
13543 !*** external ["wp","i18n"] ***!
13544 \******************************/
13545 /***/ ((module) => {
13546
13547 "use strict";
13548 module.exports = window["wp"]["i18n"];
13549
13550 /***/ }),
13551
13552 /***/ "@wordpress/plugins":
13553 /*!*********************************!*\
13554 !*** external ["wp","plugins"] ***!
13555 \*********************************/
13556 /***/ ((module) => {
13557
13558 "use strict";
13559 module.exports = window["wp"]["plugins"];
13560
13561 /***/ }),
13562
13563 /***/ "./node_modules/@linaria/react/dist/index.mjs":
13564 /*!****************************************************!*\
13565 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
13566 \****************************************************/
13567 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13568
13569 "use strict";
13570 __webpack_require__.r(__webpack_exports__);
13571 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13572 /* harmony export */ "styled": () => (/* binding */ styled_default)
13573 /* harmony export */ });
13574 /* 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");
13575 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
13576 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
13577 // src/styled.ts
13578
13579
13580
13581 var isCapital = (ch) => ch.toUpperCase() === ch;
13582 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
13583 var omit = (obj, keys) => {
13584 const res = {};
13585 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
13586 res[key] = obj[key];
13587 });
13588 return res;
13589 };
13590 function filterProps(asIs, props, omitKeys) {
13591 const filteredProps = omit(props, omitKeys);
13592 if (!asIs) {
13593 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"];
13594 Object.keys(filteredProps).forEach((key) => {
13595 if (!interopValidAttr.default(key)) {
13596 delete filteredProps[key];
13597 }
13598 });
13599 }
13600 return filteredProps;
13601 }
13602 var warnIfInvalid = (value, componentName) => {
13603 if (true) {
13604 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
13605 return;
13606 }
13607 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
13608 console.warn(
13609 `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.`
13610 );
13611 }
13612 };
13613 var idx = 0;
13614 function styled(tag) {
13615 var _a;
13616 let mockedClass = "";
13617 if (false) {}
13618 return (options) => {
13619 if (true) {
13620 if (Array.isArray(options)) {
13621 throw new Error(
13622 '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'
13623 );
13624 }
13625 }
13626 const render = (props, ref) => {
13627 const { as: component = tag, class: className = mockedClass } = props;
13628 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
13629 const filteredProps = filterProps(shouldKeepProps, props, [
13630 "as",
13631 "class"
13632 ]);
13633 filteredProps.ref = ref;
13634 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);
13635 const { vars } = options;
13636 if (vars) {
13637 const style = {};
13638 for (const name in vars) {
13639 const variable = vars[name];
13640 const result = variable[0];
13641 const unit = variable[1] || "";
13642 const value = typeof result === "function" ? result(props) : result;
13643 warnIfInvalid(value, options.name);
13644 style[`--${name}`] = `${value}${unit}`;
13645 }
13646 const ownStyle = filteredProps.style || {};
13647 const keys = Object.keys(ownStyle);
13648 if (keys.length > 0) {
13649 keys.forEach((key) => {
13650 style[key] = ownStyle[key];
13651 });
13652 }
13653 filteredProps.style = style;
13654 }
13655 if (tag.__linaria && tag !== component) {
13656 filteredProps.as = component;
13657 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
13658 }
13659 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
13660 };
13661 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
13662 const rest = omit(props, ["innerRef"]);
13663 return render(rest, props.innerRef);
13664 };
13665 Result.displayName = options.name;
13666 Result.__linaria = {
13667 className: options.class || mockedClass,
13668 extends: tag
13669 };
13670 return Result;
13671 };
13672 }
13673 var styled_default = true ? new Proxy(styled, {
13674 get(o, prop) {
13675 return o(prop);
13676 }
13677 }) : 0;
13678
13679 //# sourceMappingURL=index.mjs.map
13680
13681 /***/ }),
13682
13683 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
13684 /*!*******************************************************************************!*\
13685 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
13686 \*******************************************************************************/
13687 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13688
13689 "use strict";
13690 __webpack_require__.r(__webpack_exports__);
13691 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13692 /* harmony export */ "css": () => (/* binding */ css_default),
13693 /* harmony export */ "cx": () => (/* binding */ cx_default)
13694 /* harmony export */ });
13695 // src/css.ts
13696 var idx = 0;
13697 var css = () => {
13698 if (false) {}
13699 throw new Error(
13700 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
13701 );
13702 };
13703 var css_default = css;
13704
13705 // src/cx.ts
13706 var cx = function cx2() {
13707 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
13708 const atomicClasses = {};
13709 const nonAtomicClasses = [];
13710 presentClassNames.forEach((arg) => {
13711 const individualClassNames = arg ? arg.split(" ") : [];
13712 individualClassNames.forEach((className) => {
13713 if (className.startsWith("atm_")) {
13714 const [, keyHash] = className.split("_");
13715 atomicClasses[keyHash] = className;
13716 } else {
13717 nonAtomicClasses.push(className);
13718 }
13719 });
13720 });
13721 const result = [];
13722 for (const keyHash in atomicClasses) {
13723 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
13724 result.push(atomicClasses[keyHash]);
13725 }
13726 }
13727 result.push(...nonAtomicClasses);
13728 return result.join(" ");
13729 };
13730 var cx_default = cx;
13731
13732 //# sourceMappingURL=index.mjs.map
13733
13734 /***/ })
13735
13736 /******/ });
13737 /************************************************************************/
13738 /******/ // The module cache
13739 /******/ var __webpack_module_cache__ = {};
13740 /******/
13741 /******/ // The require function
13742 /******/ function __webpack_require__(moduleId) {
13743 /******/ // Check if module is in cache
13744 /******/ var cachedModule = __webpack_module_cache__[moduleId];
13745 /******/ if (cachedModule !== undefined) {
13746 /******/ return cachedModule.exports;
13747 /******/ }
13748 /******/ // Create a new module (and put it into the cache)
13749 /******/ var module = __webpack_module_cache__[moduleId] = {
13750 /******/ // no module.id needed
13751 /******/ // no module.loaded needed
13752 /******/ exports: {}
13753 /******/ };
13754 /******/
13755 /******/ // Execute the module function
13756 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
13757 /******/
13758 /******/ // Return the exports of the module
13759 /******/ return module.exports;
13760 /******/ }
13761 /******/
13762 /************************************************************************/
13763 /******/ /* webpack/runtime/compat get default export */
13764 /******/ (() => {
13765 /******/ // getDefaultExport function for compatibility with non-harmony modules
13766 /******/ __webpack_require__.n = (module) => {
13767 /******/ var getter = module && module.__esModule ?
13768 /******/ () => (module['default']) :
13769 /******/ () => (module);
13770 /******/ __webpack_require__.d(getter, { a: getter });
13771 /******/ return getter;
13772 /******/ };
13773 /******/ })();
13774 /******/
13775 /******/ /* webpack/runtime/define property getters */
13776 /******/ (() => {
13777 /******/ // define getter functions for harmony exports
13778 /******/ __webpack_require__.d = (exports, definition) => {
13779 /******/ for(var key in definition) {
13780 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13781 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
13782 /******/ }
13783 /******/ }
13784 /******/ };
13785 /******/ })();
13786 /******/
13787 /******/ /* webpack/runtime/global */
13788 /******/ (() => {
13789 /******/ __webpack_require__.g = (function() {
13790 /******/ if (typeof globalThis === 'object') return globalThis;
13791 /******/ try {
13792 /******/ return this || new Function('return this')();
13793 /******/ } catch (e) {
13794 /******/ if (typeof window === 'object') return window;
13795 /******/ }
13796 /******/ })();
13797 /******/ })();
13798 /******/
13799 /******/ /* webpack/runtime/hasOwnProperty shorthand */
13800 /******/ (() => {
13801 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13802 /******/ })();
13803 /******/
13804 /******/ /* webpack/runtime/make namespace object */
13805 /******/ (() => {
13806 /******/ // define __esModule on exports
13807 /******/ __webpack_require__.r = (exports) => {
13808 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
13809 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13810 /******/ }
13811 /******/ Object.defineProperty(exports, '__esModule', { value: true });
13812 /******/ };
13813 /******/ })();
13814 /******/
13815 /******/ /* webpack/runtime/nonce */
13816 /******/ (() => {
13817 /******/ __webpack_require__.nc = undefined;
13818 /******/ })();
13819 /******/
13820 /************************************************************************/
13821 var __webpack_exports__ = {};
13822 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
13823 (() => {
13824 "use strict";
13825 /*!**************************************!*\
13826 !*** ./scripts/entries/gutenberg.ts ***!
13827 \**************************************/
13828 __webpack_require__.r(__webpack_exports__);
13829 /* harmony import */ var _gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../gutenberg/FormBlock/registerFormBlock */ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx");
13830 /* harmony import */ var _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../gutenberg/Sidebar/contentType */ "./scripts/gutenberg/Sidebar/contentType.tsx");
13831 /* harmony import */ var _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gutenberg/MeetingsBlock/registerMeetingBlock */ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx");
13832 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
13833
13834
13835
13836
13837 (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]);
13838 })();
13839
13840 /******/ })()
13841 ;
13842 //# sourceMappingURL=gutenberg.js.map