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

13,521 lines 535.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./node_modules/@emotion/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 */ "fetchDisableInternalTracking": () => (/* binding */ fetchDisableInternalTracking),
191 /* harmony export */ "fetchProxyMappingsEnabled": () => (/* binding */ fetchProxyMappingsEnabled),
192 /* harmony export */ "fetchRefreshToken": () => (/* binding */ fetchRefreshToken),
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 refreshTokenRequest = null;
287 function fetchRefreshToken() {
288 if (!refreshTokenRequest) {
289 refreshTokenRequest = makeRequest('get', '/refresh-token')["catch"](function (err) {
290 refreshTokenRequest = null;
291 throw err;
292 });
293 }
294 return refreshTokenRequest;
295 }
296
297 /***/ }),
298
299 /***/ "./scripts/constants/defaultFormOptions.ts":
300 /*!*************************************************!*\
301 !*** ./scripts/constants/defaultFormOptions.ts ***!
302 \*************************************************/
303 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
304
305 "use strict";
306 __webpack_require__.r(__webpack_exports__);
307 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
308 /* harmony export */ "DEFAULT_OPTIONS": () => (/* binding */ DEFAULT_OPTIONS),
309 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
310 /* harmony export */ });
311 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
312 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
313
314 var BLANK_FORM = 'BLANK';
315 var NEWSLETTER_FORM = 'NEWSLETTER';
316 var CONTACT_US_FORM = 'CONTACT_US';
317 var EVENT_REGISTRATION_FORM = 'EVENT_REGISTRATION';
318 var TALK_TO_AN_EXPERT_FORM = 'TALK_TO_AN_EXPERT';
319 var BOOK_A_MEETING_FORM = 'BOOK_A_MEETING';
320 var GATED_CONTENT_FORM = 'GATED_CONTENT';
321 var DEFAULT_OPTIONS = {
322 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Templates', 'leadin'),
323 options: [{
324 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blank Form', 'leadin'),
325 value: BLANK_FORM
326 }, {
327 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Newsletter Form', 'leadin'),
328 value: NEWSLETTER_FORM
329 }, {
330 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact Us Form', 'leadin'),
331 value: CONTACT_US_FORM
332 }, {
333 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Event Registration Form', 'leadin'),
334 value: EVENT_REGISTRATION_FORM
335 }, {
336 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Talk to an Expert Form', 'leadin'),
337 value: TALK_TO_AN_EXPERT_FORM
338 }, {
339 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Book a Meeting Form', 'leadin'),
340 value: BOOK_A_MEETING_FORM
341 }, {
342 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gated Content Form', 'leadin'),
343 value: GATED_CONTENT_FORM
344 }]
345 };
346 function isDefaultForm(value) {
347 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;
348 }
349
350 /***/ }),
351
352 /***/ "./scripts/constants/leadinConfig.ts":
353 /*!*******************************************!*\
354 !*** ./scripts/constants/leadinConfig.ts ***!
355 \*******************************************/
356 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
357
358 "use strict";
359 __webpack_require__.r(__webpack_exports__);
360 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
361 /* harmony export */ "accountName": () => (/* binding */ accountName),
362 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
363 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
364 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
365 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
366 /* harmony export */ "decryptError": () => (/* binding */ decryptError),
367 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
368 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
369 /* harmony export */ "env": () => (/* binding */ env),
370 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
371 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
372 /* harmony export */ "hublet": () => (/* binding */ hublet),
373 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
374 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
375 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
376 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
377 /* harmony export */ "lastAuthorizeTime": () => (/* binding */ lastAuthorizeTime),
378 /* harmony export */ "lastDeauthorizeTime": () => (/* binding */ lastDeauthorizeTime),
379 /* harmony export */ "lastDisconnectTime": () => (/* binding */ lastDisconnectTime),
380 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
381 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
382 /* harmony export */ "locale": () => (/* binding */ locale),
383 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
384 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
385 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
386 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
387 /* harmony export */ "plugins": () => (/* binding */ plugins),
388 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
389 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
390 /* harmony export */ "portalId": () => (/* binding */ portalId),
391 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
392 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
393 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
394 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
395 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
396 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
397 /* harmony export */ "theme": () => (/* binding */ theme),
398 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
399 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
400 /* harmony export */ });
401 var _window$leadinConfig = window.leadinConfig,
402 accountName = _window$leadinConfig.accountName,
403 adminUrl = _window$leadinConfig.adminUrl,
404 activationTime = _window$leadinConfig.activationTime,
405 connectionStatus = _window$leadinConfig.connectionStatus,
406 deviceId = _window$leadinConfig.deviceId,
407 didDisconnect = _window$leadinConfig.didDisconnect,
408 env = _window$leadinConfig.env,
409 formsScript = _window$leadinConfig.formsScript,
410 meetingsScript = _window$leadinConfig.meetingsScript,
411 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
412 hublet = _window$leadinConfig.hublet,
413 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
414 hubspotNonce = _window$leadinConfig.hubspotNonce,
415 iframeUrl = _window$leadinConfig.iframeUrl,
416 impactLink = _window$leadinConfig.impactLink,
417 lastAuthorizeTime = _window$leadinConfig.lastAuthorizeTime,
418 lastDeauthorizeTime = _window$leadinConfig.lastDeauthorizeTime,
419 lastDisconnectTime = _window$leadinConfig.lastDisconnectTime,
420 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
421 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
422 locale = _window$leadinConfig.locale,
423 loginUrl = _window$leadinConfig.loginUrl,
424 phpVersion = _window$leadinConfig.phpVersion,
425 pluginPath = _window$leadinConfig.pluginPath,
426 plugins = _window$leadinConfig.plugins,
427 portalDomain = _window$leadinConfig.portalDomain,
428 portalEmail = _window$leadinConfig.portalEmail,
429 portalId = _window$leadinConfig.portalId,
430 redirectNonce = _window$leadinConfig.redirectNonce,
431 restNonce = _window$leadinConfig.restNonce,
432 restUrl = _window$leadinConfig.restUrl,
433 refreshToken = _window$leadinConfig.refreshToken,
434 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
435 theme = _window$leadinConfig.theme,
436 trackConsent = _window$leadinConfig.trackConsent,
437 wpVersion = _window$leadinConfig.wpVersion,
438 contentEmbed = _window$leadinConfig.contentEmbed,
439 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope,
440 decryptError = _window$leadinConfig.decryptError;
441
442
443 /***/ }),
444
445 /***/ "./scripts/gutenberg/Common/CalendarIcon.tsx":
446 /*!***************************************************!*\
447 !*** ./scripts/gutenberg/Common/CalendarIcon.tsx ***!
448 \***************************************************/
449 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
450
451 "use strict";
452 __webpack_require__.r(__webpack_exports__);
453 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
454 /* harmony export */ "default": () => (/* binding */ CalendarIcon)
455 /* harmony export */ });
456 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
457
458 function CalendarIcon() {
459 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
460 width: "18",
461 height: "18",
462 viewBox: "0 0 18 18",
463 fill: "none",
464 xmlns: "http://www.w3.org/2000/svg",
465 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
466 clipPath: "url(#clip0_903_1965)",
467 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
468 fillRule: "evenodd",
469 clipRule: "evenodd",
470 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",
471 fill: "#FF7A59"
472 })
473 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
474 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath", {
475 id: "clip0_903_1965",
476 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", {
477 width: "18",
478 height: "18",
479 fill: "white"
480 })
481 })
482 })]
483 });
484 }
485
486 /***/ }),
487
488 /***/ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx":
489 /*!**********************************************************!*\
490 !*** ./scripts/gutenberg/Common/SidebarSprocketIcon.tsx ***!
491 \**********************************************************/
492 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
493
494 "use strict";
495 __webpack_require__.r(__webpack_exports__);
496 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
497 /* harmony export */ "default": () => (/* binding */ SidebarSprocketIcon)
498 /* harmony export */ });
499 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
500
501 function SidebarSprocketIcon() {
502 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", {
503 width: "20px",
504 height: "20px",
505 version: "1.1",
506 viewBox: "0 0 40 42",
507 xmlns: "http://www.w3.org/2000/svg",
508 xmlnsXlink: "http://www.w3.org/1999/xlink",
509 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
510 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",
511 id: "Fill-1",
512 fillRule: "evenodd"
513 })
514 });
515 }
516
517 /***/ }),
518
519 /***/ "./scripts/gutenberg/Common/SprocketIcon.tsx":
520 /*!***************************************************!*\
521 !*** ./scripts/gutenberg/Common/SprocketIcon.tsx ***!
522 \***************************************************/
523 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
524
525 "use strict";
526 __webpack_require__.r(__webpack_exports__);
527 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
528 /* harmony export */ "default": () => (/* binding */ SprocketIcon)
529 /* harmony export */ });
530 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
531
532 function SprocketIcon() {
533 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
534 width: "40px",
535 height: "42px",
536 viewBox: "0 0 40 42",
537 version: "1.1",
538 xmlns: "http://www.w3.org/2000/svg",
539 xmlnsXlink: "http://www.w3.org/1999/xlink",
540 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
541 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polygon", {
542 id: "path-1",
543 points: "0.000123751494 0 39.7808917 0 39.7808917 41.6871084 0.000123751494 41.6871084"
544 })
545 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
546 id: "Page-1",
547 stroke: "none",
548 strokeWidth: "1",
549 fill: "none",
550 fillRule: "evenodd",
551 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", {
552 id: "HubSpot-Sprocket---Full-Color",
553 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("mask", {
554 id: "mask-2",
555 fill: "white",
556 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("use", {
557 xlinkHref: "#path-1"
558 })
559 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
560 id: "path-1"
561 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
562 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",
563 id: "Fill-1",
564 fill: "#F3785B",
565 fillRule: "nonzero",
566 mask: "url(#mask-2)"
567 })]
568 })
569 })]
570 });
571 }
572
573 /***/ }),
574
575 /***/ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx":
576 /*!*************************************************************!*\
577 !*** ./scripts/gutenberg/Common/StylesheetErrorBondary.tsx ***!
578 \*************************************************************/
579 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
580
581 "use strict";
582 __webpack_require__.r(__webpack_exports__);
583 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
584 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
585 /* harmony export */ });
586 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
587 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
588 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
589 /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
590
591
592
593 function StylesheetErrorBondary(_ref) {
594 var children = _ref.children;
595 var ref = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.useRefEffect)(function (element) {
596 var ownerDocument = element.ownerDocument;
597 if (ownerDocument && !ownerDocument.getElementById('leadin-gutenberg-css')) {
598 var link = ownerDocument.createElement('link');
599 link.id = 'leadin-gutenberg-css';
600 link.rel = 'stylesheet';
601 link.href = "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.pluginPath, "/build/gutenberg.css?ver=").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion);
602 ownerDocument.head.appendChild(link);
603 }
604 }, []);
605 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
606 ref: ref,
607 children: children
608 });
609 }
610 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StylesheetErrorBondary);
611
612 /***/ }),
613
614 /***/ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts":
615 /*!************************************************************!*\
616 !*** ./scripts/gutenberg/Common/useCustomCssBlockProps.ts ***!
617 \************************************************************/
618 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
619
620 "use strict";
621 __webpack_require__.r(__webpack_exports__);
622 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
623 /* harmony export */ "default": () => (/* binding */ useCustomCssBlockProps)
624 /* harmony export */ });
625 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
626 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
627
628 function useCustomCssBlockProps(defaultCssClasses) {
629 var blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
630 if (!blockProps.className || !blockProps.className.includes(defaultCssClasses)) {
631 blockProps.className = "".concat(blockProps.className, " ").concat(defaultCssClasses);
632 }
633 return blockProps;
634 }
635
636 /***/ }),
637
638 /***/ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx":
639 /*!*******************************************************!*\
640 !*** ./scripts/gutenberg/FormBlock/FormBlockSave.tsx ***!
641 \*******************************************************/
642 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
643
644 "use strict";
645 __webpack_require__.r(__webpack_exports__);
646 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
647 /* harmony export */ "default": () => (/* binding */ FormSaveBlock)
648 /* harmony export */ });
649 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
650 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
651 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
652 /* harmony import */ var _Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/useCustomCssBlockProps */ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts");
653 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); }
654 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; }
655 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; }
656 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; }
657 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
658 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); }
659
660
661
662 var DefaultCssClasses = 'wp-block-leadin-hubspot-form-block';
663 function FormSaveBlock(_ref) {
664 var attributes = _ref.attributes;
665 var portalId = attributes.portalId,
666 formId = attributes.formId,
667 embedVersion = attributes.embedVersion;
668 var blockProps = (0,_Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__["default"])(DefaultCssClasses);
669 if (portalId && formId) {
670 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, _objectSpread(_objectSpread({}, blockProps), {}, {
671 children: "[hubspot portal=\"".concat(portalId, "\" id=\"").concat(formId, "\" version=\"").concat(embedVersion, "\" type=\"form\"]")
672 }));
673 }
674 return null;
675 }
676
677 /***/ }),
678
679 /***/ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx":
680 /*!**************************************************************!*\
681 !*** ./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx ***!
682 \**************************************************************/
683 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
684
685 "use strict";
686 __webpack_require__.r(__webpack_exports__);
687 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
688 /* harmony export */ "default": () => (/* binding */ FormGutenbergPreview)
689 /* harmony export */ });
690 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
691 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
692 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
693 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
694 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
695
696
697
698
699 function FormGutenbergPreview() {
700 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
701 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
702 alt: "Create a new Hubspot Form",
703 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-form.png")
704 })
705 });
706 }
707
708 /***/ }),
709
710 /***/ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx":
711 /*!***********************************************************!*\
712 !*** ./scripts/gutenberg/FormBlock/registerFormBlock.tsx ***!
713 \***********************************************************/
714 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
715
716 "use strict";
717 __webpack_require__.r(__webpack_exports__);
718 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
719 /* harmony export */ "default": () => (/* binding */ registerFormBlock)
720 /* harmony export */ });
721 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
722 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
723 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
724 /* harmony import */ var _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/SprocketIcon */ "./scripts/gutenberg/Common/SprocketIcon.tsx");
725 /* harmony import */ var _Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/StylesheetErrorBondary */ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx");
726 /* harmony import */ var _FormBlockSave__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormBlockSave */ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx");
727 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
728 /* harmony import */ var _FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormGutenbergPreview */ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx");
729 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
730 /* harmony import */ var _shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/Form/FormEdit */ "./scripts/shared/Form/FormEdit.tsx");
731 /* harmony import */ var _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../shared/enums/connectionStatus */ "./scripts/shared/enums/connectionStatus.ts");
732 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
733 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);
734 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
735 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); }
736 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; }
737 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; }
738 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; }
739 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
740 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); }
741
742
743
744
745
746
747
748
749
750
751
752
753 function registerFormBlock() {
754 var editComponent = function editComponent(props) {
755 var isPreview = props.attributes.preview;
756 var isConnected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.connectionStatus === _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_9__["default"].Connected;
757 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_3__["default"], {
758 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), {}, {
759 origin: "gutenberg",
760 preview: true,
761 fullSiteEditor: (0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_11__.isFullSiteEditor)()
762 })) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
763 status: 401
764 })
765 });
766 };
767 // We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
768 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
769 return null;
770 }
771 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-form-block', {
772 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)('HubSpot Form', 'leadin'),
773 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)('Select and embed a HubSpot form', 'leadin'),
774 icon: _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
775 category: 'leadin-blocks',
776 attributes: {
777 portalId: {
778 type: 'string',
779 "default": ''
780 },
781 formId: {
782 type: 'string'
783 },
784 formName: {
785 type: 'string'
786 },
787 embedVersion: {
788 type: 'string'
789 },
790 preview: {
791 type: 'boolean',
792 "default": false
793 }
794 },
795 example: {
796 attributes: {
797 preview: true
798 }
799 },
800 edit: editComponent,
801 save: function save(props) {
802 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormBlockSave__WEBPACK_IMPORTED_MODULE_4__["default"], _objectSpread({}, props));
803 }
804 });
805 }
806
807 /***/ }),
808
809 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx":
810 /*!*********************************************************************!*\
811 !*** ./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx ***!
812 \*********************************************************************/
813 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
814
815 "use strict";
816 __webpack_require__.r(__webpack_exports__);
817 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
818 /* harmony export */ "default": () => (/* binding */ MeetingGutenbergPreview)
819 /* harmony export */ });
820 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
821 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
822 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
823 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
824 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
825
826
827
828
829 function MeetingGutenbergPreview() {
830 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
831 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
832 alt: "Create a new Hubspot Meeting",
833 width: "100%",
834 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-meetings.png")
835 })
836 });
837 }
838
839 /***/ }),
840
841 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx":
842 /*!**************************************************************!*\
843 !*** ./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx ***!
844 \**************************************************************/
845 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
846
847 "use strict";
848 __webpack_require__.r(__webpack_exports__);
849 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
850 /* harmony export */ "default": () => (/* binding */ MeetingSaveBlock)
851 /* harmony export */ });
852 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
853 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
854 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
855 /* harmony import */ var _Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/useCustomCssBlockProps */ "./scripts/gutenberg/Common/useCustomCssBlockProps.ts");
856 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); }
857 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; }
858 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; }
859 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; }
860 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
861 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); }
862
863
864
865 var DefaultCssClasses = 'wp-block-leadin-hubspot-meeting-block';
866 function MeetingSaveBlock(_ref) {
867 var attributes = _ref.attributes;
868 var url = attributes.url;
869 var blockProps = (0,_Common_useCustomCssBlockProps__WEBPACK_IMPORTED_MODULE_2__["default"])(DefaultCssClasses);
870 if (url) {
871 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, _objectSpread(_objectSpread({}, blockProps), {}, {
872 children: "[hubspot url=\"".concat(url, "\" type=\"meeting\"]")
873 }));
874 }
875 return null;
876 }
877
878 /***/ }),
879
880 /***/ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx":
881 /*!******************************************************************!*\
882 !*** ./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx ***!
883 \******************************************************************/
884 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
885
886 "use strict";
887 __webpack_require__.r(__webpack_exports__);
888 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
889 /* harmony export */ "default": () => (/* binding */ registerMeetingBlock)
890 /* harmony export */ });
891 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
892 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
893 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
894 /* harmony import */ var _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/CalendarIcon */ "./scripts/gutenberg/Common/CalendarIcon.tsx");
895 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
896 /* harmony import */ var _MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingGutenbergPreview */ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx");
897 /* harmony import */ var _MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MeetingSaveBlock */ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx");
898 /* harmony import */ var _shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Meeting/MeetingEdit */ "./scripts/shared/Meeting/MeetingEdit.tsx");
899 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
900 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
901 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
902 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
903 /* harmony import */ var _Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Common/StylesheetErrorBondary */ "./scripts/gutenberg/Common/StylesheetErrorBondary.tsx");
904 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); }
905 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; }
906 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; }
907 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; }
908 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
909 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); }
910
911
912
913
914
915
916
917
918
919
920
921 var ConnectionStatus = {
922 Connected: 'Connected',
923 NotConnected: 'NotConnected'
924 };
925 function registerMeetingBlock() {
926 var editComponent = function editComponent(props) {
927 var isPreview = props.attributes.preview;
928 var isConnected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.connectionStatus === ConnectionStatus.Connected;
929 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_StylesheetErrorBondary__WEBPACK_IMPORTED_MODULE_10__["default"], {
930 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), {}, {
931 preview: true,
932 origin: "gutenberg",
933 fullSiteEditor: (0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__.isFullSiteEditor)()
934 })) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
935 status: 401
936 })
937 });
938 };
939 // We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
940 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
941 return null;
942 }
943 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-meeting-block', {
944 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Hubspot Meetings Scheduler', 'leadin'),
945 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'),
946 icon: _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
947 category: 'leadin-blocks',
948 attributes: {
949 url: {
950 type: 'string',
951 "default": ''
952 },
953 preview: {
954 type: 'boolean',
955 "default": false
956 }
957 },
958 example: {
959 attributes: {
960 preview: true
961 }
962 },
963 edit: editComponent,
964 save: function save(props) {
965 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__["default"], _objectSpread({}, props));
966 }
967 });
968 }
969
970 /***/ }),
971
972 /***/ "./scripts/gutenberg/Sidebar/contentType.tsx":
973 /*!***************************************************!*\
974 !*** ./scripts/gutenberg/Sidebar/contentType.tsx ***!
975 \***************************************************/
976 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
977
978 "use strict";
979 __webpack_require__.r(__webpack_exports__);
980 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
981 /* harmony export */ "registerHubspotSidebar": () => (/* binding */ registerHubspotSidebar)
982 /* harmony export */ });
983 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
984 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
985 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__);
986 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
987 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__);
988 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
989 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
990 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
991 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
992 /* harmony import */ var _UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../UIComponents/UISidebarSelectControl */ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx");
993 /* harmony import */ var _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/SidebarSprocketIcon */ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx");
994 /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
995 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
996 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__);
997 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
998 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
999 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
1000 var _templateObject;
1001 function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014 function registerHubspotSidebar() {
1015 var ContentTypeLabelStyle = styled_components__WEBPACK_IMPORTED_MODULE_11__["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: normal;\n text-transform: none;\n "])));
1016 var ContentTypeLabel = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ContentTypeLabelStyle, {
1017 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Select the content type HubSpot Analytics uses to track this page', 'leadin')
1018 });
1019 var LeadinPluginSidebar = function LeadinPluginSidebar(_ref) {
1020 var postType = _ref.postType;
1021 var embedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_10__.useGetEmbedder)();
1022 return postType && !(0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_9__.isFullSiteEditor)() ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__.PluginSidebar, {
1023 name: "leadin",
1024 title: "HubSpot",
1025 icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, {
1026 className: "hs-plugin-sidebar-sprocket",
1027 icon: (0,_Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"])()
1028 }),
1029 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
1030 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('HubSpot Analytics', 'leadin'),
1031 initialOpen: true,
1032 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__.BackgroudAppContext.Provider, {
1033 value: embedder,
1034 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__["default"], {
1035 metaKey: "content-type",
1036 className: "select-content-type",
1037 label: ContentTypeLabel,
1038 options: [{
1039 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Detect Automatically', 'leadin'),
1040 value: ''
1041 }, {
1042 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Blog Post', 'leadin'),
1043 value: 'blog-post'
1044 }, {
1045 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Knowledge Article', 'leadin'),
1046 value: 'knowledge-article'
1047 }, {
1048 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Landing Page', 'leadin'),
1049 value: 'landing-page'
1050 }, {
1051 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Listing Page', 'leadin'),
1052 value: 'listing-page'
1053 }, {
1054 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Standard Page', 'leadin'),
1055 value: 'standard-page'
1056 }]
1057 })
1058 })
1059 })
1060 }) : null;
1061 };
1062 var LeadinPluginSidebarWrapper = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.withSelect)(function (select) {
1063 var data = select('core/editor');
1064 return {
1065 postType: data && data.getCurrentPostType() && data.getEditedPostAttribute('meta')
1066 };
1067 })(LeadinPluginSidebar);
1068 if (_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__) {
1069 _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__.registerPlugin('leadin', {
1070 render: LeadinPluginSidebarWrapper,
1071 icon: _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"]
1072 });
1073 }
1074 }
1075
1076 /***/ }),
1077
1078 /***/ "./scripts/gutenberg/UIComponents/UIImage.ts":
1079 /*!***************************************************!*\
1080 !*** ./scripts/gutenberg/UIComponents/UIImage.ts ***!
1081 \***************************************************/
1082 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1083
1084 "use strict";
1085 __webpack_require__.r(__webpack_exports__);
1086 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1087 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1088 /* harmony export */ });
1089 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1090
1091 var _exp = /*#__PURE__*/function _exp() {
1092 return function (props) {
1093 return props.height ? props.height : 'auto';
1094 };
1095 };
1096 var _exp2 = /*#__PURE__*/function _exp2() {
1097 return function (props) {
1098 return props.width ? props.width : 'auto';
1099 };
1100 };
1101 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('img')({
1102 name: "UIImage0",
1103 "class": "ump7xqy",
1104 propsAsIs: false,
1105 vars: {
1106 "ump7xqy-0": [_exp()],
1107 "ump7xqy-1": [_exp2()]
1108 }
1109 }));
1110 __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");
1111
1112 /***/ }),
1113
1114 /***/ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx":
1115 /*!*******************************************************************!*\
1116 !*** ./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx ***!
1117 \*******************************************************************/
1118 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1119
1120 "use strict";
1121 __webpack_require__.r(__webpack_exports__);
1122 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1123 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1124 /* harmony export */ });
1125 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1126 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
1127 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
1128 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
1129 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1130 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1131 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); }
1132 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; }
1133 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; }
1134 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; }
1135 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1136 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); }
1137
1138
1139
1140
1141
1142 var UISidebarSelectControl = function UISidebarSelectControl(props) {
1143 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.useBackgroundAppContext)();
1144 var monitorSidebarMetaChange = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.usePostBackgroundMessage)();
1145 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, _objectSpread({
1146 value: props.metaValue,
1147 onChange: function onChange(content) {
1148 if (props.setMetaValue) {
1149 props.setMetaValue(content);
1150 }
1151 isBackgroundAppReady && monitorSidebarMetaChange({
1152 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.TrackSidebarMetaChange,
1153 payload: {
1154 metaKey: props.metaKey
1155 }
1156 });
1157 }
1158 }, props));
1159 };
1160 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__["default"])(UISidebarSelectControl));
1161
1162 /***/ }),
1163
1164 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
1165 /*!****************************************************************!*\
1166 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
1167 \****************************************************************/
1168 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1169
1170 "use strict";
1171 __webpack_require__.r(__webpack_exports__);
1172 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1173 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
1174 /* harmony export */ });
1175 var CoreMessages = {
1176 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
1177 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
1178 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
1179 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
1180 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
1181 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID',
1182 SendIntegratedAppConfig: 'INTEGRATED_APP_EMBEDDER_CONFIG'
1183 };
1184
1185 /***/ }),
1186
1187 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
1188 /*!******************************************************************!*\
1189 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
1190 \******************************************************************/
1191 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1192
1193 "use strict";
1194 __webpack_require__.r(__webpack_exports__);
1195 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1196 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
1197 /* harmony export */ });
1198 var FormMessages = {
1199 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
1200 };
1201
1202 /***/ }),
1203
1204 /***/ "./scripts/iframe/integratedMessages/index.ts":
1205 /*!****************************************************!*\
1206 !*** ./scripts/iframe/integratedMessages/index.ts ***!
1207 \****************************************************/
1208 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1209
1210 "use strict";
1211 __webpack_require__.r(__webpack_exports__);
1212 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1213 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
1214 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
1215 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
1216 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
1217 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
1218 /* harmony export */ });
1219 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
1220 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
1221 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
1222 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
1223 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
1224
1225
1226
1227
1228
1229
1230 /***/ }),
1231
1232 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
1233 /*!************************************************************************!*\
1234 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
1235 \************************************************************************/
1236 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1237
1238 "use strict";
1239 __webpack_require__.r(__webpack_exports__);
1240 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1241 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
1242 /* harmony export */ });
1243 var LiveChatMessages = {
1244 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
1245 };
1246
1247 /***/ }),
1248
1249 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
1250 /*!********************************************************************!*\
1251 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
1252 \********************************************************************/
1253 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1254
1255 "use strict";
1256 __webpack_require__.r(__webpack_exports__);
1257 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1258 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
1259 /* harmony export */ });
1260 var PluginMessages = {
1261 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
1262 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
1263 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
1264 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
1265 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
1266 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
1267 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
1268 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
1269 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
1270 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
1271 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
1272 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
1273 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
1274 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
1275 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
1276 SkipReviewError: 'SKIP_REVIEW_ERROR',
1277 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
1278 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
1279 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
1280 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
1281 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
1282 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
1283 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR',
1284 ProxyMappingsEnabledRequest: 'PROXY_MAPPINGS_ENABLED_REQUEST',
1285 ProxyMappingsEnabledResponse: 'PROXY_MAPPINGS_ENABLED_RESPONSE',
1286 ProxyMappingsEnabledError: 'PROXY_MAPPINGS_ENABLED_ERROR',
1287 ProxyMappingsEnabledChangeRequest: 'PROXY_MAPPINGS_ENABLED_CHANGE_REQUEST',
1288 ProxyMappingsEnabledChangeError: 'PROXY_MAPPINGS_ENABLED_CHANGE_ERROR',
1289 RefreshProxyMappingsRequest: 'REFRESH_PROXY_MAPPINGS_REQUEST',
1290 RefreshProxyMappingsResponse: 'REFRESH_PROXY_MAPPINGS_RESPONSE',
1291 RefreshProxyMappingsError: 'REFRESH_PROXY_MAPPINGS_ERROR'
1292 };
1293
1294 /***/ }),
1295
1296 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
1297 /*!******************************************************************!*\
1298 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
1299 \******************************************************************/
1300 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1301
1302 "use strict";
1303 __webpack_require__.r(__webpack_exports__);
1304 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1305 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
1306 /* harmony export */ });
1307 var ProxyMessages = {
1308 FetchForms: 'FETCH_FORMS',
1309 FetchForm: 'FETCH_FORM',
1310 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
1311 GetTemplateAvailability: 'GET_TEMPLATE_AVAILABILITY',
1312 FetchAuth: 'FETCH_AUTH',
1313 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
1314 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
1315 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
1316 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
1317 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
1318 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
1319 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
1320 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
1321 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
1322 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
1323 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
1324 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
1325 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
1326 };
1327
1328 /***/ }),
1329
1330 /***/ "./scripts/iframe/useBackgroundApp.ts":
1331 /*!********************************************!*\
1332 !*** ./scripts/iframe/useBackgroundApp.ts ***!
1333 \********************************************/
1334 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1335
1336 "use strict";
1337 __webpack_require__.r(__webpack_exports__);
1338 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1339 /* harmony export */ "BackgroudAppContext": () => (/* binding */ BackgroudAppContext),
1340 /* harmony export */ "useBackgroundAppContext": () => (/* binding */ useBackgroundAppContext),
1341 /* harmony export */ "usePostAsyncBackgroundMessage": () => (/* binding */ usePostAsyncBackgroundMessage),
1342 /* harmony export */ "usePostBackgroundMessage": () => (/* binding */ usePostBackgroundMessage)
1343 /* harmony export */ });
1344 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1345 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1346
1347 var BackgroudAppContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
1348 function useBackgroundAppContext() {
1349 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BackgroudAppContext);
1350 }
1351 function usePostBackgroundMessage() {
1352 var app = useBackgroundAppContext();
1353 return function (message) {
1354 app.postMessage(message);
1355 };
1356 }
1357 function usePostAsyncBackgroundMessage() {
1358 var app = useBackgroundAppContext();
1359 return function (message) {
1360 return app.postAsyncMessage(message);
1361 };
1362 }
1363
1364 /***/ }),
1365
1366 /***/ "./scripts/lib/Raven.ts":
1367 /*!******************************!*\
1368 !*** ./scripts/lib/Raven.ts ***!
1369 \******************************/
1370 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1371
1372 "use strict";
1373 __webpack_require__.r(__webpack_exports__);
1374 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1375 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
1376 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1377 /* harmony export */ });
1378 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
1379 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
1380 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1381
1382
1383 function configureRaven() {
1384 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('local') !== -1) {
1385 return;
1386 }
1387 var domain = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.replace(/https?:\/\/app/, '');
1388 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config("https://a9f08e536ef66abb0bf90becc905b09e@exceptions".concat(domain, "/v2/1"), {
1389 instrument: {
1390 tryCatch: false
1391 },
1392 shouldSendCallback: function shouldSendCallback(data) {
1393 return !!data && !!data.culprit && /plugins\/leadin\//.test(data.culprit);
1394 },
1395 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
1396 }).install();
1397 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
1398 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
1399 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
1400 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
1401 });
1402 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
1403 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
1404 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
1405 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
1406 }).join(',')
1407 });
1408 }
1409 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
1410
1411 /***/ }),
1412
1413 /***/ "./scripts/shared/Common/AsyncSelect.tsx":
1414 /*!***********************************************!*\
1415 !*** ./scripts/shared/Common/AsyncSelect.tsx ***!
1416 \***********************************************/
1417 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1418
1419 "use strict";
1420 __webpack_require__.r(__webpack_exports__);
1421 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1422 /* harmony export */ "default": () => (/* binding */ AsyncSelect)
1423 /* harmony export */ });
1424 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1425 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1426 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1427 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1428 /* harmony import */ var _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/colors */ "./scripts/shared/UIComponents/colors.ts");
1429 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1430 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1431 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
1432 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."); }
1433 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; } }
1434 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; }
1435 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; } }
1436 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1437
1438
1439
1440
1441
1442
1443 var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1444 name: "Container",
1445 "class": "c1wxx7eu",
1446 propsAsIs: false
1447 });
1448 var _exp2 = /*#__PURE__*/function _exp2() {
1449 return function (props) {
1450 return props.focused ? '0' : '1px';
1451 };
1452 };
1453 var _exp3 = /*#__PURE__*/function _exp3() {
1454 return function (props) {
1455 return props.focused ? "0 0 0 2px ".concat(_UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM) : 'none';
1456 };
1457 };
1458 var ControlContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1459 name: "ControlContainer",
1460 "class": "c1rgwbep",
1461 propsAsIs: false,
1462 vars: {
1463 "c1rgwbep-0": [_exp2()],
1464 "c1rgwbep-1": [_exp3()]
1465 }
1466 });
1467 var ValueContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1468 name: "ValueContainer",
1469 "class": "v1mdmbaj",
1470 propsAsIs: false
1471 });
1472 var Placeholder = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1473 name: "Placeholder",
1474 "class": "p1gwkvxy",
1475 propsAsIs: false
1476 });
1477 var SingleValue = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1478 name: "SingleValue",
1479 "class": "s1bwlafs",
1480 propsAsIs: false
1481 });
1482 var IndicatorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1483 name: "IndicatorContainer",
1484 "class": "i196z9y5",
1485 propsAsIs: false
1486 });
1487 var DropdownIndicator = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1488 name: "DropdownIndicator",
1489 "class": "d1dfo5ow",
1490 propsAsIs: false
1491 });
1492 var InputContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1493 name: "InputContainer",
1494 "class": "if3lze",
1495 propsAsIs: false
1496 });
1497 var Input = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('input')({
1498 name: "Input",
1499 "class": "i9kxf50",
1500 propsAsIs: false
1501 });
1502 var InputShadow = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1503 name: "InputShadow",
1504 "class": "igjr3uc",
1505 propsAsIs: false
1506 });
1507 var MenuContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1508 name: "MenuContainer",
1509 "class": "mhb9if7",
1510 propsAsIs: false
1511 });
1512 var MenuList = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1513 name: "MenuList",
1514 "class": "mxaof7s",
1515 propsAsIs: false
1516 });
1517 var MenuGroup = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1518 name: "MenuGroup",
1519 "class": "mw50s5v",
1520 propsAsIs: false
1521 });
1522 var MenuGroupHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1523 name: "MenuGroupHeader",
1524 "class": "m11rzvjw",
1525 propsAsIs: false
1526 });
1527 var _exp5 = /*#__PURE__*/function _exp5() {
1528 return function (props) {
1529 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : 'transparent';
1530 };
1531 };
1532 var _exp6 = /*#__PURE__*/function _exp6() {
1533 return function (props) {
1534 return props.selected ? '#fff' : 'inherit';
1535 };
1536 };
1537 var _exp7 = /*#__PURE__*/function _exp7() {
1538 return function (props) {
1539 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_LIGHT;
1540 };
1541 };
1542 var MenuItem = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1543 name: "MenuItem",
1544 "class": "m1jcdsjv",
1545 propsAsIs: false,
1546 vars: {
1547 "m1jcdsjv-0": [_exp5()],
1548 "m1jcdsjv-1": [_exp6()],
1549 "m1jcdsjv-2": [_exp7()]
1550 }
1551 });
1552 function AsyncSelect(_ref) {
1553 var placeholder = _ref.placeholder,
1554 value = _ref.value,
1555 loadOptions = _ref.loadOptions,
1556 onChange = _ref.onChange,
1557 defaultOptions = _ref.defaultOptions;
1558 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1559 var inputShadowEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1560 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
1561 _useState2 = _slicedToArray(_useState, 2),
1562 isFocused = _useState2[0],
1563 setFocus = _useState2[1];
1564 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded),
1565 _useState4 = _slicedToArray(_useState3, 2),
1566 loadState = _useState4[0],
1567 setLoadState = _useState4[1];
1568 var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
1569 _useState6 = _slicedToArray(_useState5, 2),
1570 localValue = _useState6[0],
1571 setLocalValue = _useState6[1];
1572 var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(defaultOptions),
1573 _useState8 = _slicedToArray(_useState7, 2),
1574 options = _useState8[0],
1575 setOptions = _useState8[1];
1576 var inputSize = "".concat(inputShadowEl.current ? inputShadowEl.current.clientWidth + 10 : 2, "px");
1577 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1578 if (loadOptions && loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded) {
1579 loadOptions('', function (result) {
1580 setOptions(result);
1581 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1582 });
1583 }
1584 }, [loadOptions, loadState]);
1585 var _renderItems = function renderItems() {
1586 var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1587 var parentKey = arguments.length > 1 ? arguments[1] : undefined;
1588 return items.map(function (item, index) {
1589 if (item.options) {
1590 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MenuGroup, {
1591 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuGroupHeader, {
1592 id: "".concat(index, "-heading"),
1593 children: item.label
1594 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
1595 children: _renderItems(item.options, index)
1596 })]
1597 }, "async-select-item-".concat(index));
1598 } else {
1599 var key = "async-select-item-".concat(parentKey !== undefined ? "".concat(parentKey, "-").concat(index) : index);
1600 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuItem, {
1601 id: key,
1602 selected: value && item.value === value.value,
1603 onClick: function onClick() {
1604 onChange(item);
1605 setFocus(false);
1606 },
1607 children: item.label
1608 }, key);
1609 }
1610 });
1611 };
1612 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Container, {
1613 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ControlContainer, {
1614 id: "leadin-async-selector",
1615 focused: isFocused,
1616 onClick: function onClick() {
1617 if (isFocused) {
1618 if (inputEl.current) {
1619 inputEl.current.blur();
1620 }
1621 setFocus(false);
1622 setLocalValue('');
1623 } else {
1624 if (inputEl.current) {
1625 inputEl.current.focus();
1626 }
1627 setFocus(true);
1628 }
1629 },
1630 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ValueContainer, {
1631 children: [localValue === '' && (!value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Placeholder, {
1632 children: placeholder
1633 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SingleValue, {
1634 children: value.label
1635 })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(InputContainer, {
1636 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Input, {
1637 ref: inputEl,
1638 onFocus: function onFocus() {
1639 setFocus(true);
1640 },
1641 onChange: function onChange(e) {
1642 setLocalValue(e.target.value);
1643 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading);
1644 loadOptions && loadOptions(e.target.value, function (result) {
1645 setOptions(result);
1646 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1647 });
1648 },
1649 value: localValue,
1650 width: inputSize,
1651 id: "asycn-select-input"
1652 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputShadow, {
1653 ref: inputShadowEl,
1654 children: localValue
1655 })]
1656 })]
1657 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IndicatorContainer, {
1658 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, {})]
1659 })]
1660 }), isFocused && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuContainer, {
1661 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuList, {
1662 children: _renderItems(options)
1663 })
1664 })]
1665 });
1666 }
1667 __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");
1668
1669 /***/ }),
1670
1671 /***/ "./scripts/shared/Common/ErrorHandler.tsx":
1672 /*!************************************************!*\
1673 !*** ./scripts/shared/Common/ErrorHandler.tsx ***!
1674 \************************************************/
1675 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1676
1677 "use strict";
1678 __webpack_require__.r(__webpack_exports__);
1679 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1680 /* harmony export */ "default": () => (/* binding */ ErrorHandler)
1681 /* harmony export */ });
1682 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1683 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
1684 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1685 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1686 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1687 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1688 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
1689
1690
1691
1692
1693
1694
1695
1696 function redirectToPlugin() {
1697 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);
1698 }
1699 function ErrorHandler(_ref) {
1700 var status = _ref.status,
1701 resetErrorState = _ref.resetErrorState,
1702 _ref$errorInfo = _ref.errorInfo,
1703 errorInfo = _ref$errorInfo === void 0 ? {
1704 header: '',
1705 message: '',
1706 action: ''
1707 } : _ref$errorInfo;
1708 var isUnauthorized = status === 401 || status === 403;
1709 var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header;
1710 var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools', 'leadin') : errorInfo.message;
1711 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
1712 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath,
1713 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], {
1714 textAlign: "center",
1715 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1716 children: errorHeader
1717 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1718 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1719 children: errorMessage
1720 })
1721 }), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1722 "data-test-id": "authorize-button",
1723 onClick: redirectToPlugin,
1724 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin')
1725 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1726 "data-test-id": "retry-button",
1727 onClick: resetErrorState,
1728 children: errorInfo.action
1729 })]
1730 })
1731 });
1732 }
1733
1734 /***/ }),
1735
1736 /***/ "./scripts/shared/Common/HubspotWrapper.ts":
1737 /*!*************************************************!*\
1738 !*** ./scripts/shared/Common/HubspotWrapper.ts ***!
1739 \*************************************************/
1740 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1741
1742 "use strict";
1743 __webpack_require__.r(__webpack_exports__);
1744 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1745 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1746 /* harmony export */ });
1747 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1748
1749 var _exp = /*#__PURE__*/function _exp() {
1750 return function (props) {
1751 return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)");
1752 };
1753 };
1754 var _exp2 = /*#__PURE__*/function _exp2() {
1755 return function (props) {
1756 return props.padding || '90px 20% 25px';
1757 };
1758 };
1759 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
1760 name: "HubspotWrapper0",
1761 "class": "h1q5v5ee",
1762 propsAsIs: false,
1763 vars: {
1764 "h1q5v5ee-0": [_exp()],
1765 "h1q5v5ee-1": [_exp2()]
1766 }
1767 }));
1768 __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");
1769
1770 /***/ }),
1771
1772 /***/ "./scripts/shared/Common/LoadingBlock.tsx":
1773 /*!************************************************!*\
1774 !*** ./scripts/shared/Common/LoadingBlock.tsx ***!
1775 \************************************************/
1776 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1777
1778 "use strict";
1779 __webpack_require__.r(__webpack_exports__);
1780 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1781 /* harmony export */ "default": () => (/* binding */ LoadingBlock)
1782 /* harmony export */ });
1783 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1784 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1785 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1786 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1787
1788
1789
1790
1791 function LoadingBlock() {
1792 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1793 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1794 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
1795 size: 50
1796 })
1797 });
1798 }
1799
1800 /***/ }),
1801
1802 /***/ "./scripts/shared/Common/PreviewDisabled.tsx":
1803 /*!***************************************************!*\
1804 !*** ./scripts/shared/Common/PreviewDisabled.tsx ***!
1805 \***************************************************/
1806 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1807
1808 "use strict";
1809 __webpack_require__.r(__webpack_exports__);
1810 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1811 /* harmony export */ "default": () => (/* binding */ PreviewDisabled)
1812 /* harmony export */ });
1813 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1814 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1815 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1816 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1817 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1818 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
1819
1820
1821
1822
1823
1824 function PreviewDisabled() {
1825 var errorHeader = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Preview Unavailable', 'leadin');
1826 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'));
1827 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
1828 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1829 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_1__["default"], {
1830 textAlign: "center",
1831 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1832 children: errorHeader
1833 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1834 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1835 children: errorMessage
1836 })
1837 })]
1838 })
1839 });
1840 }
1841
1842 /***/ }),
1843
1844 /***/ "./scripts/shared/Form/FormEdit.tsx":
1845 /*!******************************************!*\
1846 !*** ./scripts/shared/Form/FormEdit.tsx ***!
1847 \******************************************/
1848 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1849
1850 "use strict";
1851 __webpack_require__.r(__webpack_exports__);
1852 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1853 /* harmony export */ "default": () => (/* binding */ FormEditContainer)
1854 /* harmony export */ });
1855 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1856 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1857 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1858 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1859 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
1860 /* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx");
1861 /* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx");
1862 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1863 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1864 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1865 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
1866 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); }
1867 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; }
1868 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; }
1869 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; }
1870 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1871 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); }
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882 function FormEdit(_ref) {
1883 var attributes = _ref.attributes,
1884 isSelected = _ref.isSelected,
1885 setAttributes = _ref.setAttributes,
1886 _ref$preview = _ref.preview,
1887 preview = _ref$preview === void 0 ? true : _ref$preview,
1888 _ref$origin = _ref.origin,
1889 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
1890 fullSiteEditor = _ref.fullSiteEditor;
1891 var formId = attributes.formId,
1892 formName = attributes.formName,
1893 embedVersion = attributes.embedVersion;
1894 var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId;
1895 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)();
1896 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)();
1897 var handleChange = function handleChange(selectedForm) {
1898 setAttributes({
1899 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1900 formId: selectedForm.value,
1901 formName: selectedForm.label,
1902 embedVersion: selectedForm.embedVersion
1903 });
1904 };
1905 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1906 monitorFormPreviewRender({
1907 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender,
1908 payload: {
1909 origin: origin
1910 }
1911 });
1912 }, [origin]);
1913 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, {
1914 children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], {
1915 formId: formId,
1916 formName: formName,
1917 handleChange: handleChange,
1918 origin: origin,
1919 embedVersion: embedVersion
1920 }), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1921 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"], {
1922 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1923 formId: formId,
1924 fullSiteEditor: fullSiteEditor,
1925 embedVersion: embedVersion
1926 })]
1927 })]
1928 });
1929 }
1930 function FormEditContainer(props) {
1931 var embedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_9__.useGetEmbedder)();
1932 if (embedder === null) {
1933 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__["default"], {});
1934 }
1935 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, {
1936 value: embedder,
1937 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props))
1938 });
1939 }
1940
1941 /***/ }),
1942
1943 /***/ "./scripts/shared/Form/FormSelect.tsx":
1944 /*!********************************************!*\
1945 !*** ./scripts/shared/Form/FormSelect.tsx ***!
1946 \********************************************/
1947 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1948
1949 "use strict";
1950 __webpack_require__.r(__webpack_exports__);
1951 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1952 /* harmony export */ "default": () => (/* binding */ FormSelect)
1953 /* harmony export */ });
1954 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1955 /* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx");
1956 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1957 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1958 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
1959 /* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts");
1960 /* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts");
1961 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
1962 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
1963
1964
1965
1966
1967
1968
1969
1970
1971 function FormSelect(_ref) {
1972 var formId = _ref.formId,
1973 formName = _ref.formName,
1974 handleChange = _ref.handleChange,
1975 _ref$origin = _ref.origin,
1976 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
1977 embedVersion = _ref.embedVersion;
1978 var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(),
1979 search = _useForms.search,
1980 formApiError = _useForms.formApiError,
1981 reset = _useForms.reset;
1982 var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin),
1983 createFormByTemplate = _useCreateFormFromTem.createFormByTemplate,
1984 createReset = _useCreateFormFromTem.reset,
1985 isCreating = _useCreateFormFromTem.isCreating,
1986 hasError = _useCreateFormFromTem.hasError,
1987 createApiError = _useCreateFormFromTem.formApiError;
1988 var value = formId && formName ? {
1989 label: formName,
1990 value: formId,
1991 embedVersion: embedVersion
1992 } : null;
1993 var handleLocalChange = function handleLocalChange(option) {
1994 if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) {
1995 createFormByTemplate(option.value).then(function (_ref2) {
1996 var guid = _ref2.guid,
1997 name = _ref2.name;
1998 handleChange({
1999 value: guid,
2000 label: name,
2001 embedVersion: 'v4'
2002 });
2003 });
2004 } else {
2005 handleChange(option);
2006 }
2007 };
2008 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"], {
2009 status: formApiError ? formApiError.status : createApiError.status,
2010 resetErrorState: function resetErrorState() {
2011 if (hasError) {
2012 createReset();
2013 } else {
2014 reset();
2015 }
2016 },
2017 errorInfo: {
2018 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'),
2019 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes', 'leadin'),
2020 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin')
2021 }
2022 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], {
2023 loadOptions: search,
2024 onChange: function onChange(option) {
2025 return handleLocalChange(option);
2026 },
2027 value: value
2028 });
2029 }
2030
2031 /***/ }),
2032
2033 /***/ "./scripts/shared/Form/FormSelector.tsx":
2034 /*!**********************************************!*\
2035 !*** ./scripts/shared/Form/FormSelector.tsx ***!
2036 \**********************************************/
2037 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2038
2039 "use strict";
2040 __webpack_require__.r(__webpack_exports__);
2041 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2042 /* harmony export */ "default": () => (/* binding */ FormSelector)
2043 /* harmony export */ });
2044 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2045 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2046 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2047 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2048 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2049 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2050
2051
2052
2053
2054
2055 function FormSelector(_ref) {
2056 var loadOptions = _ref.loadOptions,
2057 onChange = _ref.onChange,
2058 value = _ref.value;
2059 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
2060 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath,
2061 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
2062 "data-test-id": "leadin-form-select",
2063 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2064 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin')
2065 })
2066 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], {
2067 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'),
2068 value: value,
2069 loadOptions: loadOptions,
2070 onChange: onChange
2071 })]
2072 });
2073 }
2074
2075 /***/ }),
2076
2077 /***/ "./scripts/shared/Form/PreviewForm.tsx":
2078 /*!*********************************************!*\
2079 !*** ./scripts/shared/Form/PreviewForm.tsx ***!
2080 \*********************************************/
2081 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2082
2083 "use strict";
2084 __webpack_require__.r(__webpack_exports__);
2085 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2086 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2087 /* harmony export */ });
2088 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2089 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2090 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2091 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2092 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2093 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2094 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); }
2095 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; }
2096 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; }
2097 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; }
2098 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2099 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); }
2100
2101
2102
2103
2104
2105 function PreviewForm(_ref) {
2106 var portalId = _ref.portalId,
2107 formId = _ref.formId,
2108 fullSiteEditor = _ref.fullSiteEditor,
2109 embedVersion = _ref.embedVersion;
2110 var isFormV4 = embedVersion === 'v4';
2111 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2112 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2113 if (inputEl.current) {
2114 //@ts-expect-error Hubspot global
2115 var hbspt = window.parent.hbspt || window.hbspt;
2116 inputEl.current.innerHTML = '';
2117 var isQa = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScriptPayload.includes('qa');
2118 if (isFormV4) {
2119 var container = document.createElement('div');
2120 container.classList.add('hs-form-frame');
2121 container.dataset.region = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet;
2122 container.dataset.formId = formId;
2123 container.dataset.portalId = portalId.toString();
2124 container.dataset.env = isQa ? 'qa' : '';
2125 inputEl.current.appendChild(container);
2126 } else {
2127 var additionalParams = isQa ? {
2128 env: 'qa'
2129 } : {};
2130 hbspt.forms.create(_objectSpread({
2131 portalId: portalId,
2132 formId: formId,
2133 region: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet,
2134 target: "#".concat(inputEl.current.id)
2135 }, additionalParams));
2136 }
2137 }
2138 }, [formId, portalId, inputEl, isFormV4]);
2139 if (fullSiteEditor) {
2140 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_4__["default"], {});
2141 }
2142 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2143 ref: inputEl,
2144 id: "hbspt-previewform-".concat(formId)
2145 });
2146 }
2147
2148 /***/ }),
2149
2150 /***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts":
2151 /*!****************************************************************!*\
2152 !*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***!
2153 \****************************************************************/
2154 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2155
2156 "use strict";
2157 __webpack_require__.r(__webpack_exports__);
2158 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2159 /* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate)
2160 /* harmony export */ });
2161 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2162 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2163 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2164 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2165 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2166 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2167 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."); }
2168 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; } }
2169 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; }
2170 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; } }
2171 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2172
2173
2174
2175
2176 function useCreateFormFromTemplate() {
2177 var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg';
2178 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2179 var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)();
2180 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle),
2181 _useState2 = _slicedToArray(_useState, 2),
2182 loadState = _useState2[0],
2183 setLoadState = _useState2[1];
2184 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2185 _useState4 = _slicedToArray(_useState3, 2),
2186 formApiError = _useState4[0],
2187 setFormApiError = _useState4[1];
2188 var createFormByTemplate = function createFormByTemplate(type) {
2189 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2190 track({
2191 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate,
2192 payload: {
2193 type: type,
2194 origin: origin
2195 }
2196 });
2197 return proxy({
2198 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate,
2199 payload: {
2200 type: type,
2201 embedVersion: 'v4'
2202 }
2203 }).then(function (form) {
2204 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2205 return form;
2206 })["catch"](function (err) {
2207 setFormApiError(err);
2208 track({
2209 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed,
2210 payload: {
2211 origin: origin
2212 }
2213 });
2214 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2215 });
2216 };
2217 return {
2218 isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading,
2219 hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed,
2220 formApiError: formApiError,
2221 createFormByTemplate: createFormByTemplate,
2222 reset: function reset() {
2223 return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2224 }
2225 };
2226 }
2227
2228 /***/ }),
2229
2230 /***/ "./scripts/shared/Form/hooks/useForms.ts":
2231 /*!***********************************************!*\
2232 !*** ./scripts/shared/Form/hooks/useForms.ts ***!
2233 \***********************************************/
2234 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2235
2236 "use strict";
2237 __webpack_require__.r(__webpack_exports__);
2238 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2239 /* harmony export */ "default": () => (/* binding */ useForms)
2240 /* harmony export */ });
2241 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2242 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2243 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
2244 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
2245 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2246 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2247 /* harmony import */ var _useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useGetTemplateAvailability */ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts");
2248 function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2249 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."); }
2250 function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
2251 function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2252 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2253 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."); }
2254 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; } }
2255 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; }
2256 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; } }
2257 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2258
2259
2260
2261
2262
2263 function useForms() {
2264 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2265 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2266 _useState2 = _slicedToArray(_useState, 2),
2267 formApiError = _useState2[0],
2268 setFormApiError = _useState2[1];
2269 var _useGetTemplateAvaila = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2270 availabilityPromise = _useGetTemplateAvaila.availabilityPromise;
2271 var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) {
2272 return Promise.all([availabilityPromise, proxy({
2273 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchForms,
2274 payload: {
2275 search: search
2276 }
2277 })]).then(function (_ref) {
2278 var _ref2 = _slicedToArray(_ref, 2),
2279 templateAvailabilityResponse = _ref2[0],
2280 forms = _ref2[1];
2281 var TEMPLATE_OPTIONS = (0,_useGetTemplateAvailability__WEBPACK_IMPORTED_MODULE_4__.getTemplateOptions)(templateAvailabilityResponse.templateAvailability);
2282 callback([].concat(_toConsumableArray(forms.map(function (form) {
2283 return {
2284 label: form.name,
2285 value: form.guid,
2286 embedVersion: form.embedVersion
2287 };
2288 })), [TEMPLATE_OPTIONS]));
2289 })["catch"](function (error) {
2290 setFormApiError(error);
2291 });
2292 }, 300, {
2293 trailing: true
2294 });
2295 return {
2296 search: search,
2297 formApiError: formApiError,
2298 reset: function reset() {
2299 return setFormApiError(null);
2300 }
2301 };
2302 }
2303
2304 /***/ }),
2305
2306 /***/ "./scripts/shared/Form/hooks/useGetTemplateAvailability.ts":
2307 /*!*****************************************************************!*\
2308 !*** ./scripts/shared/Form/hooks/useGetTemplateAvailability.ts ***!
2309 \*****************************************************************/
2310 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2311
2312 "use strict";
2313 __webpack_require__.r(__webpack_exports__);
2314 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2315 /* harmony export */ "default": () => (/* binding */ useGetTemplateAvailability),
2316 /* harmony export */ "getTemplateOptions": () => (/* binding */ getTemplateOptions),
2317 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
2318 /* harmony export */ });
2319 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2320 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2321 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2322 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2323 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2324 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2325 /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../types */ "./scripts/shared/types.ts");
2326 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2327 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."); }
2328 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; } }
2329 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; }
2330 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; } }
2331 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2332
2333
2334
2335
2336
2337 function useGetTemplateAvailability() {
2338 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2339 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2340 _useState2 = _slicedToArray(_useState, 2),
2341 templateAvailability = _useState2[0],
2342 setTemplateAvailability = _useState2[1];
2343 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function () {
2344 return new Promise(function (resolve) {
2345 proxy({
2346 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.GetTemplateAvailability,
2347 payload: {}
2348 }).then(function (data) {
2349 setTemplateAvailability(data.templateAvailability);
2350 resolve(data);
2351 });
2352 });
2353 }),
2354 _useState4 = _slicedToArray(_useState3, 1),
2355 availabilityPromise = _useState4[0];
2356 return {
2357 templateAvailability: templateAvailability,
2358 availabilityPromise: availabilityPromise
2359 };
2360 }
2361 var getTemplateOptions = function getTemplateOptions(templateAvailability) {
2362 if (!templateAvailability) {
2363 return {};
2364 }
2365 return {
2366 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Templates', 'leadin'),
2367 options: Object.keys(templateAvailability).filter(function (templateId) {
2368 var hubspotFormTemplateAvailability = templateAvailability[templateId];
2369 return (hubspotFormTemplateAvailability.canCreateWithMissingScopes || !hubspotFormTemplateAvailability.missingScopes.length) && !Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.ExcludedTemplateAvailabilityKeys).includes(templateId);
2370 }).map(function (templateId) {
2371 return {
2372 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateLabels[templateId], 'leadin'),
2373 value: _types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues[templateId]
2374 };
2375 })
2376 };
2377 };
2378 function isDefaultForm(value) {
2379 return Object.values(_types__WEBPACK_IMPORTED_MODULE_4__.TemplateValues).includes(value);
2380 }
2381
2382 /***/ }),
2383
2384 /***/ "./scripts/shared/Meeting/MeetingController.tsx":
2385 /*!******************************************************!*\
2386 !*** ./scripts/shared/Meeting/MeetingController.tsx ***!
2387 \******************************************************/
2388 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2389
2390 "use strict";
2391 __webpack_require__.r(__webpack_exports__);
2392 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2393 /* harmony export */ "default": () => (/* binding */ MeetingController)
2394 /* harmony export */ });
2395 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2396 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2397 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2398 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2399 /* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx");
2400 /* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx");
2401 /* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts");
2402 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2403 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2404 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2405 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2406 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
2407 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
2408 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__);
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420 function MeetingController(_ref) {
2421 var handleChange = _ref.handleChange,
2422 url = _ref.url;
2423 var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(),
2424 meetings = _useMeetings.mappedMeetings,
2425 loading = _useMeetings.loading,
2426 error = _useMeetings.error,
2427 reload = _useMeetings.reload,
2428 connectCalendar = _useMeetings.connectCalendar;
2429 var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url);
2430 var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url);
2431 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2432 if (!url && meetings.length > 0) {
2433 handleChange(meetings[0].value);
2434 }
2435 }, [meetings, url, handleChange]);
2436 var handleLocalChange = function handleLocalChange(option) {
2437 handleChange(option.value);
2438 };
2439 var handleConnectCalendar = function handleConnectCalendar() {
2440 return connectCalendar().then(function () {
2441 reload();
2442 })["catch"](function (error) {
2443 raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', {
2444 extra: {
2445 error: error
2446 }
2447 });
2448 });
2449 };
2450 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2451 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"], {
2452 status: error && error.status || error,
2453 resetErrorState: function resetErrorState() {
2454 return reload();
2455 },
2456 errorInfo: {
2457 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'),
2458 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes', 'leadin'),
2459 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin')
2460 }
2461 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
2462 padding: "90px 32px 24px",
2463 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath,
2464 children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], {
2465 status: selectedMeetingCalendar,
2466 onConnectCalendar: handleConnectCalendar
2467 }), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], {
2468 onChange: handleLocalChange,
2469 options: meetings,
2470 value: selectedMeetingOption
2471 })]
2472 })
2473 });
2474 }
2475
2476 /***/ }),
2477
2478 /***/ "./scripts/shared/Meeting/MeetingEdit.tsx":
2479 /*!************************************************!*\
2480 !*** ./scripts/shared/Meeting/MeetingEdit.tsx ***!
2481 \************************************************/
2482 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2483
2484 "use strict";
2485 __webpack_require__.r(__webpack_exports__);
2486 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2487 /* harmony export */ "default": () => (/* binding */ MeetingsEditContainer)
2488 /* harmony export */ });
2489 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2490 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2491 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2492 /* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx");
2493 /* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx");
2494 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2495 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2496 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2497 /* harmony import */ var _utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/useGetEmbedder */ "./scripts/utils/useGetEmbedder.ts");
2498 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); }
2499 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; }
2500 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; }
2501 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; }
2502 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2503 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); }
2504
2505
2506
2507
2508
2509
2510
2511
2512 function MeetingEdit(_ref) {
2513 var url = _ref.attributes.url,
2514 isSelected = _ref.isSelected,
2515 setAttributes = _ref.setAttributes,
2516 _ref$preview = _ref.preview,
2517 preview = _ref$preview === void 0 ? true : _ref$preview,
2518 _ref$origin = _ref.origin,
2519 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin,
2520 fullSiteEditor = _ref.fullSiteEditor;
2521 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)();
2522 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)();
2523 var handleChange = function handleChange(newUrl) {
2524 setAttributes({
2525 url: newUrl
2526 });
2527 };
2528 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2529 monitorFormPreviewRender({
2530 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_5__.ProxyMessages.TrackMeetingPreviewRender,
2531 payload: {
2532 origin: origin
2533 }
2534 });
2535 }, [origin]);
2536 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, {
2537 children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], {
2538 url: url,
2539 handleChange: handleChange
2540 }), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], {
2541 url: url,
2542 fullSiteEditor: fullSiteEditor
2543 })]
2544 });
2545 }
2546 function MeetingsEditContainer(props) {
2547 var embedder = (0,_utils_useGetEmbedder__WEBPACK_IMPORTED_MODULE_7__.useGetEmbedder)();
2548 if (embedder === null) {
2549 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_6__["default"], {});
2550 }
2551 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.BackgroudAppContext.Provider, {
2552 value: embedder,
2553 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props))
2554 });
2555 }
2556
2557 /***/ }),
2558
2559 /***/ "./scripts/shared/Meeting/MeetingSelector.tsx":
2560 /*!****************************************************!*\
2561 !*** ./scripts/shared/Meeting/MeetingSelector.tsx ***!
2562 \****************************************************/
2563 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2564
2565 "use strict";
2566 __webpack_require__.r(__webpack_exports__);
2567 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2568 /* harmony export */ "default": () => (/* binding */ MeetingSelector)
2569 /* harmony export */ });
2570 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2571 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2572 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2573 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2574 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
2575 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2576 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2577
2578
2579
2580
2581
2582 function MeetingSelector(_ref) {
2583 var options = _ref.options,
2584 onChange = _ref.onChange,
2585 value = _ref.value;
2586 var optionsWrapper = [{
2587 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'),
2588 options: options
2589 }];
2590 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2591 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", {
2592 "data-test-id": "leadin-meeting-select",
2593 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2594 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin')
2595 })
2596 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
2597 defaultOptions: optionsWrapper,
2598 onChange: onChange,
2599 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'),
2600 value: value
2601 })]
2602 });
2603 }
2604
2605 /***/ }),
2606
2607 /***/ "./scripts/shared/Meeting/MeetingWarning.tsx":
2608 /*!***************************************************!*\
2609 !*** ./scripts/shared/Meeting/MeetingWarning.tsx ***!
2610 \***************************************************/
2611 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2612
2613 "use strict";
2614 __webpack_require__.r(__webpack_exports__);
2615 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2616 /* harmony export */ "default": () => (/* binding */ MeetingWarning)
2617 /* harmony export */ });
2618 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2619 /* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx");
2620 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
2621 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts");
2622 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2623 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2624
2625
2626
2627
2628
2629 function MeetingWarning(_ref) {
2630 var status = _ref.status,
2631 onConnectCalendar = _ref.onConnectCalendar;
2632 var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING;
2633 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');
2634 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');
2635 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], {
2636 titleText: titleText,
2637 titleMessage: titleMessage,
2638 children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
2639 use: "tertiary",
2640 id: "meetings-connect-calendar",
2641 onClick: onConnectCalendar,
2642 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin')
2643 })
2644 });
2645 }
2646
2647 /***/ }),
2648
2649 /***/ "./scripts/shared/Meeting/PreviewMeeting.tsx":
2650 /*!***************************************************!*\
2651 !*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***!
2652 \***************************************************/
2653 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2654
2655 "use strict";
2656 __webpack_require__.r(__webpack_exports__);
2657 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2658 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2659 /* harmony export */ });
2660 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2661 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2662 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2663 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2664 /* harmony import */ var _Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/PreviewDisabled */ "./scripts/shared/Common/PreviewDisabled.tsx");
2665
2666
2667
2668
2669 function PreviewForm(_ref) {
2670 var url = _ref.url,
2671 fullSiteEditor = _ref.fullSiteEditor;
2672 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2673 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2674 if (inputEl.current) {
2675 //@ts-expect-error Hubspot global
2676 var hbspt = window.parent.hbspt || window.hbspt;
2677 hbspt.meetings.create('.meetings-iframe-container');
2678 }
2679 }, [url, inputEl]);
2680 if (fullSiteEditor) {
2681 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_PreviewDisabled__WEBPACK_IMPORTED_MODULE_3__["default"], {});
2682 }
2683 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2684 children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2685 ref: inputEl,
2686 className: "meetings-iframe-container",
2687 "data-src": "".concat(url, "?embed=true")
2688 })
2689 });
2690 }
2691
2692 /***/ }),
2693
2694 /***/ "./scripts/shared/Meeting/constants.ts":
2695 /*!*********************************************!*\
2696 !*** ./scripts/shared/Meeting/constants.ts ***!
2697 \*********************************************/
2698 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2699
2700 "use strict";
2701 __webpack_require__.r(__webpack_exports__);
2702 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2703 /* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING),
2704 /* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING)
2705 /* harmony export */ });
2706 var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING';
2707 var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING';
2708
2709 /***/ }),
2710
2711 /***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts":
2712 /*!*************************************************************!*\
2713 !*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***!
2714 \*************************************************************/
2715 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2716
2717 "use strict";
2718 __webpack_require__.r(__webpack_exports__);
2719 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2720 /* harmony export */ "default": () => (/* binding */ useCurrentUserFetch)
2721 /* harmony export */ });
2722 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2723 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2724 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2725 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2726 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2727 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2728 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."); }
2729 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; } }
2730 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; }
2731 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; } }
2732 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2733
2734
2735
2736
2737 var user = null;
2738 function useCurrentUserFetch() {
2739 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2740 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2741 _useState2 = _slicedToArray(_useState, 2),
2742 loadState = _useState2[0],
2743 setLoadState = _useState2[1];
2744 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2745 _useState4 = _slicedToArray(_useState3, 2),
2746 error = _useState4[0],
2747 setError = _useState4[1];
2748 var createUser = function createUser() {
2749 if (!user) {
2750 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2751 }
2752 };
2753 var reload = function reload() {
2754 user = null;
2755 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2756 setError(null);
2757 };
2758 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2759 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) {
2760 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2761 proxy({
2762 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser
2763 }).then(function (data) {
2764 user = data;
2765 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2766 })["catch"](function (err) {
2767 setError(err);
2768 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2769 });
2770 }
2771 }, [loadState]);
2772 return {
2773 user: user,
2774 loadUserState: loadState,
2775 error: error,
2776 createUser: createUser,
2777 reload: reload
2778 };
2779 }
2780
2781 /***/ }),
2782
2783 /***/ "./scripts/shared/Meeting/hooks/useMeetings.ts":
2784 /*!*****************************************************!*\
2785 !*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***!
2786 \*****************************************************/
2787 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2788
2789 "use strict";
2790 __webpack_require__.r(__webpack_exports__);
2791 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2792 /* harmony export */ "default": () => (/* binding */ useMeetings),
2793 /* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting),
2794 /* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar)
2795 /* harmony export */ });
2796 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2797 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2798 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2799 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2800 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts");
2801 /* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts");
2802 /* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts");
2803 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2804 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2805 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2806 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); }
2807 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; }
2808 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; }
2809 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; }
2810 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
2811 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); }
2812 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2813 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."); }
2814 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; } }
2815 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; }
2816 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; } }
2817 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2818
2819
2820
2821
2822
2823
2824
2825
2826 function getDefaultMeetingName(meeting, currentUser, meetingUsers) {
2827 var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1),
2828 meetingOwnerId = _meeting$meetingsUser[0];
2829 var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin');
2830 if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) {
2831 var user = meetingUsers[meetingOwnerId];
2832 result += " (".concat(user.userProfile.fullName, ")");
2833 }
2834 return result;
2835 }
2836 function hasCalendarObject(user) {
2837 return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email;
2838 }
2839 function useMeetings() {
2840 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)();
2841 var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(),
2842 meetings = _useMeetingsFetch.meetings,
2843 meetingUsers = _useMeetingsFetch.meetingUsers,
2844 meetingsError = _useMeetingsFetch.error,
2845 loadMeetingsState = _useMeetingsFetch.loadMeetingsState,
2846 reloadMeetings = _useMeetingsFetch.reload;
2847 var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2848 currentUser = _useCurrentUserFetch.user,
2849 userError = _useCurrentUserFetch.error,
2850 loadUserState = _useCurrentUserFetch.loadUserState,
2851 reloadUser = _useCurrentUserFetch.reload;
2852 var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
2853 reloadUser();
2854 reloadMeetings();
2855 }, [reloadUser, reloadMeetings]);
2856 var connectCalendar = function connectCalendar() {
2857 return proxy({
2858 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar
2859 });
2860 };
2861 return {
2862 mappedMeetings: meetings.map(function (meet) {
2863 return {
2864 label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers),
2865 value: meet.link
2866 };
2867 }),
2868 meetings: meetings,
2869 meetingUsers: meetingUsers,
2870 currentUser: currentUser,
2871 error: meetingsError || userError,
2872 loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading,
2873 reload: reload,
2874 connectCalendar: connectCalendar
2875 };
2876 }
2877 function useSelectedMeeting(url) {
2878 var _useMeetings = useMeetings(),
2879 meetings = _useMeetings.mappedMeetings;
2880 var option = meetings.find(function (_ref) {
2881 var value = _ref.value;
2882 return value === url;
2883 });
2884 return option;
2885 }
2886 function useSelectedMeetingCalendar(url) {
2887 var _useMeetings2 = useMeetings(),
2888 meetings = _useMeetings2.meetings,
2889 meetingUsers = _useMeetings2.meetingUsers,
2890 currentUser = _useMeetings2.currentUser;
2891 var meeting = meetings.find(function (meet) {
2892 return meet.link === url;
2893 });
2894 var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) {
2895 return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
2896 }, {});
2897 if (!meeting) {
2898 return null;
2899 } else {
2900 var meetingsUserIds = meeting.meetingsUserIds;
2901 if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) {
2902 return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING;
2903 } else if (meetingsUserIds.map(function (id) {
2904 return mappedMeetingUsersId[id];
2905 }).some(function (user) {
2906 return !hasCalendarObject(user);
2907 })) {
2908 return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING;
2909 } else {
2910 return null;
2911 }
2912 }
2913 }
2914
2915 /***/ }),
2916
2917 /***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts":
2918 /*!**********************************************************!*\
2919 !*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***!
2920 \**********************************************************/
2921 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2922
2923 "use strict";
2924 __webpack_require__.r(__webpack_exports__);
2925 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2926 /* harmony export */ "default": () => (/* binding */ useMeetingsFetch)
2927 /* harmony export */ });
2928 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2929 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2930 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2931 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2932 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2933 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2934 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."); }
2935 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; } }
2936 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; }
2937 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; } }
2938 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2939
2940
2941
2942
2943 var meetings = [];
2944 var meetingUsers = [];
2945 function useMeetingsFetch() {
2946 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2947 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2948 _useState2 = _slicedToArray(_useState, 2),
2949 loadState = _useState2[0],
2950 setLoadState = _useState2[1];
2951 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2952 _useState4 = _slicedToArray(_useState3, 2),
2953 error = _useState4[0],
2954 setError = _useState4[1];
2955 var reload = function reload() {
2956 meetings = [];
2957 setError(null);
2958 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2959 };
2960 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2961 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) {
2962 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2963 proxy({
2964 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers
2965 }).then(function (data) {
2966 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded);
2967 meetings = data && data.meetingLinks;
2968 meetingUsers = data && data.meetingUsers;
2969 })["catch"](function (e) {
2970 setError(e);
2971 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2972 });
2973 }
2974 }, [loadState]);
2975 return {
2976 meetings: meetings,
2977 meetingUsers: meetingUsers,
2978 loadMeetingsState: loadState,
2979 error: error,
2980 reload: reload
2981 };
2982 }
2983
2984 /***/ }),
2985
2986 /***/ "./scripts/shared/UIComponents/UIAlert.tsx":
2987 /*!*************************************************!*\
2988 !*** ./scripts/shared/UIComponents/UIAlert.tsx ***!
2989 \*************************************************/
2990 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2991
2992 "use strict";
2993 __webpack_require__.r(__webpack_exports__);
2994 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2995 /* harmony export */ "default": () => (/* binding */ UIAlert)
2996 /* harmony export */ });
2997 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2998 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2999
3000
3001 var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3002 name: "AlertContainer",
3003 "class": "a1h8m4fo",
3004 propsAsIs: false
3005 });
3006 var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3007 name: "Title",
3008 "class": "tyndzxk",
3009 propsAsIs: false
3010 });
3011 var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
3012 name: "Message",
3013 "class": "m1m9sbk4",
3014 propsAsIs: false
3015 });
3016 var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
3017 name: "MessageContainer",
3018 "class": "mg5o421",
3019 propsAsIs: false
3020 });
3021 function UIAlert(_ref) {
3022 var titleText = _ref.titleText,
3023 titleMessage = _ref.titleMessage,
3024 children = _ref.children;
3025 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, {
3026 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, {
3027 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, {
3028 children: titleText
3029 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, {
3030 children: titleMessage
3031 })]
3032 }), children]
3033 });
3034 }
3035 __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");
3036
3037 /***/ }),
3038
3039 /***/ "./scripts/shared/UIComponents/UIButton.ts":
3040 /*!*************************************************!*\
3041 !*** ./scripts/shared/UIComponents/UIButton.ts ***!
3042 \*************************************************/
3043 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3044
3045 "use strict";
3046 __webpack_require__.r(__webpack_exports__);
3047 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3048 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3049 /* harmony export */ });
3050 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3051 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3052
3053
3054 var _exp2 = /*#__PURE__*/function _exp2() {
3055 return function (props) {
3056 return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX;
3057 };
3058 };
3059 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({
3060 name: "UIButton0",
3061 "class": "ug152ch",
3062 propsAsIs: false,
3063 vars: {
3064 "ug152ch-0": [_exp2()]
3065 }
3066 }));
3067 __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");
3068
3069 /***/ }),
3070
3071 /***/ "./scripts/shared/UIComponents/UIContainer.ts":
3072 /*!****************************************************!*\
3073 !*** ./scripts/shared/UIComponents/UIContainer.ts ***!
3074 \****************************************************/
3075 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3076
3077 "use strict";
3078 __webpack_require__.r(__webpack_exports__);
3079 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3080 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3081 /* harmony export */ });
3082 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3083
3084 var _exp = /*#__PURE__*/function _exp() {
3085 return function (props) {
3086 return props.textAlign ? props.textAlign : 'inherit';
3087 };
3088 };
3089 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3090 name: "UIContainer0",
3091 "class": "ua13n1c",
3092 propsAsIs: false,
3093 vars: {
3094 "ua13n1c-0": [_exp()]
3095 }
3096 }));
3097 __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");
3098
3099 /***/ }),
3100
3101 /***/ "./scripts/shared/UIComponents/UIOverlay.ts":
3102 /*!**************************************************!*\
3103 !*** ./scripts/shared/UIComponents/UIOverlay.ts ***!
3104 \**************************************************/
3105 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3106
3107 "use strict";
3108 __webpack_require__.r(__webpack_exports__);
3109 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3110 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3111 /* harmony export */ });
3112 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3113
3114 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3115 name: "UIOverlay0",
3116 "class": "u1q7a48k",
3117 propsAsIs: false
3118 }));
3119 __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");
3120
3121 /***/ }),
3122
3123 /***/ "./scripts/shared/UIComponents/UISpacer.ts":
3124 /*!*************************************************!*\
3125 !*** ./scripts/shared/UIComponents/UISpacer.ts ***!
3126 \*************************************************/
3127 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3128
3129 "use strict";
3130 __webpack_require__.r(__webpack_exports__);
3131 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3132 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3133 /* harmony export */ });
3134 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3135
3136 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
3137 name: "UISpacer0",
3138 "class": "u3qxofx",
3139 propsAsIs: false
3140 }));
3141 __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");
3142
3143 /***/ }),
3144
3145 /***/ "./scripts/shared/UIComponents/UISpinner.tsx":
3146 /*!***************************************************!*\
3147 !*** ./scripts/shared/UIComponents/UISpinner.tsx ***!
3148 \***************************************************/
3149 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3150
3151 "use strict";
3152 __webpack_require__.r(__webpack_exports__);
3153 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3154 /* harmony export */ "default": () => (/* binding */ UISpinner)
3155 /* harmony export */ });
3156 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3157 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3158 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3159
3160
3161
3162 var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3163 name: "SpinnerOuter",
3164 "class": "sxa9zrc",
3165 propsAsIs: false
3166 });
3167 var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3168 name: "SpinnerInner",
3169 "class": "s14430wa",
3170 propsAsIs: false
3171 });
3172 var _exp = /*#__PURE__*/function _exp() {
3173 return function (props) {
3174 return props.color;
3175 };
3176 };
3177 var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3178 name: "Circle",
3179 "class": "ct87ghk",
3180 propsAsIs: true,
3181 vars: {
3182 "ct87ghk-0": [_exp()]
3183 }
3184 });
3185 var _exp2 = /*#__PURE__*/function _exp2() {
3186 return function (props) {
3187 return props.color;
3188 };
3189 };
3190 var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3191 name: "AnimatedCircle",
3192 "class": "avili0h",
3193 propsAsIs: true,
3194 vars: {
3195 "avili0h-0": [_exp2()]
3196 }
3197 });
3198 function UISpinner(_ref) {
3199 var _ref$size = _ref.size,
3200 size = _ref$size === void 0 ? 20 : _ref$size;
3201 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, {
3202 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, {
3203 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
3204 height: size,
3205 width: size,
3206 viewBox: "0 0 50 50",
3207 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, {
3208 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM,
3209 cx: "25",
3210 cy: "25",
3211 r: "22.5"
3212 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, {
3213 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO,
3214 cx: "25",
3215 cy: "25",
3216 r: "22.5"
3217 })]
3218 })
3219 })
3220 });
3221 }
3222 __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");
3223
3224 /***/ }),
3225
3226 /***/ "./scripts/shared/UIComponents/colors.ts":
3227 /*!***********************************************!*\
3228 !*** ./scripts/shared/UIComponents/colors.ts ***!
3229 \***********************************************/
3230 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3231
3232 "use strict";
3233 __webpack_require__.r(__webpack_exports__);
3234 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3235 /* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO),
3236 /* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT),
3237 /* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM),
3238 /* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP),
3239 /* harmony export */ "LORAX": () => (/* binding */ LORAX),
3240 /* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT),
3241 /* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM),
3242 /* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN),
3243 /* harmony export */ "OLAF": () => (/* binding */ OLAF)
3244 /* harmony export */ });
3245 var CALYPSO = '#00a4bd';
3246 var CALYPSO_MEDIUM = '#7fd1de';
3247 var CALYPSO_LIGHT = '#e5f5f8';
3248 var LORAX = '#ff7a59';
3249 var OLAF = '#ffffff';
3250 var HEFFALUMP = '#425b76';
3251 var MARIGOLD_LIGHT = '#fef8f0';
3252 var MARIGOLD_MEDIUM = '#fae0b5';
3253 var OBSIDIAN = '#33475b';
3254
3255 /***/ }),
3256
3257 /***/ "./scripts/shared/enums/connectionStatus.ts":
3258 /*!**************************************************!*\
3259 !*** ./scripts/shared/enums/connectionStatus.ts ***!
3260 \**************************************************/
3261 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3262
3263 "use strict";
3264 __webpack_require__.r(__webpack_exports__);
3265 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3266 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3267 /* harmony export */ });
3268 var ConnectionStatus = {
3269 Connected: 'Connected',
3270 NotConnected: 'NotConnected'
3271 };
3272 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus);
3273
3274 /***/ }),
3275
3276 /***/ "./scripts/shared/enums/loadState.ts":
3277 /*!*******************************************!*\
3278 !*** ./scripts/shared/enums/loadState.ts ***!
3279 \*******************************************/
3280 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3281
3282 "use strict";
3283 __webpack_require__.r(__webpack_exports__);
3284 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3285 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3286 /* harmony export */ });
3287 var LoadState = {
3288 NotLoaded: 'NotLoaded',
3289 Loading: 'Loading',
3290 Loaded: 'Loaded',
3291 Idle: 'Idle',
3292 Failed: 'Failed'
3293 };
3294 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState);
3295
3296 /***/ }),
3297
3298 /***/ "./scripts/shared/types.ts":
3299 /*!*********************************!*\
3300 !*** ./scripts/shared/types.ts ***!
3301 \*********************************/
3302 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3303
3304 "use strict";
3305 __webpack_require__.r(__webpack_exports__);
3306 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3307 /* harmony export */ "ExcludedTemplateAvailabilityKeys": () => (/* binding */ ExcludedTemplateAvailabilityKeys),
3308 /* harmony export */ "HubSpotFormTemplateAvailabilityKeys": () => (/* binding */ HubSpotFormTemplateAvailabilityKeys),
3309 /* harmony export */ "TemplateLabels": () => (/* binding */ TemplateLabels),
3310 /* harmony export */ "TemplateValues": () => (/* binding */ TemplateValues)
3311 /* harmony export */ });
3312 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); }
3313 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; }
3314 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3315 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); }
3316 var HubSpotFormTemplateAvailabilityKeys;
3317 (function (HubSpotFormTemplateAvailabilityKeys) {
3318 HubSpotFormTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3319 HubSpotFormTemplateAvailabilityKeys["BLANK"] = "blank";
3320 HubSpotFormTemplateAvailabilityKeys["NEWSLETTER"] = "newsletter";
3321 HubSpotFormTemplateAvailabilityKeys["CONTACT_US"] = "contact-us";
3322 HubSpotFormTemplateAvailabilityKeys["EVENT_REGISTRATION"] = "event-registration";
3323 HubSpotFormTemplateAvailabilityKeys["TALK_TO_AN_EXPERT"] = "talk-to-an-expert";
3324 HubSpotFormTemplateAvailabilityKeys["BOOK_A_MEETING"] = "book-a-meeting";
3325 HubSpotFormTemplateAvailabilityKeys["GATED_CONTENT"] = "gated-content";
3326 HubSpotFormTemplateAvailabilityKeys["SUPPORT"] = "support";
3327 })(HubSpotFormTemplateAvailabilityKeys || (HubSpotFormTemplateAvailabilityKeys = {}));
3328 var ExcludedTemplateAvailabilityKeys;
3329 (function (ExcludedTemplateAvailabilityKeys) {
3330 ExcludedTemplateAvailabilityKeys["SUPPORT"] = "support";
3331 ExcludedTemplateAvailabilityKeys["AI_GENERATED"] = "ai-generated";
3332 })(ExcludedTemplateAvailabilityKeys || (ExcludedTemplateAvailabilityKeys = {}));
3333 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');
3334 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');
3335
3336 /***/ }),
3337
3338 /***/ "./scripts/utils/appUtils.ts":
3339 /*!***********************************!*\
3340 !*** ./scripts/utils/appUtils.ts ***!
3341 \***********************************/
3342 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3343
3344 "use strict";
3345 __webpack_require__.r(__webpack_exports__);
3346 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3347 /* harmony export */ "initApp": () => (/* binding */ initApp),
3348 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
3349 /* harmony export */ });
3350 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
3351 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
3352 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3353
3354
3355 function initApp(initFn) {
3356 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
3357 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
3358 }
3359 function initAppOnReady(initFn) {
3360 function main() {
3361 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
3362 }
3363 initApp(main);
3364 }
3365
3366 /***/ }),
3367
3368 /***/ "./scripts/utils/backgroundAppUtils.ts":
3369 /*!*********************************************!*\
3370 !*** ./scripts/utils/backgroundAppUtils.ts ***!
3371 \*********************************************/
3372 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3373
3374 "use strict";
3375 __webpack_require__.r(__webpack_exports__);
3376 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3377 /* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp),
3378 /* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp)
3379 /* harmony export */ });
3380 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3381 /* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts");
3382
3383
3384 function initBackgroundApp(initFn) {
3385 function main() {
3386 if (Array.isArray(initFn)) {
3387 initFn.forEach(function (callback) {
3388 return callback();
3389 });
3390 } else {
3391 initFn();
3392 }
3393 }
3394 (0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main);
3395 }
3396 var getLeadinConfig = function getLeadinConfig() {
3397 return {
3398 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.leadinPluginVersion
3399 };
3400 };
3401 var getOrCreateBackgroundApp = function getOrCreateBackgroundApp() {
3402 var refreshToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3403 if (window.LeadinBackgroundApp) {
3404 return window.LeadinBackgroundApp;
3405 }
3406 var _window = window,
3407 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3408 IntegratedAppOptions = _window.IntegratedAppOptions;
3409 var options = new IntegratedAppOptions().setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.deviceId).setLeadinConfig(getLeadinConfig()).setRefreshToken(refreshToken.trim());
3410 var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options);
3411 embedder.attachTo(document.body, false);
3412 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
3413 window.LeadinBackgroundApp = embedder;
3414 return window.LeadinBackgroundApp;
3415 };
3416
3417 /***/ }),
3418
3419 /***/ "./scripts/utils/isRefreshTokenAvailable.ts":
3420 /*!**************************************************!*\
3421 !*** ./scripts/utils/isRefreshTokenAvailable.ts ***!
3422 \**************************************************/
3423 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3424
3425 "use strict";
3426 __webpack_require__.r(__webpack_exports__);
3427 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3428 /* harmony export */ "isRefreshTokenAvailable": () => (/* binding */ isRefreshTokenAvailable)
3429 /* harmony export */ });
3430 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3431
3432 function isRefreshTokenAvailable() {
3433 return _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.connectionStatus === 'Connected';
3434 }
3435
3436 /***/ }),
3437
3438 /***/ "./scripts/utils/queryParams.ts":
3439 /*!**************************************!*\
3440 !*** ./scripts/utils/queryParams.ts ***!
3441 \**************************************/
3442 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3443
3444 "use strict";
3445 __webpack_require__.r(__webpack_exports__);
3446 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3447 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
3448 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
3449 /* harmony export */ });
3450 function addQueryObjectToUrl(urlObject, queryParams) {
3451 Object.keys(queryParams).forEach(function (key) {
3452 urlObject.searchParams.append(key, queryParams[key]);
3453 });
3454 }
3455 function removeQueryParamFromLocation(key) {
3456 var location = new URL(window.location.href);
3457 location.searchParams["delete"](key);
3458 window.history.replaceState(null, '', location.href);
3459 }
3460
3461 /***/ }),
3462
3463 /***/ "./scripts/utils/useGetEmbedder.ts":
3464 /*!*****************************************!*\
3465 !*** ./scripts/utils/useGetEmbedder.ts ***!
3466 \*****************************************/
3467 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3468
3469 "use strict";
3470 __webpack_require__.r(__webpack_exports__);
3471 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3472 /* harmony export */ "useGetEmbedder": () => (/* binding */ useGetEmbedder)
3473 /* harmony export */ });
3474 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3475 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
3476 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
3477 /* harmony import */ var _backgroundAppUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
3478 /* harmony import */ var _isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isRefreshTokenAvailable */ "./scripts/utils/isRefreshTokenAvailable.ts");
3479 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3480 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."); }
3481 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; } }
3482 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; }
3483 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; } }
3484 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
3485
3486
3487
3488
3489 function useGetEmbedder() {
3490 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
3491 _useState2 = _slicedToArray(_useState, 2),
3492 embedder = _useState2[0],
3493 setEmbedder = _useState2[1];
3494 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
3495 if ((0,_isRefreshTokenAvailable__WEBPACK_IMPORTED_MODULE_3__.isRefreshTokenAvailable)()) {
3496 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.fetchRefreshToken)().then(function (_ref) {
3497 var refreshToken = _ref.refreshToken;
3498 setEmbedder((0,_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_2__.getOrCreateBackgroundApp)(refreshToken));
3499 });
3500 }
3501 }, []);
3502 return embedder;
3503 }
3504
3505 /***/ }),
3506
3507 /***/ "./scripts/utils/withMetaData.ts":
3508 /*!***************************************!*\
3509 !*** ./scripts/utils/withMetaData.ts ***!
3510 \***************************************/
3511 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3512
3513 "use strict";
3514 __webpack_require__.r(__webpack_exports__);
3515 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3516 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
3517 /* harmony export */ "isFullSiteEditor": () => (/* binding */ isFullSiteEditor)
3518 /* harmony export */ });
3519 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3520 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3521 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); }
3522 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; }
3523 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
3524 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); }
3525
3526 // from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599
3527 var isFullSiteEditor = function isFullSiteEditor() {
3528 return _wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select && !!(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/edit-site');
3529 };
3530 var applyWithSelect = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)(function (select, props) {
3531 return {
3532 metaValue: select('core/editor').getEditedPostAttribute('meta')[props.metaKey]
3533 };
3534 });
3535 var applyWithDispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch)(function (dispatch, props) {
3536 return {
3537 setMetaValue: function setMetaValue(value) {
3538 dispatch('core/editor').editPost({
3539 meta: _defineProperty({}, props.metaKey, value)
3540 });
3541 }
3542 };
3543 });
3544 function apply(el) {
3545 return applyWithSelect(applyWithDispatch(el));
3546 }
3547 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);
3548
3549 /***/ }),
3550
3551 /***/ "./node_modules/is-what/dist/index.esm.js":
3552 /*!************************************************!*\
3553 !*** ./node_modules/is-what/dist/index.esm.js ***!
3554 \************************************************/
3555 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3556
3557 "use strict";
3558 __webpack_require__.r(__webpack_exports__);
3559 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3560 /* harmony export */ "getType": () => (/* binding */ getType),
3561 /* harmony export */ "isAnyObject": () => (/* binding */ isAnyObject),
3562 /* harmony export */ "isArray": () => (/* binding */ isArray),
3563 /* harmony export */ "isBlob": () => (/* binding */ isBlob),
3564 /* harmony export */ "isBoolean": () => (/* binding */ isBoolean),
3565 /* harmony export */ "isDate": () => (/* binding */ isDate),
3566 /* harmony export */ "isEmptyArray": () => (/* binding */ isEmptyArray),
3567 /* harmony export */ "isEmptyObject": () => (/* binding */ isEmptyObject),
3568 /* harmony export */ "isEmptyString": () => (/* binding */ isEmptyString),
3569 /* harmony export */ "isError": () => (/* binding */ isError),
3570 /* harmony export */ "isFile": () => (/* binding */ isFile),
3571 /* harmony export */ "isFullArray": () => (/* binding */ isFullArray),
3572 /* harmony export */ "isFullObject": () => (/* binding */ isFullObject),
3573 /* harmony export */ "isFullString": () => (/* binding */ isFullString),
3574 /* harmony export */ "isFunction": () => (/* binding */ isFunction),
3575 /* harmony export */ "isMap": () => (/* binding */ isMap),
3576 /* harmony export */ "isNaNValue": () => (/* binding */ isNaNValue),
3577 /* harmony export */ "isNull": () => (/* binding */ isNull),
3578 /* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined),
3579 /* harmony export */ "isNumber": () => (/* binding */ isNumber),
3580 /* harmony export */ "isObject": () => (/* binding */ isObject),
3581 /* harmony export */ "isObjectLike": () => (/* binding */ isObjectLike),
3582 /* harmony export */ "isOneOf": () => (/* binding */ isOneOf),
3583 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
3584 /* harmony export */ "isPrimitive": () => (/* binding */ isPrimitive),
3585 /* harmony export */ "isPromise": () => (/* binding */ isPromise),
3586 /* harmony export */ "isRegExp": () => (/* binding */ isRegExp),
3587 /* harmony export */ "isSet": () => (/* binding */ isSet),
3588 /* harmony export */ "isString": () => (/* binding */ isString),
3589 /* harmony export */ "isSymbol": () => (/* binding */ isSymbol),
3590 /* harmony export */ "isType": () => (/* binding */ isType),
3591 /* harmony export */ "isUndefined": () => (/* binding */ isUndefined),
3592 /* harmony export */ "isWeakMap": () => (/* binding */ isWeakMap),
3593 /* harmony export */ "isWeakSet": () => (/* binding */ isWeakSet)
3594 /* harmony export */ });
3595 /**
3596 * Returns the object type of the given payload
3597 *
3598 * @param {*} payload
3599 * @returns {string}
3600 */
3601 function getType(payload) {
3602 return Object.prototype.toString.call(payload).slice(8, -1);
3603 }
3604 /**
3605 * Returns whether the payload is undefined
3606 *
3607 * @param {*} payload
3608 * @returns {payload is undefined}
3609 */
3610 function isUndefined(payload) {
3611 return getType(payload) === 'Undefined';
3612 }
3613 /**
3614 * Returns whether the payload is null
3615 *
3616 * @param {*} payload
3617 * @returns {payload is null}
3618 */
3619 function isNull(payload) {
3620 return getType(payload) === 'Null';
3621 }
3622 /**
3623 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3624 *
3625 * @param {*} payload
3626 * @returns {payload is PlainObject}
3627 */
3628 function isPlainObject(payload) {
3629 if (getType(payload) !== 'Object')
3630 return false;
3631 return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
3632 }
3633 /**
3634 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3635 *
3636 * @param {*} payload
3637 * @returns {payload is PlainObject}
3638 */
3639 function isObject(payload) {
3640 return isPlainObject(payload);
3641 }
3642 /**
3643 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3644 *
3645 * @param {*} payload
3646 * @returns {payload is { [K in any]: never }}
3647 */
3648 function isEmptyObject(payload) {
3649 return isPlainObject(payload) && Object.keys(payload).length === 0;
3650 }
3651 /**
3652 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3653 *
3654 * @param {*} payload
3655 * @returns {payload is PlainObject}
3656 */
3657 function isFullObject(payload) {
3658 return isPlainObject(payload) && Object.keys(payload).length > 0;
3659 }
3660 /**
3661 * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
3662 *
3663 * @param {*} payload
3664 * @returns {payload is PlainObject}
3665 */
3666 function isAnyObject(payload) {
3667 return getType(payload) === 'Object';
3668 }
3669 /**
3670 * Returns whether the payload is an object like a type passed in < >
3671 *
3672 * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
3673 *
3674 * @template T this must be passed in < >
3675 * @param {*} payload
3676 * @returns {payload is T}
3677 */
3678 function isObjectLike(payload) {
3679 return isAnyObject(payload);
3680 }
3681 /**
3682 * Returns whether the payload is a function (regular or async)
3683 *
3684 * @param {*} payload
3685 * @returns {payload is AnyFunction}
3686 */
3687 function isFunction(payload) {
3688 return typeof payload === 'function';
3689 }
3690 /**
3691 * Returns whether the payload is an array
3692 *
3693 * @param {any} payload
3694 * @returns {payload is any[]}
3695 */
3696 function isArray(payload) {
3697 return getType(payload) === 'Array';
3698 }
3699 /**
3700 * Returns whether the payload is a an array with at least 1 item
3701 *
3702 * @param {*} payload
3703 * @returns {payload is any[]}
3704 */
3705 function isFullArray(payload) {
3706 return isArray(payload) && payload.length > 0;
3707 }
3708 /**
3709 * Returns whether the payload is a an empty array
3710 *
3711 * @param {*} payload
3712 * @returns {payload is []}
3713 */
3714 function isEmptyArray(payload) {
3715 return isArray(payload) && payload.length === 0;
3716 }
3717 /**
3718 * Returns whether the payload is a string
3719 *
3720 * @param {*} payload
3721 * @returns {payload is string}
3722 */
3723 function isString(payload) {
3724 return getType(payload) === 'String';
3725 }
3726 /**
3727 * Returns whether the payload is a string, BUT returns false for ''
3728 *
3729 * @param {*} payload
3730 * @returns {payload is string}
3731 */
3732 function isFullString(payload) {
3733 return isString(payload) && payload !== '';
3734 }
3735 /**
3736 * Returns whether the payload is ''
3737 *
3738 * @param {*} payload
3739 * @returns {payload is string}
3740 */
3741 function isEmptyString(payload) {
3742 return payload === '';
3743 }
3744 /**
3745 * Returns whether the payload is a number (but not NaN)
3746 *
3747 * This will return `false` for `NaN`!!
3748 *
3749 * @param {*} payload
3750 * @returns {payload is number}
3751 */
3752 function isNumber(payload) {
3753 return getType(payload) === 'Number' && !isNaN(payload);
3754 }
3755 /**
3756 * Returns whether the payload is a boolean
3757 *
3758 * @param {*} payload
3759 * @returns {payload is boolean}
3760 */
3761 function isBoolean(payload) {
3762 return getType(payload) === 'Boolean';
3763 }
3764 /**
3765 * Returns whether the payload is a regular expression (RegExp)
3766 *
3767 * @param {*} payload
3768 * @returns {payload is RegExp}
3769 */
3770 function isRegExp(payload) {
3771 return getType(payload) === 'RegExp';
3772 }
3773 /**
3774 * Returns whether the payload is a Map
3775 *
3776 * @param {*} payload
3777 * @returns {payload is Map<any, any>}
3778 */
3779 function isMap(payload) {
3780 return getType(payload) === 'Map';
3781 }
3782 /**
3783 * Returns whether the payload is a WeakMap
3784 *
3785 * @param {*} payload
3786 * @returns {payload is WeakMap<any, any>}
3787 */
3788 function isWeakMap(payload) {
3789 return getType(payload) === 'WeakMap';
3790 }
3791 /**
3792 * Returns whether the payload is a Set
3793 *
3794 * @param {*} payload
3795 * @returns {payload is Set<any>}
3796 */
3797 function isSet(payload) {
3798 return getType(payload) === 'Set';
3799 }
3800 /**
3801 * Returns whether the payload is a WeakSet
3802 *
3803 * @param {*} payload
3804 * @returns {payload is WeakSet<any>}
3805 */
3806 function isWeakSet(payload) {
3807 return getType(payload) === 'WeakSet';
3808 }
3809 /**
3810 * Returns whether the payload is a Symbol
3811 *
3812 * @param {*} payload
3813 * @returns {payload is symbol}
3814 */
3815 function isSymbol(payload) {
3816 return getType(payload) === 'Symbol';
3817 }
3818 /**
3819 * Returns whether the payload is a Date, and that the date is valid
3820 *
3821 * @param {*} payload
3822 * @returns {payload is Date}
3823 */
3824 function isDate(payload) {
3825 return getType(payload) === 'Date' && !isNaN(payload);
3826 }
3827 /**
3828 * Returns whether the payload is a Blob
3829 *
3830 * @param {*} payload
3831 * @returns {payload is Blob}
3832 */
3833 function isBlob(payload) {
3834 return getType(payload) === 'Blob';
3835 }
3836 /**
3837 * Returns whether the payload is a File
3838 *
3839 * @param {*} payload
3840 * @returns {payload is File}
3841 */
3842 function isFile(payload) {
3843 return getType(payload) === 'File';
3844 }
3845 /**
3846 * Returns whether the payload is a Promise
3847 *
3848 * @param {*} payload
3849 * @returns {payload is Promise<any>}
3850 */
3851 function isPromise(payload) {
3852 return getType(payload) === 'Promise';
3853 }
3854 /**
3855 * Returns whether the payload is an Error
3856 *
3857 * @param {*} payload
3858 * @returns {payload is Error}
3859 */
3860 function isError(payload) {
3861 return getType(payload) === 'Error';
3862 }
3863 /**
3864 * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
3865 *
3866 * @param {*} payload
3867 * @returns {payload is typeof NaN}
3868 */
3869 function isNaNValue(payload) {
3870 return getType(payload) === 'Number' && isNaN(payload);
3871 }
3872 /**
3873 * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
3874 *
3875 * @param {*} payload
3876 * @returns {(payload is boolean | null | undefined | number | string | symbol)}
3877 */
3878 function isPrimitive(payload) {
3879 return (isBoolean(payload) ||
3880 isNull(payload) ||
3881 isUndefined(payload) ||
3882 isNumber(payload) ||
3883 isString(payload) ||
3884 isSymbol(payload));
3885 }
3886 /**
3887 * Returns true whether the payload is null or undefined
3888 *
3889 * @param {*} payload
3890 * @returns {(payload is null | undefined)}
3891 */
3892 var isNullOrUndefined = isOneOf(isNull, isUndefined);
3893 function isOneOf(a, b, c, d, e) {
3894 return function (value) {
3895 return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));
3896 };
3897 }
3898 /**
3899 * Does a generic check to check that the given payload is of a given type.
3900 * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
3901 * It will, however, differentiate between object and null
3902 *
3903 * @template T
3904 * @param {*} payload
3905 * @param {T} type
3906 * @throws {TypeError} Will throw type error if type is an invalid type
3907 * @returns {payload is T}
3908 */
3909 function isType(payload, type) {
3910 if (!(type instanceof Function)) {
3911 throw new TypeError('Type must be a function');
3912 }
3913 if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
3914 throw new TypeError('Type is not a class');
3915 }
3916 // Classes usually have names (as functions usually have names)
3917 var name = type.name;
3918 return getType(payload) === name || Boolean(payload && payload.constructor === type);
3919 }
3920
3921
3922
3923
3924 /***/ }),
3925
3926 /***/ "./node_modules/lodash/_Symbol.js":
3927 /*!****************************************!*\
3928 !*** ./node_modules/lodash/_Symbol.js ***!
3929 \****************************************/
3930 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3931
3932 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
3933
3934 /** Built-in value references. */
3935 var Symbol = root.Symbol;
3936
3937 module.exports = Symbol;
3938
3939
3940 /***/ }),
3941
3942 /***/ "./node_modules/lodash/_baseGetTag.js":
3943 /*!********************************************!*\
3944 !*** ./node_modules/lodash/_baseGetTag.js ***!
3945 \********************************************/
3946 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3947
3948 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
3949 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
3950 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
3951
3952 /** `Object#toString` result references. */
3953 var nullTag = '[object Null]',
3954 undefinedTag = '[object Undefined]';
3955
3956 /** Built-in value references. */
3957 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
3958
3959 /**
3960 * The base implementation of `getTag` without fallbacks for buggy environments.
3961 *
3962 * @private
3963 * @param {*} value The value to query.
3964 * @returns {string} Returns the `toStringTag`.
3965 */
3966 function baseGetTag(value) {
3967 if (value == null) {
3968 return value === undefined ? undefinedTag : nullTag;
3969 }
3970 return (symToStringTag && symToStringTag in Object(value))
3971 ? getRawTag(value)
3972 : objectToString(value);
3973 }
3974
3975 module.exports = baseGetTag;
3976
3977
3978 /***/ }),
3979
3980 /***/ "./node_modules/lodash/_baseTrim.js":
3981 /*!******************************************!*\
3982 !*** ./node_modules/lodash/_baseTrim.js ***!
3983 \******************************************/
3984 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3985
3986 var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
3987
3988 /** Used to match leading whitespace. */
3989 var reTrimStart = /^\s+/;
3990
3991 /**
3992 * The base implementation of `_.trim`.
3993 *
3994 * @private
3995 * @param {string} string The string to trim.
3996 * @returns {string} Returns the trimmed string.
3997 */
3998 function baseTrim(string) {
3999 return string
4000 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
4001 : string;
4002 }
4003
4004 module.exports = baseTrim;
4005
4006
4007 /***/ }),
4008
4009 /***/ "./node_modules/lodash/_freeGlobal.js":
4010 /*!********************************************!*\
4011 !*** ./node_modules/lodash/_freeGlobal.js ***!
4012 \********************************************/
4013 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4014
4015 /** Detect free variable `global` from Node.js. */
4016 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
4017
4018 module.exports = freeGlobal;
4019
4020
4021 /***/ }),
4022
4023 /***/ "./node_modules/lodash/_getRawTag.js":
4024 /*!*******************************************!*\
4025 !*** ./node_modules/lodash/_getRawTag.js ***!
4026 \*******************************************/
4027 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4028
4029 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
4030
4031 /** Used for built-in method references. */
4032 var objectProto = Object.prototype;
4033
4034 /** Used to check objects for own properties. */
4035 var hasOwnProperty = objectProto.hasOwnProperty;
4036
4037 /**
4038 * Used to resolve the
4039 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4040 * of values.
4041 */
4042 var nativeObjectToString = objectProto.toString;
4043
4044 /** Built-in value references. */
4045 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4046
4047 /**
4048 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
4049 *
4050 * @private
4051 * @param {*} value The value to query.
4052 * @returns {string} Returns the raw `toStringTag`.
4053 */
4054 function getRawTag(value) {
4055 var isOwn = hasOwnProperty.call(value, symToStringTag),
4056 tag = value[symToStringTag];
4057
4058 try {
4059 value[symToStringTag] = undefined;
4060 var unmasked = true;
4061 } catch (e) {}
4062
4063 var result = nativeObjectToString.call(value);
4064 if (unmasked) {
4065 if (isOwn) {
4066 value[symToStringTag] = tag;
4067 } else {
4068 delete value[symToStringTag];
4069 }
4070 }
4071 return result;
4072 }
4073
4074 module.exports = getRawTag;
4075
4076
4077 /***/ }),
4078
4079 /***/ "./node_modules/lodash/_objectToString.js":
4080 /*!************************************************!*\
4081 !*** ./node_modules/lodash/_objectToString.js ***!
4082 \************************************************/
4083 /***/ ((module) => {
4084
4085 /** Used for built-in method references. */
4086 var objectProto = Object.prototype;
4087
4088 /**
4089 * Used to resolve the
4090 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4091 * of values.
4092 */
4093 var nativeObjectToString = objectProto.toString;
4094
4095 /**
4096 * Converts `value` to a string using `Object.prototype.toString`.
4097 *
4098 * @private
4099 * @param {*} value The value to convert.
4100 * @returns {string} Returns the converted string.
4101 */
4102 function objectToString(value) {
4103 return nativeObjectToString.call(value);
4104 }
4105
4106 module.exports = objectToString;
4107
4108
4109 /***/ }),
4110
4111 /***/ "./node_modules/lodash/_root.js":
4112 /*!**************************************!*\
4113 !*** ./node_modules/lodash/_root.js ***!
4114 \**************************************/
4115 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4116
4117 var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
4118
4119 /** Detect free variable `self`. */
4120 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4121
4122 /** Used as a reference to the global object. */
4123 var root = freeGlobal || freeSelf || Function('return this')();
4124
4125 module.exports = root;
4126
4127
4128 /***/ }),
4129
4130 /***/ "./node_modules/lodash/_trimmedEndIndex.js":
4131 /*!*************************************************!*\
4132 !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
4133 \*************************************************/
4134 /***/ ((module) => {
4135
4136 /** Used to match a single whitespace character. */
4137 var reWhitespace = /\s/;
4138
4139 /**
4140 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
4141 * character of `string`.
4142 *
4143 * @private
4144 * @param {string} string The string to inspect.
4145 * @returns {number} Returns the index of the last non-whitespace character.
4146 */
4147 function trimmedEndIndex(string) {
4148 var index = string.length;
4149
4150 while (index-- && reWhitespace.test(string.charAt(index))) {}
4151 return index;
4152 }
4153
4154 module.exports = trimmedEndIndex;
4155
4156
4157 /***/ }),
4158
4159 /***/ "./node_modules/lodash/debounce.js":
4160 /*!*****************************************!*\
4161 !*** ./node_modules/lodash/debounce.js ***!
4162 \*****************************************/
4163 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4164
4165 var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4166 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
4167 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
4168
4169 /** Error message constants. */
4170 var FUNC_ERROR_TEXT = 'Expected a function';
4171
4172 /* Built-in method references for those with the same name as other `lodash` methods. */
4173 var nativeMax = Math.max,
4174 nativeMin = Math.min;
4175
4176 /**
4177 * Creates a debounced function that delays invoking `func` until after `wait`
4178 * milliseconds have elapsed since the last time the debounced function was
4179 * invoked. The debounced function comes with a `cancel` method to cancel
4180 * delayed `func` invocations and a `flush` method to immediately invoke them.
4181 * Provide `options` to indicate whether `func` should be invoked on the
4182 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
4183 * with the last arguments provided to the debounced function. Subsequent
4184 * calls to the debounced function return the result of the last `func`
4185 * invocation.
4186 *
4187 * **Note:** If `leading` and `trailing` options are `true`, `func` is
4188 * invoked on the trailing edge of the timeout only if the debounced function
4189 * is invoked more than once during the `wait` timeout.
4190 *
4191 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
4192 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
4193 *
4194 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
4195 * for details over the differences between `_.debounce` and `_.throttle`.
4196 *
4197 * @static
4198 * @memberOf _
4199 * @since 0.1.0
4200 * @category Function
4201 * @param {Function} func The function to debounce.
4202 * @param {number} [wait=0] The number of milliseconds to delay.
4203 * @param {Object} [options={}] The options object.
4204 * @param {boolean} [options.leading=false]
4205 * Specify invoking on the leading edge of the timeout.
4206 * @param {number} [options.maxWait]
4207 * The maximum time `func` is allowed to be delayed before it's invoked.
4208 * @param {boolean} [options.trailing=true]
4209 * Specify invoking on the trailing edge of the timeout.
4210 * @returns {Function} Returns the new debounced function.
4211 * @example
4212 *
4213 * // Avoid costly calculations while the window size is in flux.
4214 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
4215 *
4216 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
4217 * jQuery(element).on('click', _.debounce(sendMail, 300, {
4218 * 'leading': true,
4219 * 'trailing': false
4220 * }));
4221 *
4222 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
4223 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
4224 * var source = new EventSource('/stream');
4225 * jQuery(source).on('message', debounced);
4226 *
4227 * // Cancel the trailing debounced invocation.
4228 * jQuery(window).on('popstate', debounced.cancel);
4229 */
4230 function debounce(func, wait, options) {
4231 var lastArgs,
4232 lastThis,
4233 maxWait,
4234 result,
4235 timerId,
4236 lastCallTime,
4237 lastInvokeTime = 0,
4238 leading = false,
4239 maxing = false,
4240 trailing = true;
4241
4242 if (typeof func != 'function') {
4243 throw new TypeError(FUNC_ERROR_TEXT);
4244 }
4245 wait = toNumber(wait) || 0;
4246 if (isObject(options)) {
4247 leading = !!options.leading;
4248 maxing = 'maxWait' in options;
4249 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
4250 trailing = 'trailing' in options ? !!options.trailing : trailing;
4251 }
4252
4253 function invokeFunc(time) {
4254 var args = lastArgs,
4255 thisArg = lastThis;
4256
4257 lastArgs = lastThis = undefined;
4258 lastInvokeTime = time;
4259 result = func.apply(thisArg, args);
4260 return result;
4261 }
4262
4263 function leadingEdge(time) {
4264 // Reset any `maxWait` timer.
4265 lastInvokeTime = time;
4266 // Start the timer for the trailing edge.
4267 timerId = setTimeout(timerExpired, wait);
4268 // Invoke the leading edge.
4269 return leading ? invokeFunc(time) : result;
4270 }
4271
4272 function remainingWait(time) {
4273 var timeSinceLastCall = time - lastCallTime,
4274 timeSinceLastInvoke = time - lastInvokeTime,
4275 timeWaiting = wait - timeSinceLastCall;
4276
4277 return maxing
4278 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
4279 : timeWaiting;
4280 }
4281
4282 function shouldInvoke(time) {
4283 var timeSinceLastCall = time - lastCallTime,
4284 timeSinceLastInvoke = time - lastInvokeTime;
4285
4286 // Either this is the first call, activity has stopped and we're at the
4287 // trailing edge, the system time has gone backwards and we're treating
4288 // it as the trailing edge, or we've hit the `maxWait` limit.
4289 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
4290 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
4291 }
4292
4293 function timerExpired() {
4294 var time = now();
4295 if (shouldInvoke(time)) {
4296 return trailingEdge(time);
4297 }
4298 // Restart the timer.
4299 timerId = setTimeout(timerExpired, remainingWait(time));
4300 }
4301
4302 function trailingEdge(time) {
4303 timerId = undefined;
4304
4305 // Only invoke if we have `lastArgs` which means `func` has been
4306 // debounced at least once.
4307 if (trailing && lastArgs) {
4308 return invokeFunc(time);
4309 }
4310 lastArgs = lastThis = undefined;
4311 return result;
4312 }
4313
4314 function cancel() {
4315 if (timerId !== undefined) {
4316 clearTimeout(timerId);
4317 }
4318 lastInvokeTime = 0;
4319 lastArgs = lastCallTime = lastThis = timerId = undefined;
4320 }
4321
4322 function flush() {
4323 return timerId === undefined ? result : trailingEdge(now());
4324 }
4325
4326 function debounced() {
4327 var time = now(),
4328 isInvoking = shouldInvoke(time);
4329
4330 lastArgs = arguments;
4331 lastThis = this;
4332 lastCallTime = time;
4333
4334 if (isInvoking) {
4335 if (timerId === undefined) {
4336 return leadingEdge(lastCallTime);
4337 }
4338 if (maxing) {
4339 // Handle invocations in a tight loop.
4340 clearTimeout(timerId);
4341 timerId = setTimeout(timerExpired, wait);
4342 return invokeFunc(lastCallTime);
4343 }
4344 }
4345 if (timerId === undefined) {
4346 timerId = setTimeout(timerExpired, wait);
4347 }
4348 return result;
4349 }
4350 debounced.cancel = cancel;
4351 debounced.flush = flush;
4352 return debounced;
4353 }
4354
4355 module.exports = debounce;
4356
4357
4358 /***/ }),
4359
4360 /***/ "./node_modules/lodash/isObject.js":
4361 /*!*****************************************!*\
4362 !*** ./node_modules/lodash/isObject.js ***!
4363 \*****************************************/
4364 /***/ ((module) => {
4365
4366 /**
4367 * Checks if `value` is the
4368 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4369 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4370 *
4371 * @static
4372 * @memberOf _
4373 * @since 0.1.0
4374 * @category Lang
4375 * @param {*} value The value to check.
4376 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4377 * @example
4378 *
4379 * _.isObject({});
4380 * // => true
4381 *
4382 * _.isObject([1, 2, 3]);
4383 * // => true
4384 *
4385 * _.isObject(_.noop);
4386 * // => true
4387 *
4388 * _.isObject(null);
4389 * // => false
4390 */
4391 function isObject(value) {
4392 var type = typeof value;
4393 return value != null && (type == 'object' || type == 'function');
4394 }
4395
4396 module.exports = isObject;
4397
4398
4399 /***/ }),
4400
4401 /***/ "./node_modules/lodash/isObjectLike.js":
4402 /*!*********************************************!*\
4403 !*** ./node_modules/lodash/isObjectLike.js ***!
4404 \*********************************************/
4405 /***/ ((module) => {
4406
4407 /**
4408 * Checks if `value` is object-like. A value is object-like if it's not `null`
4409 * and has a `typeof` result of "object".
4410 *
4411 * @static
4412 * @memberOf _
4413 * @since 4.0.0
4414 * @category Lang
4415 * @param {*} value The value to check.
4416 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4417 * @example
4418 *
4419 * _.isObjectLike({});
4420 * // => true
4421 *
4422 * _.isObjectLike([1, 2, 3]);
4423 * // => true
4424 *
4425 * _.isObjectLike(_.noop);
4426 * // => false
4427 *
4428 * _.isObjectLike(null);
4429 * // => false
4430 */
4431 function isObjectLike(value) {
4432 return value != null && typeof value == 'object';
4433 }
4434
4435 module.exports = isObjectLike;
4436
4437
4438 /***/ }),
4439
4440 /***/ "./node_modules/lodash/isSymbol.js":
4441 /*!*****************************************!*\
4442 !*** ./node_modules/lodash/isSymbol.js ***!
4443 \*****************************************/
4444 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4445
4446 var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
4447 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
4448
4449 /** `Object#toString` result references. */
4450 var symbolTag = '[object Symbol]';
4451
4452 /**
4453 * Checks if `value` is classified as a `Symbol` primitive or object.
4454 *
4455 * @static
4456 * @memberOf _
4457 * @since 4.0.0
4458 * @category Lang
4459 * @param {*} value The value to check.
4460 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4461 * @example
4462 *
4463 * _.isSymbol(Symbol.iterator);
4464 * // => true
4465 *
4466 * _.isSymbol('abc');
4467 * // => false
4468 */
4469 function isSymbol(value) {
4470 return typeof value == 'symbol' ||
4471 (isObjectLike(value) && baseGetTag(value) == symbolTag);
4472 }
4473
4474 module.exports = isSymbol;
4475
4476
4477 /***/ }),
4478
4479 /***/ "./node_modules/lodash/now.js":
4480 /*!************************************!*\
4481 !*** ./node_modules/lodash/now.js ***!
4482 \************************************/
4483 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4484
4485 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4486
4487 /**
4488 * Gets the timestamp of the number of milliseconds that have elapsed since
4489 * the Unix epoch (1 January 1970 00:00:00 UTC).
4490 *
4491 * @static
4492 * @memberOf _
4493 * @since 2.4.0
4494 * @category Date
4495 * @returns {number} Returns the timestamp.
4496 * @example
4497 *
4498 * _.defer(function(stamp) {
4499 * console.log(_.now() - stamp);
4500 * }, _.now());
4501 * // => Logs the number of milliseconds it took for the deferred invocation.
4502 */
4503 var now = function() {
4504 return root.Date.now();
4505 };
4506
4507 module.exports = now;
4508
4509
4510 /***/ }),
4511
4512 /***/ "./node_modules/lodash/toNumber.js":
4513 /*!*****************************************!*\
4514 !*** ./node_modules/lodash/toNumber.js ***!
4515 \*****************************************/
4516 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4517
4518 var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
4519 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4520 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
4521
4522 /** Used as references for various `Number` constants. */
4523 var NAN = 0 / 0;
4524
4525 /** Used to detect bad signed hexadecimal string values. */
4526 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
4527
4528 /** Used to detect binary string values. */
4529 var reIsBinary = /^0b[01]+$/i;
4530
4531 /** Used to detect octal string values. */
4532 var reIsOctal = /^0o[0-7]+$/i;
4533
4534 /** Built-in method references without a dependency on `root`. */
4535 var freeParseInt = parseInt;
4536
4537 /**
4538 * Converts `value` to a number.
4539 *
4540 * @static
4541 * @memberOf _
4542 * @since 4.0.0
4543 * @category Lang
4544 * @param {*} value The value to process.
4545 * @returns {number} Returns the number.
4546 * @example
4547 *
4548 * _.toNumber(3.2);
4549 * // => 3.2
4550 *
4551 * _.toNumber(Number.MIN_VALUE);
4552 * // => 5e-324
4553 *
4554 * _.toNumber(Infinity);
4555 * // => Infinity
4556 *
4557 * _.toNumber('3.2');
4558 * // => 3.2
4559 */
4560 function toNumber(value) {
4561 if (typeof value == 'number') {
4562 return value;
4563 }
4564 if (isSymbol(value)) {
4565 return NAN;
4566 }
4567 if (isObject(value)) {
4568 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
4569 value = isObject(other) ? (other + '') : other;
4570 }
4571 if (typeof value != 'string') {
4572 return value === 0 ? value : +value;
4573 }
4574 value = baseTrim(value);
4575 var isBinary = reIsBinary.test(value);
4576 return (isBinary || reIsOctal.test(value))
4577 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
4578 : (reIsBadHex.test(value) ? NAN : +value);
4579 }
4580
4581 module.exports = toNumber;
4582
4583
4584 /***/ }),
4585
4586 /***/ "./node_modules/memoize-one/dist/memoize-one.esm.js":
4587 /*!**********************************************************!*\
4588 !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***!
4589 \**********************************************************/
4590 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4591
4592 "use strict";
4593 __webpack_require__.r(__webpack_exports__);
4594 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4595 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4596 /* harmony export */ });
4597 var safeIsNaN = Number.isNaN ||
4598 function ponyfill(value) {
4599 return typeof value === 'number' && value !== value;
4600 };
4601 function isEqual(first, second) {
4602 if (first === second) {
4603 return true;
4604 }
4605 if (safeIsNaN(first) && safeIsNaN(second)) {
4606 return true;
4607 }
4608 return false;
4609 }
4610 function areInputsEqual(newInputs, lastInputs) {
4611 if (newInputs.length !== lastInputs.length) {
4612 return false;
4613 }
4614 for (var i = 0; i < newInputs.length; i++) {
4615 if (!isEqual(newInputs[i], lastInputs[i])) {
4616 return false;
4617 }
4618 }
4619 return true;
4620 }
4621
4622 function memoizeOne(resultFn, isEqual) {
4623 if (isEqual === void 0) { isEqual = areInputsEqual; }
4624 var lastThis;
4625 var lastArgs = [];
4626 var lastResult;
4627 var calledOnce = false;
4628 function memoized() {
4629 var newArgs = [];
4630 for (var _i = 0; _i < arguments.length; _i++) {
4631 newArgs[_i] = arguments[_i];
4632 }
4633 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
4634 return lastResult;
4635 }
4636 lastResult = resultFn.apply(this, newArgs);
4637 calledOnce = true;
4638 lastThis = this;
4639 lastArgs = newArgs;
4640 return lastResult;
4641 }
4642 return memoized;
4643 }
4644
4645 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeOne);
4646
4647
4648 /***/ }),
4649
4650 /***/ "./node_modules/merge-anything/dist/index.esm.js":
4651 /*!*******************************************************!*\
4652 !*** ./node_modules/merge-anything/dist/index.esm.js ***!
4653 \*******************************************************/
4654 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4655
4656 "use strict";
4657 __webpack_require__.r(__webpack_exports__);
4658 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4659 /* harmony export */ "concatArrays": () => (/* binding */ concatArrays),
4660 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4661 /* harmony export */ "merge": () => (/* binding */ merge)
4662 /* harmony export */ });
4663 /* harmony import */ var is_what__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-what */ "./node_modules/is-what/dist/index.esm.js");
4664
4665
4666 /*! *****************************************************************************
4667 Copyright (c) Microsoft Corporation. All rights reserved.
4668 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4669 this file except in compliance with the License. You may obtain a copy of the
4670 License at http://www.apache.org/licenses/LICENSE-2.0
4671
4672 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4673 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
4674 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
4675 MERCHANTABLITY OR NON-INFRINGEMENT.
4676
4677 See the Apache Version 2.0 License for specific language governing permissions
4678 and limitations under the License.
4679 ***************************************************************************** */
4680
4681 function __spreadArrays() {
4682 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4683 for (var r = Array(s), k = 0, i = 0; i < il; i++)
4684 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4685 r[k] = a[j];
4686 return r;
4687 }
4688
4689 function assignProp(carry, key, newVal, originalObject) {
4690 var propType = originalObject.propertyIsEnumerable(key)
4691 ? 'enumerable'
4692 : 'nonenumerable';
4693 if (propType === 'enumerable')
4694 carry[key] = newVal;
4695 if (propType === 'nonenumerable') {
4696 Object.defineProperty(carry, key, {
4697 value: newVal,
4698 enumerable: false,
4699 writable: true,
4700 configurable: true
4701 });
4702 }
4703 }
4704 function mergeRecursively(origin, newComer, extensions) {
4705 // work directly on newComer if its not an object
4706 if (!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newComer)) {
4707 // extend merge rules
4708 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4709 extensions.forEach(function (extend) {
4710 newComer = extend(origin, newComer);
4711 });
4712 }
4713 return newComer;
4714 }
4715 // define newObject to merge all values upon
4716 var newObject = {};
4717 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin)) {
4718 var props_1 = Object.getOwnPropertyNames(origin);
4719 var symbols_1 = Object.getOwnPropertySymbols(origin);
4720 newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {
4721 // @ts-ignore
4722 var targetVal = origin[key];
4723 if ((!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||
4724 ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {
4725 assignProp(carry, key, targetVal, origin);
4726 }
4727 return carry;
4728 }, {});
4729 }
4730 var props = Object.getOwnPropertyNames(newComer);
4731 var symbols = Object.getOwnPropertySymbols(newComer);
4732 var result = __spreadArrays(props, symbols).reduce(function (carry, key) {
4733 // re-define the origin and newComer as targetVal and newVal
4734 var newVal = newComer[key];
4735 var targetVal = ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin))
4736 // @ts-ignore
4737 ? origin[key]
4738 : undefined;
4739 // extend merge rules
4740 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4741 extensions.forEach(function (extend) {
4742 newVal = extend(targetVal, newVal);
4743 });
4744 }
4745 // When newVal is an object do the merge recursively
4746 if (targetVal !== undefined && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newVal)) {
4747 newVal = mergeRecursively(targetVal, newVal, extensions);
4748 }
4749 assignProp(carry, key, newVal, newComer);
4750 return carry;
4751 }, newObject);
4752 return result;
4753 }
4754 /**
4755 * Merge anything recursively.
4756 * Objects get merged, special objects (classes etc.) are re-assigned "as is".
4757 * Basic types overwrite objects or other basic types.
4758 *
4759 * @param {(IConfig | any)} origin
4760 * @param {...any[]} newComers
4761 * @returns the result
4762 */
4763 function merge(origin) {
4764 var newComers = [];
4765 for (var _i = 1; _i < arguments.length; _i++) {
4766 newComers[_i - 1] = arguments[_i];
4767 }
4768 var extensions = null;
4769 var base = origin;
4770 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin) && origin.extensions && Object.keys(origin).length === 1) {
4771 base = {};
4772 extensions = origin.extensions;
4773 }
4774 return newComers.reduce(function (result, newComer) {
4775 return mergeRecursively(result, newComer, extensions);
4776 }, base);
4777 }
4778
4779 function concatArrays(originVal, newVal) {
4780 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(originVal) && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(newVal)) {
4781 // concat logic
4782 return originVal.concat(newVal);
4783 }
4784 return newVal; // always return newVal as fallback!!
4785 }
4786
4787 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);
4788
4789
4790
4791 /***/ }),
4792
4793 /***/ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts":
4794 /*!****************************************************************************************************************************************************************************************!*\
4795 !*** ./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts ***!
4796 \****************************************************************************************************************************************************************************************/
4797 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4798
4799 "use strict";
4800 __webpack_require__.r(__webpack_exports__);
4801 // extracted by mini-css-extract-plugin
4802
4803
4804 /***/ }),
4805
4806 /***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx":
4807 /*!*******************************************************************************************************************************************************************************!*\
4808 !*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***!
4809 \*******************************************************************************************************************************************************************************/
4810 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4811
4812 "use strict";
4813 __webpack_require__.r(__webpack_exports__);
4814 // extracted by mini-css-extract-plugin
4815
4816
4817 /***/ }),
4818
4819 /***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts":
4820 /*!************************************************************************************************************************************************************************************!*\
4821 !*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***!
4822 \************************************************************************************************************************************************************************************/
4823 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4824
4825 "use strict";
4826 __webpack_require__.r(__webpack_exports__);
4827 // extracted by mini-css-extract-plugin
4828
4829
4830 /***/ }),
4831
4832 /***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx":
4833 /*!***********************************************************************************************************************************************************************************!*\
4834 !*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***!
4835 \***********************************************************************************************************************************************************************************/
4836 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4837
4838 "use strict";
4839 __webpack_require__.r(__webpack_exports__);
4840 // extracted by mini-css-extract-plugin
4841
4842
4843 /***/ }),
4844
4845 /***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts":
4846 /*!************************************************************************************************************************************************************************************!*\
4847 !*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***!
4848 \************************************************************************************************************************************************************************************/
4849 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4850
4851 "use strict";
4852 __webpack_require__.r(__webpack_exports__);
4853 // extracted by mini-css-extract-plugin
4854
4855
4856 /***/ }),
4857
4858 /***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts":
4859 /*!******************************************************************************************************************************************************************************************!*\
4860 !*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***!
4861 \******************************************************************************************************************************************************************************************/
4862 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4863
4864 "use strict";
4865 __webpack_require__.r(__webpack_exports__);
4866 // extracted by mini-css-extract-plugin
4867
4868
4869 /***/ }),
4870
4871 /***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts":
4872 /*!**************************************************************************************************************************************************************************************!*\
4873 !*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***!
4874 \**************************************************************************************************************************************************************************************/
4875 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4876
4877 "use strict";
4878 __webpack_require__.r(__webpack_exports__);
4879 // extracted by mini-css-extract-plugin
4880
4881
4882 /***/ }),
4883
4884 /***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts":
4885 /*!************************************************************************************************************************************************************************************!*\
4886 !*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***!
4887 \************************************************************************************************************************************************************************************/
4888 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4889
4890 "use strict";
4891 __webpack_require__.r(__webpack_exports__);
4892 // extracted by mini-css-extract-plugin
4893
4894
4895 /***/ }),
4896
4897 /***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx":
4898 /*!***************************************************************************************************************************************************************************************!*\
4899 !*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***!
4900 \***************************************************************************************************************************************************************************************/
4901 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4902
4903 "use strict";
4904 __webpack_require__.r(__webpack_exports__);
4905 // extracted by mini-css-extract-plugin
4906
4907
4908 /***/ }),
4909
4910 /***/ "./node_modules/object-assign/index.js":
4911 /*!*********************************************!*\
4912 !*** ./node_modules/object-assign/index.js ***!
4913 \*********************************************/
4914 /***/ ((module) => {
4915
4916 "use strict";
4917 /*
4918 object-assign
4919 (c) Sindre Sorhus
4920 @license MIT
4921 */
4922
4923
4924 /* eslint-disable no-unused-vars */
4925 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4926 var hasOwnProperty = Object.prototype.hasOwnProperty;
4927 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4928
4929 function toObject(val) {
4930 if (val === null || val === undefined) {
4931 throw new TypeError('Object.assign cannot be called with null or undefined');
4932 }
4933
4934 return Object(val);
4935 }
4936
4937 function shouldUseNative() {
4938 try {
4939 if (!Object.assign) {
4940 return false;
4941 }
4942
4943 // Detect buggy property enumeration order in older V8 versions.
4944
4945 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4946 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4947 test1[5] = 'de';
4948 if (Object.getOwnPropertyNames(test1)[0] === '5') {
4949 return false;
4950 }
4951
4952 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4953 var test2 = {};
4954 for (var i = 0; i < 10; i++) {
4955 test2['_' + String.fromCharCode(i)] = i;
4956 }
4957 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4958 return test2[n];
4959 });
4960 if (order2.join('') !== '0123456789') {
4961 return false;
4962 }
4963
4964 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4965 var test3 = {};
4966 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4967 test3[letter] = letter;
4968 });
4969 if (Object.keys(Object.assign({}, test3)).join('') !==
4970 'abcdefghijklmnopqrst') {
4971 return false;
4972 }
4973
4974 return true;
4975 } catch (err) {
4976 // We don't expect any of the above to throw, but better to be safe.
4977 return false;
4978 }
4979 }
4980
4981 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4982 var from;
4983 var to = toObject(target);
4984 var symbols;
4985
4986 for (var s = 1; s < arguments.length; s++) {
4987 from = Object(arguments[s]);
4988
4989 for (var key in from) {
4990 if (hasOwnProperty.call(from, key)) {
4991 to[key] = from[key];
4992 }
4993 }
4994
4995 if (getOwnPropertySymbols) {
4996 symbols = getOwnPropertySymbols(from);
4997 for (var i = 0; i < symbols.length; i++) {
4998 if (propIsEnumerable.call(from, symbols[i])) {
4999 to[symbols[i]] = from[symbols[i]];
5000 }
5001 }
5002 }
5003 }
5004
5005 return to;
5006 };
5007
5008
5009 /***/ }),
5010
5011 /***/ "./node_modules/prop-types/checkPropTypes.js":
5012 /*!***************************************************!*\
5013 !*** ./node_modules/prop-types/checkPropTypes.js ***!
5014 \***************************************************/
5015 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5016
5017 "use strict";
5018 /**
5019 * Copyright (c) 2013-present, Facebook, Inc.
5020 *
5021 * This source code is licensed under the MIT license found in the
5022 * LICENSE file in the root directory of this source tree.
5023 */
5024
5025
5026
5027 var printWarning = function() {};
5028
5029 if (true) {
5030 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5031 var loggedTypeFailures = {};
5032 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5033
5034 printWarning = function(text) {
5035 var message = 'Warning: ' + text;
5036 if (typeof console !== 'undefined') {
5037 console.error(message);
5038 }
5039 try {
5040 // --- Welcome to debugging React ---
5041 // This error was thrown as a convenience so that you can use this stack
5042 // to find the callsite that caused this warning to fire.
5043 throw new Error(message);
5044 } catch (x) { /**/ }
5045 };
5046 }
5047
5048 /**
5049 * Assert that the values match with the type specs.
5050 * Error messages are memorized and will only be shown once.
5051 *
5052 * @param {object} typeSpecs Map of name to a ReactPropType
5053 * @param {object} values Runtime values that need to be type-checked
5054 * @param {string} location e.g. "prop", "context", "child context"
5055 * @param {string} componentName Name of the component for error messages.
5056 * @param {?Function} getStack Returns the component stack.
5057 * @private
5058 */
5059 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
5060 if (true) {
5061 for (var typeSpecName in typeSpecs) {
5062 if (has(typeSpecs, typeSpecName)) {
5063 var error;
5064 // Prop type validation may throw. In case they do, we don't want to
5065 // fail the render phase where it didn't fail before. So we log it.
5066 // After these have been cleaned up, we'll let them throw.
5067 try {
5068 // This is intentionally an invariant that gets caught. It's the same
5069 // behavior as without this statement except with a better message.
5070 if (typeof typeSpecs[typeSpecName] !== 'function') {
5071 var err = Error(
5072 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
5073 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
5074 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
5075 );
5076 err.name = 'Invariant Violation';
5077 throw err;
5078 }
5079 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
5080 } catch (ex) {
5081 error = ex;
5082 }
5083 if (error && !(error instanceof Error)) {
5084 printWarning(
5085 (componentName || 'React class') + ': type specification of ' +
5086 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
5087 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
5088 'You may have forgotten to pass an argument to the type checker ' +
5089 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
5090 'shape all require an argument).'
5091 );
5092 }
5093 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
5094 // Only monitor this failure once because there tends to be a lot of the
5095 // same error.
5096 loggedTypeFailures[error.message] = true;
5097
5098 var stack = getStack ? getStack() : '';
5099
5100 printWarning(
5101 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
5102 );
5103 }
5104 }
5105 }
5106 }
5107 }
5108
5109 /**
5110 * Resets warning cache when testing.
5111 *
5112 * @private
5113 */
5114 checkPropTypes.resetWarningCache = function() {
5115 if (true) {
5116 loggedTypeFailures = {};
5117 }
5118 }
5119
5120 module.exports = checkPropTypes;
5121
5122
5123 /***/ }),
5124
5125 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
5126 /*!************************************************************!*\
5127 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
5128 \************************************************************/
5129 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5130
5131 "use strict";
5132 /**
5133 * Copyright (c) 2013-present, Facebook, Inc.
5134 *
5135 * This source code is licensed under the MIT license found in the
5136 * LICENSE file in the root directory of this source tree.
5137 */
5138
5139
5140
5141 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5142 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
5143
5144 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
5145 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
5146 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
5147
5148 var printWarning = function() {};
5149
5150 if (true) {
5151 printWarning = function(text) {
5152 var message = 'Warning: ' + text;
5153 if (typeof console !== 'undefined') {
5154 console.error(message);
5155 }
5156 try {
5157 // --- Welcome to debugging React ---
5158 // This error was thrown as a convenience so that you can use this stack
5159 // to find the callsite that caused this warning to fire.
5160 throw new Error(message);
5161 } catch (x) {}
5162 };
5163 }
5164
5165 function emptyFunctionThatReturnsNull() {
5166 return null;
5167 }
5168
5169 module.exports = function(isValidElement, throwOnDirectAccess) {
5170 /* global Symbol */
5171 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
5172 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
5173
5174 /**
5175 * Returns the iterator method function contained on the iterable object.
5176 *
5177 * Be sure to invoke the function with the iterable as context:
5178 *
5179 * var iteratorFn = getIteratorFn(myIterable);
5180 * if (iteratorFn) {
5181 * var iterator = iteratorFn.call(myIterable);
5182 * ...
5183 * }
5184 *
5185 * @param {?object} maybeIterable
5186 * @return {?function}
5187 */
5188 function getIteratorFn(maybeIterable) {
5189 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
5190 if (typeof iteratorFn === 'function') {
5191 return iteratorFn;
5192 }
5193 }
5194
5195 /**
5196 * Collection of methods that allow declaration and validation of props that are
5197 * supplied to React components. Example usage:
5198 *
5199 * var Props = require('ReactPropTypes');
5200 * var MyArticle = React.createClass({
5201 * propTypes: {
5202 * // An optional string prop named "description".
5203 * description: Props.string,
5204 *
5205 * // A required enum prop named "category".
5206 * category: Props.oneOf(['News','Photos']).isRequired,
5207 *
5208 * // A prop named "dialog" that requires an instance of Dialog.
5209 * dialog: Props.instanceOf(Dialog).isRequired
5210 * },
5211 * render: function() { ... }
5212 * });
5213 *
5214 * A more formal specification of how these methods are used:
5215 *
5216 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
5217 * decl := ReactPropTypes.{type}(.isRequired)?
5218 *
5219 * Each and every declaration produces a function with the same signature. This
5220 * allows the creation of custom validation functions. For example:
5221 *
5222 * var MyLink = React.createClass({
5223 * propTypes: {
5224 * // An optional string or URI prop named "href".
5225 * href: function(props, propName, componentName) {
5226 * var propValue = props[propName];
5227 * if (propValue != null && typeof propValue !== 'string' &&
5228 * !(propValue instanceof URI)) {
5229 * return new Error(
5230 * 'Expected a string or an URI for ' + propName + ' in ' +
5231 * componentName
5232 * );
5233 * }
5234 * }
5235 * },
5236 * render: function() {...}
5237 * });
5238 *
5239 * @internal
5240 */
5241
5242 var ANONYMOUS = '<<anonymous>>';
5243
5244 // Important!
5245 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
5246 var ReactPropTypes = {
5247 array: createPrimitiveTypeChecker('array'),
5248 bigint: createPrimitiveTypeChecker('bigint'),
5249 bool: createPrimitiveTypeChecker('boolean'),
5250 func: createPrimitiveTypeChecker('function'),
5251 number: createPrimitiveTypeChecker('number'),
5252 object: createPrimitiveTypeChecker('object'),
5253 string: createPrimitiveTypeChecker('string'),
5254 symbol: createPrimitiveTypeChecker('symbol'),
5255
5256 any: createAnyTypeChecker(),
5257 arrayOf: createArrayOfTypeChecker,
5258 element: createElementTypeChecker(),
5259 elementType: createElementTypeTypeChecker(),
5260 instanceOf: createInstanceTypeChecker,
5261 node: createNodeChecker(),
5262 objectOf: createObjectOfTypeChecker,
5263 oneOf: createEnumTypeChecker,
5264 oneOfType: createUnionTypeChecker,
5265 shape: createShapeTypeChecker,
5266 exact: createStrictShapeTypeChecker,
5267 };
5268
5269 /**
5270 * inlined Object.is polyfill to avoid requiring consumers ship their own
5271 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5272 */
5273 /*eslint-disable no-self-compare*/
5274 function is(x, y) {
5275 // SameValue algorithm
5276 if (x === y) {
5277 // Steps 1-5, 7-10
5278 // Steps 6.b-6.e: +0 != -0
5279 return x !== 0 || 1 / x === 1 / y;
5280 } else {
5281 // Step 6.a: NaN == NaN
5282 return x !== x && y !== y;
5283 }
5284 }
5285 /*eslint-enable no-self-compare*/
5286
5287 /**
5288 * We use an Error-like object for backward compatibility as people may call
5289 * PropTypes directly and inspect their output. However, we don't use real
5290 * Errors anymore. We don't inspect their stack anyway, and creating them
5291 * is prohibitively expensive if they are created too often, such as what
5292 * happens in oneOfType() for any type before the one that matched.
5293 */
5294 function PropTypeError(message, data) {
5295 this.message = message;
5296 this.data = data && typeof data === 'object' ? data: {};
5297 this.stack = '';
5298 }
5299 // Make `instanceof Error` still work for returned errors.
5300 PropTypeError.prototype = Error.prototype;
5301
5302 function createChainableTypeChecker(validate) {
5303 if (true) {
5304 var manualPropTypeCallCache = {};
5305 var manualPropTypeWarningCount = 0;
5306 }
5307 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5308 componentName = componentName || ANONYMOUS;
5309 propFullName = propFullName || propName;
5310
5311 if (secret !== ReactPropTypesSecret) {
5312 if (throwOnDirectAccess) {
5313 // New behavior only for users of `prop-types` package
5314 var err = new Error(
5315 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
5316 'Use `PropTypes.checkPropTypes()` to call them. ' +
5317 'Read more at http://fb.me/use-check-prop-types'
5318 );
5319 err.name = 'Invariant Violation';
5320 throw err;
5321 } else if ( true && typeof console !== 'undefined') {
5322 // Old behavior for people using React.PropTypes
5323 var cacheKey = componentName + ':' + propName;
5324 if (
5325 !manualPropTypeCallCache[cacheKey] &&
5326 // Avoid spamming the console because they are often not actionable except for lib authors
5327 manualPropTypeWarningCount < 3
5328 ) {
5329 printWarning(
5330 'You are manually calling a React.PropTypes validation ' +
5331 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
5332 'and will throw in the standalone `prop-types` package. ' +
5333 'You may be seeing this warning due to a third-party PropTypes ' +
5334 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
5335 );
5336 manualPropTypeCallCache[cacheKey] = true;
5337 manualPropTypeWarningCount++;
5338 }
5339 }
5340 }
5341 if (props[propName] == null) {
5342 if (isRequired) {
5343 if (props[propName] === null) {
5344 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5345 }
5346 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5347 }
5348 return null;
5349 } else {
5350 return validate(props, propName, componentName, location, propFullName);
5351 }
5352 }
5353
5354 var chainedCheckType = checkType.bind(null, false);
5355 chainedCheckType.isRequired = checkType.bind(null, true);
5356
5357 return chainedCheckType;
5358 }
5359
5360 function createPrimitiveTypeChecker(expectedType) {
5361 function validate(props, propName, componentName, location, propFullName, secret) {
5362 var propValue = props[propName];
5363 var propType = getPropType(propValue);
5364 if (propType !== expectedType) {
5365 // `propValue` being instance of, say, date/regexp, pass the 'object'
5366 // check, but we can offer a more precise error message here rather than
5367 // 'of type `object`'.
5368 var preciseType = getPreciseType(propValue);
5369
5370 return new PropTypeError(
5371 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
5372 {expectedType: expectedType}
5373 );
5374 }
5375 return null;
5376 }
5377 return createChainableTypeChecker(validate);
5378 }
5379
5380 function createAnyTypeChecker() {
5381 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5382 }
5383
5384 function createArrayOfTypeChecker(typeChecker) {
5385 function validate(props, propName, componentName, location, propFullName) {
5386 if (typeof typeChecker !== 'function') {
5387 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5388 }
5389 var propValue = props[propName];
5390 if (!Array.isArray(propValue)) {
5391 var propType = getPropType(propValue);
5392 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5393 }
5394 for (var i = 0; i < propValue.length; i++) {
5395 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5396 if (error instanceof Error) {
5397 return error;
5398 }
5399 }
5400 return null;
5401 }
5402 return createChainableTypeChecker(validate);
5403 }
5404
5405 function createElementTypeChecker() {
5406 function validate(props, propName, componentName, location, propFullName) {
5407 var propValue = props[propName];
5408 if (!isValidElement(propValue)) {
5409 var propType = getPropType(propValue);
5410 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5411 }
5412 return null;
5413 }
5414 return createChainableTypeChecker(validate);
5415 }
5416
5417 function createElementTypeTypeChecker() {
5418 function validate(props, propName, componentName, location, propFullName) {
5419 var propValue = props[propName];
5420 if (!ReactIs.isValidElementType(propValue)) {
5421 var propType = getPropType(propValue);
5422 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5423 }
5424 return null;
5425 }
5426 return createChainableTypeChecker(validate);
5427 }
5428
5429 function createInstanceTypeChecker(expectedClass) {
5430 function validate(props, propName, componentName, location, propFullName) {
5431 if (!(props[propName] instanceof expectedClass)) {
5432 var expectedClassName = expectedClass.name || ANONYMOUS;
5433 var actualClassName = getClassName(props[propName]);
5434 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5435 }
5436 return null;
5437 }
5438 return createChainableTypeChecker(validate);
5439 }
5440
5441 function createEnumTypeChecker(expectedValues) {
5442 if (!Array.isArray(expectedValues)) {
5443 if (true) {
5444 if (arguments.length > 1) {
5445 printWarning(
5446 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
5447 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
5448 );
5449 } else {
5450 printWarning('Invalid argument supplied to oneOf, expected an array.');
5451 }
5452 }
5453 return emptyFunctionThatReturnsNull;
5454 }
5455
5456 function validate(props, propName, componentName, location, propFullName) {
5457 var propValue = props[propName];
5458 for (var i = 0; i < expectedValues.length; i++) {
5459 if (is(propValue, expectedValues[i])) {
5460 return null;
5461 }
5462 }
5463
5464 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5465 var type = getPreciseType(value);
5466 if (type === 'symbol') {
5467 return String(value);
5468 }
5469 return value;
5470 });
5471 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5472 }
5473 return createChainableTypeChecker(validate);
5474 }
5475
5476 function createObjectOfTypeChecker(typeChecker) {
5477 function validate(props, propName, componentName, location, propFullName) {
5478 if (typeof typeChecker !== 'function') {
5479 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5480 }
5481 var propValue = props[propName];
5482 var propType = getPropType(propValue);
5483 if (propType !== 'object') {
5484 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5485 }
5486 for (var key in propValue) {
5487 if (has(propValue, key)) {
5488 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5489 if (error instanceof Error) {
5490 return error;
5491 }
5492 }
5493 }
5494 return null;
5495 }
5496 return createChainableTypeChecker(validate);
5497 }
5498
5499 function createUnionTypeChecker(arrayOfTypeCheckers) {
5500 if (!Array.isArray(arrayOfTypeCheckers)) {
5501 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
5502 return emptyFunctionThatReturnsNull;
5503 }
5504
5505 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5506 var checker = arrayOfTypeCheckers[i];
5507 if (typeof checker !== 'function') {
5508 printWarning(
5509 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
5510 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
5511 );
5512 return emptyFunctionThatReturnsNull;
5513 }
5514 }
5515
5516 function validate(props, propName, componentName, location, propFullName) {
5517 var expectedTypes = [];
5518 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5519 var checker = arrayOfTypeCheckers[i];
5520 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5521 if (checkerResult == null) {
5522 return null;
5523 }
5524 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5525 expectedTypes.push(checkerResult.data.expectedType);
5526 }
5527 }
5528 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
5529 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5530 }
5531 return createChainableTypeChecker(validate);
5532 }
5533
5534 function createNodeChecker() {
5535 function validate(props, propName, componentName, location, propFullName) {
5536 if (!isNode(props[propName])) {
5537 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5538 }
5539 return null;
5540 }
5541 return createChainableTypeChecker(validate);
5542 }
5543
5544 function invalidValidatorError(componentName, location, propFullName, key, type) {
5545 return new PropTypeError(
5546 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
5547 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
5548 );
5549 }
5550
5551 function createShapeTypeChecker(shapeTypes) {
5552 function validate(props, propName, componentName, location, propFullName) {
5553 var propValue = props[propName];
5554 var propType = getPropType(propValue);
5555 if (propType !== 'object') {
5556 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5557 }
5558 for (var key in shapeTypes) {
5559 var checker = shapeTypes[key];
5560 if (typeof checker !== 'function') {
5561 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5562 }
5563 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5564 if (error) {
5565 return error;
5566 }
5567 }
5568 return null;
5569 }
5570 return createChainableTypeChecker(validate);
5571 }
5572
5573 function createStrictShapeTypeChecker(shapeTypes) {
5574 function validate(props, propName, componentName, location, propFullName) {
5575 var propValue = props[propName];
5576 var propType = getPropType(propValue);
5577 if (propType !== 'object') {
5578 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5579 }
5580 // We need to check all keys in case some are required but missing from props.
5581 var allKeys = assign({}, props[propName], shapeTypes);
5582 for (var key in allKeys) {
5583 var checker = shapeTypes[key];
5584 if (has(shapeTypes, key) && typeof checker !== 'function') {
5585 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5586 }
5587 if (!checker) {
5588 return new PropTypeError(
5589 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
5590 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
5591 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
5592 );
5593 }
5594 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5595 if (error) {
5596 return error;
5597 }
5598 }
5599 return null;
5600 }
5601
5602 return createChainableTypeChecker(validate);
5603 }
5604
5605 function isNode(propValue) {
5606 switch (typeof propValue) {
5607 case 'number':
5608 case 'string':
5609 case 'undefined':
5610 return true;
5611 case 'boolean':
5612 return !propValue;
5613 case 'object':
5614 if (Array.isArray(propValue)) {
5615 return propValue.every(isNode);
5616 }
5617 if (propValue === null || isValidElement(propValue)) {
5618 return true;
5619 }
5620
5621 var iteratorFn = getIteratorFn(propValue);
5622 if (iteratorFn) {
5623 var iterator = iteratorFn.call(propValue);
5624 var step;
5625 if (iteratorFn !== propValue.entries) {
5626 while (!(step = iterator.next()).done) {
5627 if (!isNode(step.value)) {
5628 return false;
5629 }
5630 }
5631 } else {
5632 // Iterator will provide entry [k,v] tuples rather than values.
5633 while (!(step = iterator.next()).done) {
5634 var entry = step.value;
5635 if (entry) {
5636 if (!isNode(entry[1])) {
5637 return false;
5638 }
5639 }
5640 }
5641 }
5642 } else {
5643 return false;
5644 }
5645
5646 return true;
5647 default:
5648 return false;
5649 }
5650 }
5651
5652 function isSymbol(propType, propValue) {
5653 // Native Symbol.
5654 if (propType === 'symbol') {
5655 return true;
5656 }
5657
5658 // falsy value can't be a Symbol
5659 if (!propValue) {
5660 return false;
5661 }
5662
5663 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5664 if (propValue['@@toStringTag'] === 'Symbol') {
5665 return true;
5666 }
5667
5668 // Fallback for non-spec compliant Symbols which are polyfilled.
5669 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
5670 return true;
5671 }
5672
5673 return false;
5674 }
5675
5676 // Equivalent of `typeof` but with special handling for array and regexp.
5677 function getPropType(propValue) {
5678 var propType = typeof propValue;
5679 if (Array.isArray(propValue)) {
5680 return 'array';
5681 }
5682 if (propValue instanceof RegExp) {
5683 // Old webkits (at least until Android 4.0) return 'function' rather than
5684 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
5685 // passes PropTypes.object.
5686 return 'object';
5687 }
5688 if (isSymbol(propType, propValue)) {
5689 return 'symbol';
5690 }
5691 return propType;
5692 }
5693
5694 // This handles more types than `getPropType`. Only used for error messages.
5695 // See `createPrimitiveTypeChecker`.
5696 function getPreciseType(propValue) {
5697 if (typeof propValue === 'undefined' || propValue === null) {
5698 return '' + propValue;
5699 }
5700 var propType = getPropType(propValue);
5701 if (propType === 'object') {
5702 if (propValue instanceof Date) {
5703 return 'date';
5704 } else if (propValue instanceof RegExp) {
5705 return 'regexp';
5706 }
5707 }
5708 return propType;
5709 }
5710
5711 // Returns a string that is postfixed to a warning about an invalid type.
5712 // For example, "undefined" or "of type array"
5713 function getPostfixForTypeWarning(value) {
5714 var type = getPreciseType(value);
5715 switch (type) {
5716 case 'array':
5717 case 'object':
5718 return 'an ' + type;
5719 case 'boolean':
5720 case 'date':
5721 case 'regexp':
5722 return 'a ' + type;
5723 default:
5724 return type;
5725 }
5726 }
5727
5728 // Returns class name of the object, if any.
5729 function getClassName(propValue) {
5730 if (!propValue.constructor || !propValue.constructor.name) {
5731 return ANONYMOUS;
5732 }
5733 return propValue.constructor.name;
5734 }
5735
5736 ReactPropTypes.checkPropTypes = checkPropTypes;
5737 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
5738 ReactPropTypes.PropTypes = ReactPropTypes;
5739
5740 return ReactPropTypes;
5741 };
5742
5743
5744 /***/ }),
5745
5746 /***/ "./node_modules/prop-types/index.js":
5747 /*!******************************************!*\
5748 !*** ./node_modules/prop-types/index.js ***!
5749 \******************************************/
5750 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5751
5752 /**
5753 * Copyright (c) 2013-present, Facebook, Inc.
5754 *
5755 * This source code is licensed under the MIT license found in the
5756 * LICENSE file in the root directory of this source tree.
5757 */
5758
5759 if (true) {
5760 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5761
5762 // By explicitly using `prop-types` you are opting into new development behavior.
5763 // http://fb.me/prop-types-in-prod
5764 var throwOnDirectAccess = true;
5765 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
5766 } else {}
5767
5768
5769 /***/ }),
5770
5771 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
5772 /*!*************************************************************!*\
5773 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
5774 \*************************************************************/
5775 /***/ ((module) => {
5776
5777 "use strict";
5778 /**
5779 * Copyright (c) 2013-present, Facebook, Inc.
5780 *
5781 * This source code is licensed under the MIT license found in the
5782 * LICENSE file in the root directory of this source tree.
5783 */
5784
5785
5786
5787 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5788
5789 module.exports = ReactPropTypesSecret;
5790
5791
5792 /***/ }),
5793
5794 /***/ "./node_modules/prop-types/lib/has.js":
5795 /*!********************************************!*\
5796 !*** ./node_modules/prop-types/lib/has.js ***!
5797 \********************************************/
5798 /***/ ((module) => {
5799
5800 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
5801
5802
5803 /***/ }),
5804
5805 /***/ "./node_modules/raven-js/src/configError.js":
5806 /*!**************************************************!*\
5807 !*** ./node_modules/raven-js/src/configError.js ***!
5808 \**************************************************/
5809 /***/ ((module) => {
5810
5811 function RavenConfigError(message) {
5812 this.name = 'RavenConfigError';
5813 this.message = message;
5814 }
5815 RavenConfigError.prototype = new Error();
5816 RavenConfigError.prototype.constructor = RavenConfigError;
5817
5818 module.exports = RavenConfigError;
5819
5820
5821 /***/ }),
5822
5823 /***/ "./node_modules/raven-js/src/console.js":
5824 /*!**********************************************!*\
5825 !*** ./node_modules/raven-js/src/console.js ***!
5826 \**********************************************/
5827 /***/ ((module) => {
5828
5829 var wrapMethod = function(console, level, callback) {
5830 var originalConsoleLevel = console[level];
5831 var originalConsole = console;
5832
5833 if (!(level in console)) {
5834 return;
5835 }
5836
5837 var sentryLevel = level === 'warn' ? 'warning' : level;
5838
5839 console[level] = function() {
5840 var args = [].slice.call(arguments);
5841
5842 var msg = '' + args.join(' ');
5843 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
5844
5845 if (level === 'assert') {
5846 if (args[0] === false) {
5847 // Default browsers message
5848 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
5849 data.extra.arguments = args.slice(1);
5850 callback && callback(msg, data);
5851 }
5852 } else {
5853 callback && callback(msg, data);
5854 }
5855
5856 // this fails for some browsers. :(
5857 if (originalConsoleLevel) {
5858 // IE9 doesn't allow calling apply on console functions directly
5859 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
5860 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
5861 }
5862 };
5863 };
5864
5865 module.exports = {
5866 wrapMethod: wrapMethod
5867 };
5868
5869
5870 /***/ }),
5871
5872 /***/ "./node_modules/raven-js/src/raven.js":
5873 /*!********************************************!*\
5874 !*** ./node_modules/raven-js/src/raven.js ***!
5875 \********************************************/
5876 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5877
5878 /*global XDomainRequest:false */
5879
5880 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
5881 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
5882 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
5883
5884 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
5885 var isError = utils.isError;
5886 var isObject = utils.isObject;
5887 var isObject = utils.isObject;
5888 var isErrorEvent = utils.isErrorEvent;
5889 var isUndefined = utils.isUndefined;
5890 var isFunction = utils.isFunction;
5891 var isString = utils.isString;
5892 var isEmptyObject = utils.isEmptyObject;
5893 var each = utils.each;
5894 var objectMerge = utils.objectMerge;
5895 var truncate = utils.truncate;
5896 var objectFrozen = utils.objectFrozen;
5897 var hasKey = utils.hasKey;
5898 var joinRegExp = utils.joinRegExp;
5899 var urlencode = utils.urlencode;
5900 var uuid4 = utils.uuid4;
5901 var htmlTreeAsString = utils.htmlTreeAsString;
5902 var isSameException = utils.isSameException;
5903 var isSameStacktrace = utils.isSameStacktrace;
5904 var parseUrl = utils.parseUrl;
5905 var fill = utils.fill;
5906
5907 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
5908
5909 var dsnKeys = 'source protocol user pass host port path'.split(' '),
5910 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
5911
5912 function now() {
5913 return +new Date();
5914 }
5915
5916 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
5917 var _window =
5918 typeof window !== 'undefined'
5919 ? window
5920 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
5921 var _document = _window.document;
5922 var _navigator = _window.navigator;
5923
5924 function keepOriginalCallback(original, callback) {
5925 return isFunction(callback)
5926 ? function(data) {
5927 return callback(data, original);
5928 }
5929 : callback;
5930 }
5931
5932 // First, check for JSON support
5933 // If there is no JSON, we no-op the core features of Raven
5934 // since JSON is required to encode the payload
5935 function Raven() {
5936 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
5937 // Raven can run in contexts where there's no document (react-native)
5938 this._hasDocument = !isUndefined(_document);
5939 this._hasNavigator = !isUndefined(_navigator);
5940 this._lastCapturedException = null;
5941 this._lastData = null;
5942 this._lastEventId = null;
5943 this._globalServer = null;
5944 this._globalKey = null;
5945 this._globalProject = null;
5946 this._globalContext = {};
5947 this._globalOptions = {
5948 logger: 'javascript',
5949 ignoreErrors: [],
5950 ignoreUrls: [],
5951 whitelistUrls: [],
5952 includePaths: [],
5953 collectWindowErrors: true,
5954 maxMessageLength: 0,
5955
5956 // By default, truncates URL values to 250 chars
5957 maxUrlLength: 250,
5958 stackTraceLimit: 50,
5959 autoBreadcrumbs: true,
5960 instrument: true,
5961 sampleRate: 1
5962 };
5963 this._ignoreOnError = 0;
5964 this._isRavenInstalled = false;
5965 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
5966 // capture references to window.console *and* all its methods first
5967 // before the console plugin has a chance to monkey patch
5968 this._originalConsole = _window.console || {};
5969 this._originalConsoleMethods = {};
5970 this._plugins = [];
5971 this._startTime = now();
5972 this._wrappedBuiltIns = [];
5973 this._breadcrumbs = [];
5974 this._lastCapturedEvent = null;
5975 this._keypressTimeout;
5976 this._location = _window.location;
5977 this._lastHref = this._location && this._location.href;
5978 this._resetBackoff();
5979
5980 // eslint-disable-next-line guard-for-in
5981 for (var method in this._originalConsole) {
5982 this._originalConsoleMethods[method] = this._originalConsole[method];
5983 }
5984 }
5985
5986 /*
5987 * The core Raven singleton
5988 *
5989 * @this {Raven}
5990 */
5991
5992 Raven.prototype = {
5993 // Hardcode version string so that raven source can be loaded directly via
5994 // webpack (using a build step causes webpack #1617). Grunt verifies that
5995 // this value matches package.json during build.
5996 // See: https://github.com/getsentry/raven-js/issues/465
5997 VERSION: '3.19.1',
5998
5999 debug: false,
6000
6001 TraceKit: TraceKit, // alias to TraceKit
6002
6003 /*
6004 * Configure Raven with a DSN and extra options
6005 *
6006 * @param {string} dsn The public Sentry DSN
6007 * @param {object} options Set of global options [optional]
6008 * @return {Raven}
6009 */
6010 config: function(dsn, options) {
6011 var self = this;
6012
6013 if (self._globalServer) {
6014 this._logDebug('error', 'Error: Raven has already been configured');
6015 return self;
6016 }
6017 if (!dsn) return self;
6018
6019 var globalOptions = self._globalOptions;
6020
6021 // merge in options
6022 if (options) {
6023 each(options, function(key, value) {
6024 // tags and extra are special and need to be put into context
6025 if (key === 'tags' || key === 'extra' || key === 'user') {
6026 self._globalContext[key] = value;
6027 } else {
6028 globalOptions[key] = value;
6029 }
6030 });
6031 }
6032
6033 self.setDSN(dsn);
6034
6035 // "Script error." is hard coded into browsers for errors that it can't read.
6036 // this is the result of a script being pulled in from an external domain and CORS.
6037 globalOptions.ignoreErrors.push(/^Script error\.?$/);
6038 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
6039
6040 // join regexp rules into one big rule
6041 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
6042 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
6043 ? joinRegExp(globalOptions.ignoreUrls)
6044 : false;
6045 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
6046 ? joinRegExp(globalOptions.whitelistUrls)
6047 : false;
6048 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
6049 globalOptions.maxBreadcrumbs = Math.max(
6050 0,
6051 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
6052 ); // default and hard limit is 100
6053
6054 var autoBreadcrumbDefaults = {
6055 xhr: true,
6056 console: true,
6057 dom: true,
6058 location: true
6059 };
6060
6061 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
6062 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
6063 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
6064 } else if (autoBreadcrumbs !== false) {
6065 autoBreadcrumbs = autoBreadcrumbDefaults;
6066 }
6067 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
6068
6069 var instrumentDefaults = {
6070 tryCatch: true
6071 };
6072
6073 var instrument = globalOptions.instrument;
6074 if ({}.toString.call(instrument) === '[object Object]') {
6075 instrument = objectMerge(instrumentDefaults, instrument);
6076 } else if (instrument !== false) {
6077 instrument = instrumentDefaults;
6078 }
6079 globalOptions.instrument = instrument;
6080
6081 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
6082
6083 // return for chaining
6084 return self;
6085 },
6086
6087 /*
6088 * Installs a global window.onerror error handler
6089 * to capture and report uncaught exceptions.
6090 * At this point, install() is required to be called due
6091 * to the way TraceKit is set up.
6092 *
6093 * @return {Raven}
6094 */
6095 install: function() {
6096 var self = this;
6097 if (self.isSetup() && !self._isRavenInstalled) {
6098 TraceKit.report.subscribe(function() {
6099 self._handleOnErrorStackInfo.apply(self, arguments);
6100 });
6101 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
6102 self._instrumentTryCatch();
6103 }
6104
6105 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
6106
6107 // Install all of the plugins
6108 self._drainPlugins();
6109
6110 self._isRavenInstalled = true;
6111 }
6112
6113 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
6114 return this;
6115 },
6116
6117 /*
6118 * Set the DSN (can be called multiple time unlike config)
6119 *
6120 * @param {string} dsn The public Sentry DSN
6121 */
6122 setDSN: function(dsn) {
6123 var self = this,
6124 uri = self._parseDSN(dsn),
6125 lastSlash = uri.path.lastIndexOf('/'),
6126 path = uri.path.substr(1, lastSlash);
6127
6128 self._dsn = dsn;
6129 self._globalKey = uri.user;
6130 self._globalSecret = uri.pass && uri.pass.substr(1);
6131 self._globalProject = uri.path.substr(lastSlash + 1);
6132
6133 self._globalServer = self._getGlobalServer(uri);
6134
6135 self._globalEndpoint =
6136 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
6137
6138 // Reset backoff state since we may be pointing at a
6139 // new project/server
6140 this._resetBackoff();
6141 },
6142
6143 /*
6144 * Wrap code within a context so Raven can capture errors
6145 * reliably across domains that is executed immediately.
6146 *
6147 * @param {object} options A specific set of options for this context [optional]
6148 * @param {function} func The callback to be immediately executed within the context
6149 * @param {array} args An array of arguments to be called with the callback [optional]
6150 */
6151 context: function(options, func, args) {
6152 if (isFunction(options)) {
6153 args = func || [];
6154 func = options;
6155 options = undefined;
6156 }
6157
6158 return this.wrap(options, func).apply(this, args);
6159 },
6160
6161 /*
6162 * Wrap code within a context and returns back a new function to be executed
6163 *
6164 * @param {object} options A specific set of options for this context [optional]
6165 * @param {function} func The function to be wrapped in a new context
6166 * @param {function} func A function to call before the try/catch wrapper [optional, private]
6167 * @return {function} The newly wrapped functions with a context
6168 */
6169 wrap: function(options, func, _before) {
6170 var self = this;
6171 // 1 argument has been passed, and it's not a function
6172 // so just return it
6173 if (isUndefined(func) && !isFunction(options)) {
6174 return options;
6175 }
6176
6177 // options is optional
6178 if (isFunction(options)) {
6179 func = options;
6180 options = undefined;
6181 }
6182
6183 // At this point, we've passed along 2 arguments, and the second one
6184 // is not a function either, so we'll just return the second argument.
6185 if (!isFunction(func)) {
6186 return func;
6187 }
6188
6189 // We don't wanna wrap it twice!
6190 try {
6191 if (func.__raven__) {
6192 return func;
6193 }
6194
6195 // If this has already been wrapped in the past, return that
6196 if (func.__raven_wrapper__) {
6197 return func.__raven_wrapper__;
6198 }
6199 } catch (e) {
6200 // Just accessing custom props in some Selenium environments
6201 // can cause a "Permission denied" exception (see raven-js#495).
6202 // Bail on wrapping and return the function as-is (defers to window.onerror).
6203 return func;
6204 }
6205
6206 function wrapped() {
6207 var args = [],
6208 i = arguments.length,
6209 deep = !options || (options && options.deep !== false);
6210
6211 if (_before && isFunction(_before)) {
6212 _before.apply(this, arguments);
6213 }
6214
6215 // Recursively wrap all of a function's arguments that are
6216 // functions themselves.
6217 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
6218
6219 try {
6220 // Attempt to invoke user-land function
6221 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
6222 // means Raven caught an error invoking your application code. This is
6223 // expected behavior and NOT indicative of a bug with Raven.js.
6224 return func.apply(this, args);
6225 } catch (e) {
6226 self._ignoreNextOnError();
6227 self.captureException(e, options);
6228 throw e;
6229 }
6230 }
6231
6232 // copy over properties of the old function
6233 for (var property in func) {
6234 if (hasKey(func, property)) {
6235 wrapped[property] = func[property];
6236 }
6237 }
6238 wrapped.prototype = func.prototype;
6239
6240 func.__raven_wrapper__ = wrapped;
6241 // Signal that this function has been wrapped already
6242 // for both debugging and to prevent it to being wrapped twice
6243 wrapped.__raven__ = true;
6244 wrapped.__inner__ = func;
6245
6246 return wrapped;
6247 },
6248
6249 /*
6250 * Uninstalls the global error handler.
6251 *
6252 * @return {Raven}
6253 */
6254 uninstall: function() {
6255 TraceKit.report.uninstall();
6256
6257 this._restoreBuiltIns();
6258
6259 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
6260 this._isRavenInstalled = false;
6261
6262 return this;
6263 },
6264
6265 /*
6266 * Manually capture an exception and send it over to Sentry
6267 *
6268 * @param {error} ex An exception to be logged
6269 * @param {object} options A specific set of options for this error [optional]
6270 * @return {Raven}
6271 */
6272 captureException: function(ex, options) {
6273 // Cases for sending ex as a message, rather than an exception
6274 var isNotError = !isError(ex);
6275 var isNotErrorEvent = !isErrorEvent(ex);
6276 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
6277
6278 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
6279 return this.captureMessage(
6280 ex,
6281 objectMerge(
6282 {
6283 trimHeadFrames: 1,
6284 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
6285 },
6286 options
6287 )
6288 );
6289 }
6290
6291 // Get actual Error from ErrorEvent
6292 if (isErrorEvent(ex)) ex = ex.error;
6293
6294 // Store the raw exception object for potential debugging and introspection
6295 this._lastCapturedException = ex;
6296
6297 // TraceKit.report will re-raise any exception passed to it,
6298 // which means you have to wrap it in try/catch. Instead, we
6299 // can wrap it here and only re-raise if TraceKit.report
6300 // raises an exception different from the one we asked to
6301 // report on.
6302 try {
6303 var stack = TraceKit.computeStackTrace(ex);
6304 this._handleStackInfo(stack, options);
6305 } catch (ex1) {
6306 if (ex !== ex1) {
6307 throw ex1;
6308 }
6309 }
6310
6311 return this;
6312 },
6313
6314 /*
6315 * Manually send a message to Sentry
6316 *
6317 * @param {string} msg A plain message to be captured in Sentry
6318 * @param {object} options A specific set of options for this message [optional]
6319 * @return {Raven}
6320 */
6321 captureMessage: function(msg, options) {
6322 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
6323 // early call; we'll error on the side of logging anything called before configuration since it's
6324 // probably something you should see:
6325 if (
6326 !!this._globalOptions.ignoreErrors.test &&
6327 this._globalOptions.ignoreErrors.test(msg)
6328 ) {
6329 return;
6330 }
6331
6332 options = options || {};
6333
6334 var data = objectMerge(
6335 {
6336 message: msg + '' // Make sure it's actually a string
6337 },
6338 options
6339 );
6340
6341 var ex;
6342 // Generate a "synthetic" stack trace from this point.
6343 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
6344 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
6345 // or if it catches a thrown object without a "stack" property.
6346 try {
6347 throw new Error(msg);
6348 } catch (ex1) {
6349 ex = ex1;
6350 }
6351
6352 // null exception name so `Error` isn't prefixed to msg
6353 ex.name = null;
6354 var stack = TraceKit.computeStackTrace(ex);
6355
6356 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
6357 var initialCall = stack.stack[1];
6358
6359 var fileurl = (initialCall && initialCall.url) || '';
6360
6361 if (
6362 !!this._globalOptions.ignoreUrls.test &&
6363 this._globalOptions.ignoreUrls.test(fileurl)
6364 ) {
6365 return;
6366 }
6367
6368 if (
6369 !!this._globalOptions.whitelistUrls.test &&
6370 !this._globalOptions.whitelistUrls.test(fileurl)
6371 ) {
6372 return;
6373 }
6374
6375 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
6376 options = objectMerge(
6377 {
6378 // fingerprint on msg, not stack trace (legacy behavior, could be
6379 // revisited)
6380 fingerprint: msg,
6381 // since we know this is a synthetic trace, the top N-most frames
6382 // MUST be from Raven.js, so mark them as in_app later by setting
6383 // trimHeadFrames
6384 trimHeadFrames: (options.trimHeadFrames || 0) + 1
6385 },
6386 options
6387 );
6388
6389 var frames = this._prepareFrames(stack, options);
6390 data.stacktrace = {
6391 // Sentry expects frames oldest to newest
6392 frames: frames.reverse()
6393 };
6394 }
6395
6396 // Fire away!
6397 this._send(data);
6398
6399 return this;
6400 },
6401
6402 captureBreadcrumb: function(obj) {
6403 var crumb = objectMerge(
6404 {
6405 timestamp: now() / 1000
6406 },
6407 obj
6408 );
6409
6410 if (isFunction(this._globalOptions.breadcrumbCallback)) {
6411 var result = this._globalOptions.breadcrumbCallback(crumb);
6412
6413 if (isObject(result) && !isEmptyObject(result)) {
6414 crumb = result;
6415 } else if (result === false) {
6416 return this;
6417 }
6418 }
6419
6420 this._breadcrumbs.push(crumb);
6421 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
6422 this._breadcrumbs.shift();
6423 }
6424 return this;
6425 },
6426
6427 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
6428 var pluginArgs = [].slice.call(arguments, 1);
6429
6430 this._plugins.push([plugin, pluginArgs]);
6431 if (this._isRavenInstalled) {
6432 this._drainPlugins();
6433 }
6434
6435 return this;
6436 },
6437
6438 /*
6439 * Set/clear a user to be sent along with the payload.
6440 *
6441 * @param {object} user An object representing user data [optional]
6442 * @return {Raven}
6443 */
6444 setUserContext: function(user) {
6445 // Intentionally do not merge here since that's an unexpected behavior.
6446 this._globalContext.user = user;
6447
6448 return this;
6449 },
6450
6451 /*
6452 * Merge extra attributes to be sent along with the payload.
6453 *
6454 * @param {object} extra An object representing extra data [optional]
6455 * @return {Raven}
6456 */
6457 setExtraContext: function(extra) {
6458 this._mergeContext('extra', extra);
6459
6460 return this;
6461 },
6462
6463 /*
6464 * Merge tags to be sent along with the payload.
6465 *
6466 * @param {object} tags An object representing tags [optional]
6467 * @return {Raven}
6468 */
6469 setTagsContext: function(tags) {
6470 this._mergeContext('tags', tags);
6471
6472 return this;
6473 },
6474
6475 /*
6476 * Clear all of the context.
6477 *
6478 * @return {Raven}
6479 */
6480 clearContext: function() {
6481 this._globalContext = {};
6482
6483 return this;
6484 },
6485
6486 /*
6487 * Get a copy of the current context. This cannot be mutated.
6488 *
6489 * @return {object} copy of context
6490 */
6491 getContext: function() {
6492 // lol javascript
6493 return JSON.parse(stringify(this._globalContext));
6494 },
6495
6496 /*
6497 * Set environment of application
6498 *
6499 * @param {string} environment Typically something like 'production'.
6500 * @return {Raven}
6501 */
6502 setEnvironment: function(environment) {
6503 this._globalOptions.environment = environment;
6504
6505 return this;
6506 },
6507
6508 /*
6509 * Set release version of application
6510 *
6511 * @param {string} release Typically something like a git SHA to identify version
6512 * @return {Raven}
6513 */
6514 setRelease: function(release) {
6515 this._globalOptions.release = release;
6516
6517 return this;
6518 },
6519
6520 /*
6521 * Set the dataCallback option
6522 *
6523 * @param {function} callback The callback to run which allows the
6524 * data blob to be mutated before sending
6525 * @return {Raven}
6526 */
6527 setDataCallback: function(callback) {
6528 var original = this._globalOptions.dataCallback;
6529 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
6530 return this;
6531 },
6532
6533 /*
6534 * Set the breadcrumbCallback option
6535 *
6536 * @param {function} callback The callback to run which allows filtering
6537 * or mutating breadcrumbs
6538 * @return {Raven}
6539 */
6540 setBreadcrumbCallback: function(callback) {
6541 var original = this._globalOptions.breadcrumbCallback;
6542 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
6543 return this;
6544 },
6545
6546 /*
6547 * Set the shouldSendCallback option
6548 *
6549 * @param {function} callback The callback to run which allows
6550 * introspecting the blob before sending
6551 * @return {Raven}
6552 */
6553 setShouldSendCallback: function(callback) {
6554 var original = this._globalOptions.shouldSendCallback;
6555 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
6556 return this;
6557 },
6558
6559 /**
6560 * Override the default HTTP transport mechanism that transmits data
6561 * to the Sentry server.
6562 *
6563 * @param {function} transport Function invoked instead of the default
6564 * `makeRequest` handler.
6565 *
6566 * @return {Raven}
6567 */
6568 setTransport: function(transport) {
6569 this._globalOptions.transport = transport;
6570
6571 return this;
6572 },
6573
6574 /*
6575 * Get the latest raw exception that was captured by Raven.
6576 *
6577 * @return {error}
6578 */
6579 lastException: function() {
6580 return this._lastCapturedException;
6581 },
6582
6583 /*
6584 * Get the last event id
6585 *
6586 * @return {string}
6587 */
6588 lastEventId: function() {
6589 return this._lastEventId;
6590 },
6591
6592 /*
6593 * Determine if Raven is setup and ready to go.
6594 *
6595 * @return {boolean}
6596 */
6597 isSetup: function() {
6598 if (!this._hasJSON) return false; // needs JSON support
6599 if (!this._globalServer) {
6600 if (!this.ravenNotConfiguredError) {
6601 this.ravenNotConfiguredError = true;
6602 this._logDebug('error', 'Error: Raven has not been configured.');
6603 }
6604 return false;
6605 }
6606 return true;
6607 },
6608
6609 afterLoad: function() {
6610 // TODO: remove window dependence?
6611
6612 // Attempt to initialize Raven on load
6613 var RavenConfig = _window.RavenConfig;
6614 if (RavenConfig) {
6615 this.config(RavenConfig.dsn, RavenConfig.config).install();
6616 }
6617 },
6618
6619 showReportDialog: function(options) {
6620 if (
6621 !_document // doesn't work without a document (React native)
6622 )
6623 return;
6624
6625 options = options || {};
6626
6627 var lastEventId = options.eventId || this.lastEventId();
6628 if (!lastEventId) {
6629 throw new RavenConfigError('Missing eventId');
6630 }
6631
6632 var dsn = options.dsn || this._dsn;
6633 if (!dsn) {
6634 throw new RavenConfigError('Missing DSN');
6635 }
6636
6637 var encode = encodeURIComponent;
6638 var qs = '';
6639 qs += '?eventId=' + encode(lastEventId);
6640 qs += '&dsn=' + encode(dsn);
6641
6642 var user = options.user || this._globalContext.user;
6643 if (user) {
6644 if (user.name) qs += '&name=' + encode(user.name);
6645 if (user.email) qs += '&email=' + encode(user.email);
6646 }
6647
6648 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
6649
6650 var script = _document.createElement('script');
6651 script.async = true;
6652 script.src = globalServer + '/api/embed/error-page/' + qs;
6653 (_document.head || _document.body).appendChild(script);
6654 },
6655
6656 /**** Private functions ****/
6657 _ignoreNextOnError: function() {
6658 var self = this;
6659 this._ignoreOnError += 1;
6660 setTimeout(function() {
6661 // onerror should trigger before setTimeout
6662 self._ignoreOnError -= 1;
6663 });
6664 },
6665
6666 _triggerEvent: function(eventType, options) {
6667 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
6668 var evt, key;
6669
6670 if (!this._hasDocument) return;
6671
6672 options = options || {};
6673
6674 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
6675
6676 if (_document.createEvent) {
6677 evt = _document.createEvent('HTMLEvents');
6678 evt.initEvent(eventType, true, true);
6679 } else {
6680 evt = _document.createEventObject();
6681 evt.eventType = eventType;
6682 }
6683
6684 for (key in options)
6685 if (hasKey(options, key)) {
6686 evt[key] = options[key];
6687 }
6688
6689 if (_document.createEvent) {
6690 // IE9 if standards
6691 _document.dispatchEvent(evt);
6692 } else {
6693 // IE8 regardless of Quirks or Standards
6694 // IE9 if quirks
6695 try {
6696 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
6697 } catch (e) {
6698 // Do nothing
6699 }
6700 }
6701 },
6702
6703 /**
6704 * Wraps addEventListener to capture UI breadcrumbs
6705 * @param evtName the event name (e.g. "click")
6706 * @returns {Function}
6707 * @private
6708 */
6709 _breadcrumbEventHandler: function(evtName) {
6710 var self = this;
6711 return function(evt) {
6712 // reset keypress timeout; e.g. triggering a 'click' after
6713 // a 'keypress' will reset the keypress debounce so that a new
6714 // set of keypresses can be recorded
6715 self._keypressTimeout = null;
6716
6717 // It's possible this handler might trigger multiple times for the same
6718 // event (e.g. event propagation through node ancestors). Ignore if we've
6719 // already captured the event.
6720 if (self._lastCapturedEvent === evt) return;
6721
6722 self._lastCapturedEvent = evt;
6723
6724 // try/catch both:
6725 // - accessing evt.target (see getsentry/raven-js#838, #768)
6726 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
6727 // can throw an exception in some circumstances.
6728 var target;
6729 try {
6730 target = htmlTreeAsString(evt.target);
6731 } catch (e) {
6732 target = '<unknown>';
6733 }
6734
6735 self.captureBreadcrumb({
6736 category: 'ui.' + evtName, // e.g. ui.click, ui.input
6737 message: target
6738 });
6739 };
6740 },
6741
6742 /**
6743 * Wraps addEventListener to capture keypress UI events
6744 * @returns {Function}
6745 * @private
6746 */
6747 _keypressEventHandler: function() {
6748 var self = this,
6749 debounceDuration = 1000; // milliseconds
6750
6751 // TODO: if somehow user switches keypress target before
6752 // debounce timeout is triggered, we will only capture
6753 // a single breadcrumb from the FIRST target (acceptable?)
6754 return function(evt) {
6755 var target;
6756 try {
6757 target = evt.target;
6758 } catch (e) {
6759 // just accessing event properties can throw an exception in some rare circumstances
6760 // see: https://github.com/getsentry/raven-js/issues/838
6761 return;
6762 }
6763 var tagName = target && target.tagName;
6764
6765 // only consider keypress events on actual input elements
6766 // this will disregard keypresses targeting body (e.g. tabbing
6767 // through elements, hotkeys, etc)
6768 if (
6769 !tagName ||
6770 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
6771 )
6772 return;
6773
6774 // record first keypress in a series, but ignore subsequent
6775 // keypresses until debounce clears
6776 var timeout = self._keypressTimeout;
6777 if (!timeout) {
6778 self._breadcrumbEventHandler('input')(evt);
6779 }
6780 clearTimeout(timeout);
6781 self._keypressTimeout = setTimeout(function() {
6782 self._keypressTimeout = null;
6783 }, debounceDuration);
6784 };
6785 },
6786
6787 /**
6788 * Captures a breadcrumb of type "navigation", normalizing input URLs
6789 * @param to the originating URL
6790 * @param from the target URL
6791 * @private
6792 */
6793 _captureUrlChange: function(from, to) {
6794 var parsedLoc = parseUrl(this._location.href);
6795 var parsedTo = parseUrl(to);
6796 var parsedFrom = parseUrl(from);
6797
6798 // because onpopstate only tells you the "new" (to) value of location.href, and
6799 // not the previous (from) value, we need to track the value of the current URL
6800 // state ourselves
6801 this._lastHref = to;
6802
6803 // Use only the path component of the URL if the URL matches the current
6804 // document (almost all the time when using pushState)
6805 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
6806 to = parsedTo.relative;
6807 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
6808 from = parsedFrom.relative;
6809
6810 this.captureBreadcrumb({
6811 category: 'navigation',
6812 data: {
6813 to: to,
6814 from: from
6815 }
6816 });
6817 },
6818
6819 /**
6820 * Wrap timer functions and event targets to catch errors and provide
6821 * better metadata.
6822 */
6823 _instrumentTryCatch: function() {
6824 var self = this;
6825
6826 var wrappedBuiltIns = self._wrappedBuiltIns;
6827
6828 function wrapTimeFn(orig) {
6829 return function(fn, t) {
6830 // preserve arity
6831 // Make a copy of the arguments to prevent deoptimization
6832 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6833 var args = new Array(arguments.length);
6834 for (var i = 0; i < args.length; ++i) {
6835 args[i] = arguments[i];
6836 }
6837 var originalCallback = args[0];
6838 if (isFunction(originalCallback)) {
6839 args[0] = self.wrap(originalCallback);
6840 }
6841
6842 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
6843 // also supports only two arguments and doesn't care what this is, so we
6844 // can just call the original function directly.
6845 if (orig.apply) {
6846 return orig.apply(this, args);
6847 } else {
6848 return orig(args[0], args[1]);
6849 }
6850 };
6851 }
6852
6853 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6854
6855 function wrapEventTarget(global) {
6856 var proto = _window[global] && _window[global].prototype;
6857 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
6858 fill(
6859 proto,
6860 'addEventListener',
6861 function(orig) {
6862 return function(evtName, fn, capture, secure) {
6863 // preserve arity
6864 try {
6865 if (fn && fn.handleEvent) {
6866 fn.handleEvent = self.wrap(fn.handleEvent);
6867 }
6868 } catch (err) {
6869 // can sometimes get 'Permission denied to access property "handle Event'
6870 }
6871
6872 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
6873 // so that we don't have more than one wrapper function
6874 var before, clickHandler, keypressHandler;
6875
6876 if (
6877 autoBreadcrumbs &&
6878 autoBreadcrumbs.dom &&
6879 (global === 'EventTarget' || global === 'Node')
6880 ) {
6881 // NOTE: generating multiple handlers per addEventListener invocation, should
6882 // revisit and verify we can just use one (almost certainly)
6883 clickHandler = self._breadcrumbEventHandler('click');
6884 keypressHandler = self._keypressEventHandler();
6885 before = function(evt) {
6886 // need to intercept every DOM event in `before` argument, in case that
6887 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
6888 // see #724
6889 if (!evt) return;
6890
6891 var eventType;
6892 try {
6893 eventType = evt.type;
6894 } catch (e) {
6895 // just accessing event properties can throw an exception in some rare circumstances
6896 // see: https://github.com/getsentry/raven-js/issues/838
6897 return;
6898 }
6899 if (eventType === 'click') return clickHandler(evt);
6900 else if (eventType === 'keypress') return keypressHandler(evt);
6901 };
6902 }
6903 return orig.call(
6904 this,
6905 evtName,
6906 self.wrap(fn, undefined, before),
6907 capture,
6908 secure
6909 );
6910 };
6911 },
6912 wrappedBuiltIns
6913 );
6914 fill(
6915 proto,
6916 'removeEventListener',
6917 function(orig) {
6918 return function(evt, fn, capture, secure) {
6919 try {
6920 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
6921 } catch (e) {
6922 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
6923 }
6924 return orig.call(this, evt, fn, capture, secure);
6925 };
6926 },
6927 wrappedBuiltIns
6928 );
6929 }
6930 }
6931
6932 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
6933 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
6934 if (_window.requestAnimationFrame) {
6935 fill(
6936 _window,
6937 'requestAnimationFrame',
6938 function(orig) {
6939 return function(cb) {
6940 return orig(self.wrap(cb));
6941 };
6942 },
6943 wrappedBuiltIns
6944 );
6945 }
6946
6947 // event targets borrowed from bugsnag-js:
6948 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
6949 var eventTargets = [
6950 'EventTarget',
6951 'Window',
6952 'Node',
6953 'ApplicationCache',
6954 'AudioTrackList',
6955 'ChannelMergerNode',
6956 'CryptoOperation',
6957 'EventSource',
6958 'FileReader',
6959 'HTMLUnknownElement',
6960 'IDBDatabase',
6961 'IDBRequest',
6962 'IDBTransaction',
6963 'KeyOperation',
6964 'MediaController',
6965 'MessagePort',
6966 'ModalWindow',
6967 'Notification',
6968 'SVGElementInstance',
6969 'Screen',
6970 'TextTrack',
6971 'TextTrackCue',
6972 'TextTrackList',
6973 'WebSocket',
6974 'WebSocketWorker',
6975 'Worker',
6976 'XMLHttpRequest',
6977 'XMLHttpRequestEventTarget',
6978 'XMLHttpRequestUpload'
6979 ];
6980 for (var i = 0; i < eventTargets.length; i++) {
6981 wrapEventTarget(eventTargets[i]);
6982 }
6983 },
6984
6985 /**
6986 * Instrument browser built-ins w/ breadcrumb capturing
6987 * - XMLHttpRequests
6988 * - DOM interactions (click/typing)
6989 * - window.location changes
6990 * - console
6991 *
6992 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
6993 */
6994 _instrumentBreadcrumbs: function() {
6995 var self = this;
6996 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6997
6998 var wrappedBuiltIns = self._wrappedBuiltIns;
6999
7000 function wrapProp(prop, xhr) {
7001 if (prop in xhr && isFunction(xhr[prop])) {
7002 fill(xhr, prop, function(orig) {
7003 return self.wrap(orig);
7004 }); // intentionally don't track filled methods on XHR instances
7005 }
7006 }
7007
7008 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
7009 var xhrproto = XMLHttpRequest.prototype;
7010 fill(
7011 xhrproto,
7012 'open',
7013 function(origOpen) {
7014 return function(method, url) {
7015 // preserve arity
7016
7017 // if Sentry key appears in URL, don't capture
7018 if (isString(url) && url.indexOf(self._globalKey) === -1) {
7019 this.__raven_xhr = {
7020 method: method,
7021 url: url,
7022 status_code: null
7023 };
7024 }
7025
7026 return origOpen.apply(this, arguments);
7027 };
7028 },
7029 wrappedBuiltIns
7030 );
7031
7032 fill(
7033 xhrproto,
7034 'send',
7035 function(origSend) {
7036 return function(data) {
7037 // preserve arity
7038 var xhr = this;
7039
7040 function onreadystatechangeHandler() {
7041 if (xhr.__raven_xhr && xhr.readyState === 4) {
7042 try {
7043 // touching statusCode in some platforms throws
7044 // an exception
7045 xhr.__raven_xhr.status_code = xhr.status;
7046 } catch (e) {
7047 /* do nothing */
7048 }
7049
7050 self.captureBreadcrumb({
7051 type: 'http',
7052 category: 'xhr',
7053 data: xhr.__raven_xhr
7054 });
7055 }
7056 }
7057
7058 var props = ['onload', 'onerror', 'onprogress'];
7059 for (var j = 0; j < props.length; j++) {
7060 wrapProp(props[j], xhr);
7061 }
7062
7063 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
7064 fill(
7065 xhr,
7066 'onreadystatechange',
7067 function(orig) {
7068 return self.wrap(orig, undefined, onreadystatechangeHandler);
7069 } /* intentionally don't track this instrumentation */
7070 );
7071 } else {
7072 // if onreadystatechange wasn't actually set by the page on this xhr, we
7073 // are free to set our own and capture the breadcrumb
7074 xhr.onreadystatechange = onreadystatechangeHandler;
7075 }
7076
7077 return origSend.apply(this, arguments);
7078 };
7079 },
7080 wrappedBuiltIns
7081 );
7082 }
7083
7084 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
7085 fill(
7086 _window,
7087 'fetch',
7088 function(origFetch) {
7089 return function(fn, t) {
7090 // preserve arity
7091 // Make a copy of the arguments to prevent deoptimization
7092 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
7093 var args = new Array(arguments.length);
7094 for (var i = 0; i < args.length; ++i) {
7095 args[i] = arguments[i];
7096 }
7097
7098 var fetchInput = args[0];
7099 var method = 'GET';
7100 var url;
7101
7102 if (typeof fetchInput === 'string') {
7103 url = fetchInput;
7104 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
7105 url = fetchInput.url;
7106 if (fetchInput.method) {
7107 method = fetchInput.method;
7108 }
7109 } else {
7110 url = '' + fetchInput;
7111 }
7112
7113 if (args[1] && args[1].method) {
7114 method = args[1].method;
7115 }
7116
7117 var fetchData = {
7118 method: method,
7119 url: url,
7120 status_code: null
7121 };
7122
7123 self.captureBreadcrumb({
7124 type: 'http',
7125 category: 'fetch',
7126 data: fetchData
7127 });
7128
7129 return origFetch.apply(this, args).then(function(response) {
7130 fetchData.status_code = response.status;
7131
7132 return response;
7133 });
7134 };
7135 },
7136 wrappedBuiltIns
7137 );
7138 }
7139
7140 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
7141 // to the document. Do this before we instrument addEventListener.
7142 if (autoBreadcrumbs.dom && this._hasDocument) {
7143 if (_document.addEventListener) {
7144 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
7145 _document.addEventListener('keypress', self._keypressEventHandler(), false);
7146 } else {
7147 // IE8 Compatibility
7148 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
7149 _document.attachEvent('onkeypress', self._keypressEventHandler());
7150 }
7151 }
7152
7153 // record navigation (URL) changes
7154 // NOTE: in Chrome App environment, touching history.pushState, *even inside
7155 // a try/catch block*, will cause Chrome to output an error to console.error
7156 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
7157 var chrome = _window.chrome;
7158 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
7159 var hasPushAndReplaceState =
7160 !isChromePackagedApp &&
7161 _window.history &&
7162 history.pushState &&
7163 history.replaceState;
7164 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
7165 // TODO: remove onpopstate handler on uninstall()
7166 var oldOnPopState = _window.onpopstate;
7167 _window.onpopstate = function() {
7168 var currentHref = self._location.href;
7169 self._captureUrlChange(self._lastHref, currentHref);
7170
7171 if (oldOnPopState) {
7172 return oldOnPopState.apply(this, arguments);
7173 }
7174 };
7175
7176 var historyReplacementFunction = function(origHistFunction) {
7177 // note history.pushState.length is 0; intentionally not declaring
7178 // params to preserve 0 arity
7179 return function(/* state, title, url */) {
7180 var url = arguments.length > 2 ? arguments[2] : undefined;
7181
7182 // url argument is optional
7183 if (url) {
7184 // coerce to string (this is what pushState does)
7185 self._captureUrlChange(self._lastHref, url + '');
7186 }
7187
7188 return origHistFunction.apply(this, arguments);
7189 };
7190 };
7191
7192 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
7193 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
7194 }
7195
7196 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
7197 // console
7198 var consoleMethodCallback = function(msg, data) {
7199 self.captureBreadcrumb({
7200 message: msg,
7201 level: data.level,
7202 category: 'console'
7203 });
7204 };
7205
7206 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
7207 wrapConsoleMethod(console, level, consoleMethodCallback);
7208 });
7209 }
7210 },
7211
7212 _restoreBuiltIns: function() {
7213 // restore any wrapped builtins
7214 var builtin;
7215 while (this._wrappedBuiltIns.length) {
7216 builtin = this._wrappedBuiltIns.shift();
7217
7218 var obj = builtin[0],
7219 name = builtin[1],
7220 orig = builtin[2];
7221
7222 obj[name] = orig;
7223 }
7224 },
7225
7226 _drainPlugins: function() {
7227 var self = this;
7228
7229 // FIX ME TODO
7230 each(this._plugins, function(_, plugin) {
7231 var installer = plugin[0];
7232 var args = plugin[1];
7233 installer.apply(self, [self].concat(args));
7234 });
7235 },
7236
7237 _parseDSN: function(str) {
7238 var m = dsnPattern.exec(str),
7239 dsn = {},
7240 i = 7;
7241
7242 try {
7243 while (i--) dsn[dsnKeys[i]] = m[i] || '';
7244 } catch (e) {
7245 throw new RavenConfigError('Invalid DSN: ' + str);
7246 }
7247
7248 if (dsn.pass && !this._globalOptions.allowSecretKey) {
7249 throw new RavenConfigError(
7250 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
7251 );
7252 }
7253
7254 return dsn;
7255 },
7256
7257 _getGlobalServer: function(uri) {
7258 // assemble the endpoint from the uri pieces
7259 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
7260
7261 if (uri.protocol) {
7262 globalServer = uri.protocol + ':' + globalServer;
7263 }
7264 return globalServer;
7265 },
7266
7267 _handleOnErrorStackInfo: function() {
7268 // if we are intentionally ignoring errors via onerror, bail out
7269 if (!this._ignoreOnError) {
7270 this._handleStackInfo.apply(this, arguments);
7271 }
7272 },
7273
7274 _handleStackInfo: function(stackInfo, options) {
7275 var frames = this._prepareFrames(stackInfo, options);
7276
7277 this._triggerEvent('handle', {
7278 stackInfo: stackInfo,
7279 options: options
7280 });
7281
7282 this._processException(
7283 stackInfo.name,
7284 stackInfo.message,
7285 stackInfo.url,
7286 stackInfo.lineno,
7287 frames,
7288 options
7289 );
7290 },
7291
7292 _prepareFrames: function(stackInfo, options) {
7293 var self = this;
7294 var frames = [];
7295 if (stackInfo.stack && stackInfo.stack.length) {
7296 each(stackInfo.stack, function(i, stack) {
7297 var frame = self._normalizeFrame(stack, stackInfo.url);
7298 if (frame) {
7299 frames.push(frame);
7300 }
7301 });
7302
7303 // e.g. frames captured via captureMessage throw
7304 if (options && options.trimHeadFrames) {
7305 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
7306 frames[j].in_app = false;
7307 }
7308 }
7309 }
7310 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
7311 return frames;
7312 },
7313
7314 _normalizeFrame: function(frame, stackInfoUrl) {
7315 // normalize the frames data
7316 var normalized = {
7317 filename: frame.url,
7318 lineno: frame.line,
7319 colno: frame.column,
7320 function: frame.func || '?'
7321 };
7322
7323 // Case when we don't have any information about the error
7324 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
7325 // Generating synthetic error doesn't add any value here
7326 //
7327 // We should probably somehow let a user know that they should fix their code
7328 if (!frame.url) {
7329 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
7330 }
7331
7332 normalized.in_app = !// determine if an exception came from outside of our app
7333 // first we check the global includePaths list.
7334 (
7335 (!!this._globalOptions.includePaths.test &&
7336 !this._globalOptions.includePaths.test(normalized.filename)) ||
7337 // Now we check for fun, if the function name is Raven or TraceKit
7338 /(Raven|TraceKit)\./.test(normalized['function']) ||
7339 // finally, we do a last ditch effort and check for raven.min.js
7340 /raven\.(min\.)?js$/.test(normalized.filename)
7341 );
7342
7343 return normalized;
7344 },
7345
7346 _processException: function(type, message, fileurl, lineno, frames, options) {
7347 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
7348 if (
7349 !!this._globalOptions.ignoreErrors.test &&
7350 (this._globalOptions.ignoreErrors.test(message) ||
7351 this._globalOptions.ignoreErrors.test(prefixedMessage))
7352 ) {
7353 return;
7354 }
7355
7356 var stacktrace;
7357
7358 if (frames && frames.length) {
7359 fileurl = frames[0].filename || fileurl;
7360 // Sentry expects frames oldest to newest
7361 // and JS sends them as newest to oldest
7362 frames.reverse();
7363 stacktrace = {frames: frames};
7364 } else if (fileurl) {
7365 stacktrace = {
7366 frames: [
7367 {
7368 filename: fileurl,
7369 lineno: lineno,
7370 in_app: true
7371 }
7372 ]
7373 };
7374 }
7375
7376 if (
7377 !!this._globalOptions.ignoreUrls.test &&
7378 this._globalOptions.ignoreUrls.test(fileurl)
7379 ) {
7380 return;
7381 }
7382
7383 if (
7384 !!this._globalOptions.whitelistUrls.test &&
7385 !this._globalOptions.whitelistUrls.test(fileurl)
7386 ) {
7387 return;
7388 }
7389
7390 var data = objectMerge(
7391 {
7392 // sentry.interfaces.Exception
7393 exception: {
7394 values: [
7395 {
7396 type: type,
7397 value: message,
7398 stacktrace: stacktrace
7399 }
7400 ]
7401 },
7402 culprit: fileurl
7403 },
7404 options
7405 );
7406
7407 // Fire away!
7408 this._send(data);
7409 },
7410
7411 _trimPacket: function(data) {
7412 // For now, we only want to truncate the two different messages
7413 // but this could/should be expanded to just trim everything
7414 var max = this._globalOptions.maxMessageLength;
7415 if (data.message) {
7416 data.message = truncate(data.message, max);
7417 }
7418 if (data.exception) {
7419 var exception = data.exception.values[0];
7420 exception.value = truncate(exception.value, max);
7421 }
7422
7423 var request = data.request;
7424 if (request) {
7425 if (request.url) {
7426 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
7427 }
7428 if (request.Referer) {
7429 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
7430 }
7431 }
7432
7433 if (data.breadcrumbs && data.breadcrumbs.values)
7434 this._trimBreadcrumbs(data.breadcrumbs);
7435
7436 return data;
7437 },
7438
7439 /**
7440 * Truncate breadcrumb values (right now just URLs)
7441 */
7442 _trimBreadcrumbs: function(breadcrumbs) {
7443 // known breadcrumb properties with urls
7444 // TODO: also consider arbitrary prop values that start with (https?)?://
7445 var urlProps = ['to', 'from', 'url'],
7446 urlProp,
7447 crumb,
7448 data;
7449
7450 for (var i = 0; i < breadcrumbs.values.length; ++i) {
7451 crumb = breadcrumbs.values[i];
7452 if (
7453 !crumb.hasOwnProperty('data') ||
7454 !isObject(crumb.data) ||
7455 objectFrozen(crumb.data)
7456 )
7457 continue;
7458
7459 data = objectMerge({}, crumb.data);
7460 for (var j = 0; j < urlProps.length; ++j) {
7461 urlProp = urlProps[j];
7462 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
7463 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
7464 }
7465 }
7466 breadcrumbs.values[i].data = data;
7467 }
7468 },
7469
7470 _getHttpData: function() {
7471 if (!this._hasNavigator && !this._hasDocument) return;
7472 var httpData = {};
7473
7474 if (this._hasNavigator && _navigator.userAgent) {
7475 httpData.headers = {
7476 'User-Agent': navigator.userAgent
7477 };
7478 }
7479
7480 if (this._hasDocument) {
7481 if (_document.location && _document.location.href) {
7482 httpData.url = _document.location.href;
7483 }
7484 if (_document.referrer) {
7485 if (!httpData.headers) httpData.headers = {};
7486 httpData.headers.Referer = _document.referrer;
7487 }
7488 }
7489
7490 return httpData;
7491 },
7492
7493 _resetBackoff: function() {
7494 this._backoffDuration = 0;
7495 this._backoffStart = null;
7496 },
7497
7498 _shouldBackoff: function() {
7499 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
7500 },
7501
7502 /**
7503 * Returns true if the in-process data payload matches the signature
7504 * of the previously-sent data
7505 *
7506 * NOTE: This has to be done at this level because TraceKit can generate
7507 * data from window.onerror WITHOUT an exception object (IE8, IE9,
7508 * other old browsers). This can take the form of an "exception"
7509 * data object with a single frame (derived from the onerror args).
7510 */
7511 _isRepeatData: function(current) {
7512 var last = this._lastData;
7513
7514 if (
7515 !last ||
7516 current.message !== last.message || // defined for captureMessage
7517 current.culprit !== last.culprit // defined for captureException/onerror
7518 )
7519 return false;
7520
7521 // Stacktrace interface (i.e. from captureMessage)
7522 if (current.stacktrace || last.stacktrace) {
7523 return isSameStacktrace(current.stacktrace, last.stacktrace);
7524 } else if (current.exception || last.exception) {
7525 // Exception interface (i.e. from captureException/onerror)
7526 return isSameException(current.exception, last.exception);
7527 }
7528
7529 return true;
7530 },
7531
7532 _setBackoffState: function(request) {
7533 // If we are already in a backoff state, don't change anything
7534 if (this._shouldBackoff()) {
7535 return;
7536 }
7537
7538 var status = request.status;
7539
7540 // 400 - project_id doesn't exist or some other fatal
7541 // 401 - invalid/revoked dsn
7542 // 429 - too many requests
7543 if (!(status === 400 || status === 401 || status === 429)) return;
7544
7545 var retry;
7546 try {
7547 // If Retry-After is not in Access-Control-Expose-Headers, most
7548 // browsers will throw an exception trying to access it
7549 retry = request.getResponseHeader('Retry-After');
7550 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
7551 } catch (e) {
7552 /* eslint no-empty:0 */
7553 }
7554
7555 this._backoffDuration = retry
7556 ? // If Sentry server returned a Retry-After value, use it
7557 retry
7558 : // Otherwise, double the last backoff duration (starts at 1 sec)
7559 this._backoffDuration * 2 || 1000;
7560
7561 this._backoffStart = now();
7562 },
7563
7564 _send: function(data) {
7565 var globalOptions = this._globalOptions;
7566
7567 var baseData = {
7568 project: this._globalProject,
7569 logger: globalOptions.logger,
7570 platform: 'javascript'
7571 },
7572 httpData = this._getHttpData();
7573
7574 if (httpData) {
7575 baseData.request = httpData;
7576 }
7577
7578 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
7579 if (data.trimHeadFrames) delete data.trimHeadFrames;
7580
7581 data = objectMerge(baseData, data);
7582
7583 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
7584 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
7585 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
7586
7587 // Send along our own collected metadata with extra
7588 data.extra['session:duration'] = now() - this._startTime;
7589
7590 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
7591 // intentionally make shallow copy so that additions
7592 // to breadcrumbs aren't accidentally sent in this request
7593 data.breadcrumbs = {
7594 values: [].slice.call(this._breadcrumbs, 0)
7595 };
7596 }
7597
7598 // If there are no tags/extra, strip the key from the payload alltogther.
7599 if (isEmptyObject(data.tags)) delete data.tags;
7600
7601 if (this._globalContext.user) {
7602 // sentry.interfaces.User
7603 data.user = this._globalContext.user;
7604 }
7605
7606 // Include the environment if it's defined in globalOptions
7607 if (globalOptions.environment) data.environment = globalOptions.environment;
7608
7609 // Include the release if it's defined in globalOptions
7610 if (globalOptions.release) data.release = globalOptions.release;
7611
7612 // Include server_name if it's defined in globalOptions
7613 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
7614
7615 if (isFunction(globalOptions.dataCallback)) {
7616 data = globalOptions.dataCallback(data) || data;
7617 }
7618
7619 // Why??????????
7620 if (!data || isEmptyObject(data)) {
7621 return;
7622 }
7623
7624 // Check if the request should be filtered or not
7625 if (
7626 isFunction(globalOptions.shouldSendCallback) &&
7627 !globalOptions.shouldSendCallback(data)
7628 ) {
7629 return;
7630 }
7631
7632 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
7633 // so drop requests until "cool-off" period has elapsed.
7634 if (this._shouldBackoff()) {
7635 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
7636 return;
7637 }
7638
7639 if (typeof globalOptions.sampleRate === 'number') {
7640 if (Math.random() < globalOptions.sampleRate) {
7641 this._sendProcessedPayload(data);
7642 }
7643 } else {
7644 this._sendProcessedPayload(data);
7645 }
7646 },
7647
7648 _getUuid: function() {
7649 return uuid4();
7650 },
7651
7652 _sendProcessedPayload: function(data, callback) {
7653 var self = this;
7654 var globalOptions = this._globalOptions;
7655
7656 if (!this.isSetup()) return;
7657
7658 // Try and clean up the packet before sending by truncating long values
7659 data = this._trimPacket(data);
7660
7661 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
7662 // but this would require copying an un-truncated copy of the data packet, which can be
7663 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
7664 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
7665 this._logDebug('warn', 'Raven dropped repeat event: ', data);
7666 return;
7667 }
7668
7669 // Send along an event_id if not explicitly passed.
7670 // This event_id can be used to reference the error within Sentry itself.
7671 // Set lastEventId after we know the error should actually be sent
7672 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
7673
7674 // Store outbound payload after trim
7675 this._lastData = data;
7676
7677 this._logDebug('debug', 'Raven about to send:', data);
7678
7679 var auth = {
7680 sentry_version: '7',
7681 sentry_client: 'raven-js/' + this.VERSION,
7682 sentry_key: this._globalKey
7683 };
7684
7685 if (this._globalSecret) {
7686 auth.sentry_secret = this._globalSecret;
7687 }
7688
7689 var exception = data.exception && data.exception.values[0];
7690 this.captureBreadcrumb({
7691 category: 'sentry',
7692 message: exception
7693 ? (exception.type ? exception.type + ': ' : '') + exception.value
7694 : data.message,
7695 event_id: data.event_id,
7696 level: data.level || 'error' // presume error unless specified
7697 });
7698
7699 var url = this._globalEndpoint;
7700 (globalOptions.transport || this._makeRequest).call(this, {
7701 url: url,
7702 auth: auth,
7703 data: data,
7704 options: globalOptions,
7705 onSuccess: function success() {
7706 self._resetBackoff();
7707
7708 self._triggerEvent('success', {
7709 data: data,
7710 src: url
7711 });
7712 callback && callback();
7713 },
7714 onError: function failure(error) {
7715 self._logDebug('error', 'Raven transport failed to send: ', error);
7716
7717 if (error.request) {
7718 self._setBackoffState(error.request);
7719 }
7720
7721 self._triggerEvent('failure', {
7722 data: data,
7723 src: url
7724 });
7725 error = error || new Error('Raven send failed (no additional details provided)');
7726 callback && callback(error);
7727 }
7728 });
7729 },
7730
7731 _makeRequest: function(opts) {
7732 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
7733 if (!request) return;
7734
7735 // if browser doesn't support CORS (e.g. IE7), we are out of luck
7736 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
7737
7738 if (!hasCORS) return;
7739
7740 var url = opts.url;
7741
7742 if ('withCredentials' in request) {
7743 request.onreadystatechange = function() {
7744 if (request.readyState !== 4) {
7745 return;
7746 } else if (request.status === 200) {
7747 opts.onSuccess && opts.onSuccess();
7748 } else if (opts.onError) {
7749 var err = new Error('Sentry error code: ' + request.status);
7750 err.request = request;
7751 opts.onError(err);
7752 }
7753 };
7754 } else {
7755 request = new XDomainRequest();
7756 // xdomainrequest cannot go http -> https (or vice versa),
7757 // so always use protocol relative
7758 url = url.replace(/^https?:/, '');
7759
7760 // onreadystatechange not supported by XDomainRequest
7761 if (opts.onSuccess) {
7762 request.onload = opts.onSuccess;
7763 }
7764 if (opts.onError) {
7765 request.onerror = function() {
7766 var err = new Error('Sentry error code: XDomainRequest');
7767 err.request = request;
7768 opts.onError(err);
7769 };
7770 }
7771 }
7772
7773 // NOTE: auth is intentionally sent as part of query string (NOT as custom
7774 // HTTP header) so as to avoid preflight CORS requests
7775 request.open('POST', url + '?' + urlencode(opts.auth));
7776 request.send(stringify(opts.data));
7777 },
7778
7779 _logDebug: function(level) {
7780 if (this._originalConsoleMethods[level] && this.debug) {
7781 // In IE<10 console methods do not have their own 'apply' method
7782 Function.prototype.apply.call(
7783 this._originalConsoleMethods[level],
7784 this._originalConsole,
7785 [].slice.call(arguments, 1)
7786 );
7787 }
7788 },
7789
7790 _mergeContext: function(key, context) {
7791 if (isUndefined(context)) {
7792 delete this._globalContext[key];
7793 } else {
7794 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
7795 }
7796 }
7797 };
7798
7799 // Deprecations
7800 Raven.prototype.setUser = Raven.prototype.setUserContext;
7801 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
7802
7803 module.exports = Raven;
7804
7805
7806 /***/ }),
7807
7808 /***/ "./node_modules/raven-js/src/singleton.js":
7809 /*!************************************************!*\
7810 !*** ./node_modules/raven-js/src/singleton.js ***!
7811 \************************************************/
7812 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7813
7814 /**
7815 * Enforces a single instance of the Raven client, and the
7816 * main entry point for Raven. If you are a consumer of the
7817 * Raven library, you SHOULD load this file (vs raven.js).
7818 **/
7819
7820 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
7821
7822 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7823 var _window =
7824 typeof window !== 'undefined'
7825 ? window
7826 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7827 var _Raven = _window.Raven;
7828
7829 var Raven = new RavenConstructor();
7830
7831 /*
7832 * Allow multiple versions of Raven to be installed.
7833 * Strip Raven from the global context and returns the instance.
7834 *
7835 * @return {Raven}
7836 */
7837 Raven.noConflict = function() {
7838 _window.Raven = _Raven;
7839 return Raven;
7840 };
7841
7842 Raven.afterLoad();
7843
7844 module.exports = Raven;
7845
7846
7847 /***/ }),
7848
7849 /***/ "./node_modules/raven-js/src/utils.js":
7850 /*!********************************************!*\
7851 !*** ./node_modules/raven-js/src/utils.js ***!
7852 \********************************************/
7853 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7854
7855 var _window =
7856 typeof window !== 'undefined'
7857 ? window
7858 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7859
7860 function isObject(what) {
7861 return typeof what === 'object' && what !== null;
7862 }
7863
7864 // Yanked from https://git.io/vS8DV re-used under CC0
7865 // with some tiny modifications
7866 function isError(value) {
7867 switch ({}.toString.call(value)) {
7868 case '[object Error]':
7869 return true;
7870 case '[object Exception]':
7871 return true;
7872 case '[object DOMException]':
7873 return true;
7874 default:
7875 return value instanceof Error;
7876 }
7877 }
7878
7879 function isErrorEvent(value) {
7880 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
7881 }
7882
7883 function isUndefined(what) {
7884 return what === void 0;
7885 }
7886
7887 function isFunction(what) {
7888 return typeof what === 'function';
7889 }
7890
7891 function isString(what) {
7892 return Object.prototype.toString.call(what) === '[object String]';
7893 }
7894
7895 function isEmptyObject(what) {
7896 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
7897 return true;
7898 }
7899
7900 function supportsErrorEvent() {
7901 try {
7902 new ErrorEvent(''); // eslint-disable-line no-new
7903 return true;
7904 } catch (e) {
7905 return false;
7906 }
7907 }
7908
7909 function wrappedCallback(callback) {
7910 function dataCallback(data, original) {
7911 var normalizedData = callback(data) || data;
7912 if (original) {
7913 return original(normalizedData) || normalizedData;
7914 }
7915 return normalizedData;
7916 }
7917
7918 return dataCallback;
7919 }
7920
7921 function each(obj, callback) {
7922 var i, j;
7923
7924 if (isUndefined(obj.length)) {
7925 for (i in obj) {
7926 if (hasKey(obj, i)) {
7927 callback.call(null, i, obj[i]);
7928 }
7929 }
7930 } else {
7931 j = obj.length;
7932 if (j) {
7933 for (i = 0; i < j; i++) {
7934 callback.call(null, i, obj[i]);
7935 }
7936 }
7937 }
7938 }
7939
7940 function objectMerge(obj1, obj2) {
7941 if (!obj2) {
7942 return obj1;
7943 }
7944 each(obj2, function(key, value) {
7945 obj1[key] = value;
7946 });
7947 return obj1;
7948 }
7949
7950 /**
7951 * This function is only used for react-native.
7952 * react-native freezes object that have already been sent over the
7953 * js bridge. We need this function in order to check if the object is frozen.
7954 * So it's ok that objectFrozen returns false if Object.isFrozen is not
7955 * supported because it's not relevant for other "platforms". See related issue:
7956 * https://github.com/getsentry/react-native-sentry/issues/57
7957 */
7958 function objectFrozen(obj) {
7959 if (!Object.isFrozen) {
7960 return false;
7961 }
7962 return Object.isFrozen(obj);
7963 }
7964
7965 function truncate(str, max) {
7966 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
7967 }
7968
7969 /**
7970 * hasKey, a better form of hasOwnProperty
7971 * Example: hasKey(MainHostObject, property) === true/false
7972 *
7973 * @param {Object} host object to check property
7974 * @param {string} key to check
7975 */
7976 function hasKey(object, key) {
7977 return Object.prototype.hasOwnProperty.call(object, key);
7978 }
7979
7980 function joinRegExp(patterns) {
7981 // Combine an array of regular expressions and strings into one large regexp
7982 // Be mad.
7983 var sources = [],
7984 i = 0,
7985 len = patterns.length,
7986 pattern;
7987
7988 for (; i < len; i++) {
7989 pattern = patterns[i];
7990 if (isString(pattern)) {
7991 // If it's a string, we need to escape it
7992 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
7993 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
7994 } else if (pattern && pattern.source) {
7995 // If it's a regexp already, we want to extract the source
7996 sources.push(pattern.source);
7997 }
7998 // Intentionally skip other cases
7999 }
8000 return new RegExp(sources.join('|'), 'i');
8001 }
8002
8003 function urlencode(o) {
8004 var pairs = [];
8005 each(o, function(key, value) {
8006 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
8007 });
8008 return pairs.join('&');
8009 }
8010
8011 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
8012 // intentionally using regex and not <a/> href parsing trick because React Native and other
8013 // environments where DOM might not be available
8014 function parseUrl(url) {
8015 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
8016 if (!match) return {};
8017
8018 // coerce to undefined values to empty string so we don't get 'undefined'
8019 var query = match[6] || '';
8020 var fragment = match[8] || '';
8021 return {
8022 protocol: match[2],
8023 host: match[4],
8024 path: match[5],
8025 relative: match[5] + query + fragment // everything minus origin
8026 };
8027 }
8028 function uuid4() {
8029 var crypto = _window.crypto || _window.msCrypto;
8030
8031 if (!isUndefined(crypto) && crypto.getRandomValues) {
8032 // Use window.crypto API if available
8033 // eslint-disable-next-line no-undef
8034 var arr = new Uint16Array(8);
8035 crypto.getRandomValues(arr);
8036
8037 // set 4 in byte 7
8038 arr[3] = (arr[3] & 0xfff) | 0x4000;
8039 // set 2 most significant bits of byte 9 to '10'
8040 arr[4] = (arr[4] & 0x3fff) | 0x8000;
8041
8042 var pad = function(num) {
8043 var v = num.toString(16);
8044 while (v.length < 4) {
8045 v = '0' + v;
8046 }
8047 return v;
8048 };
8049
8050 return (
8051 pad(arr[0]) +
8052 pad(arr[1]) +
8053 pad(arr[2]) +
8054 pad(arr[3]) +
8055 pad(arr[4]) +
8056 pad(arr[5]) +
8057 pad(arr[6]) +
8058 pad(arr[7])
8059 );
8060 } else {
8061 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
8062 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
8063 var r = (Math.random() * 16) | 0,
8064 v = c === 'x' ? r : (r & 0x3) | 0x8;
8065 return v.toString(16);
8066 });
8067 }
8068 }
8069
8070 /**
8071 * Given a child DOM element, returns a query-selector statement describing that
8072 * and its ancestors
8073 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
8074 * @param elem
8075 * @returns {string}
8076 */
8077 function htmlTreeAsString(elem) {
8078 /* eslint no-extra-parens:0*/
8079 var MAX_TRAVERSE_HEIGHT = 5,
8080 MAX_OUTPUT_LEN = 80,
8081 out = [],
8082 height = 0,
8083 len = 0,
8084 separator = ' > ',
8085 sepLength = separator.length,
8086 nextStr;
8087
8088 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
8089 nextStr = htmlElementAsString(elem);
8090 // bail out if
8091 // - nextStr is the 'html' element
8092 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
8093 // (ignore this limit if we are on the first iteration)
8094 if (
8095 nextStr === 'html' ||
8096 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
8097 ) {
8098 break;
8099 }
8100
8101 out.push(nextStr);
8102
8103 len += nextStr.length;
8104 elem = elem.parentNode;
8105 }
8106
8107 return out.reverse().join(separator);
8108 }
8109
8110 /**
8111 * Returns a simple, query-selector representation of a DOM element
8112 * e.g. [HTMLElement] => input#foo.btn[name=baz]
8113 * @param HTMLElement
8114 * @returns {string}
8115 */
8116 function htmlElementAsString(elem) {
8117 var out = [],
8118 className,
8119 classes,
8120 key,
8121 attr,
8122 i;
8123
8124 if (!elem || !elem.tagName) {
8125 return '';
8126 }
8127
8128 out.push(elem.tagName.toLowerCase());
8129 if (elem.id) {
8130 out.push('#' + elem.id);
8131 }
8132
8133 className = elem.className;
8134 if (className && isString(className)) {
8135 classes = className.split(/\s+/);
8136 for (i = 0; i < classes.length; i++) {
8137 out.push('.' + classes[i]);
8138 }
8139 }
8140 var attrWhitelist = ['type', 'name', 'title', 'alt'];
8141 for (i = 0; i < attrWhitelist.length; i++) {
8142 key = attrWhitelist[i];
8143 attr = elem.getAttribute(key);
8144 if (attr) {
8145 out.push('[' + key + '="' + attr + '"]');
8146 }
8147 }
8148 return out.join('');
8149 }
8150
8151 /**
8152 * Returns true if either a OR b is truthy, but not both
8153 */
8154 function isOnlyOneTruthy(a, b) {
8155 return !!(!!a ^ !!b);
8156 }
8157
8158 /**
8159 * Returns true if the two input exception interfaces have the same content
8160 */
8161 function isSameException(ex1, ex2) {
8162 if (isOnlyOneTruthy(ex1, ex2)) return false;
8163
8164 ex1 = ex1.values[0];
8165 ex2 = ex2.values[0];
8166
8167 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
8168
8169 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
8170 }
8171
8172 /**
8173 * Returns true if the two input stack trace interfaces have the same content
8174 */
8175 function isSameStacktrace(stack1, stack2) {
8176 if (isOnlyOneTruthy(stack1, stack2)) return false;
8177
8178 var frames1 = stack1.frames;
8179 var frames2 = stack2.frames;
8180
8181 // Exit early if frame count differs
8182 if (frames1.length !== frames2.length) return false;
8183
8184 // Iterate through every frame; bail out if anything differs
8185 var a, b;
8186 for (var i = 0; i < frames1.length; i++) {
8187 a = frames1[i];
8188 b = frames2[i];
8189 if (
8190 a.filename !== b.filename ||
8191 a.lineno !== b.lineno ||
8192 a.colno !== b.colno ||
8193 a['function'] !== b['function']
8194 )
8195 return false;
8196 }
8197 return true;
8198 }
8199
8200 /**
8201 * Polyfill a method
8202 * @param obj object e.g. `document`
8203 * @param name method name present on object e.g. `addEventListener`
8204 * @param replacement replacement function
8205 * @param track {optional} record instrumentation to an array
8206 */
8207 function fill(obj, name, replacement, track) {
8208 var orig = obj[name];
8209 obj[name] = replacement(orig);
8210 if (track) {
8211 track.push([obj, name, orig]);
8212 }
8213 }
8214
8215 module.exports = {
8216 isObject: isObject,
8217 isError: isError,
8218 isErrorEvent: isErrorEvent,
8219 isUndefined: isUndefined,
8220 isFunction: isFunction,
8221 isString: isString,
8222 isEmptyObject: isEmptyObject,
8223 supportsErrorEvent: supportsErrorEvent,
8224 wrappedCallback: wrappedCallback,
8225 each: each,
8226 objectMerge: objectMerge,
8227 truncate: truncate,
8228 objectFrozen: objectFrozen,
8229 hasKey: hasKey,
8230 joinRegExp: joinRegExp,
8231 urlencode: urlencode,
8232 uuid4: uuid4,
8233 htmlTreeAsString: htmlTreeAsString,
8234 htmlElementAsString: htmlElementAsString,
8235 isSameException: isSameException,
8236 isSameStacktrace: isSameStacktrace,
8237 parseUrl: parseUrl,
8238 fill: fill
8239 };
8240
8241
8242 /***/ }),
8243
8244 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
8245 /*!***********************************************************!*\
8246 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
8247 \***********************************************************/
8248 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8249
8250 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
8251
8252 /*
8253 TraceKit - Cross brower stack traces
8254
8255 This was originally forked from github.com/occ/TraceKit, but has since been
8256 largely re-written and is now maintained as part of raven-js. Tests for
8257 this are in test/vendor.
8258
8259 MIT license
8260 */
8261
8262 var TraceKit = {
8263 collectWindowErrors: true,
8264 debug: false
8265 };
8266
8267 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
8268 var _window =
8269 typeof window !== 'undefined'
8270 ? window
8271 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
8272
8273 // global reference to slice
8274 var _slice = [].slice;
8275 var UNKNOWN_FUNCTION = '?';
8276
8277 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
8278 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
8279
8280 function getLocationHref() {
8281 if (typeof document === 'undefined' || document.location == null) return '';
8282
8283 return document.location.href;
8284 }
8285
8286 /**
8287 * TraceKit.report: cross-browser processing of unhandled exceptions
8288 *
8289 * Syntax:
8290 * TraceKit.report.subscribe(function(stackInfo) { ... })
8291 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
8292 * TraceKit.report(exception)
8293 * try { ...code... } catch(ex) { TraceKit.report(ex); }
8294 *
8295 * Supports:
8296 * - Firefox: full stack trace with line numbers, plus column number
8297 * on top frame; column number is not guaranteed
8298 * - Opera: full stack trace with line and column numbers
8299 * - Chrome: full stack trace with line and column numbers
8300 * - Safari: line and column number for the top frame only; some frames
8301 * may be missing, and column number is not guaranteed
8302 * - IE: line and column number for the top frame only; some frames
8303 * may be missing, and column number is not guaranteed
8304 *
8305 * In theory, TraceKit should work on all of the following versions:
8306 * - IE5.5+ (only 8.0 tested)
8307 * - Firefox 0.9+ (only 3.5+ tested)
8308 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
8309 * Exceptions Have Stacktrace to be enabled in opera:config)
8310 * - Safari 3+ (only 4+ tested)
8311 * - Chrome 1+ (only 5+ tested)
8312 * - Konqueror 3.5+ (untested)
8313 *
8314 * Requires TraceKit.computeStackTrace.
8315 *
8316 * Tries to catch all unhandled exceptions and report them to the
8317 * subscribed handlers. Please note that TraceKit.report will rethrow the
8318 * exception. This is REQUIRED in order to get a useful stack trace in IE.
8319 * If the exception does not reach the top of the browser, you will only
8320 * get a stack trace from the point where TraceKit.report was called.
8321 *
8322 * Handlers receive a stackInfo object as described in the
8323 * TraceKit.computeStackTrace docs.
8324 */
8325 TraceKit.report = (function reportModuleWrapper() {
8326 var handlers = [],
8327 lastArgs = null,
8328 lastException = null,
8329 lastExceptionStack = null;
8330
8331 /**
8332 * Add a crash handler.
8333 * @param {Function} handler
8334 */
8335 function subscribe(handler) {
8336 installGlobalHandler();
8337 handlers.push(handler);
8338 }
8339
8340 /**
8341 * Remove a crash handler.
8342 * @param {Function} handler
8343 */
8344 function unsubscribe(handler) {
8345 for (var i = handlers.length - 1; i >= 0; --i) {
8346 if (handlers[i] === handler) {
8347 handlers.splice(i, 1);
8348 }
8349 }
8350 }
8351
8352 /**
8353 * Remove all crash handlers.
8354 */
8355 function unsubscribeAll() {
8356 uninstallGlobalHandler();
8357 handlers = [];
8358 }
8359
8360 /**
8361 * Dispatch stack information to all handlers.
8362 * @param {Object.<string, *>} stack
8363 */
8364 function notifyHandlers(stack, isWindowError) {
8365 var exception = null;
8366 if (isWindowError && !TraceKit.collectWindowErrors) {
8367 return;
8368 }
8369 for (var i in handlers) {
8370 if (handlers.hasOwnProperty(i)) {
8371 try {
8372 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
8373 } catch (inner) {
8374 exception = inner;
8375 }
8376 }
8377 }
8378
8379 if (exception) {
8380 throw exception;
8381 }
8382 }
8383
8384 var _oldOnerrorHandler, _onErrorHandlerInstalled;
8385
8386 /**
8387 * Ensures all global unhandled exceptions are recorded.
8388 * Supported by Gecko and IE.
8389 * @param {string} message Error message.
8390 * @param {string} url URL of script that generated the exception.
8391 * @param {(number|string)} lineNo The line number at which the error
8392 * occurred.
8393 * @param {?(number|string)} colNo The column number at which the error
8394 * occurred.
8395 * @param {?Error} ex The actual Error object.
8396 */
8397 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
8398 var stack = null;
8399
8400 if (lastExceptionStack) {
8401 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
8402 lastExceptionStack,
8403 url,
8404 lineNo,
8405 message
8406 );
8407 processLastException();
8408 } else if (ex && utils.isError(ex)) {
8409 // non-string `ex` arg; attempt to extract stack trace
8410
8411 // New chrome and blink send along a real error object
8412 // Let's just report that like a normal error.
8413 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
8414 stack = TraceKit.computeStackTrace(ex);
8415 notifyHandlers(stack, true);
8416 } else {
8417 var location = {
8418 url: url,
8419 line: lineNo,
8420 column: colNo
8421 };
8422
8423 var name = undefined;
8424 var msg = message; // must be new var or will modify original `arguments`
8425 var groups;
8426 if ({}.toString.call(message) === '[object String]') {
8427 var groups = message.match(ERROR_TYPES_RE);
8428 if (groups) {
8429 name = groups[1];
8430 msg = groups[2];
8431 }
8432 }
8433
8434 location.func = UNKNOWN_FUNCTION;
8435
8436 stack = {
8437 name: name,
8438 message: msg,
8439 url: getLocationHref(),
8440 stack: [location]
8441 };
8442 notifyHandlers(stack, true);
8443 }
8444
8445 if (_oldOnerrorHandler) {
8446 return _oldOnerrorHandler.apply(this, arguments);
8447 }
8448
8449 return false;
8450 }
8451
8452 function installGlobalHandler() {
8453 if (_onErrorHandlerInstalled) {
8454 return;
8455 }
8456 _oldOnerrorHandler = _window.onerror;
8457 _window.onerror = traceKitWindowOnError;
8458 _onErrorHandlerInstalled = true;
8459 }
8460
8461 function uninstallGlobalHandler() {
8462 if (!_onErrorHandlerInstalled) {
8463 return;
8464 }
8465 _window.onerror = _oldOnerrorHandler;
8466 _onErrorHandlerInstalled = false;
8467 _oldOnerrorHandler = undefined;
8468 }
8469
8470 function processLastException() {
8471 var _lastExceptionStack = lastExceptionStack,
8472 _lastArgs = lastArgs;
8473 lastArgs = null;
8474 lastExceptionStack = null;
8475 lastException = null;
8476 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
8477 }
8478
8479 /**
8480 * Reports an unhandled Error to TraceKit.
8481 * @param {Error} ex
8482 * @param {?boolean} rethrow If false, do not re-throw the exception.
8483 * Only used for window.onerror to not cause an infinite loop of
8484 * rethrowing.
8485 */
8486 function report(ex, rethrow) {
8487 var args = _slice.call(arguments, 1);
8488 if (lastExceptionStack) {
8489 if (lastException === ex) {
8490 return; // already caught by an inner catch block, ignore
8491 } else {
8492 processLastException();
8493 }
8494 }
8495
8496 var stack = TraceKit.computeStackTrace(ex);
8497 lastExceptionStack = stack;
8498 lastException = ex;
8499 lastArgs = args;
8500
8501 // If the stack trace is incomplete, wait for 2 seconds for
8502 // slow slow IE to see if onerror occurs or not before reporting
8503 // this exception; otherwise, we will end up with an incomplete
8504 // stack trace
8505 setTimeout(function() {
8506 if (lastException === ex) {
8507 processLastException();
8508 }
8509 }, stack.incomplete ? 2000 : 0);
8510
8511 if (rethrow !== false) {
8512 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
8513 }
8514 }
8515
8516 report.subscribe = subscribe;
8517 report.unsubscribe = unsubscribe;
8518 report.uninstall = unsubscribeAll;
8519 return report;
8520 })();
8521
8522 /**
8523 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
8524 *
8525 * Syntax:
8526 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
8527 * Returns:
8528 * s.name - exception name
8529 * s.message - exception message
8530 * s.stack[i].url - JavaScript or HTML file URL
8531 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
8532 * s.stack[i].args - arguments passed to the function, if known
8533 * s.stack[i].line - line number, if known
8534 * s.stack[i].column - column number, if known
8535 *
8536 * Supports:
8537 * - Firefox: full stack trace with line numbers and unreliable column
8538 * number on top frame
8539 * - Opera 10: full stack trace with line and column numbers
8540 * - Opera 9-: full stack trace with line numbers
8541 * - Chrome: full stack trace with line and column numbers
8542 * - Safari: line and column number for the topmost stacktrace element
8543 * only
8544 * - IE: no line numbers whatsoever
8545 *
8546 * Tries to guess names of anonymous functions by looking for assignments
8547 * in the source code. In IE and Safari, we have to guess source file names
8548 * by searching for function bodies inside all page scripts. This will not
8549 * work for scripts that are loaded cross-domain.
8550 * Here be dragons: some function names may be guessed incorrectly, and
8551 * duplicate functions may be mismatched.
8552 *
8553 * TraceKit.computeStackTrace should only be used for tracing purposes.
8554 * Logging of unhandled exceptions should be done with TraceKit.report,
8555 * which builds on top of TraceKit.computeStackTrace and provides better
8556 * IE support by utilizing the window.onerror event to retrieve information
8557 * about the top of the stack.
8558 *
8559 * Note: In IE and Safari, no stack trace is recorded on the Error object,
8560 * so computeStackTrace instead walks its *own* chain of callers.
8561 * This means that:
8562 * * in Safari, some methods may be missing from the stack trace;
8563 * * in IE, the topmost function in the stack trace will always be the
8564 * caller of computeStackTrace.
8565 *
8566 * This is okay for tracing (because you are likely to be calling
8567 * computeStackTrace from the function you want to be the topmost element
8568 * of the stack trace anyway), but not okay for logging unhandled
8569 * exceptions (because your catch block will likely be far away from the
8570 * inner function that actually caused the exception).
8571 *
8572 */
8573 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
8574 // Contents of Exception in various browsers.
8575 //
8576 // SAFARI:
8577 // ex.message = Can't find variable: qq
8578 // ex.line = 59
8579 // ex.sourceId = 580238192
8580 // ex.sourceURL = http://...
8581 // ex.expressionBeginOffset = 96
8582 // ex.expressionCaretOffset = 98
8583 // ex.expressionEndOffset = 98
8584 // ex.name = ReferenceError
8585 //
8586 // FIREFOX:
8587 // ex.message = qq is not defined
8588 // ex.fileName = http://...
8589 // ex.lineNumber = 59
8590 // ex.columnNumber = 69
8591 // ex.stack = ...stack trace... (see the example below)
8592 // ex.name = ReferenceError
8593 //
8594 // CHROME:
8595 // ex.message = qq is not defined
8596 // ex.name = ReferenceError
8597 // ex.type = not_defined
8598 // ex.arguments = ['aa']
8599 // ex.stack = ...stack trace...
8600 //
8601 // INTERNET EXPLORER:
8602 // ex.message = ...
8603 // ex.name = ReferenceError
8604 //
8605 // OPERA:
8606 // ex.message = ...message... (see the example below)
8607 // ex.name = ReferenceError
8608 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
8609 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
8610
8611 /**
8612 * Computes stack trace information from the stack property.
8613 * Chrome and Gecko use this property.
8614 * @param {Error} ex
8615 * @return {?Object.<string, *>} Stack trace information.
8616 */
8617 function computeStackTraceFromStackProp(ex) {
8618 if (typeof ex.stack === 'undefined' || !ex.stack) return;
8619
8620 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
8621 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
8622 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
8623 // Used to additionally parse URL/line/column from eval frames
8624 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
8625 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
8626 lines = ex.stack.split('\n'),
8627 stack = [],
8628 submatch,
8629 parts,
8630 element,
8631 reference = /^(.*) is undefined$/.exec(ex.message);
8632
8633 for (var i = 0, j = lines.length; i < j; ++i) {
8634 if ((parts = chrome.exec(lines[i]))) {
8635 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
8636 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
8637 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
8638 // throw out eval line/column and use top-most line/column number
8639 parts[2] = submatch[1]; // url
8640 parts[3] = submatch[2]; // line
8641 parts[4] = submatch[3]; // column
8642 }
8643 element = {
8644 url: !isNative ? parts[2] : null,
8645 func: parts[1] || UNKNOWN_FUNCTION,
8646 args: isNative ? [parts[2]] : [],
8647 line: parts[3] ? +parts[3] : null,
8648 column: parts[4] ? +parts[4] : null
8649 };
8650 } else if ((parts = winjs.exec(lines[i]))) {
8651 element = {
8652 url: parts[2],
8653 func: parts[1] || UNKNOWN_FUNCTION,
8654 args: [],
8655 line: +parts[3],
8656 column: parts[4] ? +parts[4] : null
8657 };
8658 } else if ((parts = gecko.exec(lines[i]))) {
8659 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
8660 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
8661 // throw out eval line/column and use top-most line number
8662 parts[3] = submatch[1];
8663 parts[4] = submatch[2];
8664 parts[5] = null; // no column when eval
8665 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
8666 // FireFox uses this awesome columnNumber property for its top frame
8667 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
8668 // so adding 1
8669 // NOTE: this hack doesn't work if top-most frame is eval
8670 stack[0].column = ex.columnNumber + 1;
8671 }
8672 element = {
8673 url: parts[3],
8674 func: parts[1] || UNKNOWN_FUNCTION,
8675 args: parts[2] ? parts[2].split(',') : [],
8676 line: parts[4] ? +parts[4] : null,
8677 column: parts[5] ? +parts[5] : null
8678 };
8679 } else {
8680 continue;
8681 }
8682
8683 if (!element.func && element.line) {
8684 element.func = UNKNOWN_FUNCTION;
8685 }
8686
8687 stack.push(element);
8688 }
8689
8690 if (!stack.length) {
8691 return null;
8692 }
8693
8694 return {
8695 name: ex.name,
8696 message: ex.message,
8697 url: getLocationHref(),
8698 stack: stack
8699 };
8700 }
8701
8702 /**
8703 * Adds information about the first frame to incomplete stack traces.
8704 * Safari and IE require this to get complete data on the first frame.
8705 * @param {Object.<string, *>} stackInfo Stack trace information from
8706 * one of the compute* methods.
8707 * @param {string} url The URL of the script that caused an error.
8708 * @param {(number|string)} lineNo The line number of the script that
8709 * caused an error.
8710 * @param {string=} message The error generated by the browser, which
8711 * hopefully contains the name of the object that caused the error.
8712 * @return {boolean} Whether or not the stack information was
8713 * augmented.
8714 */
8715 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
8716 var initial = {
8717 url: url,
8718 line: lineNo
8719 };
8720
8721 if (initial.url && initial.line) {
8722 stackInfo.incomplete = false;
8723
8724 if (!initial.func) {
8725 initial.func = UNKNOWN_FUNCTION;
8726 }
8727
8728 if (stackInfo.stack.length > 0) {
8729 if (stackInfo.stack[0].url === initial.url) {
8730 if (stackInfo.stack[0].line === initial.line) {
8731 return false; // already in stack trace
8732 } else if (
8733 !stackInfo.stack[0].line &&
8734 stackInfo.stack[0].func === initial.func
8735 ) {
8736 stackInfo.stack[0].line = initial.line;
8737 return false;
8738 }
8739 }
8740 }
8741
8742 stackInfo.stack.unshift(initial);
8743 stackInfo.partial = true;
8744 return true;
8745 } else {
8746 stackInfo.incomplete = true;
8747 }
8748
8749 return false;
8750 }
8751
8752 /**
8753 * Computes stack trace information by walking the arguments.caller
8754 * chain at the time the exception occurred. This will cause earlier
8755 * frames to be missed but is the only way to get any stack trace in
8756 * Safari and IE. The top frame is restored by
8757 * {@link augmentStackTraceWithInitialElement}.
8758 * @param {Error} ex
8759 * @return {?Object.<string, *>} Stack trace information.
8760 */
8761 function computeStackTraceByWalkingCallerChain(ex, depth) {
8762 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
8763 stack = [],
8764 funcs = {},
8765 recursion = false,
8766 parts,
8767 item,
8768 source;
8769
8770 for (
8771 var curr = computeStackTraceByWalkingCallerChain.caller;
8772 curr && !recursion;
8773 curr = curr.caller
8774 ) {
8775 if (curr === computeStackTrace || curr === TraceKit.report) {
8776 // console.log('skipping internal function');
8777 continue;
8778 }
8779
8780 item = {
8781 url: null,
8782 func: UNKNOWN_FUNCTION,
8783 line: null,
8784 column: null
8785 };
8786
8787 if (curr.name) {
8788 item.func = curr.name;
8789 } else if ((parts = functionName.exec(curr.toString()))) {
8790 item.func = parts[1];
8791 }
8792
8793 if (typeof item.func === 'undefined') {
8794 try {
8795 item.func = parts.input.substring(0, parts.input.indexOf('{'));
8796 } catch (e) {}
8797 }
8798
8799 if (funcs['' + curr]) {
8800 recursion = true;
8801 } else {
8802 funcs['' + curr] = true;
8803 }
8804
8805 stack.push(item);
8806 }
8807
8808 if (depth) {
8809 // console.log('depth is ' + depth);
8810 // console.log('stack is ' + stack.length);
8811 stack.splice(0, depth);
8812 }
8813
8814 var result = {
8815 name: ex.name,
8816 message: ex.message,
8817 url: getLocationHref(),
8818 stack: stack
8819 };
8820 augmentStackTraceWithInitialElement(
8821 result,
8822 ex.sourceURL || ex.fileName,
8823 ex.line || ex.lineNumber,
8824 ex.message || ex.description
8825 );
8826 return result;
8827 }
8828
8829 /**
8830 * Computes a stack trace for an exception.
8831 * @param {Error} ex
8832 * @param {(string|number)=} depth
8833 */
8834 function computeStackTrace(ex, depth) {
8835 var stack = null;
8836 depth = depth == null ? 0 : +depth;
8837
8838 try {
8839 stack = computeStackTraceFromStackProp(ex);
8840 if (stack) {
8841 return stack;
8842 }
8843 } catch (e) {
8844 if (TraceKit.debug) {
8845 throw e;
8846 }
8847 }
8848
8849 try {
8850 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
8851 if (stack) {
8852 return stack;
8853 }
8854 } catch (e) {
8855 if (TraceKit.debug) {
8856 throw e;
8857 }
8858 }
8859 return {
8860 name: ex.name,
8861 message: ex.message,
8862 url: getLocationHref()
8863 };
8864 }
8865
8866 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
8867 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
8868
8869 return computeStackTrace;
8870 })();
8871
8872 module.exports = TraceKit;
8873
8874
8875 /***/ }),
8876
8877 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
8878 /*!***********************************************************************!*\
8879 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
8880 \***********************************************************************/
8881 /***/ ((module, exports) => {
8882
8883 /*
8884 json-stringify-safe
8885 Like JSON.stringify, but doesn't throw on circular references.
8886
8887 Originally forked from https://github.com/isaacs/json-stringify-safe
8888 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
8889 and IE8 compatibility. Tests for this are in test/vendor.
8890
8891 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
8892 */
8893
8894 exports = module.exports = stringify;
8895 exports.getSerialize = serializer;
8896
8897 function indexOf(haystack, needle) {
8898 for (var i = 0; i < haystack.length; ++i) {
8899 if (haystack[i] === needle) return i;
8900 }
8901 return -1;
8902 }
8903
8904 function stringify(obj, replacer, spaces, cycleReplacer) {
8905 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
8906 }
8907
8908 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
8909 function stringifyError(value) {
8910 var err = {
8911 // These properties are implemented as magical getters and don't show up in for in
8912 stack: value.stack,
8913 message: value.message,
8914 name: value.name
8915 };
8916
8917 for (var i in value) {
8918 if (Object.prototype.hasOwnProperty.call(value, i)) {
8919 err[i] = value[i];
8920 }
8921 }
8922
8923 return err;
8924 }
8925
8926 function serializer(replacer, cycleReplacer) {
8927 var stack = [];
8928 var keys = [];
8929
8930 if (cycleReplacer == null) {
8931 cycleReplacer = function(key, value) {
8932 if (stack[0] === value) {
8933 return '[Circular ~]';
8934 }
8935 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
8936 };
8937 }
8938
8939 return function(key, value) {
8940 if (stack.length > 0) {
8941 var thisPos = indexOf(stack, this);
8942 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
8943 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
8944
8945 if (~indexOf(stack, value)) {
8946 value = cycleReplacer.call(this, key, value);
8947 }
8948 } else {
8949 stack.push(value);
8950 }
8951
8952 return replacer == null
8953 ? value instanceof Error ? stringifyError(value) : value
8954 : replacer.call(this, key, value);
8955 };
8956 }
8957
8958
8959 /***/ }),
8960
8961 /***/ "./node_modules/react-is/cjs/react-is.development.js":
8962 /*!***********************************************************!*\
8963 !*** ./node_modules/react-is/cjs/react-is.development.js ***!
8964 \***********************************************************/
8965 /***/ ((__unused_webpack_module, exports) => {
8966
8967 "use strict";
8968 /** @license React v16.13.1
8969 * react-is.development.js
8970 *
8971 * Copyright (c) Facebook, Inc. and its affiliates.
8972 *
8973 * This source code is licensed under the MIT license found in the
8974 * LICENSE file in the root directory of this source tree.
8975 */
8976
8977
8978
8979
8980
8981 if (true) {
8982 (function() {
8983 'use strict';
8984
8985 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
8986 // nor polyfill, then a plain number is used for performance.
8987 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
8988 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
8989 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
8990 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
8991 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
8992 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
8993 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
8994 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
8995 // (unstable) APIs that have been removed. Can we remove the symbols?
8996
8997 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
8998 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
8999 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
9000 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
9001 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
9002 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
9003 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
9004 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
9005 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
9006 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
9007 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
9008
9009 function isValidElementType(type) {
9010 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
9011 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);
9012 }
9013
9014 function typeOf(object) {
9015 if (typeof object === 'object' && object !== null) {
9016 var $$typeof = object.$$typeof;
9017
9018 switch ($$typeof) {
9019 case REACT_ELEMENT_TYPE:
9020 var type = object.type;
9021
9022 switch (type) {
9023 case REACT_ASYNC_MODE_TYPE:
9024 case REACT_CONCURRENT_MODE_TYPE:
9025 case REACT_FRAGMENT_TYPE:
9026 case REACT_PROFILER_TYPE:
9027 case REACT_STRICT_MODE_TYPE:
9028 case REACT_SUSPENSE_TYPE:
9029 return type;
9030
9031 default:
9032 var $$typeofType = type && type.$$typeof;
9033
9034 switch ($$typeofType) {
9035 case REACT_CONTEXT_TYPE:
9036 case REACT_FORWARD_REF_TYPE:
9037 case REACT_LAZY_TYPE:
9038 case REACT_MEMO_TYPE:
9039 case REACT_PROVIDER_TYPE:
9040 return $$typeofType;
9041
9042 default:
9043 return $$typeof;
9044 }
9045
9046 }
9047
9048 case REACT_PORTAL_TYPE:
9049 return $$typeof;
9050 }
9051 }
9052
9053 return undefined;
9054 } // AsyncMode is deprecated along with isAsyncMode
9055
9056 var AsyncMode = REACT_ASYNC_MODE_TYPE;
9057 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
9058 var ContextConsumer = REACT_CONTEXT_TYPE;
9059 var ContextProvider = REACT_PROVIDER_TYPE;
9060 var Element = REACT_ELEMENT_TYPE;
9061 var ForwardRef = REACT_FORWARD_REF_TYPE;
9062 var Fragment = REACT_FRAGMENT_TYPE;
9063 var Lazy = REACT_LAZY_TYPE;
9064 var Memo = REACT_MEMO_TYPE;
9065 var Portal = REACT_PORTAL_TYPE;
9066 var Profiler = REACT_PROFILER_TYPE;
9067 var StrictMode = REACT_STRICT_MODE_TYPE;
9068 var Suspense = REACT_SUSPENSE_TYPE;
9069 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
9070
9071 function isAsyncMode(object) {
9072 {
9073 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
9074 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
9075
9076 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.');
9077 }
9078 }
9079
9080 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
9081 }
9082 function isConcurrentMode(object) {
9083 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
9084 }
9085 function isContextConsumer(object) {
9086 return typeOf(object) === REACT_CONTEXT_TYPE;
9087 }
9088 function isContextProvider(object) {
9089 return typeOf(object) === REACT_PROVIDER_TYPE;
9090 }
9091 function isElement(object) {
9092 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9093 }
9094 function isForwardRef(object) {
9095 return typeOf(object) === REACT_FORWARD_REF_TYPE;
9096 }
9097 function isFragment(object) {
9098 return typeOf(object) === REACT_FRAGMENT_TYPE;
9099 }
9100 function isLazy(object) {
9101 return typeOf(object) === REACT_LAZY_TYPE;
9102 }
9103 function isMemo(object) {
9104 return typeOf(object) === REACT_MEMO_TYPE;
9105 }
9106 function isPortal(object) {
9107 return typeOf(object) === REACT_PORTAL_TYPE;
9108 }
9109 function isProfiler(object) {
9110 return typeOf(object) === REACT_PROFILER_TYPE;
9111 }
9112 function isStrictMode(object) {
9113 return typeOf(object) === REACT_STRICT_MODE_TYPE;
9114 }
9115 function isSuspense(object) {
9116 return typeOf(object) === REACT_SUSPENSE_TYPE;
9117 }
9118
9119 exports.AsyncMode = AsyncMode;
9120 exports.ConcurrentMode = ConcurrentMode;
9121 exports.ContextConsumer = ContextConsumer;
9122 exports.ContextProvider = ContextProvider;
9123 exports.Element = Element;
9124 exports.ForwardRef = ForwardRef;
9125 exports.Fragment = Fragment;
9126 exports.Lazy = Lazy;
9127 exports.Memo = Memo;
9128 exports.Portal = Portal;
9129 exports.Profiler = Profiler;
9130 exports.StrictMode = StrictMode;
9131 exports.Suspense = Suspense;
9132 exports.isAsyncMode = isAsyncMode;
9133 exports.isConcurrentMode = isConcurrentMode;
9134 exports.isContextConsumer = isContextConsumer;
9135 exports.isContextProvider = isContextProvider;
9136 exports.isElement = isElement;
9137 exports.isForwardRef = isForwardRef;
9138 exports.isFragment = isFragment;
9139 exports.isLazy = isLazy;
9140 exports.isMemo = isMemo;
9141 exports.isPortal = isPortal;
9142 exports.isProfiler = isProfiler;
9143 exports.isStrictMode = isStrictMode;
9144 exports.isSuspense = isSuspense;
9145 exports.isValidElementType = isValidElementType;
9146 exports.typeOf = typeOf;
9147 })();
9148 }
9149
9150
9151 /***/ }),
9152
9153 /***/ "./node_modules/react-is/index.js":
9154 /*!****************************************!*\
9155 !*** ./node_modules/react-is/index.js ***!
9156 \****************************************/
9157 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9158
9159 "use strict";
9160
9161
9162 if (false) {} else {
9163 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
9164 }
9165
9166
9167 /***/ }),
9168
9169 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
9170 /*!*****************************************************************!*\
9171 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
9172 \*****************************************************************/
9173 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9174
9175 "use strict";
9176 /**
9177 * @license React
9178 * react-jsx-runtime.development.js
9179 *
9180 * Copyright (c) Facebook, Inc. and its affiliates.
9181 *
9182 * This source code is licensed under the MIT license found in the
9183 * LICENSE file in the root directory of this source tree.
9184 */
9185
9186
9187
9188 if (true) {
9189 (function() {
9190 'use strict';
9191
9192 var React = __webpack_require__(/*! react */ "react");
9193
9194 // ATTENTION
9195 // When adding new symbols to this file,
9196 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
9197 // The Symbol used to tag the ReactElement-like types.
9198 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
9199 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
9200 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
9201 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
9202 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
9203 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
9204 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
9205 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
9206 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
9207 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
9208 var REACT_MEMO_TYPE = Symbol.for('react.memo');
9209 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
9210 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
9211 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
9212 var FAUX_ITERATOR_SYMBOL = '@@iterator';
9213 function getIteratorFn(maybeIterable) {
9214 if (maybeIterable === null || typeof maybeIterable !== 'object') {
9215 return null;
9216 }
9217
9218 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
9219
9220 if (typeof maybeIterator === 'function') {
9221 return maybeIterator;
9222 }
9223
9224 return null;
9225 }
9226
9227 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
9228
9229 function error(format) {
9230 {
9231 {
9232 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
9233 args[_key2 - 1] = arguments[_key2];
9234 }
9235
9236 printWarning('error', format, args);
9237 }
9238 }
9239 }
9240
9241 function printWarning(level, format, args) {
9242 // When changing this logic, you might want to also
9243 // update consoleWithStackDev.www.js as well.
9244 {
9245 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9246 var stack = ReactDebugCurrentFrame.getStackAddendum();
9247
9248 if (stack !== '') {
9249 format += '%s';
9250 args = args.concat([stack]);
9251 } // eslint-disable-next-line react-internal/safe-string-coercion
9252
9253
9254 var argsWithFormat = args.map(function (item) {
9255 return String(item);
9256 }); // Careful: RN currently depends on this prefix
9257
9258 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
9259 // breaks IE9: https://github.com/facebook/react/issues/13610
9260 // eslint-disable-next-line react-internal/no-production-logging
9261
9262 Function.prototype.apply.call(console[level], console, argsWithFormat);
9263 }
9264 }
9265
9266 // -----------------------------------------------------------------------------
9267
9268 var enableScopeAPI = false; // Experimental Create Event Handle API.
9269 var enableCacheElement = false;
9270 var enableTransitionTracing = false; // No known bugs, but needs performance testing
9271
9272 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
9273 // stuff. Intended to enable React core members to more easily debug scheduling
9274 // issues in DEV builds.
9275
9276 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
9277
9278 var REACT_MODULE_REFERENCE;
9279
9280 {
9281 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
9282 }
9283
9284 function isValidElementType(type) {
9285 if (typeof type === 'string' || typeof type === 'function') {
9286 return true;
9287 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
9288
9289
9290 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 ) {
9291 return true;
9292 }
9293
9294 if (typeof type === 'object' && type !== null) {
9295 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
9296 // types supported by any Flight configuration anywhere since
9297 // we don't know which Flight build this will end up being used
9298 // with.
9299 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
9300 return true;
9301 }
9302 }
9303
9304 return false;
9305 }
9306
9307 function getWrappedName(outerType, innerType, wrapperName) {
9308 var displayName = outerType.displayName;
9309
9310 if (displayName) {
9311 return displayName;
9312 }
9313
9314 var functionName = innerType.displayName || innerType.name || '';
9315 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
9316 } // Keep in sync with react-reconciler/getComponentNameFromFiber
9317
9318
9319 function getContextName(type) {
9320 return type.displayName || 'Context';
9321 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
9322
9323
9324 function getComponentNameFromType(type) {
9325 if (type == null) {
9326 // Host root, text node or just invalid type.
9327 return null;
9328 }
9329
9330 {
9331 if (typeof type.tag === 'number') {
9332 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
9333 }
9334 }
9335
9336 if (typeof type === 'function') {
9337 return type.displayName || type.name || null;
9338 }
9339
9340 if (typeof type === 'string') {
9341 return type;
9342 }
9343
9344 switch (type) {
9345 case REACT_FRAGMENT_TYPE:
9346 return 'Fragment';
9347
9348 case REACT_PORTAL_TYPE:
9349 return 'Portal';
9350
9351 case REACT_PROFILER_TYPE:
9352 return 'Profiler';
9353
9354 case REACT_STRICT_MODE_TYPE:
9355 return 'StrictMode';
9356
9357 case REACT_SUSPENSE_TYPE:
9358 return 'Suspense';
9359
9360 case REACT_SUSPENSE_LIST_TYPE:
9361 return 'SuspenseList';
9362
9363 }
9364
9365 if (typeof type === 'object') {
9366 switch (type.$$typeof) {
9367 case REACT_CONTEXT_TYPE:
9368 var context = type;
9369 return getContextName(context) + '.Consumer';
9370
9371 case REACT_PROVIDER_TYPE:
9372 var provider = type;
9373 return getContextName(provider._context) + '.Provider';
9374
9375 case REACT_FORWARD_REF_TYPE:
9376 return getWrappedName(type, type.render, 'ForwardRef');
9377
9378 case REACT_MEMO_TYPE:
9379 var outerName = type.displayName || null;
9380
9381 if (outerName !== null) {
9382 return outerName;
9383 }
9384
9385 return getComponentNameFromType(type.type) || 'Memo';
9386
9387 case REACT_LAZY_TYPE:
9388 {
9389 var lazyComponent = type;
9390 var payload = lazyComponent._payload;
9391 var init = lazyComponent._init;
9392
9393 try {
9394 return getComponentNameFromType(init(payload));
9395 } catch (x) {
9396 return null;
9397 }
9398 }
9399
9400 // eslint-disable-next-line no-fallthrough
9401 }
9402 }
9403
9404 return null;
9405 }
9406
9407 var assign = Object.assign;
9408
9409 // Helpers to patch console.logs to avoid logging during side-effect free
9410 // replaying on render function. This currently only patches the object
9411 // lazily which won't cover if the log function was extracted eagerly.
9412 // We could also eagerly patch the method.
9413 var disabledDepth = 0;
9414 var prevLog;
9415 var prevInfo;
9416 var prevWarn;
9417 var prevError;
9418 var prevGroup;
9419 var prevGroupCollapsed;
9420 var prevGroupEnd;
9421
9422 function disabledLog() {}
9423
9424 disabledLog.__reactDisabledLog = true;
9425 function disableLogs() {
9426 {
9427 if (disabledDepth === 0) {
9428 /* eslint-disable react-internal/no-production-logging */
9429 prevLog = console.log;
9430 prevInfo = console.info;
9431 prevWarn = console.warn;
9432 prevError = console.error;
9433 prevGroup = console.group;
9434 prevGroupCollapsed = console.groupCollapsed;
9435 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
9436
9437 var props = {
9438 configurable: true,
9439 enumerable: true,
9440 value: disabledLog,
9441 writable: true
9442 }; // $FlowFixMe Flow thinks console is immutable.
9443
9444 Object.defineProperties(console, {
9445 info: props,
9446 log: props,
9447 warn: props,
9448 error: props,
9449 group: props,
9450 groupCollapsed: props,
9451 groupEnd: props
9452 });
9453 /* eslint-enable react-internal/no-production-logging */
9454 }
9455
9456 disabledDepth++;
9457 }
9458 }
9459 function reenableLogs() {
9460 {
9461 disabledDepth--;
9462
9463 if (disabledDepth === 0) {
9464 /* eslint-disable react-internal/no-production-logging */
9465 var props = {
9466 configurable: true,
9467 enumerable: true,
9468 writable: true
9469 }; // $FlowFixMe Flow thinks console is immutable.
9470
9471 Object.defineProperties(console, {
9472 log: assign({}, props, {
9473 value: prevLog
9474 }),
9475 info: assign({}, props, {
9476 value: prevInfo
9477 }),
9478 warn: assign({}, props, {
9479 value: prevWarn
9480 }),
9481 error: assign({}, props, {
9482 value: prevError
9483 }),
9484 group: assign({}, props, {
9485 value: prevGroup
9486 }),
9487 groupCollapsed: assign({}, props, {
9488 value: prevGroupCollapsed
9489 }),
9490 groupEnd: assign({}, props, {
9491 value: prevGroupEnd
9492 })
9493 });
9494 /* eslint-enable react-internal/no-production-logging */
9495 }
9496
9497 if (disabledDepth < 0) {
9498 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
9499 }
9500 }
9501 }
9502
9503 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9504 var prefix;
9505 function describeBuiltInComponentFrame(name, source, ownerFn) {
9506 {
9507 if (prefix === undefined) {
9508 // Extract the VM specific prefix used by each line.
9509 try {
9510 throw Error();
9511 } catch (x) {
9512 var match = x.stack.trim().match(/\n( *(at )?)/);
9513 prefix = match && match[1] || '';
9514 }
9515 } // We use the prefix to ensure our stacks line up with native stack frames.
9516
9517
9518 return '\n' + prefix + name;
9519 }
9520 }
9521 var reentry = false;
9522 var componentFrameCache;
9523
9524 {
9525 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
9526 componentFrameCache = new PossiblyWeakMap();
9527 }
9528
9529 function describeNativeComponentFrame(fn, construct) {
9530 // If something asked for a stack inside a fake render, it should get ignored.
9531 if ( !fn || reentry) {
9532 return '';
9533 }
9534
9535 {
9536 var frame = componentFrameCache.get(fn);
9537
9538 if (frame !== undefined) {
9539 return frame;
9540 }
9541 }
9542
9543 var control;
9544 reentry = true;
9545 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
9546
9547 Error.prepareStackTrace = undefined;
9548 var previousDispatcher;
9549
9550 {
9551 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
9552 // for warnings.
9553
9554 ReactCurrentDispatcher.current = null;
9555 disableLogs();
9556 }
9557
9558 try {
9559 // This should throw.
9560 if (construct) {
9561 // Something should be setting the props in the constructor.
9562 var Fake = function () {
9563 throw Error();
9564 }; // $FlowFixMe
9565
9566
9567 Object.defineProperty(Fake.prototype, 'props', {
9568 set: function () {
9569 // We use a throwing setter instead of frozen or non-writable props
9570 // because that won't throw in a non-strict mode function.
9571 throw Error();
9572 }
9573 });
9574
9575 if (typeof Reflect === 'object' && Reflect.construct) {
9576 // We construct a different control for this case to include any extra
9577 // frames added by the construct call.
9578 try {
9579 Reflect.construct(Fake, []);
9580 } catch (x) {
9581 control = x;
9582 }
9583
9584 Reflect.construct(fn, [], Fake);
9585 } else {
9586 try {
9587 Fake.call();
9588 } catch (x) {
9589 control = x;
9590 }
9591
9592 fn.call(Fake.prototype);
9593 }
9594 } else {
9595 try {
9596 throw Error();
9597 } catch (x) {
9598 control = x;
9599 }
9600
9601 fn();
9602 }
9603 } catch (sample) {
9604 // This is inlined manually because closure doesn't do it for us.
9605 if (sample && control && typeof sample.stack === 'string') {
9606 // This extracts the first frame from the sample that isn't also in the control.
9607 // Skipping one frame that we assume is the frame that calls the two.
9608 var sampleLines = sample.stack.split('\n');
9609 var controlLines = control.stack.split('\n');
9610 var s = sampleLines.length - 1;
9611 var c = controlLines.length - 1;
9612
9613 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
9614 // We expect at least one stack frame to be shared.
9615 // Typically this will be the root most one. However, stack frames may be
9616 // cut off due to maximum stack limits. In this case, one maybe cut off
9617 // earlier than the other. We assume that the sample is longer or the same
9618 // and there for cut off earlier. So we should find the root most frame in
9619 // the sample somewhere in the control.
9620 c--;
9621 }
9622
9623 for (; s >= 1 && c >= 0; s--, c--) {
9624 // Next we find the first one that isn't the same which should be the
9625 // frame that called our sample function and the control.
9626 if (sampleLines[s] !== controlLines[c]) {
9627 // In V8, the first line is describing the message but other VMs don't.
9628 // If we're about to return the first line, and the control is also on the same
9629 // line, that's a pretty good indicator that our sample threw at same line as
9630 // the control. I.e. before we entered the sample frame. So we ignore this result.
9631 // This can happen if you passed a class to function component, or non-function.
9632 if (s !== 1 || c !== 1) {
9633 do {
9634 s--;
9635 c--; // We may still have similar intermediate frames from the construct call.
9636 // The next one that isn't the same should be our match though.
9637
9638 if (c < 0 || sampleLines[s] !== controlLines[c]) {
9639 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
9640 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
9641 // but we have a user-provided "displayName"
9642 // splice it in to make the stack more readable.
9643
9644
9645 if (fn.displayName && _frame.includes('<anonymous>')) {
9646 _frame = _frame.replace('<anonymous>', fn.displayName);
9647 }
9648
9649 {
9650 if (typeof fn === 'function') {
9651 componentFrameCache.set(fn, _frame);
9652 }
9653 } // Return the line we found.
9654
9655
9656 return _frame;
9657 }
9658 } while (s >= 1 && c >= 0);
9659 }
9660
9661 break;
9662 }
9663 }
9664 }
9665 } finally {
9666 reentry = false;
9667
9668 {
9669 ReactCurrentDispatcher.current = previousDispatcher;
9670 reenableLogs();
9671 }
9672
9673 Error.prepareStackTrace = previousPrepareStackTrace;
9674 } // Fallback to just using the name if we couldn't make it throw.
9675
9676
9677 var name = fn ? fn.displayName || fn.name : '';
9678 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
9679
9680 {
9681 if (typeof fn === 'function') {
9682 componentFrameCache.set(fn, syntheticFrame);
9683 }
9684 }
9685
9686 return syntheticFrame;
9687 }
9688 function describeFunctionComponentFrame(fn, source, ownerFn) {
9689 {
9690 return describeNativeComponentFrame(fn, false);
9691 }
9692 }
9693
9694 function shouldConstruct(Component) {
9695 var prototype = Component.prototype;
9696 return !!(prototype && prototype.isReactComponent);
9697 }
9698
9699 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
9700
9701 if (type == null) {
9702 return '';
9703 }
9704
9705 if (typeof type === 'function') {
9706 {
9707 return describeNativeComponentFrame(type, shouldConstruct(type));
9708 }
9709 }
9710
9711 if (typeof type === 'string') {
9712 return describeBuiltInComponentFrame(type);
9713 }
9714
9715 switch (type) {
9716 case REACT_SUSPENSE_TYPE:
9717 return describeBuiltInComponentFrame('Suspense');
9718
9719 case REACT_SUSPENSE_LIST_TYPE:
9720 return describeBuiltInComponentFrame('SuspenseList');
9721 }
9722
9723 if (typeof type === 'object') {
9724 switch (type.$$typeof) {
9725 case REACT_FORWARD_REF_TYPE:
9726 return describeFunctionComponentFrame(type.render);
9727
9728 case REACT_MEMO_TYPE:
9729 // Memo may contain any component type so we recursively resolve it.
9730 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
9731
9732 case REACT_LAZY_TYPE:
9733 {
9734 var lazyComponent = type;
9735 var payload = lazyComponent._payload;
9736 var init = lazyComponent._init;
9737
9738 try {
9739 // Lazy may contain any component type so we recursively resolve it.
9740 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
9741 } catch (x) {}
9742 }
9743 }
9744 }
9745
9746 return '';
9747 }
9748
9749 var hasOwnProperty = Object.prototype.hasOwnProperty;
9750
9751 var loggedTypeFailures = {};
9752 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9753
9754 function setCurrentlyValidatingElement(element) {
9755 {
9756 if (element) {
9757 var owner = element._owner;
9758 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9759 ReactDebugCurrentFrame.setExtraStackFrame(stack);
9760 } else {
9761 ReactDebugCurrentFrame.setExtraStackFrame(null);
9762 }
9763 }
9764 }
9765
9766 function checkPropTypes(typeSpecs, values, location, componentName, element) {
9767 {
9768 // $FlowFixMe This is okay but Flow doesn't know it.
9769 var has = Function.call.bind(hasOwnProperty);
9770
9771 for (var typeSpecName in typeSpecs) {
9772 if (has(typeSpecs, typeSpecName)) {
9773 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
9774 // fail the render phase where it didn't fail before. So we log it.
9775 // After these have been cleaned up, we'll let them throw.
9776
9777 try {
9778 // This is intentionally an invariant that gets caught. It's the same
9779 // behavior as without this statement except with a better message.
9780 if (typeof typeSpecs[typeSpecName] !== 'function') {
9781 // eslint-disable-next-line react-internal/prod-error-codes
9782 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`.');
9783 err.name = 'Invariant Violation';
9784 throw err;
9785 }
9786
9787 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
9788 } catch (ex) {
9789 error$1 = ex;
9790 }
9791
9792 if (error$1 && !(error$1 instanceof Error)) {
9793 setCurrentlyValidatingElement(element);
9794
9795 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);
9796
9797 setCurrentlyValidatingElement(null);
9798 }
9799
9800 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
9801 // Only monitor this failure once because there tends to be a lot of the
9802 // same error.
9803 loggedTypeFailures[error$1.message] = true;
9804 setCurrentlyValidatingElement(element);
9805
9806 error('Failed %s type: %s', location, error$1.message);
9807
9808 setCurrentlyValidatingElement(null);
9809 }
9810 }
9811 }
9812 }
9813 }
9814
9815 var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
9816
9817 function isArray(a) {
9818 return isArrayImpl(a);
9819 }
9820
9821 /*
9822 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
9823 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
9824 *
9825 * The functions in this module will throw an easier-to-understand,
9826 * easier-to-debug exception with a clear errors message message explaining the
9827 * problem. (Instead of a confusing exception thrown inside the implementation
9828 * of the `value` object).
9829 */
9830 // $FlowFixMe only called in DEV, so void return is not possible.
9831 function typeName(value) {
9832 {
9833 // toStringTag is needed for namespaced types like Temporal.Instant
9834 var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
9835 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
9836 return type;
9837 }
9838 } // $FlowFixMe only called in DEV, so void return is not possible.
9839
9840
9841 function willCoercionThrow(value) {
9842 {
9843 try {
9844 testStringCoercion(value);
9845 return false;
9846 } catch (e) {
9847 return true;
9848 }
9849 }
9850 }
9851
9852 function testStringCoercion(value) {
9853 // If you ended up here by following an exception call stack, here's what's
9854 // happened: you supplied an object or symbol value to React (as a prop, key,
9855 // DOM attribute, CSS property, string ref, etc.) and when React tried to
9856 // coerce it to a string using `'' + value`, an exception was thrown.
9857 //
9858 // The most common types that will cause this exception are `Symbol` instances
9859 // and Temporal objects like `Temporal.Instant`. But any object that has a
9860 // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
9861 // exception. (Library authors do this to prevent users from using built-in
9862 // numeric operators like `+` or comparison operators like `>=` because custom
9863 // methods are needed to perform accurate arithmetic or comparison.)
9864 //
9865 // To fix the problem, coerce this object or symbol value to a string before
9866 // passing it to React. The most reliable way is usually `String(value)`.
9867 //
9868 // To find which value is throwing, check the browser or debugger console.
9869 // Before this exception was thrown, there should be `console.error` output
9870 // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
9871 // problem and how that type was used: key, atrribute, input value prop, etc.
9872 // In most cases, this console output also shows the component and its
9873 // ancestor components where the exception happened.
9874 //
9875 // eslint-disable-next-line react-internal/safe-string-coercion
9876 return '' + value;
9877 }
9878 function checkKeyStringCoercion(value) {
9879 {
9880 if (willCoercionThrow(value)) {
9881 error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
9882
9883 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
9884 }
9885 }
9886 }
9887
9888 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
9889 var RESERVED_PROPS = {
9890 key: true,
9891 ref: true,
9892 __self: true,
9893 __source: true
9894 };
9895 var specialPropKeyWarningShown;
9896 var specialPropRefWarningShown;
9897 var didWarnAboutStringRefs;
9898
9899 {
9900 didWarnAboutStringRefs = {};
9901 }
9902
9903 function hasValidRef(config) {
9904 {
9905 if (hasOwnProperty.call(config, 'ref')) {
9906 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
9907
9908 if (getter && getter.isReactWarning) {
9909 return false;
9910 }
9911 }
9912 }
9913
9914 return config.ref !== undefined;
9915 }
9916
9917 function hasValidKey(config) {
9918 {
9919 if (hasOwnProperty.call(config, 'key')) {
9920 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
9921
9922 if (getter && getter.isReactWarning) {
9923 return false;
9924 }
9925 }
9926 }
9927
9928 return config.key !== undefined;
9929 }
9930
9931 function warnIfStringRefCannotBeAutoConverted(config, self) {
9932 {
9933 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
9934 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
9935
9936 if (!didWarnAboutStringRefs[componentName]) {
9937 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);
9938
9939 didWarnAboutStringRefs[componentName] = true;
9940 }
9941 }
9942 }
9943 }
9944
9945 function defineKeyPropWarningGetter(props, displayName) {
9946 {
9947 var warnAboutAccessingKey = function () {
9948 if (!specialPropKeyWarningShown) {
9949 specialPropKeyWarningShown = true;
9950
9951 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);
9952 }
9953 };
9954
9955 warnAboutAccessingKey.isReactWarning = true;
9956 Object.defineProperty(props, 'key', {
9957 get: warnAboutAccessingKey,
9958 configurable: true
9959 });
9960 }
9961 }
9962
9963 function defineRefPropWarningGetter(props, displayName) {
9964 {
9965 var warnAboutAccessingRef = function () {
9966 if (!specialPropRefWarningShown) {
9967 specialPropRefWarningShown = true;
9968
9969 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);
9970 }
9971 };
9972
9973 warnAboutAccessingRef.isReactWarning = true;
9974 Object.defineProperty(props, 'ref', {
9975 get: warnAboutAccessingRef,
9976 configurable: true
9977 });
9978 }
9979 }
9980 /**
9981 * Factory method to create a new React element. This no longer adheres to
9982 * the class pattern, so do not use new to call it. Also, instanceof check
9983 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
9984 * if something is a React Element.
9985 *
9986 * @param {*} type
9987 * @param {*} props
9988 * @param {*} key
9989 * @param {string|object} ref
9990 * @param {*} owner
9991 * @param {*} self A *temporary* helper to detect places where `this` is
9992 * different from the `owner` when React.createElement is called, so that we
9993 * can warn. We want to get rid of owner and replace string `ref`s with arrow
9994 * functions, and as long as `this` and owner are the same, there will be no
9995 * change in behavior.
9996 * @param {*} source An annotation object (added by a transpiler or otherwise)
9997 * indicating filename, line number, and/or other information.
9998 * @internal
9999 */
10000
10001
10002 var ReactElement = function (type, key, ref, self, source, owner, props) {
10003 var element = {
10004 // This tag allows us to uniquely identify this as a React Element
10005 $$typeof: REACT_ELEMENT_TYPE,
10006 // Built-in properties that belong on the element
10007 type: type,
10008 key: key,
10009 ref: ref,
10010 props: props,
10011 // Record the component responsible for creating this element.
10012 _owner: owner
10013 };
10014
10015 {
10016 // The validation flag is currently mutative. We put it on
10017 // an external backing store so that we can freeze the whole object.
10018 // This can be replaced with a WeakMap once they are implemented in
10019 // commonly used development environments.
10020 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
10021 // the validation flag non-enumerable (where possible, which should
10022 // include every environment we run tests in), so the test framework
10023 // ignores it.
10024
10025 Object.defineProperty(element._store, 'validated', {
10026 configurable: false,
10027 enumerable: false,
10028 writable: true,
10029 value: false
10030 }); // self and source are DEV only properties.
10031
10032 Object.defineProperty(element, '_self', {
10033 configurable: false,
10034 enumerable: false,
10035 writable: false,
10036 value: self
10037 }); // Two elements created in two different places should be considered
10038 // equal for testing purposes and therefore we hide it from enumeration.
10039
10040 Object.defineProperty(element, '_source', {
10041 configurable: false,
10042 enumerable: false,
10043 writable: false,
10044 value: source
10045 });
10046
10047 if (Object.freeze) {
10048 Object.freeze(element.props);
10049 Object.freeze(element);
10050 }
10051 }
10052
10053 return element;
10054 };
10055 /**
10056 * https://github.com/reactjs/rfcs/pull/107
10057 * @param {*} type
10058 * @param {object} props
10059 * @param {string} key
10060 */
10061
10062 function jsxDEV(type, config, maybeKey, source, self) {
10063 {
10064 var propName; // Reserved names are extracted
10065
10066 var props = {};
10067 var key = null;
10068 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
10069 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
10070 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
10071 // but as an intermediary step, we will use jsxDEV for everything except
10072 // <div {...props} key="Hi" />, because we aren't currently able to tell if
10073 // key is explicitly declared to be undefined or not.
10074
10075 if (maybeKey !== undefined) {
10076 {
10077 checkKeyStringCoercion(maybeKey);
10078 }
10079
10080 key = '' + maybeKey;
10081 }
10082
10083 if (hasValidKey(config)) {
10084 {
10085 checkKeyStringCoercion(config.key);
10086 }
10087
10088 key = '' + config.key;
10089 }
10090
10091 if (hasValidRef(config)) {
10092 ref = config.ref;
10093 warnIfStringRefCannotBeAutoConverted(config, self);
10094 } // Remaining properties are added to a new props object
10095
10096
10097 for (propName in config) {
10098 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10099 props[propName] = config[propName];
10100 }
10101 } // Resolve default props
10102
10103
10104 if (type && type.defaultProps) {
10105 var defaultProps = type.defaultProps;
10106
10107 for (propName in defaultProps) {
10108 if (props[propName] === undefined) {
10109 props[propName] = defaultProps[propName];
10110 }
10111 }
10112 }
10113
10114 if (key || ref) {
10115 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
10116
10117 if (key) {
10118 defineKeyPropWarningGetter(props, displayName);
10119 }
10120
10121 if (ref) {
10122 defineRefPropWarningGetter(props, displayName);
10123 }
10124 }
10125
10126 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10127 }
10128 }
10129
10130 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
10131 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
10132
10133 function setCurrentlyValidatingElement$1(element) {
10134 {
10135 if (element) {
10136 var owner = element._owner;
10137 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
10138 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
10139 } else {
10140 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
10141 }
10142 }
10143 }
10144
10145 var propTypesMisspellWarningShown;
10146
10147 {
10148 propTypesMisspellWarningShown = false;
10149 }
10150 /**
10151 * Verifies the object is a ReactElement.
10152 * See https://reactjs.org/docs/react-api.html#isvalidelement
10153 * @param {?object} object
10154 * @return {boolean} True if `object` is a ReactElement.
10155 * @final
10156 */
10157
10158
10159 function isValidElement(object) {
10160 {
10161 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10162 }
10163 }
10164
10165 function getDeclarationErrorAddendum() {
10166 {
10167 if (ReactCurrentOwner$1.current) {
10168 var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
10169
10170 if (name) {
10171 return '\n\nCheck the render method of `' + name + '`.';
10172 }
10173 }
10174
10175 return '';
10176 }
10177 }
10178
10179 function getSourceInfoErrorAddendum(source) {
10180 {
10181 if (source !== undefined) {
10182 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
10183 var lineNumber = source.lineNumber;
10184 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
10185 }
10186
10187 return '';
10188 }
10189 }
10190 /**
10191 * Warn if there's no key explicitly set on dynamic arrays of children or
10192 * object keys are not valid. This allows us to keep track of children between
10193 * updates.
10194 */
10195
10196
10197 var ownerHasKeyUseWarning = {};
10198
10199 function getCurrentComponentErrorInfo(parentType) {
10200 {
10201 var info = getDeclarationErrorAddendum();
10202
10203 if (!info) {
10204 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10205
10206 if (parentName) {
10207 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
10208 }
10209 }
10210
10211 return info;
10212 }
10213 }
10214 /**
10215 * Warn if the element doesn't have an explicit key assigned to it.
10216 * This element is in an array. The array could grow and shrink or be
10217 * reordered. All children that haven't already been validated are required to
10218 * have a "key" property assigned to it. Error statuses are cached so a warning
10219 * will only be shown once.
10220 *
10221 * @internal
10222 * @param {ReactElement} element Element that requires a key.
10223 * @param {*} parentType element's parent's type.
10224 */
10225
10226
10227 function validateExplicitKey(element, parentType) {
10228 {
10229 if (!element._store || element._store.validated || element.key != null) {
10230 return;
10231 }
10232
10233 element._store.validated = true;
10234 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
10235
10236 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
10237 return;
10238 }
10239
10240 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
10241 // property, it may be the creator of the child that's responsible for
10242 // assigning it a key.
10243
10244 var childOwner = '';
10245
10246 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
10247 // Give the component that originally created this child.
10248 childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
10249 }
10250
10251 setCurrentlyValidatingElement$1(element);
10252
10253 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);
10254
10255 setCurrentlyValidatingElement$1(null);
10256 }
10257 }
10258 /**
10259 * Ensure that every element either is passed in a static location, in an
10260 * array with an explicit keys property defined, or in an object literal
10261 * with valid key property.
10262 *
10263 * @internal
10264 * @param {ReactNode} node Statically passed child of any type.
10265 * @param {*} parentType node's parent's type.
10266 */
10267
10268
10269 function validateChildKeys(node, parentType) {
10270 {
10271 if (typeof node !== 'object') {
10272 return;
10273 }
10274
10275 if (isArray(node)) {
10276 for (var i = 0; i < node.length; i++) {
10277 var child = node[i];
10278
10279 if (isValidElement(child)) {
10280 validateExplicitKey(child, parentType);
10281 }
10282 }
10283 } else if (isValidElement(node)) {
10284 // This element was passed in a valid location.
10285 if (node._store) {
10286 node._store.validated = true;
10287 }
10288 } else if (node) {
10289 var iteratorFn = getIteratorFn(node);
10290
10291 if (typeof iteratorFn === 'function') {
10292 // Entry iterators used to provide implicit keys,
10293 // but now we print a separate warning for them later.
10294 if (iteratorFn !== node.entries) {
10295 var iterator = iteratorFn.call(node);
10296 var step;
10297
10298 while (!(step = iterator.next()).done) {
10299 if (isValidElement(step.value)) {
10300 validateExplicitKey(step.value, parentType);
10301 }
10302 }
10303 }
10304 }
10305 }
10306 }
10307 }
10308 /**
10309 * Given an element, validate that its props follow the propTypes definition,
10310 * provided by the type.
10311 *
10312 * @param {ReactElement} element
10313 */
10314
10315
10316 function validatePropTypes(element) {
10317 {
10318 var type = element.type;
10319
10320 if (type === null || type === undefined || typeof type === 'string') {
10321 return;
10322 }
10323
10324 var propTypes;
10325
10326 if (typeof type === 'function') {
10327 propTypes = type.propTypes;
10328 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
10329 // Inner props are checked in the reconciler.
10330 type.$$typeof === REACT_MEMO_TYPE)) {
10331 propTypes = type.propTypes;
10332 } else {
10333 return;
10334 }
10335
10336 if (propTypes) {
10337 // Intentionally inside to avoid triggering lazy initializers:
10338 var name = getComponentNameFromType(type);
10339 checkPropTypes(propTypes, element.props, 'prop', name, element);
10340 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
10341 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
10342
10343 var _name = getComponentNameFromType(type);
10344
10345 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
10346 }
10347
10348 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
10349 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
10350 }
10351 }
10352 }
10353 /**
10354 * Given a fragment, validate that it can only be provided with fragment props
10355 * @param {ReactElement} fragment
10356 */
10357
10358
10359 function validateFragmentProps(fragment) {
10360 {
10361 var keys = Object.keys(fragment.props);
10362
10363 for (var i = 0; i < keys.length; i++) {
10364 var key = keys[i];
10365
10366 if (key !== 'children' && key !== 'key') {
10367 setCurrentlyValidatingElement$1(fragment);
10368
10369 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
10370
10371 setCurrentlyValidatingElement$1(null);
10372 break;
10373 }
10374 }
10375
10376 if (fragment.ref !== null) {
10377 setCurrentlyValidatingElement$1(fragment);
10378
10379 error('Invalid attribute `ref` supplied to `React.Fragment`.');
10380
10381 setCurrentlyValidatingElement$1(null);
10382 }
10383 }
10384 }
10385
10386 var didWarnAboutKeySpread = {};
10387 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
10388 {
10389 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
10390 // succeed and there will likely be errors in render.
10391
10392 if (!validType) {
10393 var info = '';
10394
10395 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
10396 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.";
10397 }
10398
10399 var sourceInfo = getSourceInfoErrorAddendum(source);
10400
10401 if (sourceInfo) {
10402 info += sourceInfo;
10403 } else {
10404 info += getDeclarationErrorAddendum();
10405 }
10406
10407 var typeString;
10408
10409 if (type === null) {
10410 typeString = 'null';
10411 } else if (isArray(type)) {
10412 typeString = 'array';
10413 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
10414 typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
10415 info = ' Did you accidentally export a JSX literal instead of a component?';
10416 } else {
10417 typeString = typeof type;
10418 }
10419
10420 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);
10421 }
10422
10423 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
10424 // TODO: Drop this when these are no longer allowed as the type argument.
10425
10426 if (element == null) {
10427 return element;
10428 } // Skip key warning if the type isn't valid since our key validation logic
10429 // doesn't expect a non-string/function type and can throw confusing errors.
10430 // We don't want exception behavior to differ between dev and prod.
10431 // (Rendering will throw with a helpful message and as soon as the type is
10432 // fixed, the key warnings will appear.)
10433
10434
10435 if (validType) {
10436 var children = props.children;
10437
10438 if (children !== undefined) {
10439 if (isStaticChildren) {
10440 if (isArray(children)) {
10441 for (var i = 0; i < children.length; i++) {
10442 validateChildKeys(children[i], type);
10443 }
10444
10445 if (Object.freeze) {
10446 Object.freeze(children);
10447 }
10448 } else {
10449 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.');
10450 }
10451 } else {
10452 validateChildKeys(children, type);
10453 }
10454 }
10455 }
10456
10457 {
10458 if (hasOwnProperty.call(props, 'key')) {
10459 var componentName = getComponentNameFromType(type);
10460 var keys = Object.keys(props).filter(function (k) {
10461 return k !== 'key';
10462 });
10463 var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
10464
10465 if (!didWarnAboutKeySpread[componentName + beforeExample]) {
10466 var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
10467
10468 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);
10469
10470 didWarnAboutKeySpread[componentName + beforeExample] = true;
10471 }
10472 }
10473 }
10474
10475 if (type === REACT_FRAGMENT_TYPE) {
10476 validateFragmentProps(element);
10477 } else {
10478 validatePropTypes(element);
10479 }
10480
10481 return element;
10482 }
10483 } // These two functions exist to still get child warnings in dev
10484 // even with the prod transform. This means that jsxDEV is purely
10485 // opt-in behavior for better messages but that we won't stop
10486 // giving you warnings if you use production apis.
10487
10488 function jsxWithValidationStatic(type, props, key) {
10489 {
10490 return jsxWithValidation(type, props, key, true);
10491 }
10492 }
10493 function jsxWithValidationDynamic(type, props, key) {
10494 {
10495 return jsxWithValidation(type, props, key, false);
10496 }
10497 }
10498
10499 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
10500 // for now we can ship identical prod functions
10501
10502 var jsxs = jsxWithValidationStatic ;
10503
10504 exports.Fragment = REACT_FRAGMENT_TYPE;
10505 exports.jsx = jsx;
10506 exports.jsxs = jsxs;
10507 })();
10508 }
10509
10510
10511 /***/ }),
10512
10513 /***/ "./node_modules/react/jsx-runtime.js":
10514 /*!*******************************************!*\
10515 !*** ./node_modules/react/jsx-runtime.js ***!
10516 \*******************************************/
10517 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10518
10519 "use strict";
10520
10521
10522 if (false) {} else {
10523 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
10524 }
10525
10526
10527 /***/ }),
10528
10529 /***/ "./node_modules/styled-components/dist/styled-components.browser.esm.js":
10530 /*!******************************************************************************!*\
10531 !*** ./node_modules/styled-components/dist/styled-components.browser.esm.js ***!
10532 \******************************************************************************/
10533 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10534
10535 "use strict";
10536 __webpack_require__.r(__webpack_exports__);
10537 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10538 /* harmony export */ "ServerStyleSheet": () => (/* binding */ ServerStyleSheet),
10539 /* harmony export */ "StyleSheetConsumer": () => (/* binding */ StyleSheetConsumer),
10540 /* harmony export */ "StyleSheetContext": () => (/* binding */ StyleSheetContext),
10541 /* harmony export */ "StyleSheetManager": () => (/* binding */ StyleSheetManager),
10542 /* harmony export */ "ThemeConsumer": () => (/* binding */ ThemeConsumer),
10543 /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
10544 /* harmony export */ "ThemeProvider": () => (/* binding */ ThemeProvider),
10545 /* 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),
10546 /* harmony export */ "createGlobalStyle": () => (/* binding */ createGlobalStyle),
10547 /* harmony export */ "css": () => (/* binding */ css),
10548 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10549 /* harmony export */ "isStyledComponent": () => (/* binding */ isStyledComponent),
10550 /* harmony export */ "keyframes": () => (/* binding */ keyframes),
10551 /* harmony export */ "withTheme": () => (/* binding */ withTheme)
10552 /* harmony export */ });
10553 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis/stylis.min */ "./node_modules/stylis/stylis.min.js");
10554 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__);
10555 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis-rule-sheet */ "./node_modules/stylis-rule-sheet/index.js");
10556 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__);
10557 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
10558 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
10559 /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
10560 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
10561 /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js");
10562 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
10563 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
10564 /* 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");
10565 /* harmony import */ var merge_anything__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! merge-anything */ "./node_modules/merge-anything/dist/index.esm.js");
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576 //
10577
10578 var interleave = (function (strings, interpolations) {
10579 var result = [strings[0]];
10580
10581 for (var i = 0, len = interpolations.length; i < len; i += 1) {
10582 result.push(interpolations[i], strings[i + 1]);
10583 }
10584
10585 return result;
10586 });
10587
10588 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
10589 return typeof obj;
10590 } : function (obj) {
10591 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
10592 };
10593
10594 var classCallCheck = function (instance, Constructor) {
10595 if (!(instance instanceof Constructor)) {
10596 throw new TypeError("Cannot call a class as a function");
10597 }
10598 };
10599
10600 var createClass = function () {
10601 function defineProperties(target, props) {
10602 for (var i = 0; i < props.length; i++) {
10603 var descriptor = props[i];
10604 descriptor.enumerable = descriptor.enumerable || false;
10605 descriptor.configurable = true;
10606 if ("value" in descriptor) descriptor.writable = true;
10607 Object.defineProperty(target, descriptor.key, descriptor);
10608 }
10609 }
10610
10611 return function (Constructor, protoProps, staticProps) {
10612 if (protoProps) defineProperties(Constructor.prototype, protoProps);
10613 if (staticProps) defineProperties(Constructor, staticProps);
10614 return Constructor;
10615 };
10616 }();
10617
10618 var _extends = Object.assign || function (target) {
10619 for (var i = 1; i < arguments.length; i++) {
10620 var source = arguments[i];
10621
10622 for (var key in source) {
10623 if (Object.prototype.hasOwnProperty.call(source, key)) {
10624 target[key] = source[key];
10625 }
10626 }
10627 }
10628
10629 return target;
10630 };
10631
10632 var inherits = function (subClass, superClass) {
10633 if (typeof superClass !== "function" && superClass !== null) {
10634 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
10635 }
10636
10637 subClass.prototype = Object.create(superClass && superClass.prototype, {
10638 constructor: {
10639 value: subClass,
10640 enumerable: false,
10641 writable: true,
10642 configurable: true
10643 }
10644 });
10645 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10646 };
10647
10648 var objectWithoutProperties = function (obj, keys) {
10649 var target = {};
10650
10651 for (var i in obj) {
10652 if (keys.indexOf(i) >= 0) continue;
10653 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
10654 target[i] = obj[i];
10655 }
10656
10657 return target;
10658 };
10659
10660 var possibleConstructorReturn = function (self, call) {
10661 if (!self) {
10662 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10663 }
10664
10665 return call && (typeof call === "object" || typeof call === "function") ? call : self;
10666 };
10667
10668 //
10669 var isPlainObject = (function (x) {
10670 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
10671 });
10672
10673 //
10674 var EMPTY_ARRAY = Object.freeze([]);
10675 var EMPTY_OBJECT = Object.freeze({});
10676
10677 //
10678 function isFunction(test) {
10679 return typeof test === 'function';
10680 }
10681
10682 //
10683
10684 function getComponentName(target) {
10685 return ( true ? typeof target === 'string' && target : 0) || target.displayName || target.name || 'Component';
10686 }
10687
10688 //
10689 function isStatelessFunction(test) {
10690 return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
10691 }
10692
10693 //
10694 function isStyledComponent(target) {
10695 return target && typeof target.styledComponentId === 'string';
10696 }
10697
10698 //
10699
10700 var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
10701
10702 var SC_VERSION_ATTR = 'data-styled-version';
10703
10704 var SC_STREAM_ATTR = 'data-styled-streamed';
10705
10706 var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
10707
10708 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';
10709
10710 // Shared empty execution context when generating static styles
10711 var STATIC_EXECUTION_CONTEXT = {};
10712
10713 //
10714
10715
10716 /**
10717 * Parse errors.md and turn it into a simple hash of code: message
10718 */
10719 var ERRORS = true ? {
10720 "1": "Cannot create styled-component for component: %s.\n\n",
10721 "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",
10722 "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
10723 "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",
10724 "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",
10725 "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",
10726 "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
10727 "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
10728 "9": "Missing document `<head>`\n\n",
10729 "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",
10730 "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",
10731 "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",
10732 "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"
10733 } : 0;
10734
10735 /**
10736 * super basic version of sprintf
10737 */
10738 function format() {
10739 var a = arguments.length <= 0 ? undefined : arguments[0];
10740 var b = [];
10741
10742 for (var c = 1, len = arguments.length; c < len; c += 1) {
10743 b.push(arguments.length <= c ? undefined : arguments[c]);
10744 }
10745
10746 b.forEach(function (d) {
10747 a = a.replace(/%[a-z]/, d);
10748 });
10749
10750 return a;
10751 }
10752
10753 /**
10754 * Create an error file out of errors.md for development and a simple web link to the full errors
10755 * in production mode.
10756 */
10757
10758 var StyledComponentsError = function (_Error) {
10759 inherits(StyledComponentsError, _Error);
10760
10761 function StyledComponentsError(code) {
10762 classCallCheck(this, StyledComponentsError);
10763
10764 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10765 interpolations[_key - 1] = arguments[_key];
10766 }
10767
10768 if (false) { var _this; } else {
10769 var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
10770 }
10771 return possibleConstructorReturn(_this);
10772 }
10773
10774 return StyledComponentsError;
10775 }(Error);
10776
10777 //
10778 var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
10779
10780 var extractComps = (function (maybeCSS) {
10781 var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
10782 var existingComponents = [];
10783 css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
10784 existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
10785 return match;
10786 });
10787 return existingComponents.map(function (_ref, i) {
10788 var componentId = _ref.componentId,
10789 matchIndex = _ref.matchIndex;
10790
10791 var nextComp = existingComponents[i + 1];
10792 var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
10793 return { componentId: componentId, cssFromDOM: cssFromDOM };
10794 });
10795 });
10796
10797 //
10798
10799 var COMMENT_REGEX = /^\s*\/\/.*$/gm;
10800
10801 // NOTE: This stylis instance is only used to split rules from SSR'd style tags
10802 var stylisSplitter = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10803 global: false,
10804 cascade: true,
10805 keyframe: false,
10806 prefix: false,
10807 compress: false,
10808 semicolon: true
10809 });
10810
10811 var stylis = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10812 global: false,
10813 cascade: true,
10814 keyframe: false,
10815 prefix: true,
10816 compress: false,
10817 semicolon: false // NOTE: This means "autocomplete missing semicolons"
10818 });
10819
10820 // Wrap `insertRulePlugin to build a list of rules,
10821 // and then make our own plugin to return the rules. This
10822 // makes it easier to hook into the existing SSR architecture
10823
10824 var parsingRules = [];
10825
10826 // eslint-disable-next-line consistent-return
10827 var returnRulesPlugin = function returnRulesPlugin(context) {
10828 if (context === -2) {
10829 var parsedRules = parsingRules;
10830 parsingRules = [];
10831 return parsedRules;
10832 }
10833 };
10834
10835 var parseRulesPlugin = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) {
10836 parsingRules.push(rule);
10837 });
10838
10839 var _componentId = void 0;
10840 var _selector = void 0;
10841 var _selectorRegexp = void 0;
10842
10843 var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
10844 if (
10845 // the first self-ref is always untouched
10846 offset > 0 &&
10847 // there should be at least two self-refs to do a replacement (.b > .b)
10848 string.slice(0, offset).indexOf(_selector) !== -1 &&
10849 // no consecutive self refs (.b.b); that is a precedence boost and treated differently
10850 string.slice(offset - _selector.length, offset) !== _selector) {
10851 return '.' + _componentId;
10852 }
10853
10854 return match;
10855 };
10856
10857 /**
10858 * When writing a style like
10859 *
10860 * & + & {
10861 * color: red;
10862 * }
10863 *
10864 * The second ampersand should be a reference to the static component class. stylis
10865 * has no knowledge of static class so we have to intelligently replace the base selector.
10866 */
10867 var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
10868 if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
10869 // eslint-disable-next-line no-param-reassign
10870 selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
10871 }
10872 };
10873
10874 stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
10875 stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
10876
10877 var splitByRules = function splitByRules(css) {
10878 return stylisSplitter('', css);
10879 };
10880
10881 function stringifyRules(rules, selector, prefix) {
10882 var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
10883
10884 var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
10885
10886 var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
10887
10888 // stylis has no concept of state to be passed to plugins
10889 // but since JS is single=threaded, we can rely on that to ensure
10890 // these properties stay in sync with the current stylis run
10891 _componentId = componentId;
10892 _selector = selector;
10893 _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
10894
10895 return stylis(prefix || !selector ? '' : selector, cssStr);
10896 }
10897
10898 //
10899 /* eslint-disable camelcase, no-undef */
10900
10901 var getNonce = (function () {
10902 return true ? __webpack_require__.nc : 0;
10903 });
10904
10905 //
10906 /* These are helpers for the StyleTags to keep track of the injected
10907 * rule names for each (component) ID that they're keeping track of.
10908 * They're crucial for detecting whether a name has already been
10909 * injected.
10910 * (This excludes rehydrated names) */
10911
10912 /* adds a new ID:name pairing to a names dictionary */
10913 var addNameForId = function addNameForId(names, id, name) {
10914 if (name) {
10915 // eslint-disable-next-line no-param-reassign
10916 var namesForId = names[id] || (names[id] = Object.create(null));
10917 namesForId[name] = true;
10918 }
10919 };
10920
10921 /* resets an ID entirely by overwriting it in the dictionary */
10922 var resetIdNames = function resetIdNames(names, id) {
10923 // eslint-disable-next-line no-param-reassign
10924 names[id] = Object.create(null);
10925 };
10926
10927 /* factory for a names dictionary checking the existance of an ID:name pairing */
10928 var hasNameForId = function hasNameForId(names) {
10929 return function (id, name) {
10930 return names[id] !== undefined && names[id][name];
10931 };
10932 };
10933
10934 /* stringifies names for the html/element output */
10935 var stringifyNames = function stringifyNames(names) {
10936 var str = '';
10937 // eslint-disable-next-line guard-for-in
10938 for (var id in names) {
10939 str += Object.keys(names[id]).join(' ') + ' ';
10940 }
10941 return str.trim();
10942 };
10943
10944 /* clones the nested names dictionary */
10945 var cloneNames = function cloneNames(names) {
10946 var clone = Object.create(null);
10947 // eslint-disable-next-line guard-for-in
10948 for (var id in names) {
10949 clone[id] = _extends({}, names[id]);
10950 }
10951 return clone;
10952 };
10953
10954 //
10955
10956 /* These are helpers that deal with the insertRule (aka speedy) API
10957 * They are used in the StyleTags and specifically the speedy tag
10958 */
10959
10960 /* retrieve a sheet for a given style tag */
10961 var sheetForTag = function sheetForTag(tag) {
10962 // $FlowFixMe
10963 if (tag.sheet) return tag.sheet;
10964
10965 /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
10966 var size = tag.ownerDocument.styleSheets.length;
10967 for (var i = 0; i < size; i += 1) {
10968 var sheet = tag.ownerDocument.styleSheets[i];
10969 // $FlowFixMe
10970 if (sheet.ownerNode === tag) return sheet;
10971 }
10972
10973 /* we should always be able to find a tag */
10974 throw new StyledComponentsError(10);
10975 };
10976
10977 /* insert a rule safely and return whether it was actually injected */
10978 var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
10979 /* abort early if cssRule string is falsy */
10980 if (!cssRule) return false;
10981
10982 var maxIndex = sheet.cssRules.length;
10983
10984 try {
10985 /* use insertRule and cap passed index with maxIndex (no of cssRules) */
10986 sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
10987 } catch (err) {
10988 /* any error indicates an invalid rule */
10989 return false;
10990 }
10991
10992 return true;
10993 };
10994
10995 /* deletes `size` rules starting from `removalIndex` */
10996 var deleteRules = function deleteRules(sheet, removalIndex, size) {
10997 var lowerBound = removalIndex - size;
10998 for (var i = removalIndex; i > lowerBound; i -= 1) {
10999 sheet.deleteRule(i);
11000 }
11001 };
11002
11003 //
11004
11005 /* this marker separates component styles and is important for rehydration */
11006 var makeTextMarker = function makeTextMarker(id) {
11007 return '\n/* sc-component-id: ' + id + ' */\n';
11008 };
11009
11010 /* add up all numbers in array up until and including the index */
11011 var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
11012 var totalUpToIndex = 0;
11013 for (var i = 0; i <= index; i += 1) {
11014 totalUpToIndex += sizes[i];
11015 }
11016
11017 return totalUpToIndex;
11018 };
11019
11020 /* create a new style tag after lastEl */
11021 var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
11022 var targetDocument = document;
11023 if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;
11024
11025 var el = targetDocument.createElement('style');
11026 el.setAttribute(SC_ATTR, '');
11027 el.setAttribute(SC_VERSION_ATTR, "4.4.1");
11028
11029 var nonce = getNonce();
11030 if (nonce) {
11031 el.setAttribute('nonce', nonce);
11032 }
11033
11034 /* Work around insertRule quirk in EdgeHTML */
11035 el.appendChild(targetDocument.createTextNode(''));
11036
11037 if (target && !tagEl) {
11038 /* Append to target when no previous element was passed */
11039 target.appendChild(el);
11040 } else {
11041 if (!tagEl || !target || !tagEl.parentNode) {
11042 throw new StyledComponentsError(6);
11043 }
11044
11045 /* Insert new style tag after the previous one */
11046 tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
11047 }
11048
11049 return el;
11050 };
11051
11052 /* takes a css factory function and outputs an html styled tag factory */
11053 var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
11054 return function (additionalAttrs) {
11055 var nonce = getNonce();
11056 var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.4.1" + '"', additionalAttrs];
11057
11058 var htmlAttr = attrs.filter(Boolean).join(' ');
11059 return '<style ' + htmlAttr + '>' + css() + '</style>';
11060 };
11061 };
11062
11063 /* takes a css factory function and outputs an element factory */
11064 var wrapAsElement = function wrapAsElement(css, names) {
11065 return function () {
11066 var _props;
11067
11068 var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.4.1", _props);
11069
11070 var nonce = getNonce();
11071 if (nonce) {
11072 // $FlowFixMe
11073 props.nonce = nonce;
11074 }
11075
11076 // eslint-disable-next-line react/no-danger
11077 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
11078 };
11079 };
11080
11081 var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
11082 return function () {
11083 return Object.keys(markers);
11084 };
11085 };
11086
11087 /* speedy tags utilise insertRule */
11088 var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
11089 var names = Object.create(null);
11090 var markers = Object.create(null);
11091 var sizes = [];
11092
11093 var extractImport = getImportRuleTag !== undefined;
11094 /* indicates whether getImportRuleTag was called */
11095 var usedImportRuleTag = false;
11096
11097 var insertMarker = function insertMarker(id) {
11098 var prev = markers[id];
11099 if (prev !== undefined) {
11100 return prev;
11101 }
11102
11103 markers[id] = sizes.length;
11104 sizes.push(0);
11105 resetIdNames(names, id);
11106
11107 return markers[id];
11108 };
11109
11110 var insertRules = function insertRules(id, cssRules, name) {
11111 var marker = insertMarker(id);
11112 var sheet = sheetForTag(el);
11113 var insertIndex = addUpUntilIndex(sizes, marker);
11114
11115 var injectedRules = 0;
11116 var importRules = [];
11117 var cssRulesSize = cssRules.length;
11118
11119 for (var i = 0; i < cssRulesSize; i += 1) {
11120 var cssRule = cssRules[i];
11121 var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
11122 if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
11123 importRules.push(cssRule);
11124 } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
11125 mayHaveImport = false;
11126 injectedRules += 1;
11127 }
11128 }
11129
11130 if (extractImport && importRules.length > 0) {
11131 usedImportRuleTag = true;
11132 // $FlowFixMe
11133 getImportRuleTag().insertRules(id + '-import', importRules);
11134 }
11135
11136 sizes[marker] += injectedRules; /* add up no of injected rules */
11137 addNameForId(names, id, name);
11138 };
11139
11140 var removeRules = function removeRules(id) {
11141 var marker = markers[id];
11142 if (marker === undefined) return;
11143 // $FlowFixMe
11144 if (el.isConnected === false) return;
11145
11146 var size = sizes[marker];
11147 var sheet = sheetForTag(el);
11148 var removalIndex = addUpUntilIndex(sizes, marker) - 1;
11149 deleteRules(sheet, removalIndex, size);
11150 sizes[marker] = 0;
11151 resetIdNames(names, id);
11152
11153 if (extractImport && usedImportRuleTag) {
11154 // $FlowFixMe
11155 getImportRuleTag().removeRules(id + '-import');
11156 }
11157 };
11158
11159 var css = function css() {
11160 var _sheetForTag = sheetForTag(el),
11161 cssRules = _sheetForTag.cssRules;
11162
11163 var str = '';
11164
11165 // eslint-disable-next-line guard-for-in
11166 for (var id in markers) {
11167 str += makeTextMarker(id);
11168 var marker = markers[id];
11169 var end = addUpUntilIndex(sizes, marker);
11170 var size = sizes[marker];
11171 for (var i = end - size; i < end; i += 1) {
11172 var rule = cssRules[i];
11173 if (rule !== undefined) {
11174 str += rule.cssText;
11175 }
11176 }
11177 }
11178
11179 return str;
11180 };
11181
11182 return {
11183 clone: function clone() {
11184 throw new StyledComponentsError(5);
11185 },
11186
11187 css: css,
11188 getIds: getIdsFromMarkersFactory(markers),
11189 hasNameForId: hasNameForId(names),
11190 insertMarker: insertMarker,
11191 insertRules: insertRules,
11192 removeRules: removeRules,
11193 sealed: false,
11194 styleTag: el,
11195 toElement: wrapAsElement(css, names),
11196 toHTML: wrapAsHtmlTag(css, names)
11197 };
11198 };
11199
11200 var makeTextNode = function makeTextNode(targetDocument, id) {
11201 return targetDocument.createTextNode(makeTextMarker(id));
11202 };
11203
11204 var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
11205 var names = Object.create(null);
11206 var markers = Object.create(null);
11207
11208 var extractImport = getImportRuleTag !== undefined;
11209
11210 /* indicates whether getImportRuleTag was called */
11211 var usedImportRuleTag = false;
11212
11213 var insertMarker = function insertMarker(id) {
11214 var prev = markers[id];
11215 if (prev !== undefined) {
11216 return prev;
11217 }
11218
11219 markers[id] = makeTextNode(el.ownerDocument, id);
11220 el.appendChild(markers[id]);
11221 names[id] = Object.create(null);
11222
11223 return markers[id];
11224 };
11225
11226 var insertRules = function insertRules(id, cssRules, name) {
11227 var marker = insertMarker(id);
11228 var importRules = [];
11229 var cssRulesSize = cssRules.length;
11230
11231 for (var i = 0; i < cssRulesSize; i += 1) {
11232 var rule = cssRules[i];
11233 var mayHaveImport = extractImport;
11234 if (mayHaveImport && rule.indexOf('@import') !== -1) {
11235 importRules.push(rule);
11236 } else {
11237 mayHaveImport = false;
11238 var separator = i === cssRulesSize - 1 ? '' : ' ';
11239 marker.appendData('' + rule + separator);
11240 }
11241 }
11242
11243 addNameForId(names, id, name);
11244
11245 if (extractImport && importRules.length > 0) {
11246 usedImportRuleTag = true;
11247 // $FlowFixMe
11248 getImportRuleTag().insertRules(id + '-import', importRules);
11249 }
11250 };
11251
11252 var removeRules = function removeRules(id) {
11253 var marker = markers[id];
11254 if (marker === undefined) return;
11255
11256 /* create new empty text node and replace the current one */
11257 var newMarker = makeTextNode(el.ownerDocument, id);
11258 el.replaceChild(newMarker, marker);
11259 markers[id] = newMarker;
11260 resetIdNames(names, id);
11261
11262 if (extractImport && usedImportRuleTag) {
11263 // $FlowFixMe
11264 getImportRuleTag().removeRules(id + '-import');
11265 }
11266 };
11267
11268 var css = function css() {
11269 var str = '';
11270
11271 // eslint-disable-next-line guard-for-in
11272 for (var id in markers) {
11273 str += markers[id].data;
11274 }
11275
11276 return str;
11277 };
11278
11279 return {
11280 clone: function clone() {
11281 throw new StyledComponentsError(5);
11282 },
11283
11284 css: css,
11285 getIds: getIdsFromMarkersFactory(markers),
11286 hasNameForId: hasNameForId(names),
11287 insertMarker: insertMarker,
11288 insertRules: insertRules,
11289 removeRules: removeRules,
11290 sealed: false,
11291 styleTag: el,
11292 toElement: wrapAsElement(css, names),
11293 toHTML: wrapAsHtmlTag(css, names)
11294 };
11295 };
11296
11297 var makeServerTag = function makeServerTag(namesArg, markersArg) {
11298 var names = namesArg === undefined ? Object.create(null) : namesArg;
11299 var markers = markersArg === undefined ? Object.create(null) : markersArg;
11300
11301 var insertMarker = function insertMarker(id) {
11302 var prev = markers[id];
11303 if (prev !== undefined) {
11304 return prev;
11305 }
11306
11307 return markers[id] = [''];
11308 };
11309
11310 var insertRules = function insertRules(id, cssRules, name) {
11311 var marker = insertMarker(id);
11312 marker[0] += cssRules.join(' ');
11313 addNameForId(names, id, name);
11314 };
11315
11316 var removeRules = function removeRules(id) {
11317 var marker = markers[id];
11318 if (marker === undefined) return;
11319 marker[0] = '';
11320 resetIdNames(names, id);
11321 };
11322
11323 var css = function css() {
11324 var str = '';
11325 // eslint-disable-next-line guard-for-in
11326 for (var id in markers) {
11327 var cssForId = markers[id][0];
11328 if (cssForId) {
11329 str += makeTextMarker(id) + cssForId;
11330 }
11331 }
11332 return str;
11333 };
11334
11335 var clone = function clone() {
11336 var namesClone = cloneNames(names);
11337 var markersClone = Object.create(null);
11338
11339 // eslint-disable-next-line guard-for-in
11340 for (var id in markers) {
11341 markersClone[id] = [markers[id][0]];
11342 }
11343
11344 return makeServerTag(namesClone, markersClone);
11345 };
11346
11347 var tag = {
11348 clone: clone,
11349 css: css,
11350 getIds: getIdsFromMarkersFactory(markers),
11351 hasNameForId: hasNameForId(names),
11352 insertMarker: insertMarker,
11353 insertRules: insertRules,
11354 removeRules: removeRules,
11355 sealed: false,
11356 styleTag: null,
11357 toElement: wrapAsElement(css, names),
11358 toHTML: wrapAsHtmlTag(css, names)
11359 };
11360
11361 return tag;
11362 };
11363
11364 var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
11365 if (IS_BROWSER && !forceServer) {
11366 var el = makeStyleTag(target, tagEl, insertBefore);
11367
11368 if (DISABLE_SPEEDY) {
11369 return makeBrowserTag(el, getImportRuleTag);
11370 } else {
11371 return makeSpeedyTag(el, getImportRuleTag);
11372 }
11373 }
11374
11375 return makeServerTag();
11376 };
11377
11378 var rehydrate = function rehydrate(tag, els, extracted) {
11379 /* add all extracted components to the new tag */
11380 for (var i = 0, len = extracted.length; i < len; i += 1) {
11381 var _extracted$i = extracted[i],
11382 componentId = _extracted$i.componentId,
11383 cssFromDOM = _extracted$i.cssFromDOM;
11384
11385 var cssRules = splitByRules(cssFromDOM);
11386 tag.insertRules(componentId, cssRules);
11387 }
11388
11389 /* remove old HTMLStyleElements, since they have been rehydrated */
11390 for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
11391 var el = els[_i];
11392 if (el.parentNode) {
11393 el.parentNode.removeChild(el);
11394 }
11395 }
11396 };
11397
11398 //
11399
11400 var SPLIT_REGEX = /\s+/;
11401
11402 /* determine the maximum number of components before tags are sharded */
11403 var MAX_SIZE = void 0;
11404 if (IS_BROWSER) {
11405 /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
11406 MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
11407 } else {
11408 /* for servers we do not need to shard at all */
11409 MAX_SIZE = -1;
11410 }
11411
11412 var sheetRunningId = 0;
11413 var master = void 0;
11414
11415 var StyleSheet = function () {
11416
11417 /* a map from ids to tags */
11418
11419 /* deferred rules for a given id */
11420
11421 /* this is used for not reinjecting rules via hasNameForId() */
11422
11423 /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
11424
11425 /* a list of tags belonging to this StyleSheet */
11426
11427 /* a tag for import rules */
11428
11429 /* current capacity until a new tag must be created */
11430
11431 /* children (aka clones) of this StyleSheet inheriting all and future injections */
11432
11433 function StyleSheet() {
11434 var _this = this;
11435
11436 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
11437 var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11438 classCallCheck(this, StyleSheet);
11439
11440 this.getImportRuleTag = function () {
11441 var importRuleTag = _this.importRuleTag;
11442
11443 if (importRuleTag !== undefined) {
11444 return importRuleTag;
11445 }
11446
11447 var firstTag = _this.tags[0];
11448 var insertBefore = true;
11449
11450 return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
11451 };
11452
11453 sheetRunningId += 1;
11454 this.id = sheetRunningId;
11455 this.forceServer = forceServer;
11456 this.target = forceServer ? null : target;
11457 this.tagMap = {};
11458 this.deferred = {};
11459 this.rehydratedNames = {};
11460 this.ignoreRehydratedNames = {};
11461 this.tags = [];
11462 this.capacity = 1;
11463 this.clones = [];
11464 }
11465
11466 /* rehydrate all SSR'd style tags */
11467
11468
11469 StyleSheet.prototype.rehydrate = function rehydrate$$1() {
11470 if (!IS_BROWSER || this.forceServer) return this;
11471
11472 var els = [];
11473 var extracted = [];
11474 var isStreamed = false;
11475
11476 /* retrieve all of our SSR style elements from the DOM */
11477 var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.4.1" + '"]');
11478
11479 var nodesSize = nodes.length;
11480
11481 /* abort rehydration if no previous style tags were found */
11482 if (!nodesSize) return this;
11483
11484 for (var i = 0; i < nodesSize; i += 1) {
11485 var el = nodes[i];
11486
11487 /* check if style tag is a streamed tag */
11488 if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
11489
11490 /* retrieve all component names */
11491 var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
11492 var elNamesSize = elNames.length;
11493 for (var j = 0, name; j < elNamesSize; j += 1) {
11494 name = elNames[j];
11495 /* add rehydrated name to sheet to avoid re-adding styles */
11496 this.rehydratedNames[name] = true;
11497 }
11498
11499 /* extract all components and their CSS */
11500 extracted.push.apply(extracted, extractComps(el.textContent));
11501
11502 /* store original HTMLStyleElement */
11503 els.push(el);
11504 }
11505
11506 /* abort rehydration if nothing was extracted */
11507 var extractedSize = extracted.length;
11508 if (!extractedSize) return this;
11509
11510 /* create a tag to be used for rehydration */
11511 var tag = this.makeTag(null);
11512
11513 rehydrate(tag, els, extracted);
11514
11515 /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
11516 this.capacity = Math.max(1, MAX_SIZE - extractedSize);
11517 this.tags.push(tag);
11518
11519 /* retrieve all component ids */
11520 for (var _j = 0; _j < extractedSize; _j += 1) {
11521 this.tagMap[extracted[_j].componentId] = tag;
11522 }
11523
11524 return this;
11525 };
11526
11527 /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
11528 * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
11529 * StyleSheetManager's context */
11530
11531
11532 /* reset the internal "master" instance */
11533 StyleSheet.reset = function reset() {
11534 var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
11535
11536 master = new StyleSheet(undefined, forceServer).rehydrate();
11537 };
11538
11539 /* adds "children" to the StyleSheet that inherit all of the parents' rules
11540 * while their own rules do not affect the parent */
11541
11542
11543 StyleSheet.prototype.clone = function clone() {
11544 var sheet = new StyleSheet(this.target, this.forceServer);
11545
11546 /* add to clone array */
11547 this.clones.push(sheet);
11548
11549 /* clone all tags */
11550 sheet.tags = this.tags.map(function (tag) {
11551 var ids = tag.getIds();
11552 var newTag = tag.clone();
11553
11554 /* reconstruct tagMap */
11555 for (var i = 0; i < ids.length; i += 1) {
11556 sheet.tagMap[ids[i]] = newTag;
11557 }
11558
11559 return newTag;
11560 });
11561
11562 /* clone other maps */
11563 sheet.rehydratedNames = _extends({}, this.rehydratedNames);
11564 sheet.deferred = _extends({}, this.deferred);
11565
11566 return sheet;
11567 };
11568
11569 /* force StyleSheet to create a new tag on the next injection */
11570
11571
11572 StyleSheet.prototype.sealAllTags = function sealAllTags() {
11573 this.capacity = 1;
11574
11575 this.tags.forEach(function (tag) {
11576 // eslint-disable-next-line no-param-reassign
11577 tag.sealed = true;
11578 });
11579 };
11580
11581 StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
11582 var lastEl = tag ? tag.styleTag : null;
11583 var insertBefore = false;
11584
11585 return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
11586 };
11587
11588 /* get a tag for a given componentId, assign the componentId to one, or shard */
11589 StyleSheet.prototype.getTagForId = function getTagForId(id) {
11590 /* simply return a tag, when the componentId was already assigned one */
11591 var prev = this.tagMap[id];
11592 if (prev !== undefined && !prev.sealed) {
11593 return prev;
11594 }
11595
11596 var tag = this.tags[this.tags.length - 1];
11597
11598 /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
11599 this.capacity -= 1;
11600
11601 if (this.capacity === 0) {
11602 this.capacity = MAX_SIZE;
11603 tag = this.makeTag(tag);
11604 this.tags.push(tag);
11605 }
11606
11607 return this.tagMap[id] = tag;
11608 };
11609
11610 /* mainly for createGlobalStyle to check for its id */
11611
11612
11613 StyleSheet.prototype.hasId = function hasId(id) {
11614 return this.tagMap[id] !== undefined;
11615 };
11616
11617 /* caching layer checking id+name to already have a corresponding tag and injected rules */
11618
11619
11620 StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
11621 /* exception for rehydrated names which are checked separately */
11622 if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
11623 return true;
11624 }
11625
11626 var tag = this.tagMap[id];
11627 return tag !== undefined && tag.hasNameForId(id, name);
11628 };
11629
11630 /* registers a componentId and registers it on its tag */
11631
11632
11633 StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
11634 /* don't inject when the id is already registered */
11635 if (this.tagMap[id] !== undefined) return;
11636
11637 var clones = this.clones;
11638
11639 for (var i = 0; i < clones.length; i += 1) {
11640 clones[i].deferredInject(id, cssRules);
11641 }
11642
11643 this.getTagForId(id).insertMarker(id);
11644 this.deferred[id] = cssRules;
11645 };
11646
11647 /* injects rules for a given id with a name that will need to be cached */
11648
11649
11650 StyleSheet.prototype.inject = function inject(id, cssRules, name) {
11651 var clones = this.clones;
11652
11653
11654 for (var i = 0; i < clones.length; i += 1) {
11655 clones[i].inject(id, cssRules, name);
11656 }
11657
11658 var tag = this.getTagForId(id);
11659
11660 /* add deferred rules for component */
11661 if (this.deferred[id] !== undefined) {
11662 // Combine passed cssRules with previously deferred CSS rules
11663 // NOTE: We cannot mutate the deferred array itself as all clones
11664 // do the same (see clones[i].inject)
11665 var rules = this.deferred[id].concat(cssRules);
11666 tag.insertRules(id, rules, name);
11667
11668 this.deferred[id] = undefined;
11669 } else {
11670 tag.insertRules(id, cssRules, name);
11671 }
11672 };
11673
11674 /* removes all rules for a given id, which doesn't remove its marker but resets it */
11675
11676
11677 StyleSheet.prototype.remove = function remove(id) {
11678 var tag = this.tagMap[id];
11679 if (tag === undefined) return;
11680
11681 var clones = this.clones;
11682
11683 for (var i = 0; i < clones.length; i += 1) {
11684 clones[i].remove(id);
11685 }
11686
11687 /* remove all rules from the tag */
11688 tag.removeRules(id);
11689
11690 /* ignore possible rehydrated names */
11691 this.ignoreRehydratedNames[id] = true;
11692
11693 /* delete possible deferred rules */
11694 this.deferred[id] = undefined;
11695 };
11696
11697 StyleSheet.prototype.toHTML = function toHTML() {
11698 return this.tags.map(function (tag) {
11699 return tag.toHTML();
11700 }).join('');
11701 };
11702
11703 StyleSheet.prototype.toReactElements = function toReactElements() {
11704 var id = this.id;
11705
11706
11707 return this.tags.map(function (tag, i) {
11708 var key = 'sc-' + id + '-' + i;
11709 return (0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(tag.toElement(), { key: key });
11710 });
11711 };
11712
11713 createClass(StyleSheet, null, [{
11714 key: 'master',
11715 get: function get$$1() {
11716 return master || (master = new StyleSheet().rehydrate());
11717 }
11718
11719 /* NOTE: This is just for backwards-compatibility with jest-styled-components */
11720
11721 }, {
11722 key: 'instance',
11723 get: function get$$1() {
11724 return StyleSheet.master;
11725 }
11726 }]);
11727 return StyleSheet;
11728 }();
11729
11730 //
11731
11732 var Keyframes = function () {
11733 function Keyframes(name, rules) {
11734 var _this = this;
11735
11736 classCallCheck(this, Keyframes);
11737
11738 this.inject = function (styleSheet) {
11739 if (!styleSheet.hasNameForId(_this.id, _this.name)) {
11740 styleSheet.inject(_this.id, _this.rules, _this.name);
11741 }
11742 };
11743
11744 this.toString = function () {
11745 throw new StyledComponentsError(12, String(_this.name));
11746 };
11747
11748 this.name = name;
11749 this.rules = rules;
11750
11751 this.id = 'sc-keyframes-' + name;
11752 }
11753
11754 Keyframes.prototype.getName = function getName() {
11755 return this.name;
11756 };
11757
11758 return Keyframes;
11759 }();
11760
11761 //
11762
11763 /**
11764 * inlined version of
11765 * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
11766 */
11767
11768 var uppercasePattern = /([A-Z])/g;
11769 var msPattern = /^ms-/;
11770
11771 /**
11772 * Hyphenates a camelcased CSS property name, for example:
11773 *
11774 * > hyphenateStyleName('backgroundColor')
11775 * < "background-color"
11776 * > hyphenateStyleName('MozTransition')
11777 * < "-moz-transition"
11778 * > hyphenateStyleName('msTransition')
11779 * < "-ms-transition"
11780 *
11781 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
11782 * is converted to `-ms-`.
11783 *
11784 * @param {string} string
11785 * @return {string}
11786 */
11787 function hyphenateStyleName(string) {
11788 return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
11789 }
11790
11791 //
11792
11793 // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
11794 function addUnitIfNeeded(name, value) {
11795 // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
11796 // $FlowFixMe
11797 if (value == null || typeof value === 'boolean' || value === '') {
11798 return '';
11799 }
11800
11801 if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__["default"])) {
11802 return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
11803 }
11804
11805 return String(value).trim();
11806 }
11807
11808 //
11809
11810 /**
11811 * It's falsish not falsy because 0 is allowed.
11812 */
11813 var isFalsish = function isFalsish(chunk) {
11814 return chunk === undefined || chunk === null || chunk === false || chunk === '';
11815 };
11816
11817 var objToCssArray = function objToCssArray(obj, prevKey) {
11818 var rules = [];
11819 var keys = Object.keys(obj);
11820
11821 keys.forEach(function (key) {
11822 if (!isFalsish(obj[key])) {
11823 if (isPlainObject(obj[key])) {
11824 rules.push.apply(rules, objToCssArray(obj[key], key));
11825
11826 return rules;
11827 } else if (isFunction(obj[key])) {
11828 rules.push(hyphenateStyleName(key) + ':', obj[key], ';');
11829
11830 return rules;
11831 }
11832 rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');
11833 }
11834 return rules;
11835 });
11836
11837 return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;
11838 };
11839
11840 function flatten(chunk, executionContext, styleSheet) {
11841 if (Array.isArray(chunk)) {
11842 var ruleSet = [];
11843
11844 for (var i = 0, len = chunk.length, result; i < len; i += 1) {
11845 result = flatten(chunk[i], executionContext, styleSheet);
11846
11847 if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
11848 }
11849
11850 return ruleSet;
11851 }
11852
11853 if (isFalsish(chunk)) {
11854 return null;
11855 }
11856
11857 /* Handle other components */
11858 if (isStyledComponent(chunk)) {
11859 return '.' + chunk.styledComponentId;
11860 }
11861
11862 /* Either execute or defer the function */
11863 if (isFunction(chunk)) {
11864 if (isStatelessFunction(chunk) && executionContext) {
11865 var _result = chunk(executionContext);
11866
11867 if ( true && (0,react_is__WEBPACK_IMPORTED_MODULE_4__.isElement)(_result)) {
11868 // eslint-disable-next-line no-console
11869 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.');
11870 }
11871
11872 return flatten(_result, executionContext, styleSheet);
11873 } else return chunk;
11874 }
11875
11876 if (chunk instanceof Keyframes) {
11877 if (styleSheet) {
11878 chunk.inject(styleSheet);
11879 return chunk.getName();
11880 } else return chunk;
11881 }
11882
11883 /* Handle objects */
11884 return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
11885 }
11886
11887 //
11888
11889 function css(styles) {
11890 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11891 interpolations[_key - 1] = arguments[_key];
11892 }
11893
11894 if (isFunction(styles) || isPlainObject(styles)) {
11895 // $FlowFixMe
11896 return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
11897 }
11898
11899 // $FlowFixMe
11900 return flatten(interleave(styles, interpolations));
11901 }
11902
11903 //
11904
11905 function constructWithOptions(componentConstructor, tag) {
11906 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
11907
11908 if (!(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(tag)) {
11909 throw new StyledComponentsError(1, String(tag));
11910 }
11911
11912 /* This is callable directly as a template function */
11913 // $FlowFixMe: Not typed to avoid destructuring arguments
11914 var templateFunction = function templateFunction() {
11915 return componentConstructor(tag, options, css.apply(undefined, arguments));
11916 };
11917
11918 /* If config methods are called, wrap up a new template function and merge options */
11919 templateFunction.withConfig = function (config) {
11920 return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
11921 };
11922
11923 /* Modify/inject new props at runtime */
11924 templateFunction.attrs = function (attrs) {
11925 return constructWithOptions(componentConstructor, tag, _extends({}, options, {
11926 attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
11927 }));
11928 };
11929
11930 return templateFunction;
11931 }
11932
11933 //
11934 // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
11935 function murmurhash(c) {
11936 for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
11937 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;
11938 }
11939 switch (e) {
11940 case 3:
11941 a ^= (c.charCodeAt(d + 2) & 255) << 16;
11942 case 2:
11943 a ^= (c.charCodeAt(d + 1) & 255) << 8;
11944 case 1:
11945 a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11946 }
11947 a ^= a >>> 13;
11948 a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11949 return (a ^ a >>> 15) >>> 0;
11950 }
11951
11952 //
11953 /* eslint-disable no-bitwise */
11954
11955 /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
11956 * counterparts */
11957 var charsLength = 52;
11958
11959 /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
11960 var getAlphabeticChar = function getAlphabeticChar(code) {
11961 return String.fromCharCode(code + (code > 25 ? 39 : 97));
11962 };
11963
11964 /* input a number, usually a hash and convert it to base-52 */
11965 function generateAlphabeticName(code) {
11966 var name = '';
11967 var x = void 0;
11968
11969 /* get a char and divide by alphabet-length */
11970 for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
11971 name = getAlphabeticChar(x % charsLength) + name;
11972 }
11973
11974 return getAlphabeticChar(x % charsLength) + name;
11975 }
11976
11977 //
11978
11979 function hasFunctionObjectKey(obj) {
11980 // eslint-disable-next-line guard-for-in, no-restricted-syntax
11981 for (var key in obj) {
11982 if (isFunction(obj[key])) {
11983 return true;
11984 }
11985 }
11986
11987 return false;
11988 }
11989
11990 function isStaticRules(rules, attrs) {
11991 for (var i = 0; i < rules.length; i += 1) {
11992 var rule = rules[i];
11993
11994 // recursive case
11995 if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
11996 return false;
11997 } else if (isFunction(rule) && !isStyledComponent(rule)) {
11998 // functions are allowed to be static if they're just being
11999 // used to get the classname of a nested styled component
12000 return false;
12001 }
12002 }
12003
12004 if (attrs.some(function (x) {
12005 return isFunction(x) || hasFunctionObjectKey(x);
12006 })) return false;
12007
12008 return true;
12009 }
12010
12011 //
12012
12013 /* combines hashStr (murmurhash) and nameGenerator for convenience */
12014 var hasher = function hasher(str) {
12015 return generateAlphabeticName(murmurhash(str));
12016 };
12017
12018 /*
12019 ComponentStyle is all the CSS-specific stuff, not
12020 the React-specific stuff.
12021 */
12022
12023 var ComponentStyle = function () {
12024 function ComponentStyle(rules, attrs, componentId) {
12025 classCallCheck(this, ComponentStyle);
12026
12027 this.rules = rules;
12028 this.isStatic = false && 0;
12029 this.componentId = componentId;
12030
12031 if (!StyleSheet.master.hasId(componentId)) {
12032 StyleSheet.master.deferredInject(componentId, []);
12033 }
12034 }
12035
12036 /*
12037 * Flattens a rule set into valid CSS
12038 * Hashes it, wraps the whole chunk in a .hash1234 {}
12039 * Returns the hash to be injected on render()
12040 * */
12041
12042
12043 ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
12044 var isStatic = this.isStatic,
12045 componentId = this.componentId,
12046 lastClassName = this.lastClassName;
12047
12048 if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
12049 return lastClassName;
12050 }
12051
12052 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12053 var name = hasher(this.componentId + flatCSS.join(''));
12054 if (!styleSheet.hasNameForId(componentId, name)) {
12055 styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
12056 }
12057
12058 this.lastClassName = name;
12059 return name;
12060 };
12061
12062 ComponentStyle.generateName = function generateName(str) {
12063 return hasher(str);
12064 };
12065
12066 return ComponentStyle;
12067 }();
12068
12069 //
12070
12071 var LIMIT = 200;
12072
12073 var createWarnTooManyClasses = (function (displayName) {
12074 var generatedClasses = {};
12075 var warningSeen = false;
12076
12077 return function (className) {
12078 if (!warningSeen) {
12079 generatedClasses[className] = true;
12080 if (Object.keys(generatedClasses).length >= LIMIT) {
12081 // Unable to find latestRule in test environment.
12082 /* eslint-disable no-console, prefer-template */
12083 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 />');
12084 warningSeen = true;
12085 generatedClasses = {};
12086 }
12087 }
12088 };
12089 });
12090
12091 //
12092
12093 var determineTheme = (function (props, fallbackTheme) {
12094 var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
12095
12096 // Props should take precedence over ThemeProvider, which should take precedence over
12097 // defaultProps, but React automatically puts defaultProps on props.
12098
12099 /* eslint-disable react/prop-types, flowtype-errors/show-errors */
12100 var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
12101 var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
12102 /* eslint-enable */
12103
12104 return theme;
12105 });
12106
12107 //
12108 var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
12109 var dashesAtEnds = /(^-|-$)/g;
12110
12111 /**
12112 * TODO: Explore using CSS.escape when it becomes more available
12113 * in evergreen browsers.
12114 */
12115 function escape(str) {
12116 return str
12117 // Replace all possible CSS selectors
12118 .replace(escapeRegex, '-')
12119
12120 // Remove extraneous hyphens at the start and end
12121 .replace(dashesAtEnds, '');
12122 }
12123
12124 //
12125
12126 function isTag(target) {
12127 return typeof target === 'string' && ( true ? target.charAt(0) === target.charAt(0).toLowerCase() : 0);
12128 }
12129
12130 //
12131
12132 function generateDisplayName(target) {
12133 // $FlowFixMe
12134 return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
12135 }
12136
12137 var _TYPE_STATICS;
12138
12139 var REACT_STATICS = {
12140 childContextTypes: true,
12141 contextTypes: true,
12142 defaultProps: true,
12143 displayName: true,
12144 getDerivedStateFromProps: true,
12145 propTypes: true,
12146 type: true
12147 };
12148
12149 var KNOWN_STATICS = {
12150 name: true,
12151 length: true,
12152 prototype: true,
12153 caller: true,
12154 callee: true,
12155 arguments: true,
12156 arity: true
12157 };
12158
12159 var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__.ForwardRef] = {
12160 $$typeof: true,
12161 render: true
12162 }, _TYPE_STATICS);
12163
12164 var defineProperty$1 = Object.defineProperty,
12165 getOwnPropertyNames = Object.getOwnPropertyNames,
12166 _Object$getOwnPropert = Object.getOwnPropertySymbols,
12167 getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
12168 return [];
12169 } : _Object$getOwnPropert,
12170 getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
12171 getPrototypeOf = Object.getPrototypeOf,
12172 objectPrototype = Object.prototype;
12173 var arrayPrototype = Array.prototype;
12174
12175
12176 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
12177 if (typeof sourceComponent !== 'string') {
12178 // don't hoist over string (html) components
12179
12180 var inheritedComponent = getPrototypeOf(sourceComponent);
12181
12182 if (inheritedComponent && inheritedComponent !== objectPrototype) {
12183 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
12184 }
12185
12186 var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
12187 // $FlowFixMe
12188 getOwnPropertySymbols(sourceComponent));
12189
12190 var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
12191
12192 var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
12193
12194 var i = keys.length;
12195 var descriptor = void 0;
12196 var key = void 0;
12197
12198 // eslint-disable-next-line no-plusplus
12199 while (i--) {
12200 key = keys[i];
12201
12202 if (
12203 // $FlowFixMe
12204 !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
12205 // $FlowFixMe
12206 !(targetStatics && targetStatics[key])) {
12207 descriptor = getOwnPropertyDescriptor(sourceComponent, key);
12208
12209 if (descriptor) {
12210 try {
12211 // Avoid failures from read-only properties
12212 defineProperty$1(targetComponent, key, descriptor);
12213 } catch (e) {
12214 /* fail silently */
12215 }
12216 }
12217 }
12218 }
12219
12220 return targetComponent;
12221 }
12222
12223 return targetComponent;
12224 }
12225
12226 //
12227 function isDerivedReactComponent(fn) {
12228 return !!(fn && fn.prototype && fn.prototype.isReactComponent);
12229 }
12230
12231 //
12232 // Helper to call a given function, only once
12233 var once = (function (cb) {
12234 var called = false;
12235
12236 return function () {
12237 if (!called) {
12238 called = true;
12239 cb.apply(undefined, arguments);
12240 }
12241 };
12242 });
12243
12244 //
12245
12246 var ThemeContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12247
12248 var ThemeConsumer = ThemeContext.Consumer;
12249
12250 /**
12251 * Provide a theme to an entire react component tree via context
12252 */
12253
12254 var ThemeProvider = function (_Component) {
12255 inherits(ThemeProvider, _Component);
12256
12257 function ThemeProvider(props) {
12258 classCallCheck(this, ThemeProvider);
12259
12260 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12261
12262 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext.bind(_this));
12263 _this.renderInner = _this.renderInner.bind(_this);
12264 return _this;
12265 }
12266
12267 ThemeProvider.prototype.render = function render() {
12268 if (!this.props.children) return null;
12269
12270 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12271 ThemeContext.Consumer,
12272 null,
12273 this.renderInner
12274 );
12275 };
12276
12277 ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
12278 var context = this.getContext(this.props.theme, outerTheme);
12279
12280 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12281 ThemeContext.Provider,
12282 { value: context },
12283 this.props.children
12284 );
12285 };
12286
12287 /**
12288 * Get the theme from the props, supporting both (outerTheme) => {}
12289 * as well as object notation
12290 */
12291
12292
12293 ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
12294 if (isFunction(theme)) {
12295 var mergedTheme = theme(outerTheme);
12296
12297 if ( true && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
12298 throw new StyledComponentsError(7);
12299 }
12300
12301 return mergedTheme;
12302 }
12303
12304 if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
12305 throw new StyledComponentsError(8);
12306 }
12307
12308 return _extends({}, outerTheme, theme);
12309 };
12310
12311 ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
12312 return this.getTheme(theme, outerTheme);
12313 };
12314
12315 return ThemeProvider;
12316 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12317
12318 //
12319
12320 var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
12321
12322 var ServerStyleSheet = function () {
12323 function ServerStyleSheet() {
12324 classCallCheck(this, ServerStyleSheet);
12325
12326 /* The master sheet might be reset, so keep a reference here */
12327 this.masterSheet = StyleSheet.master;
12328 this.instance = this.masterSheet.clone();
12329 this.sealed = false;
12330 }
12331
12332 /**
12333 * Mark the ServerStyleSheet as being fully emitted and manually GC it from the
12334 * StyleSheet singleton.
12335 */
12336
12337
12338 ServerStyleSheet.prototype.seal = function seal() {
12339 if (!this.sealed) {
12340 /* Remove sealed StyleSheets from the master sheet */
12341 var index = this.masterSheet.clones.indexOf(this.instance);
12342 this.masterSheet.clones.splice(index, 1);
12343 this.sealed = true;
12344 }
12345 };
12346
12347 ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
12348 if (this.sealed) {
12349 throw new StyledComponentsError(2);
12350 }
12351
12352 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12353 StyleSheetManager,
12354 { sheet: this.instance },
12355 children
12356 );
12357 };
12358
12359 ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
12360 this.seal();
12361 return this.instance.toHTML();
12362 };
12363
12364 ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
12365 this.seal();
12366 return this.instance.toReactElements();
12367 };
12368
12369 ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
12370 var _this = this;
12371
12372 {
12373 throw new StyledComponentsError(3);
12374 }
12375
12376 /* the tag index keeps track of which tags have already been emitted */
12377 var instance = this.instance;
12378
12379 var instanceTagIndex = 0;
12380
12381 var streamAttr = SC_STREAM_ATTR + '="true"';
12382
12383 var transformer = new stream.Transform({
12384 transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
12385 var tags = instance.tags;
12386
12387 var html = '';
12388
12389 /* retrieve html for each new style tag */
12390 for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
12391 var tag = tags[instanceTagIndex];
12392 html += tag.toHTML(streamAttr);
12393 }
12394
12395 /* force our StyleSheets to emit entirely new tags */
12396 instance.sealAllTags();
12397
12398 var renderedHtml = chunk.toString();
12399
12400 /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
12401 if (CLOSING_TAG_R.test(renderedHtml)) {
12402 var endOfClosingTag = renderedHtml.indexOf('>');
12403
12404 this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
12405 } else this.push(html + renderedHtml);
12406
12407 callback();
12408 }
12409 });
12410
12411 readableStream.on('end', function () {
12412 return _this.seal();
12413 });
12414
12415 readableStream.on('error', function (err) {
12416 _this.seal();
12417
12418 // forward the error to the transform stream
12419 transformer.emit('error', err);
12420 });
12421
12422 return readableStream.pipe(transformer);
12423 };
12424
12425 return ServerStyleSheet;
12426 }();
12427
12428 //
12429
12430 var StyleSheetContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12431 var StyleSheetConsumer = StyleSheetContext.Consumer;
12432
12433 var StyleSheetManager = function (_Component) {
12434 inherits(StyleSheetManager, _Component);
12435
12436 function StyleSheetManager(props) {
12437 classCallCheck(this, StyleSheetManager);
12438
12439 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12440
12441 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext);
12442 return _this;
12443 }
12444
12445 StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
12446 if (sheet) {
12447 return sheet;
12448 } else if (target) {
12449 return new StyleSheet(target);
12450 } else {
12451 throw new StyledComponentsError(4);
12452 }
12453 };
12454
12455 StyleSheetManager.prototype.render = function render() {
12456 var _props = this.props,
12457 children = _props.children,
12458 sheet = _props.sheet,
12459 target = _props.target;
12460
12461
12462 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12463 StyleSheetContext.Provider,
12464 { value: this.getContext(sheet, target) },
12465 true ? react__WEBPACK_IMPORTED_MODULE_2___default().Children.only(children) : 0
12466 );
12467 };
12468
12469 return StyleSheetManager;
12470 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12471 true ? StyleSheetManager.propTypes = {
12472 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)]),
12473
12474 target: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
12475 appendChild: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func.isRequired)
12476 })
12477 } : 0;
12478
12479 //
12480
12481 var identifiers = {};
12482
12483 /* We depend on components having unique IDs */
12484 function generateId(_ComponentStyle, _displayName, parentComponentId) {
12485 var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
12486
12487 /**
12488 * This ensures uniqueness if two components happen to share
12489 * the same displayName.
12490 */
12491 var nr = (identifiers[displayName] || 0) + 1;
12492 identifiers[displayName] = nr;
12493
12494 var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
12495
12496 return parentComponentId ? parentComponentId + '-' + componentId : componentId;
12497 }
12498
12499 // $FlowFixMe
12500
12501 var StyledComponent = function (_Component) {
12502 inherits(StyledComponent, _Component);
12503
12504 function StyledComponent() {
12505 classCallCheck(this, StyledComponent);
12506
12507 var _this = possibleConstructorReturn(this, _Component.call(this));
12508
12509 _this.attrs = {};
12510
12511 _this.renderOuter = _this.renderOuter.bind(_this);
12512 _this.renderInner = _this.renderInner.bind(_this);
12513
12514 if (true) {
12515 _this.warnInnerRef = once(function (displayName) {
12516 return (
12517 // eslint-disable-next-line no-console
12518 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 + '".')
12519 );
12520 });
12521
12522 _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
12523 return (
12524 // eslint-disable-next-line no-console
12525 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)
12526 );
12527 });
12528
12529 _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
12530 return (
12531 // eslint-disable-next-line no-console
12532 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 }'))
12533 );
12534 });
12535 }
12536 return _this;
12537 }
12538
12539 StyledComponent.prototype.render = function render() {
12540 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12541 StyleSheetConsumer,
12542 null,
12543 this.renderOuter
12544 );
12545 };
12546
12547 StyledComponent.prototype.renderOuter = function renderOuter() {
12548 var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
12549
12550 this.styleSheet = styleSheet;
12551
12552 // No need to subscribe a static component to theme changes, it won't change anything
12553 if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
12554
12555 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12556 ThemeConsumer,
12557 null,
12558 this.renderInner
12559 );
12560 };
12561
12562 StyledComponent.prototype.renderInner = function renderInner(theme) {
12563 var _props$forwardedCompo = this.props.forwardedComponent,
12564 componentStyle = _props$forwardedCompo.componentStyle,
12565 defaultProps = _props$forwardedCompo.defaultProps,
12566 displayName = _props$forwardedCompo.displayName,
12567 foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
12568 styledComponentId = _props$forwardedCompo.styledComponentId,
12569 target = _props$forwardedCompo.target;
12570
12571
12572 var generatedClassName = void 0;
12573 if (componentStyle.isStatic) {
12574 generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
12575 } else {
12576 generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);
12577 }
12578
12579 var elementToBeCreated = this.props.as || this.attrs.as || target;
12580 var isTargetTag = isTag(elementToBeCreated);
12581
12582 var propsForElement = {};
12583 var computedProps = _extends({}, this.props, this.attrs);
12584
12585 var key = void 0;
12586 // eslint-disable-next-line guard-for-in
12587 for (key in computedProps) {
12588 if ( true && key === 'innerRef' && isTargetTag) {
12589 this.warnInnerRef(displayName);
12590 }
12591
12592 if (key === 'forwardedComponent' || key === 'as') {
12593 continue;
12594 } 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)) {
12595 // Don't pass through non HTML tags through to HTML elements
12596 propsForElement[key] = computedProps[key];
12597 }
12598 }
12599
12600 if (this.props.style && this.attrs.style) {
12601 propsForElement.style = _extends({}, this.attrs.style, this.props.style);
12602 }
12603
12604 propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');
12605
12606 return (0,react__WEBPACK_IMPORTED_MODULE_2__.createElement)(elementToBeCreated, propsForElement);
12607 };
12608
12609 StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
12610 var _this2 = this;
12611
12612 var context = _extends({}, props, { theme: theme });
12613
12614 if (!attrs.length) return context;
12615
12616 this.attrs = {};
12617
12618 attrs.forEach(function (attrDef) {
12619 var resolvedAttrDef = attrDef;
12620 var attrDefWasFn = false;
12621 var attr = void 0;
12622 var key = void 0;
12623
12624 if (isFunction(resolvedAttrDef)) {
12625 // $FlowFixMe
12626 resolvedAttrDef = resolvedAttrDef(context);
12627 attrDefWasFn = true;
12628 }
12629
12630 /* eslint-disable guard-for-in */
12631 // $FlowFixMe
12632 for (key in resolvedAttrDef) {
12633 attr = resolvedAttrDef[key];
12634
12635 if (!attrDefWasFn) {
12636 if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
12637 if (true) {
12638 _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
12639 }
12640
12641 attr = attr(context);
12642
12643 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(attr)) {
12644 _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
12645 }
12646 }
12647 }
12648
12649 _this2.attrs[key] = attr;
12650 context[key] = attr;
12651 }
12652 /* eslint-enable */
12653 });
12654
12655 return context;
12656 };
12657
12658 StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
12659 var _props$forwardedCompo2 = props.forwardedComponent,
12660 attrs = _props$forwardedCompo2.attrs,
12661 componentStyle = _props$forwardedCompo2.componentStyle,
12662 warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
12663
12664 // statically styled-components don't need to build an execution context object,
12665 // and shouldn't be increasing the number of class names
12666
12667 if (componentStyle.isStatic && !attrs.length) {
12668 return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
12669 }
12670
12671 var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
12672
12673 if ( true && warnTooManyClasses) warnTooManyClasses(className);
12674
12675 return className;
12676 };
12677
12678 return StyledComponent;
12679 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12680
12681 function createStyledComponent(target, options, rules) {
12682 var isTargetStyledComp = isStyledComponent(target);
12683 var isClass = !isTag(target);
12684
12685 var _options$displayName = options.displayName,
12686 displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
12687 _options$componentId = options.componentId,
12688 componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
12689 _options$ParentCompon = options.ParentComponent,
12690 ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
12691 _options$attrs = options.attrs,
12692 attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
12693
12694
12695 var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
12696
12697 // fold the underlying StyledComponent attrs up (implicit extend)
12698 var finalAttrs =
12699 // $FlowFixMe
12700 isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
12701
12702 var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
12703 // $FlowFixMe
12704 target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
12705
12706 /**
12707 * forwardRef creates a new interim component, which we'll take advantage of
12708 * instead of extending ParentComponent to create _another_ interim class
12709 */
12710 var WrappedStyledComponent = void 0;
12711 var forwardRef = function forwardRef(props, ref) {
12712 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
12713 };
12714 forwardRef.displayName = displayName;
12715 WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(forwardRef);
12716 WrappedStyledComponent.displayName = displayName;
12717
12718 // $FlowFixMe
12719 WrappedStyledComponent.attrs = finalAttrs;
12720 // $FlowFixMe
12721 WrappedStyledComponent.componentStyle = componentStyle;
12722
12723 // $FlowFixMe
12724 WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
12725 Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
12726
12727 // $FlowFixMe
12728 WrappedStyledComponent.styledComponentId = styledComponentId;
12729
12730 // fold the underlying StyledComponent target up since we folded the styles
12731 // $FlowFixMe
12732 WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
12733
12734 // $FlowFixMe
12735 WrappedStyledComponent.withComponent = function withComponent(tag) {
12736 var previousComponentId = options.componentId,
12737 optionsToCopy = objectWithoutProperties(options, ['componentId']);
12738
12739
12740 var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
12741
12742 var newOptions = _extends({}, optionsToCopy, {
12743 attrs: finalAttrs,
12744 componentId: newComponentId,
12745 ParentComponent: ParentComponent
12746 });
12747
12748 return createStyledComponent(tag, newOptions, rules);
12749 };
12750
12751 // $FlowFixMe
12752 Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
12753 get: function get$$1() {
12754 return this._foldedDefaultProps;
12755 },
12756 set: function set$$1(obj) {
12757 // $FlowFixMe
12758 this._foldedDefaultProps = isTargetStyledComp ? (0,merge_anything__WEBPACK_IMPORTED_MODULE_6__["default"])(target.defaultProps, obj) : obj;
12759 }
12760 });
12761
12762 if (true) {
12763 // $FlowFixMe
12764 WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
12765 }
12766
12767 // $FlowFixMe
12768 WrappedStyledComponent.toString = function () {
12769 return '.' + WrappedStyledComponent.styledComponentId;
12770 };
12771
12772 if (isClass) {
12773 hoistNonReactStatics(WrappedStyledComponent, target, {
12774 // all SC-specific things should not be hoisted
12775 attrs: true,
12776 componentStyle: true,
12777 displayName: true,
12778 foldedComponentIds: true,
12779 styledComponentId: true,
12780 target: true,
12781 withComponent: true
12782 });
12783 }
12784
12785 return WrappedStyledComponent;
12786 }
12787
12788 //
12789 // Thanks to ReactDOMFactories for this handy list!
12790
12791 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',
12792
12793 // SVG
12794 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
12795
12796 //
12797
12798 var styled = function styled(tag) {
12799 return constructWithOptions(createStyledComponent, tag);
12800 };
12801
12802 // Shorthands for all valid HTML Elements
12803 domElements.forEach(function (domElement) {
12804 styled[domElement] = styled(domElement);
12805 });
12806
12807 //
12808
12809 var GlobalStyle = function () {
12810 function GlobalStyle(rules, componentId) {
12811 classCallCheck(this, GlobalStyle);
12812
12813 this.rules = rules;
12814 this.componentId = componentId;
12815 this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
12816
12817 if (!StyleSheet.master.hasId(componentId)) {
12818 StyleSheet.master.deferredInject(componentId, []);
12819 }
12820 }
12821
12822 GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
12823 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12824 var css = stringifyRules(flatCSS, '');
12825
12826 styleSheet.inject(this.componentId, css);
12827 };
12828
12829 GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
12830 var componentId = this.componentId;
12831
12832 if (styleSheet.hasId(componentId)) {
12833 styleSheet.remove(componentId);
12834 }
12835 };
12836
12837 // TODO: overwrite in-place instead of remove+create?
12838
12839
12840 GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
12841 this.removeStyles(styleSheet);
12842 this.createStyles(executionContext, styleSheet);
12843 };
12844
12845 return GlobalStyle;
12846 }();
12847
12848 //
12849
12850 // place our cache into shared context so it'll persist between HMRs
12851 if (IS_BROWSER) {
12852 window.scCGSHMRCache = {};
12853 }
12854
12855 function createGlobalStyle(strings) {
12856 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12857 interpolations[_key - 1] = arguments[_key];
12858 }
12859
12860 var rules = css.apply(undefined, [strings].concat(interpolations));
12861 var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
12862 var style = new GlobalStyle(rules, id);
12863
12864 var GlobalStyleComponent = function (_React$Component) {
12865 inherits(GlobalStyleComponent, _React$Component);
12866
12867 function GlobalStyleComponent(props) {
12868 classCallCheck(this, GlobalStyleComponent);
12869
12870 var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
12871
12872 var _this$constructor = _this.constructor,
12873 globalStyle = _this$constructor.globalStyle,
12874 styledComponentId = _this$constructor.styledComponentId;
12875
12876
12877 if (IS_BROWSER) {
12878 window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
12879 }
12880
12881 /**
12882 * This fixes HMR compatibility. Don't ask me why, but this combination of
12883 * caching the closure variables via statics and then persisting the statics in
12884 * state works across HMR where no other combination did. ¯\_(ツ)_/¯
12885 */
12886 _this.state = {
12887 globalStyle: globalStyle,
12888 styledComponentId: styledComponentId
12889 };
12890 return _this;
12891 }
12892
12893 GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
12894 if (window.scCGSHMRCache[this.state.styledComponentId]) {
12895 window.scCGSHMRCache[this.state.styledComponentId] -= 1;
12896 }
12897 /**
12898 * Depending on the order "render" is called this can cause the styles to be lost
12899 * until the next render pass of the remaining instance, which may
12900 * not be immediate.
12901 */
12902 if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
12903 this.state.globalStyle.removeStyles(this.styleSheet);
12904 }
12905 };
12906
12907 GlobalStyleComponent.prototype.render = function render() {
12908 var _this2 = this;
12909
12910 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(this.props.children)) {
12911 // eslint-disable-next-line no-console
12912 console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
12913 }
12914
12915 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12916 StyleSheetConsumer,
12917 null,
12918 function (styleSheet) {
12919 _this2.styleSheet = styleSheet || StyleSheet.master;
12920
12921 var globalStyle = _this2.state.globalStyle;
12922
12923
12924 if (globalStyle.isStatic) {
12925 globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
12926
12927 return null;
12928 } else {
12929 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12930 ThemeConsumer,
12931 null,
12932 function (theme) {
12933 // $FlowFixMe
12934 var defaultProps = _this2.constructor.defaultProps;
12935
12936
12937 var context = _extends({}, _this2.props);
12938
12939 if (typeof theme !== 'undefined') {
12940 context.theme = determineTheme(_this2.props, theme, defaultProps);
12941 }
12942
12943 globalStyle.renderStyles(context, _this2.styleSheet);
12944
12945 return null;
12946 }
12947 );
12948 }
12949 }
12950 );
12951 };
12952
12953 return GlobalStyleComponent;
12954 }((react__WEBPACK_IMPORTED_MODULE_2___default().Component));
12955
12956 GlobalStyleComponent.globalStyle = style;
12957 GlobalStyleComponent.styledComponentId = id;
12958
12959
12960 return GlobalStyleComponent;
12961 }
12962
12963 //
12964
12965 var replaceWhitespace = function replaceWhitespace(str) {
12966 return str.replace(/\s|\\n/g, '');
12967 };
12968
12969 function keyframes(strings) {
12970 /* Warning if you've used keyframes on React Native */
12971 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
12972 // eslint-disable-next-line no-console
12973 console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
12974 }
12975
12976 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12977 interpolations[_key - 1] = arguments[_key];
12978 }
12979
12980 var rules = css.apply(undefined, [strings].concat(interpolations));
12981
12982 var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
12983
12984 return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
12985 }
12986
12987 //
12988
12989 var withTheme = (function (Component$$1) {
12990 var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function (props, ref) {
12991 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12992 ThemeConsumer,
12993 null,
12994 function (theme) {
12995 // $FlowFixMe
12996 var defaultProps = Component$$1.defaultProps;
12997
12998 var themeProp = determineTheme(props, theme, defaultProps);
12999
13000 if ( true && themeProp === undefined) {
13001 // eslint-disable-next-line no-console
13002 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) + '"');
13003 }
13004
13005 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
13006 }
13007 );
13008 });
13009
13010 hoistNonReactStatics(WithTheme, Component$$1);
13011
13012 WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
13013
13014 return WithTheme;
13015 });
13016
13017 //
13018
13019 /* eslint-disable */
13020 var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
13021 StyleSheet: StyleSheet
13022 };
13023
13024 //
13025
13026 /* Warning if you've imported this file on React Native */
13027 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13028 // eslint-disable-next-line no-console
13029 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');
13030 }
13031
13032 /* Warning if there are several instances of styled-components */
13033 if ( true && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
13034 window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
13035
13036 if (window['__styled-components-init__'] === 1) {
13037 // eslint-disable-next-line no-console
13038 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.');
13039 }
13040
13041 window['__styled-components-init__'] += 1;
13042 }
13043
13044 //
13045
13046 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (styled);
13047
13048 //# sourceMappingURL=styled-components.browser.esm.js.map
13049
13050
13051 /***/ }),
13052
13053 /***/ "./node_modules/stylis-rule-sheet/index.js":
13054 /*!*************************************************!*\
13055 !*** ./node_modules/stylis-rule-sheet/index.js ***!
13056 \*************************************************/
13057 /***/ ((module) => {
13058
13059 (function (factory) {
13060 true ? (module['exports'] = factory()) :
13061 0
13062 }(function () {
13063
13064 'use strict'
13065
13066 return function (insertRule) {
13067 var delimiter = '/*|*/'
13068 var needle = delimiter+'}'
13069
13070 function toSheet (block) {
13071 if (block)
13072 try {
13073 insertRule(block + '}')
13074 } catch (e) {}
13075 }
13076
13077 return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
13078 switch (context) {
13079 // property
13080 case 1:
13081 // @import
13082 if (depth === 0 && content.charCodeAt(0) === 64)
13083 return insertRule(content+';'), ''
13084 break
13085 // selector
13086 case 2:
13087 if (ns === 0)
13088 return content + delimiter
13089 break
13090 // at-rule
13091 case 3:
13092 switch (ns) {
13093 // @font-face, @page
13094 case 102:
13095 case 112:
13096 return insertRule(selectors[0]+content), ''
13097 default:
13098 return content + (at === 0 ? delimiter : '')
13099 }
13100 case -2:
13101 content.split(needle).forEach(toSheet)
13102 }
13103 }
13104 }
13105 }))
13106
13107
13108 /***/ }),
13109
13110 /***/ "./node_modules/stylis/stylis.min.js":
13111 /*!*******************************************!*\
13112 !*** ./node_modules/stylis/stylis.min.js ***!
13113 \*******************************************/
13114 /***/ ((module) => {
13115
13116 !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});
13117 //# sourceMappingURL=stylis.min.js.map
13118
13119 /***/ }),
13120
13121 /***/ "react":
13122 /*!************************!*\
13123 !*** external "React" ***!
13124 \************************/
13125 /***/ ((module) => {
13126
13127 "use strict";
13128 module.exports = window["React"];
13129
13130 /***/ }),
13131
13132 /***/ "jquery":
13133 /*!*************************!*\
13134 !*** external "jQuery" ***!
13135 \*************************/
13136 /***/ ((module) => {
13137
13138 "use strict";
13139 module.exports = window["jQuery"];
13140
13141 /***/ }),
13142
13143 /***/ "@wordpress/block-editor":
13144 /*!*************************************!*\
13145 !*** external ["wp","blockEditor"] ***!
13146 \*************************************/
13147 /***/ ((module) => {
13148
13149 "use strict";
13150 module.exports = window["wp"]["blockEditor"];
13151
13152 /***/ }),
13153
13154 /***/ "@wordpress/blocks":
13155 /*!********************************!*\
13156 !*** external ["wp","blocks"] ***!
13157 \********************************/
13158 /***/ ((module) => {
13159
13160 "use strict";
13161 module.exports = window["wp"]["blocks"];
13162
13163 /***/ }),
13164
13165 /***/ "@wordpress/components":
13166 /*!************************************!*\
13167 !*** external ["wp","components"] ***!
13168 \************************************/
13169 /***/ ((module) => {
13170
13171 "use strict";
13172 module.exports = window["wp"]["components"];
13173
13174 /***/ }),
13175
13176 /***/ "@wordpress/compose":
13177 /*!*********************************!*\
13178 !*** external ["wp","compose"] ***!
13179 \*********************************/
13180 /***/ ((module) => {
13181
13182 "use strict";
13183 module.exports = window["wp"]["compose"];
13184
13185 /***/ }),
13186
13187 /***/ "@wordpress/data":
13188 /*!******************************!*\
13189 !*** external ["wp","data"] ***!
13190 \******************************/
13191 /***/ ((module) => {
13192
13193 "use strict";
13194 module.exports = window["wp"]["data"];
13195
13196 /***/ }),
13197
13198 /***/ "@wordpress/edit-post":
13199 /*!**********************************!*\
13200 !*** external ["wp","editPost"] ***!
13201 \**********************************/
13202 /***/ ((module) => {
13203
13204 "use strict";
13205 module.exports = window["wp"]["editPost"];
13206
13207 /***/ }),
13208
13209 /***/ "@wordpress/element":
13210 /*!*********************************!*\
13211 !*** external ["wp","element"] ***!
13212 \*********************************/
13213 /***/ ((module) => {
13214
13215 "use strict";
13216 module.exports = window["wp"]["element"];
13217
13218 /***/ }),
13219
13220 /***/ "@wordpress/i18n":
13221 /*!******************************!*\
13222 !*** external ["wp","i18n"] ***!
13223 \******************************/
13224 /***/ ((module) => {
13225
13226 "use strict";
13227 module.exports = window["wp"]["i18n"];
13228
13229 /***/ }),
13230
13231 /***/ "@wordpress/plugins":
13232 /*!*********************************!*\
13233 !*** external ["wp","plugins"] ***!
13234 \*********************************/
13235 /***/ ((module) => {
13236
13237 "use strict";
13238 module.exports = window["wp"]["plugins"];
13239
13240 /***/ }),
13241
13242 /***/ "./node_modules/@linaria/react/dist/index.mjs":
13243 /*!****************************************************!*\
13244 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
13245 \****************************************************/
13246 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13247
13248 "use strict";
13249 __webpack_require__.r(__webpack_exports__);
13250 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13251 /* harmony export */ "styled": () => (/* binding */ styled_default)
13252 /* harmony export */ });
13253 /* 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");
13254 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
13255 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
13256 // src/styled.ts
13257
13258
13259
13260 var isCapital = (ch) => ch.toUpperCase() === ch;
13261 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
13262 var omit = (obj, keys) => {
13263 const res = {};
13264 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
13265 res[key] = obj[key];
13266 });
13267 return res;
13268 };
13269 function filterProps(asIs, props, omitKeys) {
13270 const filteredProps = omit(props, omitKeys);
13271 if (!asIs) {
13272 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"];
13273 Object.keys(filteredProps).forEach((key) => {
13274 if (!interopValidAttr.default(key)) {
13275 delete filteredProps[key];
13276 }
13277 });
13278 }
13279 return filteredProps;
13280 }
13281 var warnIfInvalid = (value, componentName) => {
13282 if (true) {
13283 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
13284 return;
13285 }
13286 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
13287 console.warn(
13288 `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.`
13289 );
13290 }
13291 };
13292 var idx = 0;
13293 function styled(tag) {
13294 var _a;
13295 let mockedClass = "";
13296 if (false) {}
13297 return (options) => {
13298 if (true) {
13299 if (Array.isArray(options)) {
13300 throw new Error(
13301 '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'
13302 );
13303 }
13304 }
13305 const render = (props, ref) => {
13306 const { as: component = tag, class: className = mockedClass } = props;
13307 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
13308 const filteredProps = filterProps(shouldKeepProps, props, [
13309 "as",
13310 "class"
13311 ]);
13312 filteredProps.ref = ref;
13313 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);
13314 const { vars } = options;
13315 if (vars) {
13316 const style = {};
13317 for (const name in vars) {
13318 const variable = vars[name];
13319 const result = variable[0];
13320 const unit = variable[1] || "";
13321 const value = typeof result === "function" ? result(props) : result;
13322 warnIfInvalid(value, options.name);
13323 style[`--${name}`] = `${value}${unit}`;
13324 }
13325 const ownStyle = filteredProps.style || {};
13326 const keys = Object.keys(ownStyle);
13327 if (keys.length > 0) {
13328 keys.forEach((key) => {
13329 style[key] = ownStyle[key];
13330 });
13331 }
13332 filteredProps.style = style;
13333 }
13334 if (tag.__linaria && tag !== component) {
13335 filteredProps.as = component;
13336 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
13337 }
13338 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
13339 };
13340 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
13341 const rest = omit(props, ["innerRef"]);
13342 return render(rest, props.innerRef);
13343 };
13344 Result.displayName = options.name;
13345 Result.__linaria = {
13346 className: options.class || mockedClass,
13347 extends: tag
13348 };
13349 return Result;
13350 };
13351 }
13352 var styled_default = true ? new Proxy(styled, {
13353 get(o, prop) {
13354 return o(prop);
13355 }
13356 }) : 0;
13357
13358 //# sourceMappingURL=index.mjs.map
13359
13360 /***/ }),
13361
13362 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
13363 /*!*******************************************************************************!*\
13364 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
13365 \*******************************************************************************/
13366 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13367
13368 "use strict";
13369 __webpack_require__.r(__webpack_exports__);
13370 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13371 /* harmony export */ "css": () => (/* binding */ css_default),
13372 /* harmony export */ "cx": () => (/* binding */ cx_default)
13373 /* harmony export */ });
13374 // src/css.ts
13375 var idx = 0;
13376 var css = () => {
13377 if (false) {}
13378 throw new Error(
13379 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
13380 );
13381 };
13382 var css_default = css;
13383
13384 // src/cx.ts
13385 var cx = function cx2() {
13386 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
13387 const atomicClasses = {};
13388 const nonAtomicClasses = [];
13389 presentClassNames.forEach((arg) => {
13390 const individualClassNames = arg ? arg.split(" ") : [];
13391 individualClassNames.forEach((className) => {
13392 if (className.startsWith("atm_")) {
13393 const [, keyHash] = className.split("_");
13394 atomicClasses[keyHash] = className;
13395 } else {
13396 nonAtomicClasses.push(className);
13397 }
13398 });
13399 });
13400 const result = [];
13401 for (const keyHash in atomicClasses) {
13402 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
13403 result.push(atomicClasses[keyHash]);
13404 }
13405 }
13406 result.push(...nonAtomicClasses);
13407 return result.join(" ");
13408 };
13409 var cx_default = cx;
13410
13411 //# sourceMappingURL=index.mjs.map
13412
13413 /***/ })
13414
13415 /******/ });
13416 /************************************************************************/
13417 /******/ // The module cache
13418 /******/ var __webpack_module_cache__ = {};
13419 /******/
13420 /******/ // The require function
13421 /******/ function __webpack_require__(moduleId) {
13422 /******/ // Check if module is in cache
13423 /******/ var cachedModule = __webpack_module_cache__[moduleId];
13424 /******/ if (cachedModule !== undefined) {
13425 /******/ return cachedModule.exports;
13426 /******/ }
13427 /******/ // Create a new module (and put it into the cache)
13428 /******/ var module = __webpack_module_cache__[moduleId] = {
13429 /******/ // no module.id needed
13430 /******/ // no module.loaded needed
13431 /******/ exports: {}
13432 /******/ };
13433 /******/
13434 /******/ // Execute the module function
13435 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
13436 /******/
13437 /******/ // Return the exports of the module
13438 /******/ return module.exports;
13439 /******/ }
13440 /******/
13441 /************************************************************************/
13442 /******/ /* webpack/runtime/compat get default export */
13443 /******/ (() => {
13444 /******/ // getDefaultExport function for compatibility with non-harmony modules
13445 /******/ __webpack_require__.n = (module) => {
13446 /******/ var getter = module && module.__esModule ?
13447 /******/ () => (module['default']) :
13448 /******/ () => (module);
13449 /******/ __webpack_require__.d(getter, { a: getter });
13450 /******/ return getter;
13451 /******/ };
13452 /******/ })();
13453 /******/
13454 /******/ /* webpack/runtime/define property getters */
13455 /******/ (() => {
13456 /******/ // define getter functions for harmony exports
13457 /******/ __webpack_require__.d = (exports, definition) => {
13458 /******/ for(var key in definition) {
13459 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13460 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
13461 /******/ }
13462 /******/ }
13463 /******/ };
13464 /******/ })();
13465 /******/
13466 /******/ /* webpack/runtime/global */
13467 /******/ (() => {
13468 /******/ __webpack_require__.g = (function() {
13469 /******/ if (typeof globalThis === 'object') return globalThis;
13470 /******/ try {
13471 /******/ return this || new Function('return this')();
13472 /******/ } catch (e) {
13473 /******/ if (typeof window === 'object') return window;
13474 /******/ }
13475 /******/ })();
13476 /******/ })();
13477 /******/
13478 /******/ /* webpack/runtime/hasOwnProperty shorthand */
13479 /******/ (() => {
13480 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13481 /******/ })();
13482 /******/
13483 /******/ /* webpack/runtime/make namespace object */
13484 /******/ (() => {
13485 /******/ // define __esModule on exports
13486 /******/ __webpack_require__.r = (exports) => {
13487 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
13488 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13489 /******/ }
13490 /******/ Object.defineProperty(exports, '__esModule', { value: true });
13491 /******/ };
13492 /******/ })();
13493 /******/
13494 /******/ /* webpack/runtime/nonce */
13495 /******/ (() => {
13496 /******/ __webpack_require__.nc = undefined;
13497 /******/ })();
13498 /******/
13499 /************************************************************************/
13500 var __webpack_exports__ = {};
13501 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
13502 (() => {
13503 "use strict";
13504 /*!**************************************!*\
13505 !*** ./scripts/entries/gutenberg.ts ***!
13506 \**************************************/
13507 __webpack_require__.r(__webpack_exports__);
13508 /* harmony import */ var _gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../gutenberg/FormBlock/registerFormBlock */ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx");
13509 /* harmony import */ var _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../gutenberg/Sidebar/contentType */ "./scripts/gutenberg/Sidebar/contentType.tsx");
13510 /* harmony import */ var _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gutenberg/MeetingsBlock/registerMeetingBlock */ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx");
13511 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
13512
13513
13514
13515
13516 (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]);
13517 })();
13518
13519 /******/ })()
13520 ;
13521 //# sourceMappingURL=gutenberg.js.map